@overmap-ai/core 1.0.79-gcs.2 → 1.0.79
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/index.d.ts +0 -1
- package/dist/enums/asset.d.ts +8 -0
- package/dist/enums/index.d.ts +2 -0
- package/dist/enums/issue.d.ts +14 -13
- package/dist/enums/procedures.d.ts +11 -0
- package/dist/overmap-core.js +10883 -7760
- package/dist/overmap-core.umd.cjs +10 -11
- package/dist/sdk/constants.d.ts +2 -3
- package/dist/sdk/index.d.ts +1 -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 +2 -1
- 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 +26 -0
- 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 +175 -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 +29 -15
- package/dist/sdk/typings.d.ts +14 -4
- package/dist/sdk/utils.d.ts +2 -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/reducers.d.ts +78 -45
- 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 +37 -53
- package/dist/store/slices/assetTypeAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +36 -52
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +36 -51
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +36 -51
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +36 -51
- 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 +120 -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 +120 -0
- 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 +110 -36
- package/dist/store/slices/formRevisionSlice.d.ts +36 -51
- package/dist/store/slices/formSlice.d.ts +36 -51
- package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +12 -37
- package/dist/store/slices/formSubmissionSlice.d.ts +10 -36
- package/dist/store/slices/geoImageSlice.d.ts +36 -51
- package/dist/store/slices/index.d.ts +26 -15
- package/dist/store/slices/issueAssociationSlice.d.ts +38 -52
- 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 +36 -52
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +36 -51
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +36 -51
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +36 -51
- 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 +120 -0
- package/dist/store/slices/issueTypeSlice.d.ts +11 -42
- package/dist/store/slices/issueTypeStatusSlice.d.ts +120 -0
- package/dist/store/slices/issueUpdateSlice.d.ts +246 -37
- package/dist/store/slices/organizationAccessSlice.d.ts +11 -37
- package/dist/store/slices/organizationSlice.d.ts +36 -51
- package/dist/store/slices/procedureFieldValuesSlice.d.ts +120 -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 +122 -0
- package/dist/store/slices/procedureStepCommentSlice.d.ts +122 -0
- package/dist/store/slices/procedureStepDefaultAssigneeSlice.d.ts +120 -0
- package/dist/store/slices/procedureStepDefaultReviewerSlice.d.ts +120 -0
- package/dist/store/slices/procedureStepEventSlice.d.ts +122 -0
- package/dist/store/slices/procedureStepFieldValuesAttachmentSlice.d.ts +120 -0
- package/dist/store/slices/procedureStepFieldValuesReviewSlice.d.ts +124 -0
- package/dist/store/slices/procedureStepFieldValuesSlice.d.ts +122 -0
- package/dist/store/slices/procedureStepFieldsAttachmentSlice.d.ts +120 -0
- package/dist/store/slices/procedureStepFieldsSlice.d.ts +220 -0
- package/dist/store/slices/procedureStepReviewerSlice.d.ts +122 -0
- package/dist/store/slices/procedureStepSlice.d.ts +121 -0
- package/dist/store/slices/procedureTypeAttachmentSlice.d.ts +100 -0
- package/dist/store/slices/procedureTypeFieldValuesAttachmentSlice.d.ts +120 -0
- package/dist/store/slices/procedureTypeFieldsAttachmentSlice.d.ts +120 -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 +11 -37
- 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 +38 -67
- package/dist/store/slices/projectSlice.d.ts +37 -52
- package/dist/store/slices/teamMembershipSlice.d.ts +11 -37
- package/dist/store/slices/teamSlice.d.ts +10 -37
- package/dist/store/slices/userSlice.d.ts +45 -60
- package/dist/typings/files.d.ts +27 -14
- package/dist/typings/models/assets.d.ts +19 -67
- package/dist/typings/models/base.d.ts +5 -2
- package/dist/typings/models/documents.d.ts +4 -5
- package/dist/typings/models/emailDomain.d.ts +6 -0
- package/dist/typings/models/emailVerification.d.ts +1 -1
- package/dist/typings/models/fields.d.ts +4 -4
- package/dist/typings/models/forms.d.ts +3 -2
- package/dist/typings/models/geoImages.d.ts +7 -7
- package/dist/typings/models/index.d.ts +2 -1
- package/dist/typings/models/issues.d.ts +49 -33
- package/dist/typings/models/organizations.d.ts +1 -1
- package/dist/typings/models/procedures.d.ts +106 -0
- package/dist/typings/models/projects.d.ts +14 -9
- package/dist/typings/models/teams.d.ts +3 -4
- package/dist/typings/models/users.d.ts +6 -11
- package/dist/utils/file.d.ts +7 -11
- 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 -0
- package/dist/utils/models/issues.d.ts +3 -0
- package/dist/utils/utils.d.ts +0 -7
- package/dist/utils/uuid.d.ts +2 -0
- package/package.json +39 -42
- package/dist/constants/defaults.d.ts +0 -3
- 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/store/slices/assetProcedureSlice.d.ts +0 -137
- package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +0 -136
- package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +0 -137
- package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +0 -135
- package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +0 -224
- package/dist/store/slices/assetProcedureStepSlice.d.ts +0 -138
- package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +0 -48
- package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +0 -136
- package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +0 -136
- package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +0 -135
- 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 -135
- package/dist/store/slices/assetStageSlice.d.ts +0 -137
- package/dist/store/slices/categorySlice.d.ts +0 -136
- package/dist/typings/models/categories.d.ts +0 -7
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
(function(s,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("react"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","file-saver","fast-tree-builder","ts-tree-lib","react","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],U):(s=typeof globalThis<"u"?globalThis:s||self,U(s["overmap-core"]={},null,s.toolkit,s.request,s.uuid,s.fileSaver,s.buildTree,s.tsTreeLib,s.react,s.reduxOffline,s.offlineConfig,s.localforage,s.createMigration,null,null,s.idb,s.jwtDecode,s.dependencyGraph))})(this,function(s,U,d,We,Ke,zp,Up,xn,Cp,Dp,ec,Bp,$p,mP,pP,kp,Lp,Gp){"use strict";var lP=Object.defineProperty;var hP=(s,U,d)=>U in s?lP(s,U,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[U]=d;var S=(s,U,d)=>hP(s,typeof U!="symbol"?U+"":U,d);var jp;const tc=Object.freeze([]),sc=Object.freeze({});var ic=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(ic||{}),l=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(l||{}),ac=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(ac||{}),Zt=(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))(Zt||{}),Jt=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.SELECTED=2]="SELECTED",t[t.DONE=4]="DONE",t))(Jt||{}),V=(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))(V||{});const Np=Jt.BACKLOG,Hp=Zt.MEDIUM,nc=6e4;function b(t){return{addOne:(p,A)=>{const y=t(A.payload);p.instances[y]=A.payload},addMany:(p,A)=>{for(const y of A.payload){const I=t(y);p.instances[I]=y}},setOne:(p,A)=>{const y=t(A.payload);p.instances[y]=A.payload},setMany:(p,A)=>{for(const y of A.payload){const I=t(y);p.instances[I]=y}},updateOne:(p,A)=>{const y=t(A.payload);p.instances[y]=A.payload},updateMany:(p,A)=>{for(const y of A.payload){const I=t(y);p.instances[I]=y}},deleteOne:(p,A)=>{delete p.instances[A.payload]},deleteMany:(p,A)=>{for(const y of A.payload)delete p.instances[y]},initialize:(p,A)=>{p.instances={};const y=new Set;for(const I of A.payload){const g=t(I);y.add(g),p.instances[g]=I}y.size!==A.payload.length&&console.warn("duplicate ids detected when initializing model instances.")},getInitialState:p=>({...p,instances:{}})}}function Wp(){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 et="versioning",F=d.createAction("RESET"),M=d.createAction("RESET_PROJECT_STATE"),_=d.createAction("RESET_ORGANIZATION_STATE");jp=Symbol.toStringTag;class Xt{constructor(){S(this,jp,"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 Qt=!1;["true","1"].includes("".toLowerCase())&&(Qt=!0);function Kp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;const i=Object.keys(t),a=Object.keys(e),n=i.length;if(n!==a.length)return!1;for(let c=0;c<n;c++){const r=i[c];if(!Object.prototype.hasOwnProperty.call(e,r)||t[r]!==e[r])return!1}return!0}function xt(t){const e={};return function(){const i=Array.prototype.slice.call(arguments);return i in e?(Qt&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,i,")"),e[i]):(Qt&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,i,")"),e[i]=t.apply(this,i))}}function Yp(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?tc:t,Ft=t=>Object.keys(t).length===0?sc:t,cc=xt(t=>{if(!t)return"";const e=new Date(t),i=e.getFullYear()===es.getFullYear(),a={day:"numeric",month:"short"};return i||(a.year="numeric"),e.toLocaleDateString([],a)}),Zp=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),Jp=1e3*86400,es=new Date,Xp=t=>new Date(t).toDateString()===es.toDateString(),Qp=xt((t,e,i)=>{const a=Math.round((new Date(t).getTime()-es.getTime())/Jp);return a<e||a>i?cc(t):Zp.format(a,"days")});function xp(t){return new Uint8Array(t).reduce((i,a)=>i+a.toString(16).padStart(2,"0"),"")}const ts=async(t,e)=>{e||(e=await Ye(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 Ye(t){return new Promise((e,i)=>{const a=new FileReader;a.onload=()=>{const n=a.result;if(!n){i(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",n).then(c=>{const r=xp(c);e(r)})},a.readAsArrayBuffer(t)})}function eA(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 rc(t,e){return new File([t],e,{type:t.type})}function tA(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 sA=async t=>{const e={};for(const i of t){const a=await Ye(i);e[a]={sha1:a,extension:i.name.split(".").pop()||"",file_type:i.type,size:i.size}}return Object.values(e)},dc=async t=>(await fetch(t)).blob(),iA=t=>new Promise((e,i)=>{const a=new FileReader;a.onloadend=()=>{var n;e(((n=a.result)==null?void 0:n.toString())||"")},a.readAsDataURL(t)});function aA(t){const e=new Blob([t]);zp.saveAs(e,t.name)}const uc={};function nA(t,e,i,...a){const n=uc[t];let c=!1;n?n[e]||(n[e]=!0,c=!0):(uc[t]={[e]:!0},c=!0),c&&console[i](...a)}const oc=["created_at","updated_at","index","revision"];function P(t){return{...t,uuid:Ke.v4()}}function lc(t){const e={};for(const i of t)e[i.uuid]=i;return e}function hc(t){return t.map(({uuid:e})=>e)}function cA(t,e=void 0,i=255){let a=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!e){const c=t.split(".");c.length>1&&(e=c[c.length-1])}e&&!e.startsWith(".")&&(e="."+e);const n=e?e.length:0;return a.length+n>i&&(a=a.slice(0,i-n)+(e||"")),a}function rA(t){return t.toLowerCase().replace(" ","-")}function dA(t,e=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,e?"_":"-")}function uA(t,e){if(t.length<=e)return t;const i=t.slice(0,e-1);return i.slice(0,i.lastIndexOf(" "))+"…"}const f=t=>e=>i=>t(i,e);function mc(t,e,i){return i.findIndex(a=>a.uuid===t.uuid)===e}function oA(t,e,i){return i.findIndex(a=>a.file_sha1===t.file_sha1)===e}const lA=/^.+@.+\..+$/;function v(t){const e={...t};for(const i of[...oc,"created_by"])i in e&&delete e[i];return e}const pc=t=>{const e=t.toSorted((i,a)=>i.order-a.order);return Up(e,{id:i=>i.uuid,parentId:i=>i.parent,includeEmptyChildrenArray:!0,valueKey:!1})},hA=t=>{const{roots:e}=pc(t);return e.map(i=>new xn.Tree(i))},Ac=(t,e)=>{const{nodes:i}=pc(e),a=i.get(t);if(!a)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new xn.Tree(a)},D=b(t=>t.uuid),yc=D.getInitialState({}),ss=d.createSlice({name:"agents",initialState:yc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,yc)),reducers:{initializeConversations:D.initialize,addConversation:D.addOne,addConversations:D.addMany,setConversation:D.setOne,setConversations:D.setMany,updateConversation:D.updateOne,updateConversations:D.updateMany,deleteConversation:D.deleteOne,deleteConversations:D.deleteMany}}),{initializeConversations:fc,addConversation:Sc,addConversations:mA,setConversation:Tc,setConversations:pA,updateConversation:Ic,updateConversations:AA,deleteConversation:yA,deleteConversations:fA}=ss.actions,is=t=>t.agentsReducer.instances,SA=d.createSelector([is],t=>Object.values(t)),TA=f(d.createSelector([is,(t,e)=>e],(t,e)=>t[e])),gc=ss.reducer,B=b(t=>t.uuid),Fc=B.getInitialState({}),as=d.createSlice({name:"assetAttachments",initialState:Fc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Fc)),reducers:{initializeAssetAttachments:B.initialize,addAssetAttachment:B.addOne,addAssetAttachments:B.addMany,setAssetAttachment:B.setOne,setAssetAttachments:B.setMany,updateAssetAttachment:B.updateOne,updateAssetAttachments:B.updateMany,deleteAssetAttachment:B.deleteOne,deleteAssetAttachments:B.deleteMany}}),{initializeAssetAttachments:ns,addAssetAttachment:IA,addAssetAttachments:cs,setAssetAttachment:Pc,setAssetAttachments:gA,updateAssetAttachment:FA,updateAssetAttachments:bc,deleteAssetAttachment:_c,deleteAssetAttachments:rs}=as.actions,Oc=t=>t.assetAttachmentReducer.instances,Rc=d.createSelector([Oc],t=>Object.values(t)),vc=t=>e=>e.assetAttachmentReducer.instances[t],wc=f(d.createSelector([Rc,(t,e)=>e],(t,e)=>T(t.filter(({asset:i})=>e===i)))),Mc=as.reducer,$=b(({uuid:t})=>t),Vc=$.getInitialState({}),ds=d.createSlice({name:"assetProcedureTypeAttachments",initialState:Vc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Vc)),reducers:{initializeAssetProcedureTypeAttachments:$.initialize,addAssetProcedureTypeAttachment:$.addOne,addAssetProcedureTypeAttachments:$.addMany,setAssetProcedureTypeAttachment:$.setOne,setAssetProcedureTypeAttachments:$.setMany,updateAssetProcedureTypeAttachment:$.updateOne,updateAssetProcedureTypeAttachments:$.updateMany,deleteAssetProcedureTypeAttachment:$.deleteOne,deleteAssetProcedureTypeAttachments:$.deleteMany}}),{initializeAssetProcedureTypeAttachments:us,addAssetProcedureTypeAttachment:PA,addAssetProcedureTypeAttachments:Ec,setAssetProcedureTypeAttachment:jc,setAssetProcedureTypeAttachments:bA,updateAssetProcedureTypeAttachment:_A,updateAssetProcedureTypeAttachments:qc,deleteAssetProcedureTypeAttachment:zc,deleteAssetProcedureTypeAttachments:Uc}=ds.actions,Cc=ds.reducer,Dc=t=>t.assetProcedureTypeAttachmentReducer.instances,Bc=d.createSelector([Dc],t=>Object.values(t)),$c=t=>e=>e.assetProcedureTypeAttachmentReducer.instances[t],OA=f(d.createSelector([Bc,(t,e)=>e],(t,e)=>T(t.filter(({asset_procedure_type:i})=>e===i)))),k=b(({uuid:t})=>t),kc=k.getInitialState({}),os=d.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:kc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,kc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:k.initialize,addAssetProcedureTypeFieldsAttachment:k.addOne,addAssetProcedureTypeFieldsAttachments:k.addMany,setAssetProcedureTypeFieldsAttachment:k.setOne,setAssetProcedureTypeFieldsAttachments:k.setMany,updateAssetProcedureTypeFieldsAttachment:k.updateOne,updateAssetProcedureTypeFieldsAttachments:k.updateMany,deleteAssetProcedureTypeFieldsAttachment:k.deleteOne,deleteAssetProcedureTypeFieldsAttachments:k.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:Lc,addAssetProcedureTypeFieldsAttachment:RA,addAssetProcedureTypeFieldsAttachments:Gc,setAssetProcedureTypeFieldsAttachment:vA,setAssetProcedureTypeFieldsAttachments:wA,updateAssetProcedureTypeFieldsAttachment:MA,updateAssetProcedureTypeFieldsAttachments:Nc,deleteAssetProcedureTypeFieldsAttachment:VA,deleteAssetProcedureTypeFieldsAttachments:Hc}=os.actions,Wc=os.reducer,Kc=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,Yc=d.createSelector([Kc],t=>Object.values(t)),EA=f(d.createSelector([Yc,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),jA=t=>e=>e.assetProcedureTypeFieldsAttachmentReducer.instances[t],L=b(({uuid:t})=>t),Zc=L.getInitialState({}),ls=d.createSlice({name:"assetProcedureTypeFields",initialState:Zc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Zc)),reducers:{initializeAssetProcedureTypeFields:L.initialize,addAssetProcedureTypeFields:L.addOne,addAssetProcedureTypeFieldsMany:L.addMany,setAssetProcedureTypeFields:L.setOne,setAssetProcedureTypeFieldsMany:L.setMany,updateAssetProcedureTypeFields:L.updateOne,updateAssetProcedureTypeFieldsMany:L.updateMany,deleteAssetProcedureTypeFields:L.deleteOne,deleteAssetProcedureTypeFieldsMany:L.deleteMany}}),{initializeAssetProcedureTypeFields:Jc,addAssetProcedureTypeFields:Xc,addAssetProcedureTypeFieldsMany:qA,setAssetProcedureTypeFields:zA,setAssetProcedureTypeFieldsMany:UA,updateAssetProcedureTypeFields:Qc,updateAssetProcedureTypeFieldsMany:CA,deleteAssetProcedureTypeFields:xc,deleteAssetProcedureTypeFieldsMany:DA}=ls.actions,er=ls.reducer,tr=t=>t.assetProcedureTypeFieldsReducer.instances,hs=d.createSelector([tr],t=>Object.values(t)),BA=f(d.createSelector([hs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),$A=f(d.createSelector([hs,(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])),kA=t=>e=>e.assetProcedureTypeFieldsReducer.instances[t],G=b(({uuid:t})=>t),sr=G.getInitialState({}),ms=d.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:sr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,sr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:G.initialize,addAssetProcedureTypeFieldValuesAttachment:G.addOne,addAssetProcedureTypeFieldValuesAttachments:G.addMany,setAssetProcedureTypeFieldValuesAttachment:G.setOne,setAssetProcedureTypeFieldValuesAttachments:G.setMany,updateAssetProcedureTypeFieldValuesAttachment:G.updateOne,updateAssetProcedureTypeFieldValuesAttachments:G.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:G.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:G.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:ir,addAssetProcedureTypeFieldValuesAttachment:LA,addAssetProcedureTypeFieldValuesAttachments:Pt,setAssetProcedureTypeFieldValuesAttachment:GA,setAssetProcedureTypeFieldValuesAttachments:NA,updateAssetProcedureTypeFieldValuesAttachment:HA,updateAssetProcedureTypeFieldValuesAttachments:ar,deleteAssetProcedureTypeFieldValuesAttachment:WA,deleteAssetProcedureTypeFieldValuesAttachments:bt}=ms.actions,nr=ms.reducer,ps=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,cr=d.createSelector([ps],t=>Object.values(t)),KA=t=>e=>e.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],rr=f(d.createSelector([ps,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),dr=f(d.createSelector([cr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),N=b(({uuid:t})=>t),ur=N.getInitialState({}),As=d.createSlice({name:"assetProcedureTypeFieldValues",initialState:ur,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,ur)),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:or,addAssetProcedureTypeFieldValues:ys,addAssetProcedureTypeFieldValuesMany:lr,setAssetProcedureTypeFieldValues:YA,setAssetProcedureTypeFieldValuesMany:ZA,updateAssetProcedureTypeFieldValues:tt,updateAssetProcedureTypeFieldValuesMany:hr,deleteAssetProcedureTypeFieldValues:fs,deleteAssetProcedureTypeFieldValuesMany:mr}=As.actions,pr=As.reducer,Ar=t=>t.assetProcedureTypeFieldValuesReducer.instances,Ss=d.createSelector([Ar],t=>Object.values(t)),JA=f(d.createSelector([Ss,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),XA=f(d.createSelector([Ss,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),Ts=t=>e=>e.assetProcedureTypeFieldValuesReducer.instances[t],H=b(({uuid:t})=>t),yr=H.getInitialState({}),Is=d.createSlice({name:"assetProcedures",initialState:yr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,yr)),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:fr,addAssetProcedure:gs,addAssetProcedures:Sr,updateAssetProcedure:st,updateAssetProcedures:QA,deleteAssetProcedure:Fs,deleteAssetProcedures:Tr,setAssetProcedure:xA,setAssetProcedures:ey}=Is.actions,Ir=Is.reducer,Ps=t=>t.assetProcedureReducer.instances,bs=d.createSelector([Ps],t=>Object.values(t)),gr=f(d.createSelector([bs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),ty=f(d.createSelector([bs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),_s=t=>e=>e.assetProcedureReducer.instances[t],sy=f(d.createSelector([Ps,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n&&i.push(n)}return T(i)})),W=b(t=>t.uuid),Fr=W.getInitialState({}),Os=d.createSlice({name:"assetProcedureTypes",initialState:Fr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Fr)),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:Pr,addAssetProcedureType:Rs,addAssetProcedureTypes:iy,updateAssetProcedureType:it,updateAssetProcedureTypes:ay,deleteAssetProcedureType:vs,deleteAssetProcedureTypes:ny,setAssetProcedureType:cy,setAssetProcedureTypes:ry}=Os.actions,br=Os.reducer,ws=t=>t.assetProcedureTypeReducer.instances,_r=d.createSelector([ws],t=>Object.values(t)),Ms=t=>e=>e.assetProcedureTypeReducer.instances[t],dy=f(d.createSelector([ws,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n&&i.push(n)}return T(i)})),uy=f(d.createSelector([_r,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),K=b(t=>t.uuid),Or=K.getInitialState({}),Vs=d.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Or,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Or)),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:Rr,addAssetProcedureStepFieldsAttachment:oy,addAssetProcedureStepFieldsAttachments:vr,setAssetProcedureStepFieldsAttachment:ly,setAssetProcedureStepFieldsAttachments:hy,updateAssetProcedureStepFieldsAttachment:my,updateAssetProcedureStepFieldsAttachments:wr,deleteAssetProcedureStepFieldsAttachment:py,deleteAssetProcedureStepFieldsAttachments:Mr}=Vs.actions,Vr=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Er=d.createSelector([Vr],t=>Object.values(t)),Ay=f(d.createSelector([Er,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),yy=t=>e=>e.assetProcedureStepFieldsAttachmentReducer.instances[t],jr=Vs.reducer,Y=b(t=>t.uuid),qr=Y.getInitialState({}),Es=d.createSlice({name:"assetProcedureStepFields",initialState:qr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,qr)),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:zr,addAssetProcedureStepFields:js,addAssetProcedureStepFieldsMany:fy,setAssetProcedureStepFields:Sy,setAssetProcedureStepFieldsMany:Ty,updateAssetProcedureStepFields:at,updateAssetProcedureStepFieldsMany:Iy,deleteAssetProcedureStepFields:qs,deleteAssetProcedureStepFieldsMany:gy}=Es.actions,zs=t=>t.assetProcedureStepFieldsReducer.instances,Us=d.createSelector([zs],t=>Object.values(t)),Fy=f(d.createSelector([Us,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),Py=f(d.createSelector([Us,(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])),by=d.createSelector([zs],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}),_y=t=>e=>e.assetProcedureStepFieldsReducer.instances[t],Ur=Es.reducer,Z=b(t=>t.uuid),Cr=Z.getInitialState({}),Cs=d.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Cr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Cr)),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:Dr,addAssetProcedureStepFieldValuesAttachment:Oy,addAssetProcedureStepFieldValuesAttachments:_t,setAssetProcedureStepFieldValuesAttachment:Ry,setAssetProcedureStepFieldValuesAttachments:vy,updateAssetProcedureStepFieldValuesAttachment:wy,updateAssetProcedureStepFieldValuesAttachments:Br,deleteAssetProcedureStepFieldValuesAttachment:My,deleteAssetProcedureStepFieldValuesAttachments:Ot}=Cs.actions,Ds=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,$r=d.createSelector([Ds],t=>Object.values(t)),Vy=t=>e=>e.assetProcedureStepFieldValuesAttachmentReducer.instances[t],kr=f(d.createSelector([Ds,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),Lr=f(d.createSelector([$r,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),Gr=Cs.reducer,J=b(t=>t.uuid),Nr=J.getInitialState({}),Bs=d.createSlice({name:"assetProcedureStepFieldValues",initialState:Nr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Nr)),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:Hr,addAssetProcedureStepFieldValues:$s,addAssetProcedureStepFieldValuesMany:Wr,setAssetProcedureStepFieldValues:Ey,setAssetProcedureStepFieldValuesMany:jy,updateAssetProcedureStepFieldValues:nt,updateAssetProcedureStepFieldValuesMany:Kr,deleteAssetProcedureStepFieldValues:ks,deleteAssetProcedureStepFieldValuesMany:Yr}=Bs.actions,Zr=t=>t.assetProcedureStepFieldValuesReducer.instances,Rt=d.createSelector([Zr],t=>Object.values(t)),qy=f(d.createSelector([Rt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),zy=f(d.createSelector([Rt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),Uy=f(d.createSelector([Rt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),Ls=t=>e=>e.assetProcedureStepFieldValuesReducer.instances[t],Jr=Bs.reducer,X=b(t=>t.uuid),Xr=X.getInitialState({}),Gs=d.createSlice({name:"assetProcedureSteps",initialState:Xr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Xr)),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:Qr,setAssetProcedureStep:xr,setAssetProcedureSteps:Cy,addAssetProcedureStep:ed,addAssetProcedureSteps:td,updateAssetProcedureStep:vt,updateAssetProcedureSteps:Dy,deleteAssetProcedureStep:sd,deleteAssetProcedureSteps:id}=Gs.actions,ad=Gs.reducer,ct=t=>t.assetProcedureStepReducer.instances,Ns=t=>e=>e.assetProcedureStepReducer.instances[t],nd=d.createSelector([ct],t=>Object.values(t)),By=f(d.createSelector([ct,(t,e)=>e],(t,e)=>{const i={};for(const[a,n]of Object.entries(t))n.asset_procedure_type===e&&(i[a]=n);return Ft(i)})),$y=f(d.createSelector([nd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),ky=f(d.createSelector([ct,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectAssetProcedureStepsByIds: No step exists with the id",a)}return T(i)})),cd=f(d.createSelector([ct,(t,e)=>e],(t,e)=>{if(!t[e])return T([]);const n=Ac(e,Object.values(t)).all().map(({model:c})=>c);return T(n)})),Q=b(t=>t.uuid),rd=Q.getInitialState({}),Hs=d.createSlice({name:"assets",initialState:rd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,rd)),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:dd,addAsset:Ws,addAssets:wt,updateAsset:rt,updateAssets:Ly,deleteAsset:Ks,deleteAssets:Ys,setAsset:Gy,setAssets:Ny}=Hs.actions,Zs=t=>t.assetReducer.instances,ud=d.createSelector([Zs],t=>T(Object.values(t))),Js=f(d.createSelector([ud,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),Xs=t=>e=>e.assetReducer.instances[t],od=f(d.createSelector([Zs,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n&&i.push(n)}return T(i)})),Hy=t=>e=>Js(t)(e).length,ld=Hs.reducer,x=b(t=>t.uuid),hd=x.getInitialState({}),Qs=d.createSlice({name:"assetStageCompletions",initialState:hd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,hd)),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:md,addAssetStageCompletion:xs,addAssetStageCompletions:ei,setAssetStageCompletion:Wy,setAssetStageCompletions:Ky,updateAssetStageCompletion:pd,updateAssetStageCompletions:Ad,deleteAssetStageCompletion:ti,deleteAssetStageCompletions:si}=Qs.actions,yd=Qs.reducer,ii=t=>t.assetStageCompletionReducer.instances,Yy=d.createSelector([ii],t=>Object.values(t)),fd=t=>e=>e.assetStageCompletionReducer.instances[t],Sd=f(d.createSelector([ii,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),ee=b(t=>t.uuid),Td=ee.getInitialState({}),ai=d.createSlice({name:"assetStages",initialState:Td,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Td)),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:Id,setAssetStage:gd,setAssetStages:Zy,addAssetStage:ni,addAssetStages:Jy,updateAssetStage:Mt,updateAssetStages:Xy,deleteAssetStage:ci,deleteAssetStages:Qy}=ai.actions,Fd=ai.reducer,Vt=t=>t.assetStageReducer.instances,ri=t=>e=>e.assetStageReducer.instances[t],Pd=d.createSelector([Vt],t=>Object.values(t)),xy=f(d.createSelector([Vt,(t,e)=>e],(t,e)=>{const i={};for(const[a,n]of Object.entries(t))n.asset_procedure_type===e&&(i[a]=n);return Ft(i)})),ef=f(d.createSelector([Pd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),tf=f(d.createSelector([Vt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectStagesFromStageIds: No stage exists with the id",a)}return T(i)})),te=b(t=>t.uuid),bd=te.getInitialState({}),di=d.createSlice({name:"assetTypeAttachments",initialState:bd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,bd)),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:ui,addAssetTypeAttachment:sf,addAssetTypeAttachments:oi,setAssetTypeAttachment:_d,setAssetTypeAttachments:af,updateAssetTypeAttachment:nf,updateAssetTypeAttachments:Od,deleteAssetTypeAttachment:Rd,deleteAssetTypeAttachments:li}=di.actions,vd=t=>t.assetTypeAttachmentReducer.instances,wd=d.createSelector([vd],t=>Object.values(t)),Md=t=>e=>e.assetTypeAttachmentReducer.instances[t],Vd=f(d.createSelector([wd,(t,e)=>e],(t,e)=>T(t.filter(({asset_type:i})=>e===i)))),Ed=di.reducer,se=b(t=>t.uuid),jd=se.getInitialState({}),hi=d.createSlice({name:"assetTypeFieldsAttachments",initialState:jd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,jd)),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:qd,addAssetTypeFieldsAttachment:cf,addAssetTypeFieldsAttachments:zd,setAssetTypeFieldsAttachment:rf,setAssetTypeFieldsAttachments:df,updateAssetTypeFieldsAttachment:uf,updateAssetTypeFieldsAttachments:Ud,deleteAssetTypeFieldsAttachment:of,deleteAssetTypeFieldsAttachments:Cd}=hi.actions,Dd=t=>t.assetTypeFieldsAttachmentReducer.instances,Bd=d.createSelector([Dd],t=>Object.values(t)),lf=f(d.createSelector([Bd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),hf=t=>e=>e.assetTypeFieldsAttachmentReducer.instances[t],$d=hi.reducer,ie=b(t=>t.uuid),kd=ie.getInitialState({}),mi=d.createSlice({name:"assetTypeFields",initialState:kd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,kd)),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:Ld,addAssetTypeFields:Gd,addAssetTypeFieldsMany:mf,setAssetTypeFields:pf,setAssetTypeFieldsMany:Af,updateAssetTypeFields:Nd,updateAssetTypeFieldsMany:yf,deleteAssetTypeFields:Hd,deleteAssetTypeFieldsMany:ff}=mi.actions,Wd=t=>t.assetTypeFieldsReducer.instances,Et=d.createSelector([Wd],t=>Object.values(t)),Sf=f(d.createSelector([Et,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),Tf=f(d.createSelector([Et,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),If=t=>e=>e.assetTypeFieldsReducer.instances[t],Kd=mi.reducer,ae=b(t=>t.uuid),Yd=ae.getInitialState({}),pi=d.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Yd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Yd)),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:Zd,addAssetTypeFieldValuesAttachment:gf,addAssetTypeFieldValuesAttachments:jt,setAssetTypeFieldValuesAttachment:Ff,setAssetTypeFieldValuesAttachments:Pf,updateAssetTypeFieldValuesAttachment:bf,updateAssetTypeFieldValuesAttachments:Jd,deleteAssetTypeFieldValuesAttachment:_f,deleteAssetTypeFieldValuesAttachments:qt}=pi.actions,Ai=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Xd=d.createSelector([Ai],t=>Object.values(t)),Of=t=>e=>e.assetTypeFieldValuesAttachmentReducer.instances[t],Qd=f(d.createSelector([Ai,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),xd=f(d.createSelector([Xd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),eu=pi.reducer,ne=b(t=>t.uuid),tu=ne.getInitialState({}),yi=d.createSlice({name:"assetTypeFieldValues",initialState:tu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,tu)),reducers:{initializeAssetTypeFieldValues:ne.initialize,addAssetTypeFieldValues:ne.addOne,addAssetTypeFieldValuesMany:ne.addMany,setAssetTypeFieldValues:ne.setOne,setAssetTypeFieldValuesMany:ne.setMany,updateAssetTypeFieldValues:ne.updateOne,updateAssetTypeFieldValuesMany:ne.updateMany,deleteAssetTypeFieldValues:ne.deleteOne,deleteAssetTypeFieldValuesMany:ne.deleteMany}}),{initializeAssetTypeFieldValues:su,addAssetTypeFieldValues:fi,addAssetTypeFieldValuesMany:iu,setAssetTypeFieldValues:Rf,setAssetTypeFieldValuesMany:vf,updateAssetTypeFieldValues:dt,updateAssetTypeFieldValuesMany:au,deleteAssetTypeFieldValues:Si,deleteAssetTypeFieldValuesMany:nu}=yi.actions,cu=t=>t.assetTypeFieldValuesReducer.instances,Ti=d.createSelector([cu],t=>Object.values(t)),wf=f(d.createSelector([Ti,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),Mf=f(d.createSelector([Et,Ti,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(n=>n.asset_type===i).map(n=>n.uuid));return T(e.filter(n=>a.has(n.fields_revision)))})),Ii=t=>e=>e.assetTypeFieldValuesReducer.instances[t],ru=yi.reducer,ce=b(t=>t.uuid),du=ce.getInitialState({}),gi=d.createSlice({name:"assetTypeIdentifiers",initialState:du,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,du)),reducers:{initializeAssetTypeIdentifiers:ce.initialize,addAssetTypeIdentifier:ce.addOne,addAssetTypeIdentifiers:ce.addMany,setAssetTypeIdentifier:ce.setOne,setAssetTypeIdentifiers:ce.setMany,updateAssetTypeIdentifier:ce.updateOne,updateAssetTypeIdentifiers:ce.updateMany,deleteAssetTypeIdentifier:ce.deleteOne,deleteAssetTypeIdentifiers:ce.deleteMany}}),{initializeAssetTypeIdentifiers:uu,addAssetTypeIdentifier:Fi,addAssetTypeIdentifiers:Vf,setAssetTypeIdentifier:Ef,setAssetTypeIdentifiers:jf,updateAssetTypeIdentifier:ut,updateAssetTypeIdentifiers:qf,deleteAssetTypeIdentifier:Pi,deleteAssetTypeIdentifiers:zf}=gi.actions,ou=t=>t.assetTypeIdentifierReducer.instances,lu=d.createSelector([ou],t=>Object.values(t)),bi=t=>e=>e.assetTypeIdentifierReducer.instances[t],Uf=f(d.createSelector([lu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),hu=gi.reducer,re=b(t=>t.uuid),mu=re.getInitialState({}),_i=d.createSlice({name:"assetTypeIdentifierValues",initialState:mu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,mu)),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:pu,addAssetTypeIdentifierValue:Oi,addAssetTypeIdentifierValues:Cf,setAssetTypeIdentifierValue:Df,setAssetTypeIdentifierValues:Bf,updateAssetTypeIdentifierValue:ot,updateAssetTypeIdentifierValues:$f,deleteAssetTypeIdentifierValue:Ri,deleteAssetTypeIdentifierValues:kf}=_i.actions,Au=t=>t.assetTypeIdentifierValueReducer.instances,vi=d.createSelector([Au],t=>Object.values(t)),wi=t=>e=>e.assetTypeIdentifierValueReducer.instances[t],Lf=f(d.createSelector([vi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),Gf=f(d.createSelector([vi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type_identifier===e)))),yu=_i.reducer,de=b(t=>t.uuid),fu=de.getInitialState({}),Mi=d.createSlice({name:"assetTypes",initialState:fu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,fu)),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:Su,setAssetType:Nf,setAssetTypes:Hf,addAssetType:Vi,addAssetTypes:Wf,updateAssetType:lt,updateAssetTypes:Kf,deleteAssetType:Ei,deleteAssetTypes:Yf}=Mi.actions,ji=t=>t.assetTypeReducer.instances,Tu=d.createSelector([ji],t=>Object.values(t)),qi=t=>e=>e.assetTypeReducer.instances[t],Zf=f(d.createSelector([ji,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectAssetTypesByIds: No assetType exists with the id",a)}return T(i)})),Jf=f(d.createSelector([Tu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Iu=Mi.reducer,gu={accessToken:"",refreshToken:"",isLoggedIn:!1},zt=d.createSlice({name:"auth",initialState:gu,extraReducers:t=>t.addCase(F,e=>Object.assign(e,gu)),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||zt.caseReducers.clearTokens(t),t.isLoggedIn=e.payload}}}),{setTokens:Xf,clearTokens:Qf,setLoggedIn:Fu}=zt.actions,xf=t=>t.authReducer.accessToken,eS=t=>t.authReducer.isLoggedIn,Pu=zt.reducer,ue=b(t=>t.uuid),bu=ue.getInitialState({}),zi=d.createSlice({name:"categories",initialState:bu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,bu)),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:_u,addCategory:Ui,addCategories:tS,setCategory:sS,setCategories:iS,updateCategory:Ou,updateCategories:aS,deleteCategory:Ru,deleteCategories:nS}=zi.actions,Ci=t=>t.categoryReducer.instances,vu=d.createSelector([Ci],t=>Object.values(t)),Di=t=>e=>e.categoryReducer.instances[t],cS=f(d.createSelector([Ci,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectCategoryByIds: No category exists with the id",a)}return T(i)})),rS=f(d.createSelector([vu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),wu=zi.reducer,oe=b(t=>t.uuid),Mu=oe.getInitialState({}),Bi=d.createSlice({name:"documentAttachments",initialState:Mu,extraReducers:t=>t.addCase(F,e=>Object.assign(e,Mu)),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:$i,addDocumentAttachment:dS,addDocumentAttachments:Vu,setDocumentAttachment:Eu,setDocumentAttachments:uS,updateDocumentAttachment:oS,updateDocumentAttachments:ju,deleteDocumentAttachment:qu,deleteDocumentAttachments:zu}=Bi.actions,Uu=t=>t.documentAttachmentReducer.instances,Cu=d.createSelector([Uu],t=>Object.values(t)),Du=t=>e=>e.documentAttachmentReducer.instances[t],lS=f(d.createSelector([Cu,(t,e)=>e],(t,e)=>T(t.filter(({document:i})=>e===i)))),Bu=Bi.reducer,$u={documents:{}},ki=d.createSlice({name:"documents",initialState:$u,extraReducers:t=>t.addCase(F,e=>{Object.assign(e,$u)}),reducers:{setDocuments:(t,e)=>{if(e.payload.filter(mc).length!==e.payload.length)throw new Error("Tried to use setIssues reducer with duplicate ID's");t.documents=lc(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 n=t.documents[a.parent_document];t.documents[a.parent_document]={...n,children_documents:n.children_documents.filter(c=>c!==a.uuid)}}delete t.documents[i]}}}}),{setDocuments:ku,addDocuments:Lu,updateDocuments:Ze,removeDocuments:Li}=ki.actions,Ut=t=>t.documentsReducer.documents,Gi=d.createSelector([Ut],t=>Object.values(t)),Gu=t=>e=>e.documentsReducer.documents[t],hS=f(d.createSelector([Ut,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectDocumentByIds: No document exists with the id",a)}return T(i)})),mS=f(d.createSelector([Gi,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),pS=f(d.createSelector([Gi,(t,e)=>e],(t,e)=>t.filter(i=>i.organization===e))),Nu=ki.reducer,Hu={s3Urls:{}},Wu=1e3*60*60,AS=Wu*24*7,Ni=d.createSlice({name:"file",initialState:Hu,extraReducers:t=>t.addCase(F,e=>Object.assign(e,Hu)),reducers:{setUploadUrl:(t,e)=>{const{url:i,fields:a,sha1:n}=e.payload,c=new Date,r=new Date(c.getTime()+AS);t.s3Urls[n]={url:i,fields:a,exp:r.getTime()}}}}),{setUploadUrl:Ku}=Ni.actions,Yu=t=>e=>{const i=e.fileReducer.s3Urls[t];if(!i)return;const a=new Date().getTime();if(!((i.exp??a)-a<Wu))return i},Zu=Ni.reducer,le=b(t=>t.uuid),Ju=le.getInitialState({}),Hi=d.createSlice({name:"formIdentifiers",initialState:Ju,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Ju)),reducers:{initializeFormIdentifiers:le.initialize,addFormIdentifier:le.addOne,addFormIdentifiers:le.addMany,setFormIdentifier:le.setOne,setFormIdentifiers:le.setMany,updateFormIdentifier:le.updateOne,updateFormIdentifiers:le.updateMany,deleteFormIdentifier:le.deleteOne,deleteFormIdentifiers:le.deleteMany}}),{initializeFormIdentifiers:Xu,addFormIdentifier:Wi,addFormIdentifiers:yS,setFormIdentifier:fS,setFormIdentifiers:SS,updateFormIdentifier:ht,updateFormIdentifiers:TS,deleteFormIdentifier:Ki,deleteFormIdentifiers:IS}=Hi.actions,Qu=t=>t.formIdentifierReducer.instances,xu=d.createSelector([Qu],t=>Object.values(t)),Yi=t=>e=>e.formIdentifierReducer.instances[t],gS=f(d.createSelector([xu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),eo=Hi.reducer,he=b(t=>t.uuid),to=he.getInitialState({}),Zi=d.createSlice({name:"formIdentifierValues",initialState:to,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,to)),reducers:{initializeFormIdentifierValues:he.initialize,addFormIdentifierValue:he.addOne,addFormIdentifierValues:he.addMany,setFormIdentifierValue:he.setOne,setFormIdentifierValues:he.setMany,updateFormIdentifierValue:he.updateOne,updateFormIdentifierValues:he.updateMany,deleteFormIdentifierValue:he.deleteOne,deleteFormIdentifierValues:he.deleteMany}}),{initializeFormIdentifierValues:so,addFormIdentifierValue:Ji,addFormIdentifierValues:FS,setFormIdentifierValue:PS,setFormIdentifierValues:bS,updateFormIdentifierValue:mt,updateFormIdentifierValues:_S,deleteFormIdentifierValue:Xi,deleteFormIdentifierValues:OS}=Zi.actions,io=t=>t.formIdentifierValueReducer.instances,Qi=d.createSelector([io],t=>Object.values(t)),xi=t=>e=>e.formIdentifierValueReducer.instances[t],RS=f(d.createSelector([Qi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),vS=f(d.createSelector([Qi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_identifier===e)))),ao=Zi.reducer,me=b(t=>t.uuid),no=me.getInitialState({}),ea=d.createSlice({name:"formRevisionAttachments",initialState:no,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,no)),reducers:{initializeFormRevisionAttachments:me.initialize,addFormRevisionAttachment:me.addOne,addFormRevisionAttachments:me.addMany,setFormRevisionAttachment:me.setOne,setFormRevisionAttachments:me.setMany,updateFormRevisionAttachment:me.updateOne,updateFormRevisionAttachments:me.updateMany,deleteFormRevisionAttachment:me.deleteOne,deleteFormRevisionAttachments:me.deleteMany}}),{initializeFormRevisionAttachments:co,addFormRevisionAttachment:wS,addFormRevisionAttachments:ro,setFormRevisionAttachment:MS,setFormRevisionAttachments:VS,updateFormRevisionAttachment:ES,updateFormRevisionAttachments:uo,deleteFormRevisionAttachment:jS,deleteFormRevisionAttachments:oo}=ea.actions,lo=t=>t.formRevisionAttachmentReducer.instances,qS=f(d.createSelector([lo,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.form_revision===e)))),ho=ea.reducer,pe=b(t=>t.uuid),mo=pe.getInitialState({}),ta=d.createSlice({name:"formRevisions",initialState:mo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,mo)),reducers:{initializeFormRevisions:pe.initialize,addFormRevision:pe.addOne,addFormRevisions:pe.addMany,setFormRevision:pe.setOne,setFormRevisions:pe.setMany,updateFormRevision:pe.updateOne,updateFormRevisions:pe.updateMany,deleteFormRevision:pe.deleteOne,deleteFormRevisions:pe.deleteMany}}),{initializeFormRevisions:po,addFormRevision:sa,addFormRevisions:Ao,setFormRevision:yo,setFormRevisions:zS,updateFormRevision:US,updateFormRevisions:CS,deleteFormRevision:ia,deleteFormRevisions:fo}=ta.actions,aa=t=>t.formRevisionReducer.instances,na=d.createSelector([aa],t=>Object.values(t)),DS=t=>e=>e.formRevisionReducer.instances[t],BS=f(d.createSelector([na,(t,e)=>e],(t,e)=>t.filter(i=>i.form===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),So=f(d.createSelector([na,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),To=ta.reducer,Ae=b(t=>t.uuid),Io=Ae.getInitialState({}),ca=d.createSlice({name:"forms",initialState:Io,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Io)),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:go,addForm:ra,addForms:$S,setForm:kS,setForms:LS,updateForm:GS,updateForms:NS,deleteForm:da,deleteForms:HS}=ca.actions,Fo=ca.reducer,Po=t=>t.formReducer.instances,bo=d.createSelector([Po],t=>Object.values(t)),_o=t=>e=>e.formReducer.instances[t],WS=f(d.createSelector([bo,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),ye=b(t=>t.uuid),Oo=ye.getInitialState({}),ua=d.createSlice({name:"formSubmissionAttachments",initialState:Oo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Oo)),reducers:{initializeFormSubmissionAttachments:ye.initialize,addFormSubmissionAttachment:ye.addOne,addFormSubmissionAttachments:ye.addMany,setFormSubmissionAttachment:ye.setOne,setFormSubmissionAttachments:ye.setMany,updateFormSubmissionAttachment:ye.updateOne,updateFormSubmissionAttachments:ye.updateMany,deleteFormSubmissionAttachment:ye.deleteOne,deleteFormSubmissionAttachments:ye.deleteMany}}),{initializeFormSubmissionAttachments:Ro,addFormSubmissionAttachment:KS,addFormSubmissionAttachments:Ct,setFormSubmissionAttachment:YS,setFormSubmissionAttachments:ZS,updateFormSubmissionAttachment:JS,updateFormSubmissionAttachments:vo,deleteFormSubmissionAttachment:XS,deleteFormSubmissionAttachments:Dt}=ua.actions,wo=t=>t.formSubmissionAttachmentReducer.instances,oa=d.createSelector([wo],t=>Object.values(t)),Mo=f(d.createSelector([oa,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),Vo=f(d.createSelector([oa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),Eo=ua.reducer,fe=b(t=>t.uuid),jo=fe.getInitialState({}),la=d.createSlice({name:"formSubmissions",initialState:jo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,jo)),reducers:{initializeFormSubmissions:fe.initialize,setFormSubmission:fe.setOne,setFormSubmissions:fe.setMany,addFormSubmission:fe.addOne,addFormSubmissions:fe.addMany,updateFormSubmission:fe.updateOne,updateFormSubmissions:fe.updateMany,deleteFormSubmission:fe.deleteOne,deleteFormSubmissions:fe.deleteMany}}),{initializeFormSubmissions:qo,setFormSubmission:Bt,setFormSubmissions:QS,addFormSubmission:ha,addFormSubmissions:zo,updateFormSubmission:Uo,updateFormSubmissions:xS,deleteFormSubmission:ma,deleteFormSubmissions:Co}=la.actions,pa=t=>t.formSubmissionReducer.instances,eT=d.createSelector([pa],t=>Object.values(t)),Aa=t=>e=>e.formSubmissionReducer.instances[t],Do=f(d.createSelector([pa,aa,(t,e)=>e],(t,e,i)=>{const a=new Set;for(const n of Object.values(e))n.form===i&&a.add(n.uuid);return Object.values(t).filter(n=>a.has(n.form_revision))})),Bo=la.reducer,Se=b(t=>t.uuid),$o=Se.getInitialState({}),ya=d.createSlice({name:"geoImages",initialState:$o,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,$o)),reducers:{initializeGeoImages:Se.initialize,setGeoImage:Se.setOne,setGeoImages:Se.setMany,addGeoImage:Se.addOne,addGeoImages:Se.addMany,updateGeoImage:Se.updateOne,updateGeoImages:Se.updateMany,deleteGeoImage:Se.deleteOne,deleteGeoImages:Se.deleteMany}}),{initializeGeoImages:ko,setGeoImage:pt,setGeoImages:Lo,addGeoImage:Go,addGeoImages:No,updateGeoImage:Ho,updateGeoImages:tT,deleteGeoImage:fa,deleteGeoImages:Wo}=ya.actions,Ko=t=>t.geoImageReducer.instances,Yo=d.createSelector([Ko],t=>Object.values(t)),Sa=t=>e=>e.geoImageReducer.instances[t],sT=f(d.createSelector([Yo,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),Zo=ya.reducer,Te=b(t=>t.uuid),Jo=Te.getInitialState({}),Ta=d.createSlice({name:"issueAssociations",initialState:Jo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Jo)),reducers:{initializeIssueAssociations:Te.initialize,addIssueAssociation:Te.addOne,addIssueAssociations:Te.addMany,setIssueAssociation:Te.setOne,setIssueAssociations:Te.setMany,updateIssueAssociation:Te.updateOne,updateIssueAssociations:Te.updateMany,deleteIssueAssociation:Te.deleteOne,deleteIssueAssociations:Te.deleteMany}}),{initializeIssueAssociations:Xo,setIssueAssociations:iT,setIssueAssociation:aT,updateIssueAssociation:Qo,updateIssueAssociations:nT,addIssueAssociation:Ia,addIssueAssociations:ga,deleteIssueAssociation:Fa,deleteIssueAssociations:Pa}=Ta.actions,At=t=>t.issueAssociationReducer.instances,cT=d.createSelector([At],t=>Object.values(t)),xo=t=>e=>e.issueAssociationReducer.instances[t],el=f(d.createSelector([At,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.associated_issue===e)))),tl=f(d.createSelector([At,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),sl=f(d.createSelector([At,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.asset===e)))),il=Ta.reducer,Ie=b(t=>t.uuid),al=Ie.getInitialState({}),ba=d.createSlice({name:"issueAttachments",initialState:al,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,al)),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:_a,addIssueAttachment:rT,addIssueAttachments:Oa,setIssueAttachment:nl,setIssueAttachments:dT,updateIssueAttachment:uT,updateIssueAttachments:cl,deleteIssueAttachment:rl,deleteIssueAttachments:Ra}=ba.actions,dl=t=>t.issueAttachmentReducer.instances,ul=d.createSelector([dl],t=>Object.values(t)),ol=f(d.createSelector([ul,(t,e)=>e],(t,e)=>T(t.filter(({issue:i})=>e===i)))),ll=t=>e=>e.issueAttachmentReducer.instances[t],hl=ba.reducer,ge=b(t=>t.uuid),ml=ge.getInitialState({}),va=d.createSlice({name:"issueCommentAttachments",initialState:ml,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,ml)),reducers:{initializeIssueCommentAttachments:ge.initialize,addIssueCommentAttachment:ge.addOne,addIssueCommentAttachments:ge.addMany,setIssueCommentAttachment:ge.setOne,setIssueCommentAttachments:ge.setMany,updateIssueCommentAttachment:ge.updateOne,updateIssueCommentAttachments:ge.updateMany,deleteIssueCommentAttachment:ge.deleteOne,deleteIssueCommentAttachments:ge.deleteMany}}),{initializeIssueCommentAttachments:wa,addIssueCommentAttachment:oT,addIssueCommentAttachments:pl,setIssueCommentAttachment:Al,setIssueCommentAttachments:lT,updateIssueCommentAttachment:hT,updateIssueCommentAttachments:yl,deleteIssueCommentAttachment:fl,deleteIssueCommentAttachments:Sl}=va.actions,Tl=t=>t.issueCommentAttachmentReducer.instances,Il=d.createSelector([Tl],t=>Object.values(t)),gl=t=>e=>e.issueCommentAttachmentReducer.instances[t],mT=f(d.createSelector([Il,(t,e)=>e],(t,e)=>T(t.filter(({issue_comment:i})=>e===i)))),Fl=va.reducer,Fe=b(t=>t.uuid),Pl=Fe.getInitialState({}),Ma=d.createSlice({name:"issueComments",initialState:Pl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Pl)),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:pT,addIssueComment:Va,addIssueComments:AT,setIssueComment:Ea,setIssueComments:bl,updateIssueComment:yT,updateIssueComments:fT,deleteIssueComment:ja,deleteIssueComments:ST}=Ma.actions,_l=t=>t.issueCommentReducer.instances,qa=t=>e=>e.issueCommentReducer.instances[t],TT=f(d.createSelector([_l,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),Ol=Ma.reducer,Pe=b(t=>t.uuid),Rl=Pe.getInitialState({}),za=d.createSlice({name:"issues",initialState:Rl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Rl)),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:vl,addIssue:Ua,addIssues:wl,setIssue:IT,setIssues:gT,updateIssue:$t,updateIssues:FT,deleteIssue:Ca,deleteIssues:Ml}=za.actions,Da=t=>t.issueReducer.instances,Ba=d.createSelector([Da],t=>Object.values(t)),$a=t=>e=>e.issueReducer.instances[t],PT=f(d.createSelector([Da,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectIssuesByIds: No issue exists with the id",a)}return T(i)})),bT=f(d.createSelector([Ba,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),Vl=f(d.createSelector([Ba,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e))),El=za.reducer,be=b(t=>t.uuid),jl=be.getInitialState({}),ka=d.createSlice({name:"issueTypeAttachments",initialState:jl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,jl)),reducers:{initializeIssueTypeAttachments:be.initialize,addIssueTypeAttachment:be.addOne,addIssueTypeAttachments:be.addMany,setIssueTypeAttachment:be.setOne,setIssueTypeAttachments:be.setMany,updateIssueTypeAttachment:be.updateOne,updateIssueTypeAttachments:be.updateMany,deleteIssueTypeAttachment:be.deleteOne,deleteIssueTypeAttachments:be.deleteMany}}),{initializeIssueTypeAttachments:La,addIssueTypeAttachment:_T,addIssueTypeAttachments:ql,setIssueTypeAttachment:zl,setIssueTypeAttachments:OT,updateIssueTypeAttachment:RT,updateIssueTypeAttachments:Ul,deleteIssueTypeAttachment:Cl,deleteIssueTypeAttachments:Dl}=ka.actions,Bl=t=>t.issueTypeAttachmentReducer.instances,$l=d.createSelector([Bl],t=>Object.values(t)),kl=t=>e=>e.issueTypeAttachmentReducer.instances[t],vT=f(d.createSelector([$l,(t,e)=>e],(t,e)=>T(t.filter(({issue_type:i})=>e===i)))),Ll=ka.reducer,_e=b(t=>t.uuid),Gl=_e.getInitialState({}),Ga=d.createSlice({name:"issueTypeFieldsAttachments",initialState:Gl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Gl)),reducers:{initializeIssueTypeFieldsAttachments:_e.initialize,addIssueTypeFieldsAttachment:_e.addOne,addIssueTypeFieldsAttachments:_e.addMany,setIssueTypeFieldsAttachment:_e.setOne,setIssueTypeFieldsAttachments:_e.setMany,updateIssueTypeFieldsAttachment:_e.updateOne,updateIssueTypeFieldsAttachments:_e.updateMany,deleteIssueTypeFieldsAttachment:_e.deleteOne,deleteIssueTypeFieldsAttachments:_e.deleteMany}}),{initializeIssueTypeFieldsAttachments:Nl,addIssueTypeFieldsAttachment:wT,addIssueTypeFieldsAttachments:Hl,setIssueTypeFieldsAttachment:MT,setIssueTypeFieldsAttachments:VT,updateIssueTypeFieldsAttachment:ET,updateIssueTypeFieldsAttachments:Wl,deleteIssueTypeFieldsAttachment:jT,deleteIssueTypeFieldsAttachments:Kl}=Ga.actions,Yl=t=>t.issueTypeFieldsAttachmentReducer.instances,Zl=d.createSelector([Yl],t=>Object.values(t)),qT=f(d.createSelector([Zl,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),zT=t=>e=>e.issueTypeFieldsAttachmentReducer.instances[t],Jl=Ga.reducer,Oe=b(t=>t.uuid),Xl=Oe.getInitialState({}),Na=d.createSlice({name:"issueTypeFieldValues",initialState:Xl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Xl)),reducers:{initializeIssueTypeFieldValues:Oe.initialize,addIssueTypeFieldValues:Oe.addOne,addIssueTypeFieldValuesMany:Oe.addMany,setIssueTypeFieldValues:Oe.setOne,setIssueTypeFieldValuesMany:Oe.setMany,updateIssueTypeFieldValues:Oe.updateOne,updateIssueTypeFieldValuesMany:Oe.updateMany,deleteIssueTypeFieldValues:Oe.deleteOne,deleteIssueTypeFieldValuesMany:Oe.deleteMany}}),{initializeIssueTypeFieldValues:Ql,addIssueTypeFieldValues:Ha,addIssueTypeFieldValuesMany:UT,setIssueTypeFieldValues:CT,setIssueTypeFieldValuesMany:DT,updateIssueTypeFieldValues:yt,updateIssueTypeFieldValuesMany:BT,deleteIssueTypeFieldValues:Wa,deleteIssueTypeFieldValuesMany:$T}=Na.actions,xl=t=>t.issueTypeFieldValuesReducer.instances,Ka=d.createSelector([xl],t=>Object.values(t)),kT=f(d.createSelector([Ka,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),Ya=t=>e=>e.issueTypeFieldValuesReducer.instances[t],eh=Na.reducer,Re=b(t=>t.uuid),th=Re.getInitialState({}),Za=d.createSlice({name:"issueTypeFields",initialState:th,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,th)),reducers:{initializeIssueTypeFields:Re.initialize,addIssueTypeFields:Re.addOne,addIssueTypeFieldsMany:Re.addMany,setIssueTypeFields:Re.setOne,setIssueTypeFieldsMany:Re.setMany,updateIssueTypeFields:Re.updateOne,updateIssueTypeFieldsMany:Re.updateMany,deleteIssueTypeFields:Re.deleteOne,deleteIssueTypeFieldsMany:Re.deleteMany}}),{initializeIssueTypeFields:sh,addIssueTypeFields:ih,addIssueTypeFieldsMany:LT,setIssueTypeFields:GT,setIssueTypeFieldsMany:NT,updateIssueTypeFields:ah,updateIssueTypeFieldsMany:HT,deleteIssueTypeFields:nh,deleteIssueTypeFieldsMany:WT}=Za.actions,ch=t=>t.issueTypeFieldsReducer.instances,kt=d.createSelector([ch],t=>Object.values(t)),KT=f(d.createSelector([kt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),YT=f(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])),ZT=f(d.createSelector([kt,Ka,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(n=>n.issue_type===i).map(n=>n.uuid));return T(e.filter(n=>a.has(n.fields_revision)))})),JT=t=>e=>e.issueTypeFieldsReducer.instances[t],rh=Za.reducer,ve=b(t=>t.uuid),dh=ve.getInitialState({}),Ja=d.createSlice({name:"issueTypeFieldValuesAttachments",initialState:dh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,dh)),reducers:{initializeIssueTypeFieldValuesAttachments:ve.initialize,addIssueTypeFieldValuesAttachment:ve.addOne,addIssueTypeFieldValuesAttachments:ve.addMany,setIssueTypeFieldValuesAttachment:ve.setOne,setIssueTypeFieldValuesAttachments:ve.setMany,updateIssueTypeFieldValuesAttachment:ve.updateOne,updateIssueTypeFieldValuesAttachments:ve.updateMany,deleteIssueTypeFieldValuesAttachment:ve.deleteOne,deleteIssueTypeFieldValuesAttachments:ve.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:uh,addIssueTypeFieldValuesAttachment:XT,addIssueTypeFieldValuesAttachments:Lt,setIssueTypeFieldValuesAttachment:QT,setIssueTypeFieldValuesAttachments:xT,updateIssueTypeFieldValuesAttachment:eI,updateIssueTypeFieldValuesAttachments:oh,deleteIssueTypeFieldValuesAttachment:tI,deleteIssueTypeFieldValuesAttachments:Gt}=Ja.actions,lh=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Xa=d.createSelector([lh],t=>Object.values(t)),sI=t=>e=>e.issueTypeFieldValuesAttachmentReducer.instances[t],hh=f(d.createSelector([Xa,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),mh=f(d.createSelector([Xa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),ph=Ja.reducer,we=b(t=>t.uuid),Ah=we.getInitialState({}),Qa=d.createSlice({name:"issueTypeIdentifiers",initialState:Ah,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Ah)),reducers:{initializeIssueTypeIdentifiers:we.initialize,addIssueTypeIdentifier:we.addOne,addIssueTypeIdentifiers:we.addMany,setIssueTypeIdentifier:we.setOne,setIssueTypeIdentifiers:we.setMany,updateIssueTypeIdentifier:we.updateOne,updateIssueTypeIdentifiers:we.updateMany,deleteIssueTypeIdentifier:we.deleteOne,deleteIssueTypeIdentifiers:we.deleteMany}}),{initializeIssueTypeIdentifiers:yh,addIssueTypeIdentifier:xa,addIssueTypeIdentifiers:iI,setIssueTypeIdentifier:aI,setIssueTypeIdentifiers:nI,updateIssueTypeIdentifier:ft,updateIssueTypeIdentifiers:cI,deleteIssueTypeIdentifier:en,deleteIssueTypeIdentifiers:rI}=Qa.actions,fh=t=>t.issueTypeIdentifierReducer.instances,Sh=d.createSelector([fh],t=>Object.values(t)),tn=t=>e=>e.issueTypeIdentifierReducer.instances[t],dI=f(d.createSelector([Sh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),Th=Qa.reducer,Me=b(t=>t.uuid),Ih=Me.getInitialState({}),sn=d.createSlice({name:"issueTypeIdentifierValues",initialState:Ih,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Ih)),reducers:{initializeIssueTypeIdentifierValues:Me.initialize,addIssueTypeIdentifierValue:Me.addOne,addIssueTypeIdentifierValues:Me.addMany,setIssueTypeIdentifierValue:Me.setOne,setIssueTypeIdentifierValues:Me.setMany,updateIssueTypeIdentifierValue:Me.updateOne,updateIssueTypeIdentifierValues:Me.updateMany,deleteIssueTypeIdentifierValue:Me.deleteOne,deleteIssueTypeIdentifierValues:Me.deleteMany}}),{initializeIssueTypeIdentifierValues:gh,addIssueTypeIdentifierValue:an,addIssueTypeIdentifierValues:uI,setIssueTypeIdentifierValue:oI,setIssueTypeIdentifierValues:lI,updateIssueTypeIdentifierValue:St,updateIssueTypeIdentifierValues:hI,deleteIssueTypeIdentifierValue:nn,deleteIssueTypeIdentifierValues:mI}=sn.actions,Fh=t=>t.issueTypeIdentifierValueReducer.instances,cn=d.createSelector([Fh],t=>Object.values(t)),rn=t=>e=>e.issueTypeIdentifierValueReducer.instances[t],pI=f(d.createSelector([cn,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),AI=f(d.createSelector([cn,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type_identifier===e)))),Ph=sn.reducer,C=b(t=>t.uuid),bh=C.getInitialState({}),dn=d.createSlice({name:"issueTypes",initialState:bh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,bh)),reducers:{initializeIssueTypes:C.initialize,addIssueType:C.addOne,addIssueTypes:C.addMany,setIssueType:C.setOne,setIssueTypes:C.setMany,updateIssueType:C.updateOne,updateIssueTypes:C.updateMany,deleteIssueType:C.deleteOne,deleteIssueTypes:C.deleteMany,removeIssueType:C.deleteOne}}),{initializeIssueTypes:_h,addIssueType:Oh,addIssueTypes:yI,setIssueType:Tt,setIssueTypes:fI,updateIssueType:Rh,updateIssueTypes:SI,deleteIssueType:TI,deleteIssueTypes:II,removeIssueType:un}=dn.actions,on=t=>t.issueTypeReducer.instances,vh=d.createSelector(on,t=>Object.values(t)),ln=t=>e=>e.issueTypeReducer.instances[t],gI=f(d.createSelector([on,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectIssueTypesByIds: No issue type exists with the id",a)}return i})),FI=f(d.createSelector([vh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),wh=dn.reducer,Ve=b(t=>t.uuid),Mh=Ve.getInitialState({}),hn=d.createSlice({name:"issueUpdates",initialState:Mh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Mh)),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:Vh,addIssueUpdate:Eh,addIssueUpdates:jh,setIssueUpdate:PI,setIssueUpdates:bI,updateIssueUpdate:_I,updateIssueUpdates:OI,deleteIssueUpdate:qh,deleteIssueUpdates:zh}=hn.actions,Uh=t=>t.issueUpdateReducer.instances,Ch=d.createSelector([Uh],t=>Object.values(t)),Dh=f(d.createSelector([Ch,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),Bh=hn.reducer,Ee=b(({uuid:t})=>t),$h=Ee.getInitialState({currentUser:null}),mn=d.createSlice({name:"users",initialState:$h,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,$h)),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,e)=>{t.currentUser=e.payload}}}),{initializeUsers:kh,setUsers:RI,setUser:vI,addUsers:wI,addUser:Lh,updateUsers:MI,updateUser:VI,deleteUser:Gh,deleteUsers:EI,setCurrentUser:jI}=mn.actions,Nh=mn.reducer,Hh=t=>t.userReducer.currentUser,Nt=t=>t.userReducer.instances,pn=d.createSelector([Nt],t=>Object.values(t)),Wh=t=>e=>e.userReducer.instances[t],qI=f(d.createSelector([Nt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectUsersByIds: No user exists with the id",a)}return T(i)})),je=b(t=>t.uuid),Kh=je.getInitialState({}),An=d.createSlice({name:"organizationAccess",initialState:Kh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,Kh)),reducers:{initializeOrganizationAccesses:je.initialize,addOrganizationAccess:je.addOne,addOrganizationAccesses:je.addMany,setOrganizationAccess:je.setOne,setOrganizationAccesses:je.setMany,updateOrganizationAccess:je.updateOne,updateOrganizationAccesses:je.updateMany,deleteOrganizationAccess:je.deleteOne,deleteOrganizationAccesses:je.deleteMany}}),{initializeOrganizationAccesses:Yh,addOrganizationAccess:Zh,addOrganizationAccesses:zI,setOrganizationAccess:UI,setOrganizationAccesses:CI,updateOrganizationAccess:Ht,updateOrganizationAccesses:DI,deleteOrganizationAccess:Jh,deleteOrganizationAccesses:BI}=An.actions,Xh=An.reducer,yn=t=>t.organizationAccessReducer.instances,fn=t=>e=>e.organizationAccessReducer.instances[t],$I=d.createSelector([Hh,yn],(t,e)=>Object.values(e).find(a=>a.user===(t==null?void 0:t.uuid))??null),Qh=d.createSelector([yn],t=>{const e={};for(const i of Object.values(t))e[i.user]=i;return Ft(e)}),kI=f(d.createSelector([Nt,Qh,(t,e)=>e],(t,e,i)=>T(Object.values(t).filter(a=>{const n=e[a.uuid];return!!n&&n.organization===i})))),qe=b(t=>t.uuid),xh=qe.getInitialState({}),Sn=d.createSlice({name:"organizations",initialState:xh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,xh)),reducers:{initializeOrganizations:qe.initialize,setOrganizations:qe.setMany,setOrganization:qe.setOne,addOrganizations:qe.addMany,addOrganization:qe.addOne,updateOrganizations:qe.updateMany,updateOrganization:qe.updateOne,deleteOrganization:qe.deleteOne,deleteOrganizations:qe.deleteMany}}),{initializeOrganizations:em,setOrganizations:LI,setOrganization:GI,addOrganizations:NI,addOrganization:tm,updateOrganizations:HI,updateOrganization:sm,deleteOrganization:WI,deleteOrganizations:KI}=Sn.actions,im=t=>t.organizationReducer.instances,YI=d.createSelector([im],t=>Object.values(t)),ZI=t=>e=>e.organizationReducer.instances[t],am=Sn.reducer,nm=(t,e,i)=>{const a=t.uuid?t:{...t,uuid:Ke.v4()};return{payload:a,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:a,BASE_URL:e,serviceName:i}}}}},cm={deletedRequests:[],latestRetryTime:0},Tn=d.createSlice({name:"outbox",initialState:cm,extraReducers:t=>t.addCase(F,e=>Object.assign(e,cm)),reducers:{enqueueRequest:{reducer:(t,e)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t);const{BASE_URL:e,serviceName:i,...a}=t;return nm(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}}}),JI=t=>t.outboxReducer.deletedRequests,XI=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:rm,markForDeletion:QI,markAsDeleted:dm,_setLatestRetryTime:um}=Tn.actions,om=Tn.reducer,ze=b(t=>t.uuid),lm=ze.getInitialState({}),In=d.createSlice({name:"projectAccess",initialState:lm,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,lm)),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:hm,addProjectAccess:gn,addProjectAccesses:Fn,setProjectAccess:xI,setProjectAccesses:eg,updateProjectAccess:It,updateProjectAccesses:mm,deleteProjectAccess:Pn,deleteProjectAccesses:bn}=In.actions,pm=In.reducer,_n=t=>t.projectAccessReducer.instances,Wt=d.createSelector(_n,t=>Object.values(t)),On=t=>e=>e.projectAccessReducer.instances[t],Am=f(d.createSelector([_n,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.project===e)))),tg=f(d.createSelector([Wt,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(n=>n.project===e))i[a.user]=a;return i})),sg=f(d.createSelector([pn,Wt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(n=>n.project===i).map(n=>n.user));return T(t.filter(n=>a.has(n.uuid)))})),Ue=b(t=>t.uuid),ym=Ue.getInitialState({}),Rn=d.createSlice({name:"projectAttachments",initialState:ym,extraReducers:t=>t.addMatcher(d.isAnyOf(F,_),e=>Object.assign(e,ym)),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:vn,addProjectAttachment:ig,addProjectAttachments:fm,setProjectAttachment:Sm,setProjectAttachments:Tm,updateProjectAttachment:ag,updateProjectAttachments:Im,deleteProjectAttachment:gm,deleteProjectAttachments:wn}=Rn.actions,Fm=t=>t.projectAttachmentReducer.instances,Pm=d.createSelector([Fm],t=>Object.values(t)),bm=t=>e=>e.projectAttachmentReducer.instances[t],_m=f(d.createSelector([Pm,(t,e)=>e],(t,e)=>T(t.filter(({project:i})=>e===i)))),Om=Rn.reducer,Ce=b(t=>t.uuid),Rm=Ce.getInitialState({activeProjectFileId:null,isImportingProjectFile:!1}),Mn=d.createSlice({name:"projectFiles",initialState:Rm,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,_),e=>Object.assign(e,Rm)),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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`)
|
|
7
|
-
`):`${n}: ${JSON.stringify(c)}`).join(`
|
|
8
|
-
`)}catch(n){console.error("Failed to extract error message from response body",n)}}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>Kg?Je:i}class z extends Error{constructor(i){super(Je);S(this,"status");S(this,"response");S(this,"message");S(this,"options");const{response:a,innerError:n}=i;this.message=i.message??Yg(a,n)??Je,this.status=(a==null?void 0:a.status)??0,this.response=a,i.discard=i.discard??!1,this.options=i}}function Fp(t){function e(i){return typeof i=="object"&&i!==null&&["ok","redirect","clientError","serverError","error"].every(n=>n 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}}class Zg extends hp{constructor(e){super(e)}}class R extends hp{constructor(i,a){super(i);S(this,"auth");this.auth=a}}class Jg extends R{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(Sc(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(n=>{this.dispatch(Ic(n))})}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(Tc(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.performRequest({method:l.GET,url:"/agents/conversations/",queryParams:{project:e}},i);return this.dispatch(fc(a)),a}}class E extends R{getNumberOfAttachmentsWithSha1(e){const{issueAttachmentReducer:i,assetAttachmentReducer:a,assetTypeAttachmentReducer:n,documentAttachmentReducer:c,projectAttachmentReducer:r,formRevisionAttachmentReducer:u,formSubmissionAttachmentReducer:m,geoImageReducer:o,assetTypeFieldsAttachmentReducer:h,assetTypeFieldValuesAttachmentReducer:p,issueTypeFieldsAttachmentReducer:A,issueTypeFieldValuesAttachmentReducer:y}=this.client.store.getState();return[].concat(Object.values(i.instances),Object.values(a.instances),Object.values(n.instances),Object.values(c.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(A.instances),Object.values(y.instances)).filter(g=>g.file_sha1===e).length}processPresignedUrls(e){const i={};for(const[a,n]of Object.entries(e))i[a]=this.enqueueRequest({url:n.url,description:"Upload file to S3",method:l.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${n.fields.key}`],blocks:[a],s3url:n});return i}async getFilePayload(e){const i=await Ye(e),a={sha1:i,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,i),a}}class ke extends E{constructor(){super(...arguments);S(this,"pageSize",op)}async _bulkAdd(i){var h;const{store:a}=this.client,n=(h=a.getState().userReducer.currentUser)==null?void 0:h.uuid,c=new Date().toISOString(),r=[],u=[],m={};for(const p of i){const{modelUuid:A,file:y}=p,I=await this.getFilePayload(y);I.sha1 in m||(m[I.sha1]=I);const g=this.buildModel({file:y,file_sha1:I.sha1,submitted_at:c,created_by:n,modelUuid:A});r.push(g),u.push(this.buildPayload(g,I))}this.dispatch(this.addAttachments(r));const o=this.enqueueRequest({description:`Add ${this.name}`,method:l.POST,url:`${this.url}/bulk/`,payload:{submitted_at:c,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:A})=>{this.dispatch(this.updateAttachments(p)),this.processPresignedUrls(A)}).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,n=this.selectAttachment(i)(a.getState());if(!n)throw new Error(`Attempting to delete attachment with uuid ${i} that does not exist in the store`);this.dispatch(this.removeAttachment(this.getId(n)));const c=this.enqueueRequest({description:`Delete ${this.name}`,method:l.DELETE,url:`${this.url}/${i}/`,blockers:[i],blocks:[]});return c.then(()=>{this.getNumberOfAttachmentsWithSha1(n.file_sha1)===0&&this.client.files.removeCache(n.file_sha1)}).catch(()=>{this.dispatch(this.setAttachment(n))}),c}}class Xg extends ke{constructor(){super(...arguments);S(this,"name","Asset Attachment");S(this,"url","/asset-attachments");S(this,"initializeAttachments",ns);S(this,"addAttachments",cs);S(this,"updateAttachments",bc);S(this,"removeAttachments",rs);S(this,"removeAttachment",_c);S(this,"setAttachment",Pc);S(this,"selectAttachment",vc)}getId(i){return i.uuid}buildModel(i){return P({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 c=(await this.performPagination({method:l.GET,url:`${this.url}/`,queryParams:{asset__project:i}},a)).flat();return this.dispatch(ns(c)),c}}class Qg extends ke{constructor(){super(...arguments);S(this,"name","Asset Procedure Attachment");S(this,"url","/asset-procedure-type-attachments");S(this,"initializeAttachments",us);S(this,"addAttachments",Ec);S(this,"updateAttachments",qc);S(this,"removeAttachments",Uc);S(this,"removeAttachment",zc);S(this,"setAttachment",jc);S(this,"selectAttachment",$c)}getId(i){return i.uuid}buildModel(i){return P({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 n=await this.performRequest({method:l.GET,url:`${this.url}/`,queryParams:{asset_procedure_type__organization:i}},a);return this.dispatch(us(n)),n}}class xg extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,y=await this.getFilePayload(A);y.sha1 in n||(n[y.sha1]=y);const I=P({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:y.extension,file_sha1:y.sha1,fields_revision:h};r.push(g)}this.dispatch(Gc(c));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(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Nc(o.attachments))}).catch(()=>{this.dispatch(Hc(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-procedure-type-fields-attachments/",queryParams:{fields_revision__asset_procedure_type__organization:e}},i);return this.dispatch(Lc(a)),a}}class eF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Xc(c));const r=this.enqueueRequest({description:"Add Asset Procedure Type Fields",method:l.POST,url:"/asset-procedure-type-fields/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Qc(m))}).catch(m=>{throw this.dispatch(xc(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-procedure-type-fields/",queryParams:{asset_procedure_type__organization:e}},i);return this.dispatch(Jc(a)),a}}function Ne(t,e){const i=[];let a=0;const n=t.length;for(;a<n;)i.push(t.slice(a,a+=e));return i}class tF extends E{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.uuid,c=Ne(e,i??e.length),r=[],u=[];for(const h of c){const p={},A=[];for(const y of h){const{fieldValuesUuid:I,fieldIdentifier:g,file:O}=y,w=await this.getFilePayload(O);w.sha1 in p||(p[w.sha1]=w);const j=P({file:URL.createObjectURL(O),file_type:O.type,file_name:O.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:g});r.push(j);const xe={uuid:j.uuid,file_name:O.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:g,field_values:I};A.push(xe)}u.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(Pt(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 A of h)this.processPresignedUrls(A.presigned_urls);const p=h.flatMap(A=>A.attachments);this.dispatch(ar(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(),n=rr(e)(a);this.dispatch(bt(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(c){throw this.dispatch(Pt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/asset-procedure-type-field-values-attachments/",queryParams:{field_values__asset_procedure__project:e,latest:!0}},i)).flat();return this.dispatch(ir(n)),n}}class sF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=P({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset procedure type field values",method:l.POST,url:"/asset-procedure-type-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[n.uuid]});return this.dispatch(ys(n)),c.then(u=>(this.dispatch(tt(u)),u)).catch(()=>{this.dispatch(fs(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ne(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const A=P({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,submitted_at:a});n.push(A),h.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure:p.asset_procedure,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(lr(n));const u=[];for(const o of r){const h=o.field_values.map(g=>g.asset),p=o.field_values.map(g=>g.fields_revision),A=o.field_values.map(g=>g.asset_procedure),y=o.field_values.map(g=>g.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,...A],blocks:y});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(hr(o.flat()))}).catch(()=>{this.dispatch(mr(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=Ts(e.uuid)(a);if(!n)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(tt(c));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:[c.fields_revision,c.asset,c.asset_procedure],blocks:[c.uuid]});return r.then(u=>{this.dispatch(tt(u))}).catch(()=>{this.dispatch(tt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ts(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=dr(e)(a);this.dispatch(fs(e)),this.dispatch(bt(c.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(ys(n)),this.dispatch(Pt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/asset-procedure-type-field-values/",queryParams:{asset_procedure__project:e,latest:!0}},i)).flat();return this.dispatch(or(n)),n}}class iF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(gs(c));const r=this.enqueueRequest({description:"Create asset procedure",method:l.POST,url:"/asset-procedures/",payload:v(c),blockers:[e.asset_procedure_type,e.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(st(m))}).catch(()=>{this.dispatch(Fs(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=_s(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(st(n));const c=this.enqueueRequest({description:"Update asset procedure",method:l.PATCH,url:`/asset-procedures/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(st(r))}).catch(()=>{this.dispatch(st(a))}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=_s(e)(a);if(!n)throw new Error(`Expected asset procedure with uuid ${e} to exist`);return this.dispatch(Fs(e)),this.enqueueRequest({description:"Delete asset procedure",method:l.DELETE,url:`/asset-procedures/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(gs(n)),c})}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/asset-procedures/",queryParams:{project:e}},i)).flat();return this.dispatch(fr(n)),n}}class aF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Rs(c));const r=this.enqueueRequest({description:"Create asset procedure type",method:l.POST,url:"/asset-procedure-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return r.then(m=>{this.dispatch(it(m))}).catch(()=>{this.dispatch(vs(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Ms(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(it(n));const c=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 c.then(r=>{this.dispatch(it(r))}).catch(()=>{this.dispatch(it(a))}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Ms(e)(a);if(!n)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const c=gr(e)(a);return this.dispatch(vs(e)),this.dispatch(Tr(c.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(Rs(n)),this.dispatch(Sr(c)),r})}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-procedure-types/",queryParams:{organization:e}},i);return this.dispatch(Pr(a)),a}}class nF extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,y=await this.getFilePayload(A);y.sha1 in n||(n[y.sha1]=y);const I=P({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:y.extension,file_sha1:y.sha1,fields_revision:h};r.push(g)}this.dispatch(vr(c));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(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(wr(o.attachments))}).catch(()=>{this.dispatch(Mr(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-procedure-step-fields-attachments/",queryParams:{fields_revision__asset_procedure_step__organization:e}},i);return this.dispatch(Rr(a)),a}}class cF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(js(c));const r=this.enqueueRequest({description:"Add Asset Procedure Step Fields",method:l.POST,url:"/asset-procedure-step-fields/",payload:v(c),blockers:[c.asset_procedure_step],blocks:[c.uuid]});return r.then(m=>{this.dispatch(at(m))}).catch(m=>{throw this.dispatch(qs(c.uuid)),m}),[c,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 n={...a,...e};this.dispatch(at(n));const c=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 c.then(r=>{this.dispatch(at(r))}).catch(r=>{throw this.dispatch(at(a)),r}),[n,c]}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(qs(e));const n=this.enqueueRequest({description:"Delete Asset Procedure Step Fields",method:l.DELETE,url:`/asset-procedure-step-fields/${e}/`,blockers:[e],blocks:[e]});return n.catch(c=>{throw this.dispatch(js(a)),c}),n}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-procedure-step-fields/",queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},i);return this.dispatch(zr(a)),a}}class rF extends E{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.uuid,c=Ne(e,i??e.length),r=[],u=[];for(const h of c){const p={},A=[];for(const y of h){const{fieldValuesUuid:I,fieldIdentifier:g,file:O}=y,w=await this.getFilePayload(O);w.sha1 in p||(p[w.sha1]=w);const j=P({file:URL.createObjectURL(O),file_type:O.type,file_name:O.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:g});r.push(j);const xe={uuid:j.uuid,file_name:O.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:g,field_values:I};A.push(xe)}u.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(_t(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 A of h)this.processPresignedUrls(A.presigned_urls);const p=h.flatMap(A=>A.attachments);this.dispatch(Br(p))}).catch(h=>{throw this.dispatch(Ot(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(),n=kr(e)(a);this.dispatch(Ot(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(c){throw this.dispatch(_t(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/asset-procedure-step-field-values-attachments/",queryParams:{field_values__asset_procedure__project:e,latest:!0}},i)).flat();return this.dispatch(Dr(n)),n}}class dF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=P({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset procedure step field values",method:l.POST,url:"/asset-procedure-step-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[n.uuid]});return this.dispatch($s(n)),c.then(u=>(this.dispatch(nt(u)),u)).catch(()=>{this.dispatch(ks(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ne(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const A=P({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,submitted_at:a});n.push(A),h.push({uuid:A.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:A.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(Wr(n));const u=[];for(const o of r){const h=o.field_values.map(g=>g.asset),p=o.field_values.map(g=>g.fields_revision),A=o.field_values.map(g=>g.asset_procedure),y=o.field_values.map(g=>g.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,...A],blocks:y});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(Kr(o.flat()))}).catch(()=>{this.dispatch(Yr(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=Ls(e.uuid)(a);if(!n)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(nt(c));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:[c.fields_revision,c.asset,c.asset_procedure],blocks:[c.uuid]});return r.then(u=>{this.dispatch(nt(u))}).catch(()=>{this.dispatch(nt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ls(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Lr(e)(a);this.dispatch(ks(e)),this.dispatch(Ot(c.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($s(n)),this.dispatch(_t(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/asset-procedure-step-field-values/",queryParams:{asset_procedure__project:e,latest:!0}},i)).flat();return this.dispatch(Hr(n)),n}}class uF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(ed(c));const r=this.enqueueRequest({description:"Create asset procedure step",method:l.POST,url:"/asset-procedure-steps/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(vt(m))}).catch(()=>{this.dispatch(sd(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Ns(e.uuid)(i.getState());if(!a)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(vt(n));const c=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 c.then(r=>{this.dispatch(vt(r))}).catch(()=>{this.dispatch(xr(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ns(e)(a);if(!n)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const c=cd(e)(a);return this.dispatch(id([e,...hc(c)])),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-procedure-steps/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(td([n,...c])),r})}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-procedure-steps/",queryParams:{asset_procedure_type__organization:e}},i);return this.dispatch(Qr(a)),a}}class oF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Ws(c));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/assets/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(rt(m))}).catch(()=>{this.dispatch(Ks(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Xs(e.uuid)(i.getState());if(!a)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(rt(n));const c=this.enqueueRequest({description:"Edit asset",method:l.PATCH,url:`/assets/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(rt(r))}).catch(()=>{this.dispatch(rt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Xs(e)(a);if(!n)throw new Error(`No asset with uuid ${e} found in the store`);const c=wc(e)(a),r=sl(e)(a);if(this.dispatch(Ks(e)),c.length>0){const u=c.map(({uuid:m})=>m);this.dispatch(rs(u))}if(r.length>0){const u=r.map(({uuid:m})=>m);this.dispatch(Pa(u))}return this.enqueueRequest({description:"Delete asset",method:l.DELETE,url:`/assets/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(Ws(n)),this.dispatch(cs(c)),this.dispatch(ga(r)),u})}bulkAdd(e,i,a,n){const c=new Date().toISOString(),r=Ke.v4(),u=Ne(e,n).map(h=>{const p=h.map(A=>P(A));return{batchId:Ke.v4(),payload:{transaction_id:r,submitted_at:c,asset_type:i,project:a,assets:p}}}),m=[];let o=null;for(const h of u){const{batchId:p,payload:A}=h,y=A.assets.map(w=>w.uuid),I=[i];o&&I.push(o);const g=y;g.push(p);const O=this.enqueueRequest({description:"Batch create assets",method:l.POST,url:"/assets/bulk/",payload:A,blockers:I,blocks:g});o=h.batchId,m.push(O)}return Promise.all(m).then(h=>{const p=h.flat();this.dispatch(wt(p))}),m}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=od(e)(a);this.dispatch(Ys(e));try{await this.enqueueRequest({description:"Bulk delete assets",method:l.DELETE,url:"/assets/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(wt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/assets/",queryParams:{project:e}},i)).flat();return this.dispatch(dd(n)),n}}class lF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(xs(c));const r=this.enqueueRequest({description:"Add asset stage completion",method:l.POST,url:"/asset-stage-completions/",payload:v(c),blockers:[e.asset,e.asset_stage],blocks:[c.uuid]});return r.then(m=>{this.dispatch(pd(m))}).catch(()=>{this.dispatch(ti(c.uuid))}),[c,r]}delete(e){const{store:i}=this.client,a=fd(e)(i.getState());if(!a)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(ti(e));const n=this.enqueueRequest({description:"Delete asset stage completion",method:l.DELETE,url:`/asset-stage-completions/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(xs(a))}),n}bulkAdd(e){var o;const{store:i}=this.client,a=new Date().toISOString(),n=(o=i.getState().userReducer.currentUser)==null?void 0:o.uuid,c=e.map(h=>P(h)),r=c.map(h=>({...h,created_by:n,submitted_at:a})),u=r.map(({uuid:h})=>h);this.dispatch(ei(r));const m=this.enqueueRequest({description:"Bulk create asset stage completions",method:l.POST,url:"/asset-stage-completions/bulk/",payload:{submitted_at:a,completions:c},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(Ad(h))}).catch(()=>{this.dispatch(si(u))}),[r,m]}bulkDelete(e){const{store:i}=this.client,a=Sd(e)(i.getState());this.dispatch(si(e));const n=this.enqueueRequest({description:"Deleting asset stage completions",method:l.DELETE,url:"/asset-stage-completions/bulk/",payload:{uuids:e},blockers:e,blocks:[]});return n.catch(()=>{this.dispatch(ei(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/asset-stage-completions/",queryParams:{asset_procedure__project:e}},i)).flat();return this.dispatch(md(n)),n}}class hF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(ni(c));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/asset-stages/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Mt(m))}).catch(()=>{this.dispatch(ci(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=ri(e.uuid)(i.getState());if(!a)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(Mt(n));const c=this.enqueueRequest({description:"Update asset stage",method:l.PATCH,url:`/asset-stages/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(Mt(r))}).catch(()=>{this.dispatch(gd(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=ri(e)(a);if(!n)throw new Error(`No asset stage with uuid ${e} found in the store`);return this.dispatch(ci(e)),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(ni(n)),c})}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-stages/",queryParams:{asset_procedure_type__organization:e}},i);return this.dispatch(Id(a)),a}}class mF extends ke{constructor(){super(...arguments);S(this,"name","Asset Type Attachment");S(this,"url","/asset-type-attachments");S(this,"initializeAttachments",ui);S(this,"addAttachments",oi);S(this,"updateAttachments",Od);S(this,"removeAttachments",li);S(this,"removeAttachment",Rd);S(this,"setAttachment",_d);S(this,"selectAttachment",Md)}getId(i){return i.uuid}buildModel(i){return P({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 n=await this.performRequest({method:l.GET,url:`${this.url}/`,queryParams:{asset_type__organization:i}},a);return this.dispatch(ui(n)),n}}class pF extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,y=await this.getFilePayload(A);y.sha1 in n||(n[y.sha1]=y);const I=P({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:y.extension,file_sha1:y.sha1,fields_revision:h};r.push(g)}this.dispatch(zd(c));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(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Ud(o.attachments))}).catch(()=>{this.dispatch(Cd(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-type-fields-attachments/",queryParams:{fields_revision__asset_type__organization:e}},i);return this.dispatch(qd(a)),a}}class AF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Gd(c));const r=this.enqueueRequest({description:"Add Asset Type Fields",method:l.POST,url:"/asset-type-fields/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Nd(m))}).catch(m=>{throw this.dispatch(Hd(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-type-fields/",queryParams:{asset_type__organization:e}},i);return this.dispatch(Ld(a)),a}}class yF extends E{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.uuid,c=Ne(e,i??e.length),r=[],u=[];for(const h of c){const p={},A=[];for(const y of h){const{fieldValuesUuid:I,fieldIdentifier:g,file:O}=y,w=await this.getFilePayload(O);w.sha1 in p||(p[w.sha1]=w);const j=P({file:URL.createObjectURL(O),file_type:O.type,file_name:O.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:g});r.push(j);const xe={uuid:j.uuid,file_name:O.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:g,field_values:I};A.push(xe)}u.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(jt(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 A of h)this.processPresignedUrls(A.presigned_urls);const p=h.flatMap(A=>A.attachments);this.dispatch(Jd(p))}).catch(h=>{throw this.dispatch(qt(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(),n=Qd(e)(a);this.dispatch(qt(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(c){throw this.dispatch(jt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/asset-type-field-values-attachments/",queryParams:{field_values__asset__project:e,latest:!0}},i)).flat();return this.dispatch(Zd(n)),n}}class fF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=P({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset type field values",method:l.POST,url:"/asset-type-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision],blocks:[n.uuid]});return this.dispatch(fi(n)),c.then(u=>(this.dispatch(dt(u)),u)).catch(()=>{this.dispatch(Si(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ne(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const A=P({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,submitted_at:a});n.push(A),h.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(iu(n));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),A=o.field_values.map(I=>I.uuid),y=this.enqueueRequest({description:"Bulk add asset type field values",method:l.POST,url:"/asset-type-field-values/bulk/",payload:o,blockers:[...h,...p],blocks:A});u.push(y)}return Promise.all(u).then(o=>{this.dispatch(au(o.flat()))}).catch(()=>{this.dispatch(nu(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=Ii(e.uuid)(a);if(!n)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(dt(c));const r=this.enqueueRequest({description:"Delete asset type field values",method:l.PATCH,url:`/asset-type-field-values/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.asset],blocks:[c.uuid]});return r.then(u=>{this.dispatch(dt(u))}).catch(()=>{this.dispatch(dt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ii(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=xd(e)(a);this.dispatch(Si(e)),this.dispatch(qt(c.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(fi(n)),this.dispatch(jt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/asset-type-field-values/",queryParams:{asset__project:e,latest:!0}},i)).flat();return this.dispatch(su(n)),n}}class SF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Fi(c));const r=this.enqueueRequest({description:"Create asset type identifier",method:l.POST,url:"/asset-type-identifiers/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ut(m))}).catch(()=>{this.dispatch(Pi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=bi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ut(n));const c=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 c.then(r=>{this.dispatch(ut(r))}).catch(()=>{this.dispatch(ut(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=bi(e)(a);if(!n)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(Pi(e));try{return await this.enqueueRequest({description:"Delete asset type identifier",method:l.DELETE,url:`/asset-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Fi(n)),c}}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-type-identifiers/",queryParams:{asset_type__organization:e}},i);return this.dispatch(uu(a)),a}}class TF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Oi(c));const r=this.enqueueRequest({description:"Create asset type identifier value",method:l.POST,url:"/asset-type-identifier-values/",payload:v(c),blockers:[e.asset,e.asset_type_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ot(m))}).catch(()=>{this.dispatch(Ri(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=wi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ot(n));const c=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 c.then(r=>{this.dispatch(ot(r))}).catch(()=>{this.dispatch(ot(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=wi(e)(a);if(!n)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(Ri(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(c){throw this.dispatch(Oi(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/asset-type-identifier-values/",queryParams:{asset__project:e}},i)).flat();return this.dispatch(pu(n)),n}}class IF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Vi(c));const r=this.enqueueRequest({description:"Create asset type",method:l.POST,url:"/asset-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return r.then(m=>{this.dispatch(lt(m))}).catch(()=>{this.dispatch(Ei(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=qi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(lt(n));const c=this.enqueueRequest({description:"Update asset type",method:l.PATCH,url:`/asset-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(lt(r))}).catch(()=>{this.dispatch(lt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=qi(e)(a);if(!n)throw new Error(`Expected asset type with uuid ${e} to exist`);const c=Js(e)(a),r=Vd(e)(a);return this.dispatch(Ei(e)),this.dispatch(Ys(c.map(u=>u.uuid))),this.dispatch(li(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(Vi(n)),this.dispatch(wt(c)),this.dispatch(oi(r)),u})}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/asset-types/",queryParams:{organization:e}},i);return this.dispatch(Su(a)),a}}class gF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Ui(c));const r=this.enqueueRequest({description:"Create Category",method:l.POST,url:"/categories/",payload:v(c),blockers:[e.project],blocks:[c.uuid]});return[c,r]}update(e){const i=this.client.store.getState(),a=Di(e.uuid)(i);if(!a)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const n={...a,...e};this.dispatch(Ou(n));const c=this.enqueueRequest({description:"Edit Category",method:l.PATCH,url:`/categories/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return[n,c]}remove(e){const{store:i}=this.client,a=Di(e)(i.getState());if(!a)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(Ru(e));const n=this.enqueueRequest({description:"Delete Category",method:l.DELETE,url:`/categories/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return n.catch(()=>{this.dispatch(Ui(a))}),n}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/categories/",queryParams:{project__organization:e}},i);return this.dispatch(_u(a)),a}}class FF extends ke{constructor(){super(...arguments);S(this,"name","Document Attachment");S(this,"url","/document-attachments");S(this,"initializeAttachments",$i);S(this,"addAttachments",Vu);S(this,"updateAttachments",ju);S(this,"removeAttachments",zu);S(this,"removeAttachment",qu);S(this,"setAttachment",Eu);S(this,"selectAttachment",Du)}getId(i){return i.uuid}buildModel(i){return P({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,n=(p=a.getState().userReducer.currentUser)==null?void 0:p.uuid,c=new Date().toISOString(),r=[],u=[],m={},o={};for(const A of i){const{documentUuid:y,file:I}=A,g=await this.getFilePayload(I);g.sha1 in m||(m[g.sha1]=g,o[g.sha1]=[]);const O=this.buildModel({file:I,file_sha1:g.sha1,submitted_at:c,created_by:n,modelUuid:y});r.push(O),u.push(this.buildPayload(O,g)),o[g.sha1].push(O.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:c,attachments:u,files:Object.values(m)},blocks:r.map(A=>A.uuid),blockers:r.map(A=>A.file_sha1)});return h.then(({attachments:A,presigned_urls:y})=>{this.dispatch(this.updateAttachments(A));const I=this.processPresignedUrls(y);for(const[g,O]of Object.entries(I))O.then(()=>{const w=o[g];for(const j of w)this.makeReadable(j)})}).catch(()=>{this.dispatch(this.removeAttachments(r.map(A=>A.uuid)))}),[r,h.then(({attachments:A})=>A)]}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 n=await this.performRequest({method:l.GET,url:"/document-attachments/",queryParams:{document__project__organization:i}},a),c=await this.performRequest({method:l.GET,url:"/document-attachments/",queryParams:{document__organization:i}},a),r=[...n,...c];return this.dispatch($i(r)),r}}class PF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Lu([c]));const r=this.enqueueRequest({description:"Create Document",method:l.POST,url:"/documents/",payload:v(c),queryParams:{parent_document:c.parent_document??void 0},blockers:c.parent_document?[c.parent_document]:[],blocks:[c.uuid]});return r.catch(()=>{this.dispatch(Li([c.uuid]))}),[c,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 n={...a,...e};this.dispatch(Ze([n]));const c=this.enqueueRequest({description:"Update Document",method:l.PATCH,url:`/documents/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.catch(()=>{Ze([a])}),[n,c]}delete(e){const{store:i}=this.client,a=Ut(i.getState()),n=Gu(e)(i.getState());if(!n)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const c=n.parent_document?a[n.parent_document]:void 0;this.dispatch(Li([e]));const r=this.enqueueRequest({description:"Delete Document",method:l.DELETE,url:`/documents/${e}/`,blockers:[e],blocks:[]});return r.then(u=>{this.dispatch(Ze(u))}).catch(()=>{this.dispatch(Ze([n])),c&&this.dispatch(Ze([c]))}),r}async refreshStore(e,i){const a=this.performRequest({method:l.GET,url:"/documents/",queryParams:{project__organization:e}},i),n=this.performRequest({method:l.GET,url:"/documents/",queryParams:{organization:e}},i),c=[...await a,...await n];return this.dispatch(ku(c)),c}}class bF extends R{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 Kt={},Kn=new Set;let Yt=0,Yn=0,Zn=0;const _F=20;class OF extends R{constructor(){super(...arguments);S(this,"host");S(this,"_dbPromise",kp.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 n=await ts(a,i),c=await this.enqueueRequest({description:"Get S3 URL",method:l.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await Ye(a),file_type:a.type,extension:a.name.split(".").pop(),size:a.size.toString()},blockers:[],blocks:[`s3-${n}`]});return"url"in c&&this.dispatch(Ku({sha1:i,...c})),c}async addCache(i,a){if(Kn.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 n=await this._dbPromise;!!await n.get("files",a)?(console.error("File already cached (this is unexpected at this point):",i.name,a),Yt++):(await n.put("files",i,a),Yn++),Kn.add(a),Zn++,Zn%_F===0&&console.debug(`File cache summary: ${Yt} hits and ${Yn} misses, ${Yt/(Yt+Yn)*100}% hit rate over ${Zn} calls to addCache.`)}async removeCache(i){await(await this._dbPromise).delete("files",i),Kn.delete(i)}async fetchCache(i){return(await this._dbPromise).get("files",i)}async getOrRenewUploadUrl(i){const a=this.client.store.getState();return Yu(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 n=await ts(a,i),c={file_name:a.name,file_sha1:i,file:n},r=await this.getOrRenewUploadUrl(i);if("warning"in r){if(r.warning==="already_uploaded")return[c,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-${n}`],blocks:[i],s3url:r});return[c,m]}async fetchFileFromUrl(i,a,n){const c=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 dc(i),p=new File([h],n??a,{type:h.type});return await this.addCache(p,a),p}let u=Kt[c],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 A=new File([p],n??a,{type:p.type});h(A)})}),Kt[c]=u);let o;try{o=await u}catch(h){throw m&&h instanceof z&&delete Kt[c],h}if(m){const h=await Ye(o);if(h!==a){const y=`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("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","react","file-saver","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],L):(i=typeof globalThis<"u"?globalThis:i||self,L(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.fileSaver,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,L,l,pt,rt,ab,rb,db,pc,ub,yc,lb,ob,gR,MR,hb,mb,pb){"use strict";var bR=Object.defineProperty;var _R=(i,L,l)=>L in i?bR(i,L,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[L]=l;var h=(i,L,l)=>_R(i,typeof L!="symbol"?L+"":L,l);var nb;const fc=Object.freeze([]),Sc=Object.freeze({}),Ac=6e4;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||{}),Pc=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Pc||{}),$=(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||{}),Fc=(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))(Fc||{}),bc=(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))(bc||{}),_c=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(_c||{});function O(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 yb(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 gt="versioning",T=l.createAction("RESET"),V=l.createAction("RESET_PROJECT_STATE"),F=l.createAction("RESET_ORGANIZATION_STATE");function fb(t,s){return ab.useMemo(t,s)}nb=Symbol.toStringTag;class rs{constructor(){h(this,nb,"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 ds=!1;["true","1"].includes("".toLowerCase())&&(ds=!0);function Sb(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 us(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ds&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ds&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function Ab(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?fc:t,ls=t=>Object.keys(t).length===0?Sc:t,gc=us(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===os.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),Ib=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),Tb=1e3*86400,os=new Date,Pb=t=>new Date(t).toDateString()===os.toDateString(),Ob=us((t,s,e)=>{const n=Math.round((new Date(t).getTime()-os.getTime())/Tb);return n<s||n>e?gc(t):Ib.format(n,"days")});function Fb(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Dt(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=Fb(r);s(a)})},n.readAsArrayBuffer(t)})}const bb=(t,s)=>`${t}${s?`.${s}`:""}`;function _b(t,s){return new File([t],s,{type:t.type})}function Mc(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Rc=async t=>(await fetch(t)).blob(),wc=async(t,s)=>{const e=await Rc(t);return new File([e],s,{type:e.type})};function gb(t){const s=new Blob([t]);rb.saveAs(s,t.name)}function vc(t){return typeof t=="string"&&t.startsWith("blob:")}function Mb(t){return t.type.startsWith("image/")}const Ec={};function Rb(t,s,e,...n){const c=Ec[t];let r=!1;c?c[s]||(c[s]=!0,r=!0):(Ec[t]={[s]:!0},r=!0),r&&console[e](...n)}const Bc=["created_at","updated_at","index","revision"];function P(t){return{...t,uuid:rt.v4()}}function wb(t){const s={};for(const e of t)s[e.uuid]=e;return s}function E(t){return t.map(({uuid:s})=>s)}function jt(t,s){return t.localeCompare(s)}function hs(t,s){return jt(t.uuid,s.uuid)}function vb(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 Eb(t){return t.toLowerCase().replace(" ","-")}function Bb(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function Vb(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const zb=/^.+@.+\..+$/;function M(t){const s={...t};for(const e of[...Bc,"created_by"])e in s&&delete s[e];return s}const Vc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,zc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Dc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,jc=t=>db(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),Db=t=>{const{roots:s}=jc(t);return s.map(e=>new pc.Tree(e))},qc=(t,s)=>{const{nodes:e}=jc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new pc.Tree(n)},yt=(t,s)=>t.submitted_at===s.submitted_at?0:t.submitted_at<s.submitted_at?-1:1;class jb{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),G=O(t=>t.uuid),Cc={instances:{}},ms=l.createSlice({name:"agents",initialState:Cc,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Cc)),reducers:{initializeConversations:G.initialize,addConversation:G.addOne,addConversations:G.addMany,setConversation:G.setOne,setConversations:G.setMany,updateConversation:G.updateOne,updateConversations:G.updateMany,deleteConversation:G.deleteOne,deleteConversations:G.deleteMany}}),{initializeConversations:$c,addConversation:Uc,addConversations:qb,setConversation:Lc,setConversations:Cb,updateConversation:kc,updateConversations:$b,deleteConversation:Ub,deleteConversations:Lb}=ms.actions,ps=t=>t.agentsReducer.instances,kb=l.createSelector([ps],t=>Object.values(t)),Nb=y(l.createSelector([ps,(t,s)=>s],(t,s)=>t[s])),Nc=ms.reducer,H=O(t=>t.uuid),Gc={instances:{}},ys=l.createSlice({name:"assetAttachments",initialState:Gc,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Gc)),reducers:{initializeAssetAttachments:H.initialize,addAssetAttachment:H.addOne,addAssetAttachments:H.addMany,setAssetAttachment:H.setOne,setAssetAttachments:H.setMany,updateAssetAttachment:H.updateOne,updateAssetAttachments:H.updateMany,deleteAssetAttachment:H.deleteOne,deleteAssetAttachments:H.deleteMany}}),{initializeAssetAttachments:Hc,addAssetAttachment:Wc,addAssetAttachments:fs,setAssetAttachment:Kc,setAssetAttachments:Yc,updateAssetAttachment:Zc,updateAssetAttachments:Jc,deleteAssetAttachment:Xc,deleteAssetAttachments:Ss}=ys.actions,Qc=t=>t.assetAttachmentReducer.instances,As=l.createSelector([Qc],t=>Object.values(t)),xc=t=>s=>s.assetAttachmentReducer.instances[t],ea=y(l.createSelector([As,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ta=y(l.createSelector([As,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>s===e)))),sa=ys.reducer,W=O(t=>t.uuid),ia={instances:{}},Is=l.createSlice({name:"assetComments",initialState:ia,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,ia)),reducers:{initializeAssetComments:W.initialize,addAssetComment:W.addOne,addAssetComments:W.addMany,setAssetComment:W.setOne,setAssetComments:W.setMany,updateAssetComment:W.updateOne,updateAssetComments:W.updateMany,deleteAssetComment:W.deleteOne,deleteAssetComments:W.deleteMany}}),{initializeAssetComments:na,addAssetComment:ca,addAssetComments:qt,setAssetComment:aa,setAssetComments:ra,updateAssetComment:da,updateAssetComments:ua,deleteAssetComment:la,deleteAssetComments:Ct}=Is.actions,oa=t=>t.assetCommentReducer.instances,$t=l.createSelector([oa],t=>S(Object.values(t).toSorted(yt))),ha=t=>s=>s.assetCommentReducer.instances[t],ma=y(l.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),pa=y(l.createSelector([$t,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),ya=y(l.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.asset)))})),fa=Is.reducer,K=O(t=>t.uuid),Sa={instances:{}},Ts=l.createSlice({name:"assets",initialState:Sa,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Sa)),reducers:{initializeAssets:K.initialize,addAsset:K.addOne,addAssets:K.addMany,setAsset:K.setOne,setAssets:K.setMany,updateAsset:K.updateOne,updateAssets:K.updateMany,deleteAsset:K.deleteOne,deleteAssets:K.deleteMany}}),{initializeAssets:Aa,addAsset:Ia,addAssets:Ps,updateAsset:Ta,updateAssets:Pa,deleteAsset:Oa,deleteAssets:Os,setAsset:Fa,setAssets:ba}=Ts.actions,_a=t=>t.assetReducer.instances,Ut=l.createSelector([_a],t=>S(Object.values(t))),Gb=y(l.createSelector([Ut,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>e===s)))),ga=y(l.createSelector([Ut,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Ma=t=>s=>s.assetReducer.instances[t],Ra=y(l.createSelector([Ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),wa=Ts.reducer,Y=O(t=>t.uuid),va={instances:{}},Fs=l.createSlice({name:"assetTypeAttachments",initialState:va,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,va)),reducers:{initializeAssetTypeAttachments:Y.initialize,addAssetTypeAttachment:Y.addOne,addAssetTypeAttachments:Y.addMany,setAssetTypeAttachment:Y.setOne,setAssetTypeAttachments:Y.setMany,updateAssetTypeAttachment:Y.updateOne,updateAssetTypeAttachments:Y.updateMany,deleteAssetTypeAttachment:Y.deleteOne,deleteAssetTypeAttachments:Y.deleteMany}}),{initializeAssetTypeAttachments:Ea,addAssetTypeAttachment:Ba,addAssetTypeAttachments:bs,setAssetTypeAttachment:Va,setAssetTypeAttachments:za,updateAssetTypeAttachment:Da,updateAssetTypeAttachments:ja,deleteAssetTypeAttachment:qa,deleteAssetTypeAttachments:_s}=Fs.actions,Ca=t=>t.assetTypeAttachmentReducer.instances,gs=l.createSelector([Ca],t=>Object.values(t)),$a=t=>s=>s.assetTypeAttachmentReducer.instances[t],Ua=y(l.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),La=y(l.createSelector([gs,(t,s)=>s],(t,s)=>S(t.filter(({asset_type:e})=>s===e)))),ka=Fs.reducer,Z=O(t=>t.uuid),Na={instances:{}},Ms=l.createSlice({name:"assetTypeFieldsAttachments",initialState:Na,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Na)),reducers:{initializeAssetTypeFieldsAttachments:Z.initialize,addAssetTypeFieldsAttachment:Z.addOne,addAssetTypeFieldsAttachments:Z.addMany,setAssetTypeFieldsAttachment:Z.setOne,setAssetTypeFieldsAttachments:Z.setMany,updateAssetTypeFieldsAttachment:Z.updateOne,updateAssetTypeFieldsAttachments:Z.updateMany,deleteAssetTypeFieldsAttachment:Z.deleteOne,deleteAssetTypeFieldsAttachments:Z.deleteMany}}),{initializeAssetTypeFieldsAttachments:Ga,addAssetTypeFieldsAttachment:Ha,addAssetTypeFieldsAttachments:Wa,setAssetTypeFieldsAttachment:Ka,setAssetTypeFieldsAttachments:Ya,updateAssetTypeFieldsAttachment:Za,updateAssetTypeFieldsAttachments:Ja,deleteAssetTypeFieldsAttachment:Xa,deleteAssetTypeFieldsAttachments:Qa}=Ms.actions,xa=t=>t.assetTypeFieldsAttachmentReducer.instances,Rs=l.createSelector([xa],t=>Object.values(t)),Hb=y(l.createSelector([Rs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),er=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],tr=y(l.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),sr=Ms.reducer,J=O(t=>t.uuid),ir={instances:{}},ws=l.createSlice({name:"assetTypeFields",initialState:ir,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ir)),reducers:{initializeAssetTypeFields:J.initialize,addAssetTypeFields:J.addOne,addAssetTypeFieldsMany:J.addMany,setAssetTypeFields:J.setOne,setAssetTypeFieldsMany:J.setMany,updateAssetTypeFields:J.updateOne,updateAssetTypeFieldsMany:J.updateMany,deleteAssetTypeFields:J.deleteOne,deleteAssetTypeFieldsMany:J.deleteMany}}),{initializeAssetTypeFields:nr,addAssetTypeFields:cr,addAssetTypeFieldsMany:ar,setAssetTypeFields:rr,setAssetTypeFieldsMany:dr,updateAssetTypeFields:ur,updateAssetTypeFieldsMany:lr,deleteAssetTypeFields:or,deleteAssetTypeFieldsMany:hr}=ws.actions,mr=t=>t.assetTypeFieldsReducer.instances,Mt=l.createSelector([mr],t=>Object.values(t)),Wb=y(l.createSelector([Mt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Kb=y(l.createSelector([Mt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).toSorted(yt).pop())),pr=t=>s=>s.assetTypeFieldsReducer.instances[t],yr=y(l.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),fr=ws.reducer,X=O(t=>t.uuid),Sr={instances:{}},vs=l.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Sr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Sr)),reducers:{initializeAssetTypeFieldValuesAttachments:X.initialize,addAssetTypeFieldValuesAttachment:X.addOne,addAssetTypeFieldValuesAttachments:X.addMany,setAssetTypeFieldValuesAttachment:X.setOne,setAssetTypeFieldValuesAttachments:X.setMany,updateAssetTypeFieldValuesAttachment:X.updateOne,updateAssetTypeFieldValuesAttachments:X.updateMany,deleteAssetTypeFieldValuesAttachment:X.deleteOne,deleteAssetTypeFieldValuesAttachments:X.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Ar,addAssetTypeFieldValuesAttachment:Ir,addAssetTypeFieldValuesAttachments:Es,setAssetTypeFieldValuesAttachment:Tr,setAssetTypeFieldValuesAttachments:Pr,updateAssetTypeFieldValuesAttachment:Or,updateAssetTypeFieldValuesAttachments:Fr,deleteAssetTypeFieldValuesAttachment:br,deleteAssetTypeFieldValuesAttachments:Bs}=vs.actions,_r=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Vs=l.createSelector([_r],t=>Object.values(t)),gr=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],Mr=y(l.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Rr=y(l.createSelector([Vs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),wr=vs.reducer,Q=O(t=>t.uuid),vr={instances:{}},zs=l.createSlice({name:"assetTypeFieldValues",initialState:vr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,vr)),reducers:{initializeAssetTypeFieldValues:Q.initialize,addAssetTypeFieldValues:Q.addOne,addAssetTypeFieldValuesMany:Q.addMany,setAssetTypeFieldValues:Q.setOne,setAssetTypeFieldValuesMany:Q.setMany,updateAssetTypeFieldValues:Q.updateOne,updateAssetTypeFieldValuesMany:Q.updateMany,deleteAssetTypeFieldValues:Q.deleteOne,deleteAssetTypeFieldValuesMany:Q.deleteMany}}),{initializeAssetTypeFieldValues:Er,addAssetTypeFieldValues:Br,addAssetTypeFieldValuesMany:Vr,setAssetTypeFieldValues:zr,setAssetTypeFieldValuesMany:Dr,updateAssetTypeFieldValues:jr,updateAssetTypeFieldValuesMany:qr,deleteAssetTypeFieldValues:Cr,deleteAssetTypeFieldValuesMany:$r}=zs.actions,Ur=t=>t.assetTypeFieldValuesReducer.instances,Lt=l.createSelector([Ur],t=>Object.values(t)),Yb=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),Zb=y(l.createSelector([Mt,Lt,(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)))})),Lr=t=>s=>s.assetTypeFieldValuesReducer.instances[t],kr=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Nr=zs.reducer,x=O(t=>t.uuid),Gr={instances:{}},Ds=l.createSlice({name:"assetTypeIdentifiers",initialState:Gr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Gr)),reducers:{initializeAssetTypeIdentifiers:x.initialize,addAssetTypeIdentifier:x.addOne,addAssetTypeIdentifiers:x.addMany,setAssetTypeIdentifier:x.setOne,setAssetTypeIdentifiers:x.setMany,updateAssetTypeIdentifier:x.updateOne,updateAssetTypeIdentifiers:x.updateMany,deleteAssetTypeIdentifier:x.deleteOne,deleteAssetTypeIdentifiers:x.deleteMany}}),{initializeAssetTypeIdentifiers:Hr,addAssetTypeIdentifier:Wr,addAssetTypeIdentifiers:Kr,setAssetTypeIdentifier:Yr,setAssetTypeIdentifiers:Zr,updateAssetTypeIdentifier:Jr,updateAssetTypeIdentifiers:Xr,deleteAssetTypeIdentifier:Qr,deleteAssetTypeIdentifiers:xr}=Ds.actions,ed=t=>t.assetTypeIdentifierReducer.instances,js=l.createSelector([ed],t=>Object.values(t)),td=t=>s=>s.assetTypeIdentifierReducer.instances[t],sd=y(l.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Jb=y(l.createSelector([js,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),id=Ds.reducer,ee=O(t=>t.uuid),nd={instances:{}},qs=l.createSlice({name:"assetTypeIdentifierValues",initialState:nd,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,nd)),reducers:{initializeAssetTypeIdentifierValues:ee.initialize,addAssetTypeIdentifierValue:ee.addOne,addAssetTypeIdentifierValues:ee.addMany,setAssetTypeIdentifierValue:ee.setOne,setAssetTypeIdentifierValues:ee.setMany,updateAssetTypeIdentifierValue:ee.updateOne,updateAssetTypeIdentifierValues:ee.updateMany,deleteAssetTypeIdentifierValue:ee.deleteOne,deleteAssetTypeIdentifierValues:ee.deleteMany}}),{initializeAssetTypeIdentifierValues:cd,addAssetTypeIdentifierValue:ad,addAssetTypeIdentifierValues:rd,setAssetTypeIdentifierValue:dd,setAssetTypeIdentifierValues:ud,updateAssetTypeIdentifierValue:ld,updateAssetTypeIdentifierValues:od,deleteAssetTypeIdentifierValue:hd,deleteAssetTypeIdentifierValues:md}=qs.actions,pd=t=>t.assetTypeIdentifierValueReducer.instances,kt=l.createSelector([pd],t=>Object.values(t)),yd=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],fd=y(l.createSelector([kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Xb=y(l.createSelector([kt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),Qb=y(l.createSelector([kt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type_identifier===s)))),Sd=qs.reducer,te=O(t=>t.uuid),Ad={instances:{}},Cs=l.createSlice({name:"assetTypes",initialState:Ad,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ad)),reducers:{initializeAssetTypes:te.initialize,setAssetType:te.setOne,setAssetTypes:te.setMany,addAssetType:te.addOne,addAssetTypes:te.addMany,updateAssetType:te.updateOne,updateAssetTypes:te.updateMany,deleteAssetType:te.deleteOne,deleteAssetTypes:te.deleteMany}}),{initializeAssetTypes:Id,setAssetType:Td,setAssetTypes:Pd,addAssetType:Od,addAssetTypes:Fd,updateAssetType:bd,updateAssetTypes:_d,deleteAssetType:gd,deleteAssetTypes:Md}=Cs.actions,Rd=t=>t.assetTypeReducer.instances,$s=l.createSelector([Rd],t=>Object.values(t)),wd=t=>s=>s.assetTypeReducer.instances[t],vd=y(l.createSelector([$s,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),xb=y(l.createSelector([$s,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Ed=Cs.reducer,se=O(t=>t.uuid),Bd={instances:{}},Us=l.createSlice({name:"assetTypeStatuses",initialState:Bd,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Bd)),reducers:{initializeAssetTypeStatuses:se.initialize,addAssetTypeStatus:se.addOne,addAssetTypeStatuses:se.addMany,setAssetTypeStatus:se.setOne,setAssetTypeStatuses:se.setMany,updateAssetTypeStatus:se.updateOne,updateAssetTypeStatuses:se.updateMany,deleteAssetTypeStatus:se.deleteOne,deleteAssetTypeStatuses:se.deleteMany}}),{initializeAssetTypeStatuses:Vd,addAssetTypeStatus:zd,addAssetTypeStatuses:Dd,setAssetTypeStatus:jd,setAssetTypeStatuses:qd,updateAssetTypeStatus:Cd,updateAssetTypeStatuses:$d,deleteAssetTypeStatus:Ud,deleteAssetTypeStatuses:Ld}=Us.actions,kd=t=>t.assetTypeStatusReducer.instances,Ls=l.createSelector([kd],t=>S(Object.values(t).toSorted(Vc))),Nd=t=>s=>s.assetTypeStatusReducer.instances[t],Gd=y(l.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),e_=y(l.createSelector([Ls,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Hd=Us.reducer,Wd={accessToken:"",refreshToken:"",isLoggedIn:!1},Nt=l.createSlice({name:"auth",initialState:Wd,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Wd)),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||Nt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:t_,clearTokens:s_,setLoggedIn:Kd}=Nt.actions,i_=t=>t.authReducer.accessToken,n_=t=>t.authReducer.isLoggedIn,Yd=Nt.reducer,ie=O(t=>t.uuid),Zd={instances:{}},ks=l.createSlice({name:"documentAttachments",initialState:Zd,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Zd)),reducers:{initializeDocumentAttachments:ie.initialize,addDocumentAttachment:ie.addOne,addDocumentAttachments:ie.addMany,setDocumentAttachment:ie.setOne,setDocumentAttachments:ie.setMany,updateDocumentAttachment:ie.updateOne,updateDocumentAttachments:ie.updateMany,deleteDocumentAttachment:ie.deleteOne,deleteDocumentAttachments:ie.deleteMany}}),{initializeDocumentAttachments:Jd,addDocumentAttachment:Xd,addDocumentAttachments:Qd,setDocumentAttachment:xd,setDocumentAttachments:eu,updateDocumentAttachment:tu,updateDocumentAttachments:su,deleteDocumentAttachment:iu,deleteDocumentAttachments:nu}=ks.actions,cu=t=>t.documentAttachmentReducer.instances,Ns=l.createSelector([cu],t=>Object.values(t)),au=t=>s=>s.documentAttachmentReducer.instances[t],ru=y(l.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),c_=y(l.createSelector([Ns,(t,s)=>s],(t,s)=>S(t.filter(({document:e})=>s===e)))),du=ks.reducer,ne=O(({uuid:t})=>t),uu={instances:{}},Gs=l.createSlice({name:"documents",initialState:uu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>{Object.assign(s,uu)}),reducers:{initializeDocuments:ne.initialize,addDocument:ne.addOne,addDocuments:ne.addMany,setDocument:ne.setOne,setDocuments:ne.setMany,updateDocument:ne.updateOne,updateDocuments:ne.updateMany,deleteDocument:ne.deleteOne,deleteDocuments:ne.deleteMany}}),{initializeDocuments:lu,addDocument:ou,addDocuments:hu,setDocument:mu,setDocuments:pu,updateDocument:yu,updateDocuments:fu,deleteDocument:Su,deleteDocuments:Au}=Gs.actions,Iu=Gs.reducer,Hs=t=>t.documentsReducer.instances,Gt=l.createSelector([Hs],t=>Object.values(t)),Tu=t=>s=>s.documentsReducer.instances[t],Pu=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),a_=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),r_=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Ou=y(l.createSelector([Hs,(t,s)=>s],(t,s)=>{if(!t[s])return S([]);const c=qc(s,Object.values(t)).all().map(({model:r})=>r);return S(c)})),ce=O(t=>t.uuid),Fu={instances:{}},Ws=l.createSlice({name:"emailDomains",initialState:Fu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Fu)),reducers:{initializeEmailDomains:ce.initialize,addEmailDomain:ce.addOne,addEmailDomains:ce.addMany,setEmailDomain:ce.setOne,setEmailDomains:ce.setMany,updateEmailDomain:ce.updateOne,updateEmailDomains:ce.updateMany,deleteEmailDomain:ce.deleteOne,deleteEmailDomains:ce.deleteMany}}),{initializeEmailDomains:bu,addEmailDomain:_u,addEmailDomains:gu,setEmailDomain:Mu,setEmailDomains:Ru,updateEmailDomain:wu,updateEmailDomains:vu,deleteEmailDomain:Eu,deleteEmailDomains:Bu}=Ws.actions,Vu=t=>t.emailDomainsReducer.instances,Ks=l.createSelector([Vu],t=>Object.values(t)),zu=t=>s=>s.emailDomainsReducer.instances[t],Du=y(l.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),d_=y(l.createSelector([Ks,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),ju=Ws.reducer,qu={s3Urls:{}},Cu=1e3*60*60,u_=Cu*24*7,Ys=l.createSlice({name:"file",initialState:qu,extraReducers:t=>t.addCase(T,s=>Object.assign(s,qu)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:c}=s.payload,r=new Date,a=new Date(r.getTime()+u_);t.s3Urls[c]={url:e,fields:n,exp:a.getTime()}}}}),{setUploadUrl:l_}=Ys.actions,o_=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Cu))return e},$u=Ys.reducer,ae=O(t=>t.uuid),Uu={instances:{}},Zs=l.createSlice({name:"formIdentifiers",initialState:Uu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Uu)),reducers:{initializeFormIdentifiers:ae.initialize,addFormIdentifier:ae.addOne,addFormIdentifiers:ae.addMany,setFormIdentifier:ae.setOne,setFormIdentifiers:ae.setMany,updateFormIdentifier:ae.updateOne,updateFormIdentifiers:ae.updateMany,deleteFormIdentifier:ae.deleteOne,deleteFormIdentifiers:ae.deleteMany}}),{initializeFormIdentifiers:Lu,addFormIdentifier:ku,addFormIdentifiers:Nu,setFormIdentifier:Gu,setFormIdentifiers:Hu,updateFormIdentifier:Wu,updateFormIdentifiers:Ku,deleteFormIdentifier:Yu,deleteFormIdentifiers:Zu}=Zs.actions,Ju=t=>t.formIdentifierReducer.instances,Js=l.createSelector([Ju],t=>Object.values(t)),Xu=t=>s=>s.formIdentifierReducer.instances[t],Qu=y(l.createSelector([Js,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),h_=y(l.createSelector([Js,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),xu=Zs.reducer,re=O(t=>t.uuid),el={instances:{}},Xs=l.createSlice({name:"formIdentifierValues",initialState:el,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,el)),reducers:{initializeFormIdentifierValues:re.initialize,addFormIdentifierValue:re.addOne,addFormIdentifierValues:re.addMany,setFormIdentifierValue:re.setOne,setFormIdentifierValues:re.setMany,updateFormIdentifierValue:re.updateOne,updateFormIdentifierValues:re.updateMany,deleteFormIdentifierValue:re.deleteOne,deleteFormIdentifierValues:re.deleteMany}}),{initializeFormIdentifierValues:tl,addFormIdentifierValue:sl,addFormIdentifierValues:il,setFormIdentifierValue:nl,setFormIdentifierValues:cl,updateFormIdentifierValue:al,updateFormIdentifierValues:rl,deleteFormIdentifierValue:dl,deleteFormIdentifierValues:ul}=Xs.actions,ll=t=>t.formIdentifierValueReducer.instances,Ht=l.createSelector([ll],t=>Object.values(t)),ol=t=>s=>s.formIdentifierValueReducer.instances[t],hl=y(l.createSelector([Ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),m_=y(l.createSelector([Ht,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),p_=y(l.createSelector([Ht,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_identifier===s)))),ml=Xs.reducer,de=O(t=>t.uuid),pl={instances:{}},Qs=l.createSlice({name:"formRevisionAttachments",initialState:pl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,pl)),reducers:{initializeFormRevisionAttachments:de.initialize,addFormRevisionAttachment:de.addOne,addFormRevisionAttachments:de.addMany,setFormRevisionAttachment:de.setOne,setFormRevisionAttachments:de.setMany,updateFormRevisionAttachment:de.updateOne,updateFormRevisionAttachments:de.updateMany,deleteFormRevisionAttachment:de.deleteOne,deleteFormRevisionAttachments:de.deleteMany}}),{initializeFormRevisionAttachments:yl,addFormRevisionAttachment:fl,addFormRevisionAttachments:Sl,setFormRevisionAttachment:Al,setFormRevisionAttachments:Il,updateFormRevisionAttachment:Tl,updateFormRevisionAttachments:Pl,deleteFormRevisionAttachment:Ol,deleteFormRevisionAttachments:Fl}=Qs.actions,Wt=t=>t.formRevisionAttachmentReducer.instances,bl=l.createSelector([Wt],t=>Object.values(t)),_l=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>t[s])),gl=y(l.createSelector([bl,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),y_=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.form_revision===s)))),Ml=Qs.reducer,ue=O(t=>t.uuid),Rl={instances:{}},xs=l.createSlice({name:"formRevisions",initialState:Rl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Rl)),reducers:{initializeFormRevisions:ue.initialize,addFormRevision:ue.addOne,addFormRevisions:ue.addMany,setFormRevision:ue.setOne,setFormRevisions:ue.setMany,updateFormRevision:ue.updateOne,updateFormRevisions:ue.updateMany,deleteFormRevision:ue.deleteOne,deleteFormRevisions:ue.deleteMany}}),{initializeFormRevisions:wl,addFormRevision:vl,addFormRevisions:ei,setFormRevision:El,setFormRevisions:Bl,updateFormRevision:Vl,updateFormRevisions:zl,deleteFormRevision:Dl,deleteFormRevisions:ti}=xs.actions,jl=t=>t.formRevisionReducer.instances,Kt=l.createSelector([jl],t=>Object.values(t)),ql=t=>s=>s.formRevisionReducer.instances[t],Cl=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),f_=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).toSorted(yt).pop())),$l=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),Ul=xs.reducer,le=O(t=>t.uuid),Ll={instances:{}},si=l.createSlice({name:"forms",initialState:Ll,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ll)),reducers:{initializeForms:le.initialize,addForm:le.addOne,addForms:le.addMany,setForm:le.setOne,setForms:le.setMany,updateForm:le.updateOne,updateForms:le.updateMany,deleteForm:le.deleteOne,deleteForms:le.deleteMany}}),{initializeForms:kl,addForm:Nl,addForms:Gl,setForm:Hl,setForms:Wl,updateForm:Kl,updateForms:Yl,deleteForm:Zl,deleteForms:Jl}=si.actions,Xl=si.reducer,Ql=t=>t.formReducer.instances,ii=l.createSelector([Ql],t=>Object.values(t)),xl=t=>s=>s.formReducer.instances[t],eo=y(l.createSelector([ii,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),S_=y(l.createSelector([ii,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),oe=O(t=>t.uuid),to={instances:{}},ni=l.createSlice({name:"formSubmissionAttachments",initialState:to,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,to)),reducers:{initializeFormSubmissionAttachments:oe.initialize,addFormSubmissionAttachment:oe.addOne,addFormSubmissionAttachments:oe.addMany,setFormSubmissionAttachment:oe.setOne,setFormSubmissionAttachments:oe.setMany,updateFormSubmissionAttachment:oe.updateOne,updateFormSubmissionAttachments:oe.updateMany,deleteFormSubmissionAttachment:oe.deleteOne,deleteFormSubmissionAttachments:oe.deleteMany}}),{initializeFormSubmissionAttachments:so,addFormSubmissionAttachment:io,addFormSubmissionAttachments:ci,setFormSubmissionAttachment:no,setFormSubmissionAttachments:co,updateFormSubmissionAttachment:ao,updateFormSubmissionAttachments:ro,deleteFormSubmissionAttachment:uo,deleteFormSubmissionAttachments:ai}=ni.actions,ri=t=>t.formSubmissionAttachmentReducer.instances,di=l.createSelector([ri],t=>Object.values(t)),lo=y(l.createSelector([ri,(t,s)=>s],(t,s)=>t[s])),ui=y(l.createSelector([di,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.uuid)))})),oo=ui,ho=y(l.createSelector([di,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),mo=ni.reducer,he=O(t=>t.uuid),po={instances:{}},li=l.createSlice({name:"formSubmissions",initialState:po,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,po)),reducers:{initializeFormSubmissions:he.initialize,setFormSubmission:he.setOne,setFormSubmissions:he.setMany,addFormSubmission:he.addOne,addFormSubmissions:he.addMany,updateFormSubmission:he.updateOne,updateFormSubmissions:he.updateMany,deleteFormSubmission:he.deleteOne,deleteFormSubmissions:he.deleteMany}}),{initializeFormSubmissions:yo,setFormSubmission:fo,setFormSubmissions:So,addFormSubmission:Ao,addFormSubmissions:oi,updateFormSubmission:Io,updateFormSubmissions:To,deleteFormSubmission:Po,deleteFormSubmissions:hi}=li.actions,Oo=t=>t.formSubmissionReducer.instances,mi=l.createSelector([Oo],t=>Object.values(t)),Fo=t=>s=>s.formSubmissionReducer.instances[t],bo=y(l.createSelector([mi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),_o=y(l.createSelector([mi,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s))),go=li.reducer,me=O(t=>t.uuid),Mo={instances:{}},pi=l.createSlice({name:"geoImages",initialState:Mo,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Mo)),reducers:{initializeGeoImages:me.initialize,setGeoImage:me.setOne,setGeoImages:me.setMany,addGeoImage:me.addOne,addGeoImages:me.addMany,updateGeoImage:me.updateOne,updateGeoImages:me.updateMany,deleteGeoImage:me.deleteOne,deleteGeoImages:me.deleteMany}}),{initializeGeoImages:Ro,setGeoImage:wo,setGeoImages:vo,addGeoImage:Eo,addGeoImages:Bo,updateGeoImage:Vo,updateGeoImages:zo,deleteGeoImage:Do,deleteGeoImages:jo}=pi.actions,qo=t=>t.geoImageReducer.instances,yi=l.createSelector([qo],t=>Object.values(t)),Co=t=>s=>s.geoImageReducer.instances[t],$o=y(l.createSelector([yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),A_=y(l.createSelector([yi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),Uo=pi.reducer,pe=O(t=>t.uuid),Lo={instances:{}},fi=l.createSlice({name:"issueAssociations",initialState:Lo,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Lo)),reducers:{initializeIssueAssociations:pe.initialize,addIssueAssociation:pe.addOne,addIssueAssociations:pe.addMany,setIssueAssociation:pe.setOne,setIssueAssociations:pe.setMany,updateIssueAssociation:pe.updateOne,updateIssueAssociations:pe.updateMany,deleteIssueAssociation:pe.deleteOne,deleteIssueAssociations:pe.deleteMany}}),{initializeIssueAssociations:ko,setIssueAssociations:No,setIssueAssociation:Go,updateIssueAssociation:Ho,updateIssueAssociations:Wo,addIssueAssociation:Ko,addIssueAssociations:ft,deleteIssueAssociation:Yo,deleteIssueAssociations:St}=fi.actions,Zo=t=>t.issueAssociationReducer.instances,At=l.createSelector([Zo],t=>Object.values(t)),Jo=t=>s=>s.issueAssociationReducer.instances[t],Xo=y(l.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Qo=y(l.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({issue:n})=>e.has(n)))})),xo=y(l.createSelector([At,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>e===s)))),eh=y(l.createSelector([At,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>e===s)))),th=y(l.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({asset:n})=>e.has(n)))})),sh=fi.reducer,ye=O(t=>t.uuid),ih={instances:{}},Si=l.createSlice({name:"issueAttachments",initialState:ih,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,ih)),reducers:{initializeIssueAttachments:ye.initialize,addIssueAttachment:ye.addOne,addIssueAttachments:ye.addMany,setIssueAttachment:ye.setOne,setIssueAttachments:ye.setMany,updateIssueAttachment:ye.updateOne,updateIssueAttachments:ye.updateMany,deleteIssueAttachment:ye.deleteOne,deleteIssueAttachments:ye.deleteMany}}),{initializeIssueAttachments:nh,addIssueAttachment:ch,addIssueAttachments:Ai,setIssueAttachment:ah,setIssueAttachments:rh,updateIssueAttachment:dh,updateIssueAttachments:uh,deleteIssueAttachment:lh,deleteIssueAttachments:Ii}=Si.actions,oh=t=>t.issueAttachmentReducer.instances,Ti=l.createSelector([oh],t=>Object.values(t)),hh=y(l.createSelector([Ti,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>s===e)))),mh=t=>s=>s.issueAttachmentReducer.instances[t],ph=y(l.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),yh=Si.reducer,fe=O(t=>t.uuid),fh={instances:{}},Pi=l.createSlice({name:"issueCommentAttachments",initialState:fh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,fh)),reducers:{initializeIssueCommentAttachments:fe.initialize,addIssueCommentAttachment:fe.addOne,addIssueCommentAttachments:fe.addMany,setIssueCommentAttachment:fe.setOne,setIssueCommentAttachments:fe.setMany,updateIssueCommentAttachment:fe.updateOne,updateIssueCommentAttachments:fe.updateMany,deleteIssueCommentAttachment:fe.deleteOne,deleteIssueCommentAttachments:fe.deleteMany}}),{initializeIssueCommentAttachments:Sh,addIssueCommentAttachment:Ah,addIssueCommentAttachments:Ih,setIssueCommentAttachment:Th,setIssueCommentAttachments:Ph,updateIssueCommentAttachment:Oh,updateIssueCommentAttachments:Fh,deleteIssueCommentAttachment:bh,deleteIssueCommentAttachments:_h}=Pi.actions,gh=t=>t.issueCommentAttachmentReducer.instances,Oi=l.createSelector([gh],t=>Object.values(t)),Mh=t=>s=>s.issueCommentAttachmentReducer.instances[t],Rh=y(l.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),I_=y(l.createSelector([Oi,(t,s)=>s],(t,s)=>S(t.filter(({issue_comment:e})=>s===e)))),wh=Pi.reducer,Se=O(t=>t.uuid),vh={instances:{}},Fi=l.createSlice({name:"issueComments",initialState:vh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,vh)),reducers:{initializeIssueComments:Se.initialize,addIssueComment:Se.addOne,addIssueComments:Se.addMany,setIssueComment:Se.setOne,setIssueComments:Se.setMany,updateIssueComment:Se.updateOne,updateIssueComments:Se.updateMany,deleteIssueComment:Se.deleteOne,deleteIssueComments:Se.deleteMany}}),{initializeIssueComments:Eh,addIssueComment:Bh,addIssueComments:Vh,setIssueComment:zh,setIssueComments:Dh,updateIssueComment:jh,updateIssueComments:qh,deleteIssueComment:Ch,deleteIssueComments:$h}=Fi.actions,bi=t=>t.issueCommentReducer.instances,Uh=t=>s=>s.issueCommentReducer.instances[t],Lh=y(l.createSelector([bi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(Object.values(t).filter(({uuid:n})=>e.has(n)))})),T_=y(l.createSelector([bi,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.issue===s)))),kh=Fi.reducer,Ae=O(t=>t.uuid),Nh={instances:{}},_i=l.createSlice({name:"issues",initialState:Nh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Nh)),reducers:{initializeIssues:Ae.initialize,addIssue:Ae.addOne,addIssues:Ae.addMany,setIssue:Ae.setOne,setIssues:Ae.setMany,updateIssue:Ae.updateOne,updateIssues:Ae.updateMany,deleteIssue:Ae.deleteOne,deleteIssues:Ae.deleteMany}}),{initializeIssues:Gh,addIssue:Hh,addIssues:gi,setIssue:Wh,setIssues:Kh,updateIssue:Yh,updateIssues:Zh,deleteIssue:Jh,deleteIssues:Mi}=_i.actions,Xh=t=>t.issueReducer.instances,Yt=l.createSelector([Xh],t=>Object.values(t)),Qh=t=>s=>s.issueReducer.instances[t],xh=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),P_=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),em=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),tm=_i.reducer,Ie=O(t=>t.uuid),sm={instances:{}},Ri=l.createSlice({name:"issueTypeAttachments",initialState:sm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,sm)),reducers:{initializeIssueTypeAttachments:Ie.initialize,addIssueTypeAttachment:Ie.addOne,addIssueTypeAttachments:Ie.addMany,setIssueTypeAttachment:Ie.setOne,setIssueTypeAttachments:Ie.setMany,updateIssueTypeAttachment:Ie.updateOne,updateIssueTypeAttachments:Ie.updateMany,deleteIssueTypeAttachment:Ie.deleteOne,deleteIssueTypeAttachments:Ie.deleteMany}}),{initializeIssueTypeAttachments:im,addIssueTypeAttachment:nm,addIssueTypeAttachments:cm,setIssueTypeAttachment:am,setIssueTypeAttachments:rm,updateIssueTypeAttachment:dm,updateIssueTypeAttachments:um,deleteIssueTypeAttachment:lm,deleteIssueTypeAttachments:om}=Ri.actions,hm=t=>t.issueTypeAttachmentReducer.instances,wi=l.createSelector([hm],t=>Object.values(t)),mm=t=>s=>s.issueTypeAttachmentReducer.instances[t],pm=y(l.createSelector([wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),O_=y(l.createSelector([wi,(t,s)=>s],(t,s)=>S(t.filter(({issue_type:e})=>s===e)))),ym=Ri.reducer,Te=O(t=>t.uuid),fm={instances:{}},vi=l.createSlice({name:"issueTypeFieldsAttachments",initialState:fm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,fm)),reducers:{initializeIssueTypeFieldsAttachments:Te.initialize,addIssueTypeFieldsAttachment:Te.addOne,addIssueTypeFieldsAttachments:Te.addMany,setIssueTypeFieldsAttachment:Te.setOne,setIssueTypeFieldsAttachments:Te.setMany,updateIssueTypeFieldsAttachment:Te.updateOne,updateIssueTypeFieldsAttachments:Te.updateMany,deleteIssueTypeFieldsAttachment:Te.deleteOne,deleteIssueTypeFieldsAttachments:Te.deleteMany}}),{initializeIssueTypeFieldsAttachments:Sm,addIssueTypeFieldsAttachment:Am,addIssueTypeFieldsAttachments:Im,setIssueTypeFieldsAttachment:Tm,setIssueTypeFieldsAttachments:Pm,updateIssueTypeFieldsAttachment:Om,updateIssueTypeFieldsAttachments:Fm,deleteIssueTypeFieldsAttachment:bm,deleteIssueTypeFieldsAttachments:_m}=vi.actions,gm=t=>t.issueTypeFieldsAttachmentReducer.instances,Ei=l.createSelector([gm],t=>Object.values(t)),F_=y(l.createSelector([Ei,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),Mm=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],Rm=y(l.createSelector([Ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),wm=vi.reducer,Pe=O(t=>t.uuid),vm={instances:{}},Bi=l.createSlice({name:"issueTypeFieldValues",initialState:vm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,vm)),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:Em,addIssueTypeFieldValues:Bm,addIssueTypeFieldValuesMany:Vm,setIssueTypeFieldValues:zm,setIssueTypeFieldValuesMany:Dm,updateIssueTypeFieldValues:jm,updateIssueTypeFieldValuesMany:qm,deleteIssueTypeFieldValues:Cm,deleteIssueTypeFieldValuesMany:$m}=Bi.actions,Um=t=>t.issueTypeFieldValuesReducer.instances,Zt=l.createSelector([Um],t=>Object.values(t)),b_=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),Lm=t=>s=>s.issueTypeFieldValuesReducer.instances[t],km=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Nm=Bi.reducer,Oe=O(t=>t.uuid),Gm={instances:{}},Vi=l.createSlice({name:"issueTypeFields",initialState:Gm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Gm)),reducers:{initializeIssueTypeFields:Oe.initialize,addIssueTypeFields:Oe.addOne,addIssueTypeFieldsMany:Oe.addMany,setIssueTypeFields:Oe.setOne,setIssueTypeFieldsMany:Oe.setMany,updateIssueTypeFields:Oe.updateOne,updateIssueTypeFieldsMany:Oe.updateMany,deleteIssueTypeFields:Oe.deleteOne,deleteIssueTypeFieldsMany:Oe.deleteMany}}),{initializeIssueTypeFields:Hm,addIssueTypeFields:Wm,addIssueTypeFieldsMany:Km,setIssueTypeFields:Ym,setIssueTypeFieldsMany:Zm,updateIssueTypeFields:Jm,updateIssueTypeFieldsMany:Xm,deleteIssueTypeFields:Qm,deleteIssueTypeFieldsMany:xm}=Vi.actions,ep=t=>t.issueTypeFieldsReducer.instances,Rt=l.createSelector([ep],t=>Object.values(t)),__=y(l.createSelector([Rt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),g_=y(l.createSelector([Rt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),M_=y(l.createSelector([Rt,Zt,(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)))})),tp=t=>s=>s.issueTypeFieldsReducer.instances[t],sp=y(l.createSelector([Rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ip=Vi.reducer,Fe=O(t=>t.uuid),np={instances:{}},zi=l.createSlice({name:"issueTypeFieldValuesAttachments",initialState:np,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,np)),reducers:{initializeIssueTypeFieldValuesAttachments:Fe.initialize,addIssueTypeFieldValuesAttachment:Fe.addOne,addIssueTypeFieldValuesAttachments:Fe.addMany,setIssueTypeFieldValuesAttachment:Fe.setOne,setIssueTypeFieldValuesAttachments:Fe.setMany,updateIssueTypeFieldValuesAttachment:Fe.updateOne,updateIssueTypeFieldValuesAttachments:Fe.updateMany,deleteIssueTypeFieldValuesAttachment:Fe.deleteOne,deleteIssueTypeFieldValuesAttachments:Fe.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:cp,addIssueTypeFieldValuesAttachment:ap,addIssueTypeFieldValuesAttachments:Di,setIssueTypeFieldValuesAttachment:rp,setIssueTypeFieldValuesAttachments:dp,updateIssueTypeFieldValuesAttachment:up,updateIssueTypeFieldValuesAttachments:lp,deleteIssueTypeFieldValuesAttachment:op,deleteIssueTypeFieldValuesAttachments:ji}=zi.actions,hp=t=>t.issueTypeFieldValuesAttachmentReducer.instances,qi=l.createSelector([hp],t=>Object.values(t)),mp=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],pp=y(l.createSelector([qi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),yp=y(l.createSelector([qi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),fp=zi.reducer,be=O(t=>t.uuid),Sp={instances:{}},Ci=l.createSlice({name:"issueTypeIdentifiers",initialState:Sp,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Sp)),reducers:{initializeIssueTypeIdentifiers:be.initialize,addIssueTypeIdentifier:be.addOne,addIssueTypeIdentifiers:be.addMany,setIssueTypeIdentifier:be.setOne,setIssueTypeIdentifiers:be.setMany,updateIssueTypeIdentifier:be.updateOne,updateIssueTypeIdentifiers:be.updateMany,deleteIssueTypeIdentifier:be.deleteOne,deleteIssueTypeIdentifiers:be.deleteMany}}),{initializeIssueTypeIdentifiers:Ap,addIssueTypeIdentifier:Ip,addIssueTypeIdentifiers:Tp,setIssueTypeIdentifier:Pp,setIssueTypeIdentifiers:Op,updateIssueTypeIdentifier:Fp,updateIssueTypeIdentifiers:bp,deleteIssueTypeIdentifier:_p,deleteIssueTypeIdentifiers:gp}=Ci.actions,Mp=t=>t.issueTypeIdentifierReducer.instances,$i=l.createSelector([Mp],t=>Object.values(t)),Rp=t=>s=>s.issueTypeIdentifierReducer.instances[t],wp=y(l.createSelector([$i,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),R_=y(l.createSelector([$i,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),vp=Ci.reducer,_e=O(t=>t.uuid),Ep={instances:{}},Ui=l.createSlice({name:"issueTypeIdentifierValues",initialState:Ep,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Ep)),reducers:{initializeIssueTypeIdentifierValues:_e.initialize,addIssueTypeIdentifierValue:_e.addOne,addIssueTypeIdentifierValues:_e.addMany,setIssueTypeIdentifierValue:_e.setOne,setIssueTypeIdentifierValues:_e.setMany,updateIssueTypeIdentifierValue:_e.updateOne,updateIssueTypeIdentifierValues:_e.updateMany,deleteIssueTypeIdentifierValue:_e.deleteOne,deleteIssueTypeIdentifierValues:_e.deleteMany}}),{initializeIssueTypeIdentifierValues:Bp,addIssueTypeIdentifierValue:Vp,addIssueTypeIdentifierValues:zp,setIssueTypeIdentifierValue:Dp,setIssueTypeIdentifierValues:jp,updateIssueTypeIdentifierValue:qp,updateIssueTypeIdentifierValues:Cp,deleteIssueTypeIdentifierValue:$p,deleteIssueTypeIdentifierValues:Up}=Ui.actions,Lp=t=>t.issueTypeIdentifierValueReducer.instances,Jt=l.createSelector([Lp],t=>Object.values(t)),kp=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],Np=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),w_=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),v_=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type_identifier===s)))),Gp=Ui.reducer,ge=O(t=>t.uuid),Hp={instances:{}},Li=l.createSlice({name:"issueTypePriorities",initialState:Hp,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Hp)),reducers:{initializeIssueTypePriorities:ge.initialize,addIssueTypePriority:ge.addOne,addIssueTypePriorities:ge.addMany,setIssueTypePriority:ge.setOne,setIssueTypePriorities:ge.setMany,updateIssueTypePriority:ge.updateOne,updateIssueTypePriorities:ge.updateMany,deleteIssueTypePriority:ge.deleteOne,deleteIssueTypePriorities:ge.deleteMany}}),{initializeIssueTypePriorities:Wp,addIssueTypePriority:Kp,addIssueTypePriorities:Yp,setIssueTypePriority:Zp,setIssueTypePriorities:Jp,updateIssueTypePriority:Xp,updateIssueTypePriorities:Qp,deleteIssueTypePriority:xp,deleteIssueTypePriorities:ey}=Li.actions,ty=t=>t.issueTypePriorityReducer.instances,ki=l.createSelector([ty],t=>S(Object.values(t).toSorted(Dc))),Ni=t=>s=>s.issueTypePriorityReducer.instances[t],sy=y(l.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),E_=y(l.createSelector([ki,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),iy=Li.reducer,Me=O(t=>t.uuid),ny={instances:{}},Gi=l.createSlice({name:"issueTypes",initialState:ny,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ny)),reducers:{initializeIssueTypes:Me.initialize,addIssueType:Me.addOne,addIssueTypes:Me.addMany,setIssueType:Me.setOne,setIssueTypes:Me.setMany,updateIssueType:Me.updateOne,updateIssueTypes:Me.updateMany,deleteIssueType:Me.deleteOne,deleteIssueTypes:Me.deleteMany}}),{initializeIssueTypes:cy,addIssueType:ay,addIssueTypes:ry,setIssueType:dy,setIssueTypes:uy,updateIssueType:ly,updateIssueTypes:oy,deleteIssueType:hy,deleteIssueTypes:my}=Gi.actions,py=t=>t.issueTypeReducer.instances,Hi=l.createSelector(py,t=>Object.values(t)),yy=t=>s=>s.issueTypeReducer.instances[t],fy=y(l.createSelector([Hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),B_=y(l.createSelector([Hi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Sy=Gi.reducer,Re=O(t=>t.uuid),Ay={instances:{}},Wi=l.createSlice({name:"issueTypeStatuses",initialState:Ay,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ay)),reducers:{initializeIssueTypeStatuses:Re.initialize,addIssueTypeStatus:Re.addOne,addIssueTypeStatuses:Re.addMany,setIssueTypeStatus:Re.setOne,setIssueTypeStatuses:Re.setMany,updateIssueTypeStatus:Re.updateOne,updateIssueTypeStatuses:Re.updateMany,deleteIssueTypeStatus:Re.deleteOne,deleteIssueTypeStatuses:Re.deleteMany}}),{initializeIssueTypeStatuses:Iy,addIssueTypeStatus:Ty,addIssueTypeStatuses:Py,setIssueTypeStatus:Oy,setIssueTypeStatuses:Fy,updateIssueTypeStatus:by,updateIssueTypeStatuses:_y,deleteIssueTypeStatus:gy,deleteIssueTypeStatuses:My}=Wi.actions,Ry=t=>t.issueTypeStatusReducer.instances,Ki=l.createSelector([Ry],t=>S(Object.values(t).toSorted(zc))),Yi=t=>s=>s.issueTypeStatusReducer.instances[t],wy=y(l.createSelector([Ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),V_=y(l.createSelector([Ki,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),vy=Wi.reducer,we=O(t=>t.uuid),Ey={instances:{}},Zi=l.createSlice({name:"issueUpdates",initialState:Ey,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Ey)),reducers:{initializeIssueUpdates:we.initialize,addIssueUpdate:we.addOne,addIssueUpdates:we.addMany,setIssueUpdate:we.setOne,setIssueUpdates:we.setMany,updateIssueUpdate:we.updateOne,updateIssueUpdates:we.updateMany,deleteIssueUpdate:we.deleteOne,deleteIssueUpdates:we.deleteMany}}),{initializeIssueUpdates:By,addIssueUpdate:Ji,addIssueUpdates:Xi,setIssueUpdate:Vy,setIssueUpdates:zy,updateIssueUpdate:Dy,updateIssueUpdates:jy,deleteIssueUpdate:Qi,deleteIssueUpdates:xi}=Zi.actions,en=t=>t.issueUpdateReducer.instances,tn=l.createSelector([en],t=>Object.values(t)),qy=y(l.createSelector([en,(t,s)=>s],(t,s)=>t[s])),Cy=y(l.createSelector([tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),$y=y(l.createSelector([tn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),Uy=Zi.reducer,ve=O(t=>t.id),Ly={instances:{},currentUser:null},sn=l.createSlice({name:"users",initialState:Ly,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Ly)).addCase(F,s=>Object.assign(s,{...s,instances:[]})),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,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:ky,setUsers:Ny,setUser:Gy,addUsers:Hy,addUser:nn,updateUsers:Wy,updateUser:Ky,deleteUser:cn,deleteUsers:Yy,setCurrentUser:z_,setCurrentUserProfile:D_}=sn.actions,Zy=sn.reducer,Jy=t=>t.userReducer.currentUser,an=t=>t.userReducer.instances,Xt=l.createSelector([an],t=>Object.values(t)),Qt=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)))})),Ee=O(t=>t.uuid),Qy={instances:{}},rn=l.createSlice({name:"organizationAccess",initialState:Qy,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Qy)),reducers:{initializeOrganizationAccesses:Ee.initialize,addOrganizationAccess:Ee.addOne,addOrganizationAccesses:Ee.addMany,setOrganizationAccess:Ee.setOne,setOrganizationAccesses:Ee.setMany,updateOrganizationAccess:Ee.updateOne,updateOrganizationAccesses:Ee.updateMany,deleteOrganizationAccess:Ee.deleteOne,deleteOrganizationAccesses:Ee.deleteMany}}),{initializeOrganizationAccesses:xy,addOrganizationAccess:ef,addOrganizationAccesses:tf,setOrganizationAccess:sf,setOrganizationAccesses:nf,updateOrganizationAccess:cf,updateOrganizationAccesses:af,deleteOrganizationAccess:rf,deleteOrganizationAccesses:df}=rn.actions,uf=rn.reducer,xt=t=>t.organizationAccessReducer.instances,lf=t=>s=>s.organizationAccessReducer.instances[t],of=y(l.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(Object.values(t).filter(({uuid:n})=>e.has(n)))})),j_=l.createSelector([Jy,xt],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),hf=l.createSelector([xt],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return ls(s)}),q_=y(l.createSelector([an,hf,(t,s)=>s],(t,s,e)=>S(Object.values(t).filter(n=>{const c=s[n.id];return!!c&&c.organization===e})))),Be=O(t=>t.uuid),mf={instances:{}},dn=l.createSlice({name:"organizations",initialState:mf,extraReducers:t=>t.addMatcher(l.isAnyOf(T),s=>Object.assign(s,mf)),reducers:{initializeOrganizations:Be.initialize,setOrganizations:Be.setMany,setOrganization:Be.setOne,addOrganizations:Be.addMany,addOrganization:Be.addOne,updateOrganizations:Be.updateMany,updateOrganization:Be.updateOne,deleteOrganization:Be.deleteOne,deleteOrganizations:Be.deleteMany}}),{initializeOrganizations:pf,setOrganizations:yf,setOrganization:ff,addOrganizations:Sf,addOrganization:Af,updateOrganizations:If,updateOrganization:Tf,deleteOrganization:Pf,deleteOrganizations:Of}=dn.actions,Ff=t=>t.organizationReducer.instances,bf=l.createSelector([Ff],t=>Object.values(t)),_f=t=>s=>s.organizationReducer.instances[t],gf=y(l.createSelector([bf,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Mf=dn.reducer,Rf=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:rt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},wf={deletedRequests:[],latestRetryTime:0},un=l.createSlice({name:"outbox",initialState:wf,extraReducers:t=>t.addCase(T,s=>Object.assign(s,wf)),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 Rf(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}}}),C_=t=>t.outboxReducer.deletedRequests,$_=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:vf,markForDeletion:U_,markAsDeleted:Ef,_setLatestRetryTime:Bf}=un.actions,Vf=un.reducer,Ve=O(t=>t.uuid),zf={instances:{}},ln=l.createSlice({name:"projectAccess",initialState:zf,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,zf)),reducers:{initializeProjectAccesses:Ve.initialize,addProjectAccess:Ve.addOne,addProjectAccesses:Ve.addMany,setProjectAccess:Ve.setOne,setProjectAccesses:Ve.setMany,updateProjectAccess:Ve.updateOne,updateProjectAccesses:Ve.updateMany,deleteProjectAccess:Ve.deleteOne,deleteProjectAccesses:Ve.deleteMany}}),{initializeProjectAccesses:Df,addProjectAccess:jf,addProjectAccesses:qf,setProjectAccess:Cf,setProjectAccesses:$f,updateProjectAccess:Uf,updateProjectAccesses:Lf,deleteProjectAccess:kf,deleteProjectAccesses:Nf}=ln.actions,Gf=ln.reducer,on=t=>t.projectAccessReducer.instances,wt=l.createSelector(on,t=>Object.values(t)),Hf=t=>s=>s.projectAccessReducer.instances[t],Wf=y(l.createSelector([wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),L_=y(l.createSelector([on,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.project===s)))),k_=y(l.createSelector([wt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(c=>c.project===s))e[n.user]=n;return e})),N_=y(l.createSelector([Xt,wt,(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)))})),ze=O(t=>t.uuid),Kf={instances:{}},hn=l.createSlice({name:"projectAttachments",initialState:Kf,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Kf)),reducers:{initializeProjectAttachments:ze.initialize,addProjectAttachment:ze.addOne,addProjectAttachments:ze.addMany,setProjectAttachment:ze.setOne,setProjectAttachments:ze.setMany,updateProjectAttachment:ze.updateOne,updateProjectAttachments:ze.updateMany,deleteProjectAttachment:ze.deleteOne,deleteProjectAttachments:ze.deleteMany}}),{initializeProjectAttachments:Yf,addProjectAttachment:Zf,addProjectAttachments:Jf,setProjectAttachment:Xf,setProjectAttachments:Qf,updateProjectAttachment:xf,updateProjectAttachments:eS,deleteProjectAttachment:tS,deleteProjectAttachments:sS}=hn.actions,iS=t=>t.projectAttachmentReducer.instances,mn=l.createSelector([iS],t=>Object.values(t)),nS=t=>s=>s.projectAttachmentReducer.instances[t],cS=y(l.createSelector([mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),G_=y(l.createSelector([mn,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>s===e)))),aS=hn.reducer,De=O(t=>t.uuid),rS={instances:{}},pn=l.createSlice({name:"projectComments",initialState:rS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,rS)),reducers:{initializeProjectComments:De.initialize,addProjectComment:De.addOne,addProjectComments:De.addMany,setProjectComment:De.setOne,setProjectComments:De.setMany,updateProjectComment:De.updateOne,updateProjectComments:De.updateMany,deleteProjectComment:De.deleteOne,deleteProjectComments:De.deleteMany}}),{initializeProjectComments:dS,addProjectComment:uS,addProjectComments:lS,setProjectComment:oS,setProjectComments:hS,updateProjectComment:mS,updateProjectComments:pS,deleteProjectComment:yS,deleteProjectComments:fS}=pn.actions,SS=t=>t.projectCommentReducer.instances,es=l.createSelector([SS],t=>S(Object.values(t).toSorted(yt))),AS=t=>s=>s.projectCommentReducer.instances[t],IS=y(l.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),H_=y(l.createSelector([es,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),W_=y(l.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.project)))})),TS=pn.reducer,je=O(t=>t.uuid),PS={instances:{}},yn=l.createSlice({name:"projectFiles",initialState:PS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,PS)),reducers:{initializeProjectFiles:je.initialize,setProjectFile:je.setOne,setProjectFiles:je.setMany,addProjectFile:je.addOne,addProjectFiles:je.addMany,updateProjectFile:je.updateOne,updateProjectFiles:je.updateMany,deleteProjectFile:je.deleteOne,deleteProjectFiles:je.deleteMany}}),{initializeProjectFiles:OS,setProjectFile:FS,setProjectFiles:bS,addProjectFile:_S,addProjectFiles:gS,updateProjectFile:MS,updateProjectFiles:RS,deleteProjectFile:wS,deleteProjectFiles:vS}=yn.actions,ES=t=>t.projectFileReducer.instances,BS=l.createSelector([ES],t=>S(Object.values(t).toSorted((s,e)=>s.z_index-e.z_index))),VS=t=>s=>s.projectFileReducer.instances[t],zS=y(l.createSelector([BS,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),DS=yn.reducer,qe=O(t=>t.uuid),jS={instances:{}},fn=l.createSlice({name:"projects",initialState:jS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,jS)),reducers:{initializeProjects:qe.initialize,setProjects:qe.setMany,setProject:qe.setOne,addProjects:qe.addMany,addProject:qe.addOne,updateProjects:qe.updateMany,updateProject:qe.updateOne,deleteProject:qe.deleteOne,deleteProjects:qe.deleteMany}}),{initializeProjects:qS,setProjects:CS,setProject:$S,addProjects:US,addProject:LS,updateProjects:kS,updateProject:NS,deleteProject:GS,deleteProjects:HS}=fn.actions,WS=fn.reducer,KS=t=>t.projectReducer.instances,ts=l.createSelector([KS],t=>Object.values(t)),YS=t=>s=>s.projectReducer.instances[t],ZS=y(l.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),K_=y(l.createSelector([ts,wt,(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)))})),Y_=y(l.createSelector([ts,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Ce=O(({uuid:t})=>t),JS={instances:{}},Sn=l.createSlice({name:"procedureInitiatives",initialState:JS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,JS)),reducers:{initializeProcedureInitiatives:Ce.initialize,addProcedureInitiative:Ce.addOne,addProcedureInitiatives:Ce.addMany,setProcedureInitiative:Ce.setOne,setProcedureInitiatives:Ce.setMany,updateProcedureInitiative:Ce.updateOne,updateProcedureInitiatives:Ce.updateMany,deleteProcedureInitiative:Ce.deleteOne,deleteProcedureInitiatives:Ce.deleteMany}}),{initializeProcedureInitiatives:XS,addProcedureInitiative:QS,addProcedureInitiatives:xS,setProcedureInitiative:eA,setProcedureInitiatives:tA,updateProcedureInitiative:sA,updateProcedureInitiatives:iA,deleteProcedureInitiative:nA,deleteProcedureInitiatives:cA}=Sn.actions,aA=Sn.reducer,rA=t=>t.procedureInitiativeReducer.instances,ss=l.createSelector([rA],t=>Object.values(t)),dA=t=>s=>s.procedureInitiativeReducer.instances[t],uA=y(l.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Z_=y(l.createSelector([ss,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),J_=y(l.createSelector([ss,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),$e=O(({uuid:t})=>t),lA={instances:{}},An=l.createSlice({name:"procedures",initialState:lA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,lA)),reducers:{initializeProcedures:$e.initialize,addProcedure:$e.addOne,addProcedures:$e.addMany,setProcedure:$e.setOne,setProcedures:$e.setMany,updateProcedure:$e.updateOne,updateProcedures:$e.updateMany,deleteProcedure:$e.deleteOne,deleteProcedures:$e.deleteMany}}),{initializeProcedures:oA,addProcedure:hA,addProcedures:It,setProcedure:mA,setProcedures:pA,updateProcedure:yA,updateProcedures:fA,deleteProcedure:SA,deleteProcedures:Tt}=An.actions,AA=An.reducer,IA=t=>t.procedureReducer.instances,dt=l.createSelector([IA],t=>Object.values(t)),TA=t=>s=>s.procedureReducer.instances[t],PA=y(l.createSelector([dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),X_=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),OA=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),FA=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),bA=y(l.createSelector([dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({asset:n})=>e.has(n)))})),_A=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_initiative===s)))),Ue=O(t=>t.uuid),gA={instances:{}},In=l.createSlice({name:"procedureStepAssignees",initialState:gA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,gA)),reducers:{initializeProcedureStepAssignees:Ue.initialize,addProcedureStepAssignee:Ue.addOne,addProcedureStepAssignees:Ue.addMany,setProcedureStepAssignee:Ue.setOne,setProcedureStepAssignees:Ue.setMany,updateProcedureStepAssignee:Ue.updateOne,updateProcedureStepAssignees:Ue.updateMany,deleteProcedureStepAssignee:Ue.deleteOne,deleteProcedureStepAssignees:Ue.deleteMany}}),{initializeProcedureStepAssignees:MA,addProcedureStepAssignee:RA,addProcedureStepAssignees:wA,setProcedureStepAssignee:vA,setProcedureStepAssignees:EA,updateProcedureStepAssignee:BA,updateProcedureStepAssignees:VA,deleteProcedureStepAssignee:zA,deleteProcedureStepAssignees:DA}=In.actions,jA=t=>t.procedureStepAssigneeReducer.instances,vt=l.createSelector([jA],t=>Object.values(t)),qA=t=>s=>s.procedureStepAssigneeReducer.instances[t],CA=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)))),$A=In.reducer,Le=O(t=>t.uuid),UA={instances:{}},Tn=l.createSlice({name:"procedureStepComments",initialState:UA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,UA)),reducers:{initializeProcedureStepComments:Le.initialize,addProcedureStepComment:Le.addOne,addProcedureStepComments:Le.addMany,setProcedureStepComment:Le.setOne,setProcedureStepComments:Le.setMany,updateProcedureStepComment:Le.updateOne,updateProcedureStepComments:Le.updateMany,deleteProcedureStepComment:Le.deleteOne,deleteProcedureStepComments:Le.deleteMany}}),{initializeProcedureStepComments:LA,addProcedureStepComment:kA,addProcedureStepComments:NA,setProcedureStepComment:GA,setProcedureStepComments:HA,updateProcedureStepComment:WA,updateProcedureStepComments:KA,deleteProcedureStepComment:YA,deleteProcedureStepComments:ZA}=Tn.actions,JA=t=>t.procedureStepCommentReducer.instances,Et=l.createSelector([JA],t=>Object.values(t)),XA=t=>s=>s.procedureStepCommentReducer.instances[t],QA=y(l.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),tg=y(l.createSelector([Et,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),sg=y(l.createSelector([Et,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),ig=y(l.createSelector([Et,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),xA=Tn.reducer,ke=O(t=>t.uuid),eI={instances:{}},Pn=l.createSlice({name:"procedureStepDefaultAssignees",initialState:eI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,eI)),reducers:{initializeProcedureStepDefaultAssignees:ke.initialize,addProcedureStepDefaultAssignee:ke.addOne,addProcedureStepDefaultAssignees:ke.addMany,setProcedureStepDefaultAssignee:ke.setOne,setProcedureStepDefaultAssignees:ke.setMany,updateProcedureStepDefaultAssignee:ke.updateOne,updateProcedureStepDefaultAssignees:ke.updateMany,deleteProcedureStepDefaultAssignee:ke.deleteOne,deleteProcedureStepDefaultAssignees:ke.deleteMany}}),{initializeProcedureStepDefaultAssignees:tI,addProcedureStepDefaultAssignee:sI,addProcedureStepDefaultAssignees:iI,setProcedureStepDefaultAssignee:nI,setProcedureStepDefaultAssignees:cI,updateProcedureStepDefaultAssignee:aI,updateProcedureStepDefaultAssignees:rI,deleteProcedureStepDefaultAssignee:dI,deleteProcedureStepDefaultAssignees:uI}=Pn.actions,lI=t=>t.procedureStepDefaultAssigneeReducer.instances,On=l.createSelector([lI],t=>Object.values(t)),oI=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],hI=y(l.createSelector([On,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ng=y(l.createSelector([On,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),mI=Pn.reducer,Ne=O(t=>t.uuid),pI={instances:{}},Fn=l.createSlice({name:"procedureStepDefaultReviewers",initialState:pI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,pI)),reducers:{initializeProcedureStepDefaultReviewers:Ne.initialize,addProcedureStepDefaultReviewer:Ne.addOne,addProcedureStepDefaultReviewers:Ne.addMany,setProcedureStepDefaultReviewer:Ne.setOne,setProcedureStepDefaultReviewers:Ne.setMany,updateProcedureStepDefaultReviewer:Ne.updateOne,updateProcedureStepDefaultReviewers:Ne.updateMany,deleteProcedureStepDefaultReviewer:Ne.deleteOne,deleteProcedureStepDefaultReviewers:Ne.deleteMany}}),{initializeProcedureStepDefaultReviewers:yI,addProcedureStepDefaultReviewer:fI,addProcedureStepDefaultReviewers:SI,setProcedureStepDefaultReviewer:AI,setProcedureStepDefaultReviewers:II,updateProcedureStepDefaultReviewer:TI,updateProcedureStepDefaultReviewers:PI,deleteProcedureStepDefaultReviewer:OI,deleteProcedureStepDefaultReviewers:FI}=Fn.actions,bI=t=>t.procedureStepDefaultReviewerReducer.instances,bn=l.createSelector([bI],t=>Object.values(t)),_I=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],gI=y(l.createSelector([bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),cg=y(l.createSelector([bn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),MI=Fn.reducer,Ge=O(t=>t.uuid),RI={instances:{}},_n=l.createSlice({name:"procedureStepEvents",initialState:RI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,RI)),reducers:{initializeProcedureStepEvents:Ge.initialize,addProcedureStepEvent:Ge.addOne,addProcedureStepEvents:Ge.addMany,setProcedureStepEvent:Ge.setOne,setProcedureStepEvents:Ge.setMany,updateProcedureStepEvent:Ge.updateOne,updateProcedureStepEvents:Ge.updateMany,deleteProcedureStepEvent:Ge.deleteOne,deleteProcedureStepEvents:Ge.deleteMany}}),{initializeProcedureStepEvents:wI,addProcedureStepEvent:vI,addProcedureStepEvents:EI,setProcedureStepEvent:BI,setProcedureStepEvents:VI,updateProcedureStepEvent:zI,updateProcedureStepEvents:DI,deleteProcedureStepEvent:jI,deleteProcedureStepEvents:qI}=_n.actions,CI=t=>t.procedureStepEventReducer.instances,Bt=l.createSelector([CI],t=>Object.values(t)),$I=t=>s=>s.procedureStepEventReducer.instances[t],UI=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ag=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),rg=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),dg=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)))),LI=_n.reducer,He=O(t=>t.uuid),kI={instances:{}},gn=l.createSlice({name:"procedureStepFieldsAttachments",initialState:kI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,kI)),reducers:{initializeProcedureStepFieldsAttachments:He.initialize,addProcedureStepFieldsAttachment:He.addOne,addProcedureStepFieldsAttachments:He.addMany,setProcedureStepFieldsAttachment:He.setOne,setProcedureStepFieldsAttachments:He.setMany,updateProcedureStepFieldsAttachment:He.updateOne,updateProcedureStepFieldsAttachments:He.updateMany,deleteProcedureStepFieldsAttachment:He.deleteOne,deleteProcedureStepFieldsAttachments:He.deleteMany}}),{initializeProcedureStepFieldsAttachments:NI,addProcedureStepFieldsAttachment:GI,addProcedureStepFieldsAttachments:Mn,setProcedureStepFieldsAttachment:HI,setProcedureStepFieldsAttachments:WI,updateProcedureStepFieldsAttachment:KI,updateProcedureStepFieldsAttachments:YI,deleteProcedureStepFieldsAttachment:ZI,deleteProcedureStepFieldsAttachments:Rn}=gn.actions,JI=t=>t.procedureStepFieldsAttachmentReducer.instances,wn=l.createSelector([JI],t=>Object.values(t)),XI=y(l.createSelector([wn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),QI=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],xI=y(l.createSelector([wn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),eT=gn.reducer,We=O(t=>t.uuid),tT={instances:{}},vn=l.createSlice({name:"procedureStepFields",initialState:tT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,tT)),reducers:{initializeProcedureStepFields:We.initialize,addProcedureStepFields:We.addOne,addProcedureStepFieldsMany:We.addMany,setProcedureStepFields:We.setOne,setProcedureStepFieldsMany:We.setMany,updateProcedureStepFields:We.updateOne,updateProcedureStepFieldsMany:We.updateMany,deleteProcedureStepFields:We.deleteOne,deleteProcedureStepFieldsMany:We.deleteMany}}),{initializeProcedureStepFields:sT,addProcedureStepFields:iT,addProcedureStepFieldsMany:nT,setProcedureStepFields:cT,setProcedureStepFieldsMany:aT,updateProcedureStepFields:rT,updateProcedureStepFieldsMany:dT,deleteProcedureStepFields:uT,deleteProcedureStepFieldsMany:lT}=vn.actions,En=t=>t.procedureStepFieldsReducer.instances,is=l.createSelector([En],t=>Object.values(t)),ug=y(l.createSelector([is,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),lg=y(l.createSelector([is,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).toSorted(yt).pop())),og=l.createSelector([En],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}),oT=t=>s=>s.procedureStepFieldsReducer.instances[t],hT=y(l.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),mT=vn.reducer,Ke=O(t=>t.uuid),pT={instances:{}},Bn=l.createSlice({name:"procedureStepFieldValuesAttachments",initialState:pT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,pT)),reducers:{initializeProcedureStepFieldValuesAttachments:Ke.initialize,addProcedureStepFieldValuesAttachment:Ke.addOne,addProcedureStepFieldValuesAttachments:Ke.addMany,setProcedureStepFieldValuesAttachment:Ke.setOne,setProcedureStepFieldValuesAttachments:Ke.setMany,updateProcedureStepFieldValuesAttachment:Ke.updateOne,updateProcedureStepFieldValuesAttachments:Ke.updateMany,deleteProcedureStepFieldValuesAttachment:Ke.deleteOne,deleteProcedureStepFieldValuesAttachments:Ke.deleteMany}}),{initializeProcedureStepFieldValuesAttachments:yT,addProcedureStepFieldValuesAttachment:fT,addProcedureStepFieldValuesAttachments:Vn,setProcedureStepFieldValuesAttachment:ST,setProcedureStepFieldValuesAttachments:AT,updateProcedureStepFieldValuesAttachment:IT,updateProcedureStepFieldValuesAttachments:TT,deleteProcedureStepFieldValuesAttachment:PT,deleteProcedureStepFieldValuesAttachments:zn}=Bn.actions,OT=t=>t.procedureStepFieldValuesAttachmentReducer.instances,Dn=l.createSelector([OT],t=>Object.values(t)),FT=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],bT=y(l.createSelector([Dn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),_T=y(l.createSelector([Dn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),gT=Bn.reducer,Ye=O(t=>t.uuid),MT={instances:{}},jn=l.createSlice({name:"procedureStepFieldValues",initialState:MT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,MT)),reducers:{initializeProcedureStepFieldValues:Ye.initialize,addProcedureStepFieldValues:Ye.addOne,addProcedureStepFieldValuesMany:Ye.addMany,setProcedureStepFieldValues:Ye.setOne,setProcedureStepFieldValuesMany:Ye.setMany,updateProcedureStepFieldValues:Ye.updateOne,updateProcedureStepFieldValuesMany:Ye.updateMany,deleteProcedureStepFieldValues:Ye.deleteOne,deleteProcedureStepFieldValuesMany:Ye.deleteMany}}),{initializeProcedureStepFieldValues:RT,addProcedureStepFieldValues:wT,addProcedureStepFieldValuesMany:vT,setProcedureStepFieldValues:ET,setProcedureStepFieldValuesMany:BT,updateProcedureStepFieldValues:VT,updateProcedureStepFieldValuesMany:zT,deleteProcedureStepFieldValues:DT,deleteProcedureStepFieldValuesMany:jT}=jn.actions,qT=jn.reducer,CT=t=>t.procedureStepFieldValuesReducer.instances,ut=l.createSelector([CT],t=>Object.values(t)),hg=y(l.createSelector([ut,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),mg=y(l.createSelector([ut,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),$T=t=>s=>s.procedureStepFieldValuesReducer.instances[t],UT=y(l.createSelector([ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),pg=y(l.createSelector([ut,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),Ze=O(t=>t.uuid),LT={instances:{}},qn=l.createSlice({name:"procedureStepFieldValuesReviews",initialState:LT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,LT)),reducers:{initializeProcedureStepFieldValuesReviews:Ze.initialize,addProcedureStepFieldValuesReview:Ze.addOne,addProcedureStepFieldValuesReviews:Ze.addMany,setProcedureStepFieldValuesReview:Ze.setOne,setProcedureStepFieldValuesReviews:Ze.setMany,updateProcedureStepFieldValuesReview:Ze.updateOne,updateProcedureStepFieldValuesReviews:Ze.updateMany,deleteProcedureStepFieldValuesReview:Ze.deleteOne,deleteProcedureStepFieldValuesReviews:Ze.deleteMany}}),{initializeProcedureStepFieldValuesReviews:kT,addProcedureStepFieldValuesReview:NT,addProcedureStepFieldValuesReviews:Cn,setProcedureStepFieldValuesReview:GT,setProcedureStepFieldValuesReviews:HT,updateProcedureStepFieldValuesReview:WT,updateProcedureStepFieldValuesReviews:KT,deleteProcedureStepFieldValuesReview:YT,deleteProcedureStepFieldValuesReviews:$n}=qn.actions,ZT=t=>t.procedureStepFieldValuesReviewReducer.instances,lt=l.createSelector([ZT],t=>Object.values(t)),JT=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],XT=y(l.createSelector([lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),QT=y(l.createSelector([lt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),yg=y(l.createSelector([lt,(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})),fg=y(l.createSelector([ut,lt,(t,s)=>s],(t,s,e)=>{const n=new Set(E(t.filter(({procedure:c})=>e===c)));return S(s.filter(({field_values:c})=>n.has(c)))})),Sg=y(l.createSelector([ut,lt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const c=new Set(E(t.filter(({procedure_step:r,procedure:a})=>e===a&&r===n)));return S(s.filter(({field_values:r})=>c.has(r)))})),Ag=l.createSelector([lt],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}),xT=qn.reducer,Je=O(t=>t.uuid),eP={instances:{}},Un=l.createSlice({name:"procedureStepReviewers",initialState:eP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,eP)),reducers:{initializeProcedureStepReviewers:Je.initialize,addProcedureStepReviewer:Je.addOne,addProcedureStepReviewers:Je.addMany,setProcedureStepReviewer:Je.setOne,setProcedureStepReviewers:Je.setMany,updateProcedureStepReviewer:Je.updateOne,updateProcedureStepReviewers:Je.updateMany,deleteProcedureStepReviewer:Je.deleteOne,deleteProcedureStepReviewers:Je.deleteMany}}),{initializeProcedureStepReviewers:tP,addProcedureStepReviewer:sP,addProcedureStepReviewers:iP,setProcedureStepReviewer:nP,setProcedureStepReviewers:cP,updateProcedureStepReviewer:aP,updateProcedureStepReviewers:rP,deleteProcedureStepReviewer:dP,deleteProcedureStepReviewers:uP}=Un.actions,lP=t=>t.procedureStepReviewerReducer.instances,Vt=l.createSelector([lP],t=>Object.values(t)),oP=t=>s=>s.procedureStepReviewerReducer.instances[t],hP=y(l.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Ig=y(l.createSelector([Vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),Tg=y(l.createSelector([Vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),Pg=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)))),mP=Un.reducer,Xe=O(t=>t.uuid),pP={instances:{}},Ln=l.createSlice({name:"procedureSteps",initialState:pP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,pP)),reducers:{initializeProcedureSteps:Xe.initialize,setProcedureStep:Xe.setOne,setProcedureSteps:Xe.setMany,addProcedureStep:Xe.addOne,addProcedureSteps:Xe.addMany,updateProcedureStep:Xe.updateOne,updateProcedureSteps:Xe.updateMany,deleteProcedureStep:Xe.deleteOne,deleteProcedureSteps:Xe.deleteMany}}),{initializeProcedureSteps:yP,setProcedureStep:fP,setProcedureSteps:SP,addProcedureStep:AP,addProcedureSteps:IP,updateProcedureStep:TP,updateProcedureSteps:PP,deleteProcedureStep:OP,deleteProcedureSteps:FP}=Ln.actions,bP=Ln.reducer,kn=t=>t.procedureStepReducer.instances,_P=t=>s=>s.procedureStepReducer.instances[t],Nn=l.createSelector([kn],t=>Object.values(t).toSorted((s,e)=>s.order-e.order)),Og=y(l.createSelector([kn,(t,s)=>s],(t,s)=>{const e={};for(const[n,c]of Object.entries(t))c.procedure_type===s&&(e[n]=c);return ls(e)})),Fg=y(l.createSelector([Nn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),gP=y(l.createSelector([Nn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Qe=O(({uuid:t})=>t),MP={instances:{}},Gn=l.createSlice({name:"procedureTypeAttachments",initialState:MP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,MP)),reducers:{initializeProcedureTypeAttachments:Qe.initialize,addProcedureTypeAttachment:Qe.addOne,addProcedureTypeAttachments:Qe.addMany,setProcedureTypeAttachment:Qe.setOne,setProcedureTypeAttachments:Qe.setMany,updateProcedureTypeAttachment:Qe.updateOne,updateProcedureTypeAttachments:Qe.updateMany,deleteProcedureTypeAttachment:Qe.deleteOne,deleteProcedureTypeAttachments:Qe.deleteMany}}),{initializeProcedureTypeAttachments:RP,addProcedureTypeAttachment:wP,addProcedureTypeAttachments:vP,setProcedureTypeAttachment:EP,setProcedureTypeAttachments:BP,updateProcedureTypeAttachment:VP,updateProcedureTypeAttachments:zP,deleteProcedureTypeAttachment:DP,deleteProcedureTypeAttachments:jP}=Gn.actions,qP=Gn.reducer,CP=t=>t.procedureTypeAttachmentReducer.instances,Hn=l.createSelector([CP],t=>Object.values(t)),$P=t=>s=>s.procedureTypeAttachmentReducer.instances[t],UP=y(l.createSelector([Hn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),bg=y(l.createSelector([Hn,(t,s)=>s],(t,s)=>S(t.filter(({procedure_type:e})=>s===e)))),xe=O(({uuid:t})=>t),LP={instances:{}},Wn=l.createSlice({name:"procedureTypeFieldsAttachments",initialState:LP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,LP)),reducers:{initializeProcedureTypeFieldsAttachments:xe.initialize,addProcedureTypeFieldsAttachment:xe.addOne,addProcedureTypeFieldsAttachments:xe.addMany,setProcedureTypeFieldsAttachment:xe.setOne,setProcedureTypeFieldsAttachments:xe.setMany,updateProcedureTypeFieldsAttachment:xe.updateOne,updateProcedureTypeFieldsAttachments:xe.updateMany,deleteProcedureTypeFieldsAttachment:xe.deleteOne,deleteProcedureTypeFieldsAttachments:xe.deleteMany}}),{initializeProcedureTypeFieldsAttachments:kP,addProcedureTypeFieldsAttachment:NP,addProcedureTypeFieldsAttachments:GP,setProcedureTypeFieldsAttachment:HP,setProcedureTypeFieldsAttachments:WP,updateProcedureTypeFieldsAttachment:KP,updateProcedureTypeFieldsAttachments:YP,deleteProcedureTypeFieldsAttachment:ZP,deleteProcedureTypeFieldsAttachments:JP}=Wn.actions,XP=Wn.reducer,QP=t=>t.procedureTypeFieldsAttachmentReducer.instances,Kn=l.createSelector([QP],t=>Object.values(t)),_g=y(l.createSelector([Kn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),xP=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],eO=y(l.createSelector([Kn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),et=O(({uuid:t})=>t),tO={instances:{}},Yn=l.createSlice({name:"procedureTypeFields",initialState:tO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,tO)),reducers:{initializeProcedureTypeFields:et.initialize,addProcedureTypeFields:et.addOne,addProcedureTypeFieldsMany:et.addMany,setProcedureTypeFields:et.setOne,setProcedureTypeFieldsMany:et.setMany,updateProcedureTypeFields:et.updateOne,updateProcedureTypeFieldsMany:et.updateMany,deleteProcedureTypeFields:et.deleteOne,deleteProcedureTypeFieldsMany:et.deleteMany}}),{initializeProcedureTypeFields:sO,addProcedureTypeFields:iO,addProcedureTypeFieldsMany:nO,setProcedureTypeFields:cO,setProcedureTypeFieldsMany:aO,updateProcedureTypeFields:rO,updateProcedureTypeFieldsMany:dO,deleteProcedureTypeFields:uO,deleteProcedureTypeFieldsMany:lO}=Yn.actions,oO=Yn.reducer,hO=t=>t.procedureTypeFieldsReducer.instances,ns=l.createSelector([hO],t=>Object.values(t)),gg=y(l.createSelector([ns,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),Mg=y(l.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),mO=t=>s=>s.procedureTypeFieldsReducer.instances[t],pO=y(l.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),tt=O(({uuid:t})=>t),yO={instances:{}},Zn=l.createSlice({name:"procedureFieldValuesAttachments",initialState:yO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,yO)),reducers:{initializeProcedureFieldValuesAttachments:tt.initialize,addProcedureFieldValuesAttachment:tt.addOne,addProcedureFieldValuesAttachments:tt.addMany,setProcedureFieldValuesAttachment:tt.setOne,setProcedureFieldValuesAttachments:tt.setMany,updateProcedureFieldValuesAttachment:tt.updateOne,updateProcedureFieldValuesAttachments:tt.updateMany,deleteProcedureFieldValuesAttachment:tt.deleteOne,deleteProcedureFieldValuesAttachments:tt.deleteMany}}),{initializeProcedureFieldValuesAttachments:fO,addProcedureFieldValuesAttachment:SO,addProcedureFieldValuesAttachments:Jn,setProcedureFieldValuesAttachment:AO,setProcedureFieldValuesAttachments:IO,updateProcedureFieldValuesAttachment:TO,updateProcedureFieldValuesAttachments:PO,deleteProcedureFieldValuesAttachment:OO,deleteProcedureFieldValuesAttachments:Xn}=Zn.actions,FO=Zn.reducer,bO=t=>t.procedureFieldValuesAttachmentReducer.instances,Qn=l.createSelector([bO],t=>Object.values(t)),_O=t=>s=>s.procedureFieldValuesAttachmentReducer.instances[t],gO=y(l.createSelector([Qn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),MO=y(l.createSelector([Qn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),st=O(({uuid:t})=>t),RO={instances:{}},xn=l.createSlice({name:"procedureFieldValues",initialState:RO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,RO)),reducers:{initializeProcedureFieldValues:st.initialize,addProcedureFieldValues:st.addOne,addProcedureFieldValuesMany:st.addMany,setProcedureFieldValues:st.setOne,setProcedureFieldValuesMany:st.setMany,updateProcedureFieldValues:st.updateOne,updateProcedureFieldValuesMany:st.updateMany,deleteProcedureFieldValues:st.deleteOne,deleteProcedureFieldValuesMany:st.deleteMany}}),{initializeProcedureFieldValues:wO,addProcedureFieldValues:vO,addProcedureFieldValuesMany:EO,setProcedureFieldValues:BO,setProcedureFieldValuesMany:VO,updateProcedureFieldValues:zO,updateProcedureFieldValuesMany:DO,deleteProcedureFieldValues:jO,deleteProcedureFieldValuesMany:qO}=xn.actions,CO=xn.reducer,$O=t=>t.procedureFieldValuesReducer.instances,ec=l.createSelector([$O],t=>Object.values(t)),Rg=y(l.createSelector([ec,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),UO=t=>s=>s.procedureFieldValuesReducer.instances[t],LO=y(l.createSelector([ec,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),it=O(t=>t.uuid),kO={instances:{}},tc=l.createSlice({name:"procedureTypes",initialState:kO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,kO)),reducers:{initializeProcedureTypes:it.initialize,addProcedureType:it.addOne,addProcedureTypes:it.addMany,setProcedureType:it.setOne,setProcedureTypes:it.setMany,updateProcedureType:it.updateOne,updateProcedureTypes:it.updateMany,deleteProcedureType:it.deleteOne,deleteProcedureTypes:it.deleteMany}}),{initializeProcedureTypes:NO,addProcedureType:GO,addProcedureTypes:HO,setProcedureType:WO,setProcedureTypes:KO,updateProcedureType:YO,updateProcedureTypes:ZO,deleteProcedureType:JO,deleteProcedureTypes:XO}=tc.actions,QO=tc.reducer,xO=t=>t.procedureTypeReducer.instances,sc=l.createSelector([xO],t=>Object.values(t)),eF=t=>s=>s.procedureTypeReducer.instances[t],tF=y(l.createSelector([sc,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),wg=y(l.createSelector([sc,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),vg={isRehydrated:!1},ic=l.createSlice({name:"rehydrated",initialState:vg,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:Eg}=ic.actions,Bg=t=>t.rehydratedReducer.isRehydrated,sF=ic.reducer,nt=O(t=>t.uuid),iF={instances:{}},nc=l.createSlice({name:"teamMemberships",initialState:iF,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,iF)),reducers:{initializeTeamMemberships:nt.initialize,addTeamMembership:nt.addOne,addTeamMemberships:nt.addMany,setTeamMembership:nt.setOne,setTeamMemberships:nt.setMany,updateTeamMembership:nt.updateOne,updateTeamMemberships:nt.updateMany,deleteTeamMembership:nt.deleteOne,deleteTeamMemberships:nt.deleteMany}}),{initializeTeamMemberships:nF,addTeamMembership:cF,addTeamMemberships:aF,setTeamMembership:rF,setTeamMemberships:dF,updateTeamMembership:uF,updateTeamMemberships:lF,deleteTeamMembership:oF,deleteTeamMemberships:hF}=nc.actions,mF=nc.reducer,pF=t=>t.teamMembershipReducer.instances,cs=l.createSelector([pF],t=>Object.values(t)),yF=t=>s=>s.teamMembershipReducer.instances[t],fF=y(l.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Vg=y(l.createSelector([cs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(c=>c.team===s))e[n.user]=n;return e})),zg=y(l.createSelector([Xt,cs,(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)))})),ct=O(t=>t.uuid),SF={instances:{}},cc=l.createSlice({name:"teams",initialState:SF,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,SF)),reducers:{initializeTeams:ct.initialize,addTeam:ct.addOne,addTeams:ct.addMany,setTeam:ct.setOne,setTeams:ct.setMany,updateTeam:ct.updateOne,updateTeams:ct.updateMany,deleteTeam:ct.deleteOne,deleteTeams:ct.deleteMany}}),{initializeTeams:AF,addTeam:IF,addTeams:TF,setTeam:PF,setTeams:OF,updateTeam:FF,updateTeams:bF,deleteTeam:_F,deleteTeams:gF}=cc.actions,MF=t=>t.teamReducer.instances,ac=l.createSelector([MF],t=>Object.values(t)),RF=t=>s=>s.teamReducer.instances[t],wF=y(l.createSelector([ac,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Dg=y(l.createSelector([ac,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),vF=cc.reducer,jg={version:0},EF=l.createSlice({name:"versioning",initialState:jg,reducers:{}}),BF=EF.reducer,rc={outboxReducer:Vf,fileReducer:$u,authReducer:Yd},qg=l.combineReducers(rc),VF={...rc,[gt]:BF,assetReducer:wa,assetAttachmentReducer:sa,assetCommentReducer:fa,assetTypeReducer:Ed,assetTypeAttachmentReducer:ka,issueReducer:tm,issueAttachmentReducer:yh,issueTypeReducer:Sy,issueTypeAttachmentReducer:ym,organizationReducer:Mf,projectReducer:WS,projectAttachmentReducer:aS,projectCommentReducer:TS,projectAccessReducer:Gf,organizationAccessReducer:uf,projectFileReducer:DS,procedureTypeReducer:QO,procedureInitiativeReducer:aA,procedureReducer:AA,procedureTypeFieldsReducer:oO,procedureFieldValuesReducer:CO,procedureTypeAttachmentReducer:qP,procedureTypeFieldsAttachmentReducer:XP,procedureFieldValuesAttachmentReducer:FO,procedureStepFieldsAttachmentReducer:eT,procedureStepFieldsReducer:mT,procedureStepFieldValuesAttachmentReducer:gT,procedureStepFieldValuesReducer:qT,procedureStepFieldValuesReviewReducer:xT,procedureStepAssigneeReducer:$A,procedureStepCommentReducer:xA,procedureStepDefaultAssigneeReducer:mI,procedureStepDefaultReviewerReducer:MI,procedureStepEventReducer:LI,procedureStepReviewerReducer:mP,procedureStepReducer:bP,rehydratedReducer:sF,formReducer:Xl,formRevisionReducer:Ul,formRevisionAttachmentReducer:Ml,formSubmissionAttachmentReducer:mo,formSubmissionReducer:go,formIdentifierReducer:xu,formIdentifierValueReducer:ml,userReducer:Zy,emailDomainsReducer:ju,documentsReducer:Iu,documentAttachmentReducer:du,teamReducer:vF,agentsReducer:Nc,issueCommentReducer:kh,issueCommentAttachmentReducer:wh,issueUpdateReducer:Uy,geoImageReducer:Uo,issueAssociationReducer:sh,issueTypeFieldsReducer:ip,issueTypeFieldValuesReducer:Nm,issueTypeFieldsAttachmentReducer:wm,issueTypeFieldValuesAttachmentReducer:fp,issueTypeIdentifierReducer:vp,issueTypeIdentifierValueReducer:Gp,issueTypePriorityReducer:iy,issueTypeStatusReducer:vy,assetTypeFieldsReducer:fr,assetTypeFieldValuesReducer:Nr,assetTypeFieldsAttachmentReducer:sr,assetTypeFieldValuesAttachmentReducer:wr,assetTypeIdentifierReducer:id,assetTypeIdentifierValueReducer:Sd,assetTypeStatusReducer:Hd,teamMembershipReducer:mF},Cg=l.combineReducers(VF),zF=1e4,DF=200,dc=[400,409,403,404,405,500],k=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 CF=()=>LF.length-1,$F=t=>(t[gt]={version:CF()},t),UF=()=>$F({}),$g=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),Ug=t=>s=>{var e;return s===void 0&&(s={}),((e=s[gt])==null?void 0:e.version)===CF()?s:t(s)},LF=[$F,UF,UF,$g],Lg=Object.fromEntries(LF.map((t,s)=>[s,Ug(t)])),kg=t=>{if(t)throw t;const s=Ft();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},kF=(t,s,e)=>{const n=mt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},NF=(t,s,e)=>{const n=mt();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 Ng(t,s){if(!s.payload)throw new Error("Received empty payload");return sb(s)}const Gg={...yc,effect:Ng,discard:HF,returnPromises:!0,persistCallback:kg,retry:Yg,persistOptions:{storage:lb},queue:{...yc.queue,enqueue:kF,dequeue:NF,peek:(...t)=>Kg(...t)}},Hg=ob(Lg,gt),Wg=l.compose(ub.offline(Gg),Hg);async function GF(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 lc(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,c,e)}function HF(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=Ft(),r=n.getState().outboxReducer.deletedRequests,a=s.payload.uuid;function u(){n.dispatch(Ef(a));const m=mt();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&&dc.includes(m)){console.warn("Discarding request due to error:",t,`
|
|
4
|
+
Action:`,s);const f=mt();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=mt();if(!d)throw new Error("Outbox coordinator not set");return d.registerRetry(s.payload.uuid),!1}function Kg(t,s,e){var n;return(n=mt())==null?void 0:n.peek()}function Yg(t,s){return Ft().dispatch(Bf(new Date().getTime())),Ac}const Pt="An unknown error occurred",Zg=500,WF=["non_field_errors","detail"];function Jg(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"?WF.includes(c)?r:`${c}: ${r}`:Array.isArray(r)?WF.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>Zg?Pt:e}class U extends Error{constructor(e){super(Pt);h(this,"status");h(this,"response");h(this,"message");h(this,"options");const{response:n,innerError:c}=e;this.message=e.message??Jg(n,c)??Pt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function KF(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 Xg extends qF{constructor(s){super(s)}}class ot extends qF{constructor(e,n){super(e);h(this,"auth");this.auth=n}}class Qg extends ot{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(Uc(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(kc(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(Lc(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($c(n)),n}}function at(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}`}}class v extends ot{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 v{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=at(e,Math.min(n??e.length,k)),f=[];for(const g of m){const _=[],w={},B=[],C=[];for(const z of g){let bt;if("file"in z){const{file:mc,...FR}=z,_t=await this.client.files.getFilePayload(mc);_t.sha1 in w||(w[_t.sha1]=_t);const cb=URL.createObjectURL(mc);p.add(cb),bt={...FR,file_sha1:_t.sha1,file_type:_t.file_type,file_name:mc.name,file_extension:_t.extension,file_url:cb}}else bt=z;const q=this.buildModel(bt);d.push(q);const N=this.buildBulkPayload(q);_.push(N);const as=this.getBlockers(q);B.push(...as);const OR=this.getBlocks(q);C.push(...OR)}const D={payloads:_,submittedAt:u,files:Object.values(w),blockers:B,blocks:C};f.push(D)}this.dispatch(c(d));const I=f.map(g=>{const{submittedAt:_,files:w,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:w,payloads:B},blockers:D,blocks:C})});Promise.all(I).then(g=>{const _=g.flatMap(w=>w.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:w}of g){const B=this.client.files.processPresignedUrls(w);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 xg extends j{constructor(){super(...arguments);h(this,"name","Asset attachment");h(this,"url","/asset-attachments");h(this,"actions",{addOne:Wc,addMany:fs,setOne:Kc,setMany:Yc,updateOne:Zc,updateMany:Jc,deleteOne:Xc,deleteMany:Ss,initialize:Hc});h(this,"selectors",{selectById:xc,selectByIds:ea})}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 P({...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 eM extends v{constructor(){super(...arguments);h(this,"name","Asset Comment");h(this,"url","/asset-comments");h(this,"actions",{addOne:ca,addMany:qt,setOne:aa,setMany:ra,updateOne:da,updateMany:ua,deleteOne:la,deleteMany:Ct,initialize:na});h(this,"selectors",{selectById:ha,selectByIds:ma})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=P({...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 tM extends v{constructor(){super(...arguments);h(this,"url","/assets");h(this,"name","Asset");h(this,"actions",{addOne:Ia,addMany:Ps,setOne:Fa,setMany:ba,updateOne:Ta,updateMany:Pa,deleteOne:Oa,deleteMany:Os,initialize:Aa});h(this,"selectors",{selectById:Ma,selectByIds:Ra})}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=P({...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(ta(e)),d=this.select(pa(e)),p=this.select(eh(e)),m=this.select(FA(e));this.dispatch(c(e)),this.dispatch(Ss(E(u))),this.dispatch(Ct(E(d))),this.dispatch(St(E(p))),this.dispatch(Tt(E(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(n(a)),this.dispatch(fs(u)),this.dispatch(qt(d)),this.dispatch(ft(p)),this.dispatch(It(m)),f}}bulkAdd(e,n){const{addMany:c}=this.actions,r=new Date().toISOString(),a=at(e,Math.min(n??e.length,k)).map(p=>{const m=p.map(f=>P(f));return{batchId:rt.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:w})=>w),R=f.assets.map(({asset_type:w})=>w),b=f.assets.map(({project:w})=>w),g=f.assets.map(({status:w})=>w),_=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=E(e).toSorted(jt);if(a.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=this.select(r(a)).toSorted(hs);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=at(e,Math.min(n??e.length,k)),m=[];let f=null;for(const I of p){const R=rt.v4(),b=E(I),g=I.map(({status:w})=>w).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(ya(e)),d=this.select(th(e)),p=this.select(bA(e));this.dispatch(c(e)),this.dispatch(Ct(E(u))),this.dispatch(St(E(d))),this.dispatch(Tt(E(p)));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(m){throw this.dispatch(n(a)),this.dispatch(qt(u)),this.dispatch(ft(d)),this.dispatch(It(p)),m}}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 sM extends j{constructor(){super(...arguments);h(this,"name","Asset Type Attachment");h(this,"url","/asset-type-attachments");h(this,"actions",{addOne:Ba,addMany:bs,setOne:Va,setMany:za,updateOne:Da,updateMany:ja,deleteOne:qa,deleteMany:_s,initialize:Ea});h(this,"selectors",{selectById:$a,selectByIds:Ua})}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 P({...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 iM extends j{constructor(){super(...arguments);h(this,"name","Asset Type Fields Attachment");h(this,"url","/asset-type-fields-attachments");h(this,"actions",{addOne:Ha,addMany:Wa,setOne:Ka,setMany:Ya,updateOne:Za,updateMany:Ja,deleteOne:Xa,deleteMany:Qa,initialize:Ga});h(this,"selectors",{selectById:er,selectByIds:tr})}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 P({...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 nM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Fields");h(this,"url","/asset-type-fields");h(this,"actions",{addOne:cr,addMany:ar,setOne:rr,setMany:dr,updateOne:ur,updateMany:lr,deleteOne:or,deleteMany:hr,initialize:nr});h(this,"selectors",{selectById:pr,selectByIds:yr})}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=P({...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 cM 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:Ir,addMany:Es,setOne:Tr,setMany:Pr,updateOne:Or,updateMany:Fr,deleteOne:br,deleteMany:Bs,initialize:Ar});h(this,"selectors",{selectById:gr,selectByIds:Mr})}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 P({...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 aM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Field Values");h(this,"url","/asset-type-field-values");h(this,"actions",{addOne:Br,addMany:Vr,setOne:zr,setMany:Dr,updateOne:jr,updateMany:qr,deleteOne:Cr,deleteMany:$r,initialize:Er});h(this,"selectors",{selectById:Lr,selectByIds:kr})}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=P({...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=at(c,Math.min(n??c.length,k)),I=[];for(const b of f){const g=[];for(const _ of b){const w=P({..._,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(w),g.push({uuid:w.uuid,asset:_.asset,fields_revision:_.fields_revision,published_at:_.published_at,values:w.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),w=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(w),blocks:B});R.push(C)}return Promise.all(R).then(b=>{this.dispatch(u(b.flat()))}).catch(()=>{this.dispatch(d(E(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(Rr(e));this.dispatch(n(e)),this.dispatch(Bs(E(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(Es(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 rM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Identifier");h(this,"url","/asset-type-identifiers");h(this,"actions",{addOne:Wr,addMany:Kr,setOne:Yr,setMany:Zr,updateOne:Jr,updateMany:Xr,deleteOne:Qr,deleteMany:xr,initialize:Hr});h(this,"selectors",{selectById:td,selectByIds:sd})}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=P({...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 dM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Identifier Value");h(this,"url","/asset-type-identifier-values");h(this,"actions",{addOne:ad,addMany:rd,setOne:dd,setMany:ud,updateOne:ld,updateMany:od,deleteOne:hd,deleteMany:md,initialize:cd});h(this,"selectors",{selectById:yd,selectByIds:fd})}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=P({...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=at(e,Math.min(n??e.length,k)),m=[],f=[];for(const b of p){const g=[],_=[],w=[];for(const C of b){const D=P({...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),w.push(D.uuid)}const B={payloads:g,submitted_at:u,blockers:_,blocks:w};m.push(B)}this.dispatch(c(f));const I=m.map(b=>{const{payloads:g,submitted_at:_,blockers:w,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:w,blocks:B})});Promise.all(I).then(b=>{this.dispatch(r(b.flat()))}).catch(b=>{throw this.dispatch(a(E(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 uM extends v{constructor(){super(...arguments);h(this,"name","Asset Type");h(this,"url","/asset-types");h(this,"actions",{addOne:Od,addMany:Fd,setOne:Td,setMany:Pd,updateOne:bd,updateMany:_d,deleteOne:gd,deleteMany:Md,initialize:Id});h(this,"selectors",{selectById:wd,selectByIds:vd})}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=P({...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(ga(e)),d=this.select(La(e));this.dispatch(n(e)),this.dispatch(Os(E(u))),this.dispatch(_s(E(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(Ps(u)),this.dispatch(bs(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 lM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Status");h(this,"url","/asset-type-statuses");h(this,"actions",{addOne:zd,addMany:Dd,setOne:jd,setMany:qd,updateOne:Cd,updateMany:$d,deleteOne:Ud,deleteMany:Ld,initialize:Vd});h(this,"selectors",{selectById:Nd,selectByIds:Gd})}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=P({...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 oM extends j{constructor(){super(...arguments);h(this,"name","Document Attachment");h(this,"url","/document-attachments");h(this,"actions",{addOne:Xd,addMany:Qd,setOne:xd,setMany:eu,updateOne:tu,updateMany:su,deleteOne:iu,deleteMany:nu,initialize:Jd});h(this,"selectors",{selectById:au,selectByIds:ru})}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 P({...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 hM extends v{constructor(){super(...arguments);h(this,"name","Document");h(this,"url","/documents");h(this,"actions",{addOne:ou,addMany:hu,setOne:mu,setMany:pu,updateOne:yu,updateMany:fu,deleteOne:Su,deleteMany:Au,initialize:lu});h(this,"selectors",{selectById:Tu,selectByIds:Pu})}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=P({...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(Ou(e));this.dispatch(n(e)),this.dispatch(a(E(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 ht extends ot{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 mM extends ht{constructor(){super(...arguments);h(this,"name","Email Domains");h(this,"url","/organization-email-domains");h(this,"actions",{addOne:_u,addMany:gu,setOne:Mu,setMany:Ru,updateOne:wu,updateMany:vu,deleteOne:Eu,deleteMany:Bu,initialize:bu});h(this,"selectors",{selectById:zu,selectByIds:Du})}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 pM extends ot{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 zt={},uc=new Set;class yM extends ot{constructor(){super(...arguments);h(this,"host");h(this,"dbPromise",hb.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 Dt(e);if(uc.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),uc.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),uc.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 zt?u=zt[r]:vc(e)?(u=wc(e,c),zt[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)})}),zt[r]=u);let d;try{d=await u}catch(m){throw m instanceof U&&delete zt[r],m}const p=await Dt(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(y)}const p=o.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=n??h+"."+p;if(o=rc(o,A),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),Kt[c]=new Promise(y=>{y(o)})}return o}}class RF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Wi(c));const r=this.enqueueRequest({description:"Create form identifier",method:l.POST,url:"/form-identifiers/",payload:v(c),blockers:[c.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ht(m))}).catch(()=>{this.dispatch(Ki(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Yi(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ht(n));const c=this.enqueueRequest({description:"Update form identifier",method:l.PATCH,url:`/form-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(ht(r))}).catch(()=>{this.dispatch(ht(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Yi(e)(a);if(!n)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(Ki(e));try{return await this.enqueueRequest({description:"Delete form identifier",method:l.DELETE,url:`/form-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Wi(n)),c}}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/form-identifiers/",queryParams:{form__organization:e}},i);return this.dispatch(Xu(a)),a}}class vF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(Ji(c));const r=this.enqueueRequest({description:"Create form identifier value",method:l.POST,url:"/form-identifier-values/",payload:v(c),blockers:[e.form_submission,e.form_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(Xi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=xi(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(mt(n));const c=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 c.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=xi(e)(a);if(!n)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(Xi(e));try{return await this.enqueueRequest({description:"Delete form identifier value",method:l.DELETE,url:`/form-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Ji(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/form-identifier-values/",queryParams:{form_submission__form_revision__form__organization:e}},i)).flat();return this.dispatch(so(n)),n}}class wF extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,n={},c=[],r=[];for(const o of e){const{revisionUuid:h,fieldIdentifier:p,file:A}=o,y=await this.getFilePayload(A);y.sha1 in n||(n[y.sha1]=y);const I=P({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:y.extension,file_sha1:y.sha1,form_revision:h};r.push(g)}this.dispatch(ro(c));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(n)},blockers:c.map(o=>o.form_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(uo(o.attachments))}).catch(()=>{this.dispatch(oo(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e}},i);return this.dispatch(co(a)),a}}class MF extends E{add(e){var u;const{store:i}=this.client,n=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=P({...e,created_by:n,submitted_at:new Date().toISOString()});this.dispatch(sa(c));const r=this.enqueueRequest({description:"Create form revision",method:l.POST,url:"/form-revisions/",payload:v(c),blockers:[e.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(yo(m))}).catch(()=>{this.dispatch(ia(c.uuid))}),[c,r]}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/form-revisions/",queryParams:{form__organization:e}},i);return this.dispatch(po(a)),a}}class VF extends E{add(e,i){var o;const{store:a}=this.client,n=new Date().toISOString(),c=(o=a.getState().userReducer.currentUser)==null?void 0:o.uuid,r=P({...e,submitted_at:n,created_by:c}),u=P({...i,form:r.uuid,submitted_at:n,created_by:c});this.dispatch(ra(r)),this.dispatch(sa(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(da(r.uuid)),this.dispatch(ia(u.uuid)),h}),[r,u,m]}async delete(e){const{store:i}=this.client,a=i.getState(),n=_o(e)(a);if(!n)throw new Error("Expected form to exist");const c=Do(e)(a);c.length>0&&this.dispatch(Co(c.map(({uuid:u})=>u)));const r=So(e)(a);r.length>0&&this.dispatch(fo(r.map(({uuid:u})=>u))),this.dispatch(da(e));try{return await this.enqueueRequest({description:"Delete form",method:l.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(ra(n)),r.length>0&&this.dispatch(Ao(r)),c.length>0&&this.dispatch(zo(c)),u}}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/forms/",queryParams:{organization:e}},i);return this.dispatch(go(a)),a}}class EF extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,n={},c=[],r=[];for(const o of e){const{submissionUuid:h,fieldIdentifier:p,file:A}=o,y=await this.getFilePayload(A);y.sha1 in n||(n[y.sha1]=y);const I=P({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:A.name,file_sha1:y.sha1,file_extension:y.extension,field_identifier:p,form_submission:h};r.push(g)}this.dispatch(Ct(c));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(n)},blockers:c.map(o=>o.form_submission),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(vo(o.attachments))}).catch(o=>{throw this.dispatch(Dt(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=Mo(e)(a);this.dispatch(Dt(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(c){throw this.dispatch(Ct(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/form-submission-attachments/",queryParams:{form_submission__form_revision__form__organization:e}},i)).flat();return this.dispatch(Ro(n)),n}}class jF extends E{add(e){var r;const{store:i}=this.client,a=i.getState(),n=P({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add form submission",method:l.POST,url:"/form-submissions/",payload:v(n),blockers:[e.form_revision],blocks:[n.uuid]});return this.dispatch(ha(n)),c.then(u=>(this.dispatch(Bt(u)),u)).catch(()=>{this.dispatch(ma(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=Aa(e.uuid)(a);if(!n)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(Uo(c));const r=this.enqueueRequest({description:"Delete user form submissions",method:l.PATCH,url:`/form-submissions/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return r.then(u=>{this.dispatch(Bt(u))}).catch(()=>{this.dispatch(Bt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Aa(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Vo(e)(a);this.dispatch(ma(e)),this.dispatch(Dt(c.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(ha(n)),this.dispatch(Ct(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/form-submissions/",queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},i)).flat();return this.dispatch(qo(n)),n}}class qF extends E{async add(e){var p;const{store:i}=this.client,{file:a,...n}=e,c=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.uuid,u=n.project,m=await this.getFilePayload(a),o=P({...n,file_name:a.name,file_sha1:m.sha1,file_type:a.type,file:URL.createObjectURL(a),submitted_at:c,created_by:r});this.dispatch(Go(o));const h=this.enqueueRequest({description:"Add geo image",method:l.POST,url:"/geo-images/",payload:{uuid:o.uuid,submitted_at:c,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(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(pt(A.geo_image))}).catch(()=>{this.dispatch(fa(o.uuid))}),[o,h.then(A=>A.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,n=new Date().toISOString(),c=(p=a.getState().userReducer.currentUser)==null?void 0:p.uuid,r=[],u=[],m=[],o={};for(const A of e){const{file:y,...I}=A,g=await this.getFilePayload(y);g.sha1 in o||(o[g.sha1]=g);const O=P({...I,file_name:y.name,file_sha1:g.sha1,file_type:y.type,file:URL.createObjectURL(y),submitted_at:n,created_by:c,project:i});r.push(O),u.push(O.uuid),m.push({uuid:O.uuid,sha1:O.file_sha1,file_name:O.file_name,title:O.title,description:O.description,geo_marker:O.geo_marker,canvas_marker:O.canvas_marker,direction:O.direction,original_date:O.original_date})}this.dispatch(No(r));const h=this.enqueueRequest({description:"Bulk add geo images",method:l.POST,url:"/geo-images/bulk/",payload:{submitted_at:n,project:i,geo_images:m,files:Object.values(o)},blocks:[i],blockers:u});return h.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(Lo(A.geo_images))}).catch(()=>{this.dispatch(Wo(u))}),[r,h.then(A=>A.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),n=Sa(e.uuid)(a);if(!n)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const c={...n,...e};this.dispatch(Ho(c));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(pt(u))}).catch(()=>{this.dispatch(pt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Sa(e)(a);if(!n)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(fa(e));const c=this.enqueueRequest({description:"Delete geo image",method:l.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return c.catch(()=>{this.dispatch(pt(n))}),c}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/geo-images/",queryParams:{project:e}},i);return this.dispatch(ko(a)),a}}class zF extends R{add(e){var u;const{store:i}=this.client,a=new Date().toISOString(),n=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=P({...e,submitted_at:a,created_by:n});this.dispatch(Ia(c));const r=this.enqueueRequest({description:"Add issue association",method:l.POST,url:"/issue-associations/",payload:v(c),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Qo(m))}).catch(()=>{this.dispatch(Fa(c.uuid))}),[c,r]}async delete(e){const{store:i}=this.client,a=xo(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Fa(e));const n=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(Ia(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/issue-associations/",queryParams:{associated_issue__project:e}},i)).flat();return this.dispatch(Xo(n)),n}}class UF extends ke{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",_a);S(this,"addAttachments",Oa);S(this,"updateAttachments",cl);S(this,"removeAttachments",Ra);S(this,"removeAttachment",rl);S(this,"setAttachment",nl);S(this,"selectAttachment",ll)}getId(i){return i.uuid}buildModel(i){return P({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 c=(await this.performPagination({method:l.GET,url:`${this.url}/`,queryParams:{issue__project:i}},a)).flat();return this.dispatch(_a(c)),c}}class CF extends ke{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",wa);S(this,"addAttachments",pl);S(this,"updateAttachments",yl);S(this,"removeAttachments",Sl);S(this,"removeAttachment",fl);S(this,"setAttachment",Al);S(this,"selectAttachment",gl)}getId(i){return i.uuid}buildModel(i){return P({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 c=(await this.performPagination({method:l.GET,url:`${this.url}/`,queryParams:{issue_comment__issue__project:i}},a)).flat();return this.dispatch(wa(c)),c}}class DF extends R{add(e){var c;const{store:i}=this.client,a=P({...e,author:(c=i.getState().userReducer.currentUser)==null?void 0:c.uuid,submitted_at:new Date().toISOString()});this.dispatch(Va(a));const n=this.enqueueRequest({description:"Add issue comment",method:l.POST,url:"/issue-comments/",payload:v(a),blockers:[e.issue],blocks:[a.uuid]});return n.catch(()=>{this.dispatch(ja(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=qa(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const n={...a,...e};this.dispatch(Ea(n));const c=this.enqueueRequest({description:"Edit issue comment",method:l.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.catch(()=>{this.dispatch(Ea(a))}),[n,c]}remove(e){const{store:i}=this.client,a=qa(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(ja(e));const n=this.enqueueRequest({description:"Delete comment",method:l.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(Va(a))}),n}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/issue-comments/",queryParams:{issue__project:e}},i);return this.dispatch(bl(a)),a}}class BF extends R{add(e){var m;const{store:i}=this.client,a=i.getState(),n=new Date().toISOString(),c=(m=a.userReducer.currentUser)==null?void 0:m.uuid,r=P({...e,submitted_at:n,created_by:c});this.dispatch(Ua(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($t(o))}).catch(o=>{throw this.dispatch(Ca(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=$a(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 n={...a,...e};this.dispatch($t(n));const c={};for(const o of[V.TITLE,V.DESCRIPTION,V.STATUS,V.CATEGORY,V.PRIORITY,V.ASSIGNED_TO,V.DUE_DATE])if(o in e&&e[o]!==a[o])switch(o){case V.PRIORITY:case V.STATUS:{const h=e[o];c[o]=h!==void 0?Number(h):null;break}case V.DUE_DATE:case V.DESCRIPTION:case V.TITLE:c[o]=e[o]??null;break;case V.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`);c[o]=h?{name:h.name,color:h.color,uuid:h.uuid}:null;break}case V.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`);c[o]=h?{email:h.email,uuid:h.uuid}:null;break}}const r=P({created_by:(m=i.userReducer.currentUser)==null?void 0:m.uuid,submitted_at:new Date().toISOString(),issue:a.uuid,changes:c});this.dispatch(Eh(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($t(a)),this.dispatch(qh(r.uuid))}),[n,u]}async remove(e){const{store:i}=this.client,a=i.getState(),n=$a(e)(a);if(!n)throw new Error(`No issue with uuid ${e} found in the store`);const c=ol(e)(a),r=Dh(e)(a),u={};for(const o of el(e)(a))u[o.uuid]=o;for(const o of tl(e)(a))u[o.uuid]=o;const m=Object.values(u);this.dispatch(Ca(e)),c.length>0&&this.dispatch(Ra(c.map(({uuid:o})=>o))),r.length>0&&this.dispatch(zh(r.map(({uuid:o})=>o))),m.length>0&&this.dispatch(Pa(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(Ua(n)),this.dispatch(Oa(c)),this.dispatch(jh(r)),this.dispatch(ga(m)),o}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/issues/",queryParams:{project:e}},i)).flat();return this.dispatch(vl(n)),n}}class $F extends ke{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",La);S(this,"addAttachments",ql);S(this,"updateAttachments",Ul);S(this,"removeAttachments",Dl);S(this,"removeAttachment",Cl);S(this,"setAttachment",zl);S(this,"selectAttachment",kl)}getId(i){return i.uuid}buildModel(i){return P({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 n=await this.performRequest({method:l.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i}},a);return this.dispatch(La(n)),n}}class kF extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,y=await this.getFilePayload(A);y.sha1 in n||(n[y.sha1]=y);const I=P({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:A.name,file_extension:y.extension,field_identifier:p,file_sha1:y.sha1,fields_revision:h};r.push(g)}this.dispatch(Hl(c));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(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Wl(o.attachments))}).catch(()=>{this.dispatch(Kl(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e}},i);return this.dispatch(Nl(a)),a}}class LF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(ih(c));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:l.POST,url:"/issue-type-fields/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ah(m))}).catch(m=>{throw this.dispatch(nh(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e}},i);return this.dispatch(sh(a)),a}}class GF extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,n={},c=[],r=[];for(const o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:A}=o,y=await this.getFilePayload(A);y.sha1 in n||(n[y.sha1]=y);const I=P({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:y.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:A.name,file_sha1:y.sha1,file_extension:y.extension,field_identifier:p,field_values:h};r.push(g)}this.dispatch(Lt(c));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(n)},blockers:c.map(o=>o.field_values),blocks:c.map(o=>o.uuid)});return u.then(({presigned_urls:o,attachments:h})=>{this.processPresignedUrls(o),this.dispatch(oh(h))}).catch(o=>{throw this.dispatch(Gt(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=hh(e)(a);this.dispatch(Gt(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(c){throw this.dispatch(Lt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{field_values__issue__project:e,latest:!0}},i)).flat();return this.dispatch(uh(n)),n}}class NF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=P({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add issue type field values",method:l.POST,url:"/issue-type-field-values/",payload:v(n),blockers:[e.issue,e.fields_revision],blocks:[n.uuid]});return this.dispatch(Ha(n)),c.then(u=>(this.dispatch(yt(u)),u)).catch(()=>{this.dispatch(Wa(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=Ya(e.uuid)(a);if(!n)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(yt(c));const r=this.enqueueRequest({description:"Update issue type field values",method:l.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.issue],blocks:[c.uuid]});return r.then(u=>{this.dispatch(yt(u))}).catch(()=>{this.dispatch(yt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ya(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=mh(e)(a);this.dispatch(Wa(e)),this.dispatch(Gt(c.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(Ha(n)),this.dispatch(Lt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/issue-type-field-values/",queryParams:{issue__project:e,latest:!0}},i)).flat();return this.dispatch(Ql(n)),n}}class HF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(xa(c));const r=this.enqueueRequest({description:"Create issue type identifier",method:l.POST,url:"/issue-type-identifiers/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ft(m))}).catch(()=>{this.dispatch(en(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=tn(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ft(n));const c=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 c.then(r=>{this.dispatch(ft(r))}).catch(()=>{this.dispatch(ft(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=tn(e)(a);if(!n)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(en(e));try{return await this.enqueueRequest({description:"Delete issue type identifier",method:l.DELETE,url:`/issue-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(xa(n)),c}}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/issue-type-identifiers/",queryParams:{issue_type__organization:e}},i);return this.dispatch(yh(a)),a}}class WF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=new Date().toISOString(),c=P({...e,created_by:a,submitted_at:n});this.dispatch(an(c));const r=this.enqueueRequest({description:"Create issue type identifier value",method:l.POST,url:"/issue-type-identifier-values/",payload:v(c),blockers:[e.issue,e.issue_type_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(St(m))}).catch(()=>{this.dispatch(nn(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=rn(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(St(n));const c=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 c.then(r=>{this.dispatch(St(r))}).catch(()=>{this.dispatch(St(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=rn(e)(a);if(!n)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(nn(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(c){throw this.dispatch(an(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/issue-type-identifier-values/",queryParams:{issue__project:e}},i)).flat();return this.dispatch(gh(n)),n}}class KF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=P({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid});this.dispatch(Oh(n));const c=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return c.then(u=>{this.dispatch(Tt(u))}).catch(()=>{this.dispatch(un(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=ln(e.uuid)(a);if(!n)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const c={...n,...e};this.dispatch(Rh(c));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(Tt(u))}).catch(()=>{this.dispatch(Tt(n))}),[c,r]}delete(e){const{store:i}=this.client,a=i.getState(),n=ln(e)(a);if(!n)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const c=Vl(e)(a);this.dispatch(un(e)),this.dispatch(Ml(c.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(Tt(n)),this.dispatch(wl(c))}),r}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/issue-types/",queryParams:{organization:e}},i);return this.dispatch(_h(a)),a}}class YF extends R{async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/issue-updates/",queryParams:{issue__project:e}},i)).flat();return this.dispatch(Vh(n)),n}}const ZF=1800;function JF(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 XF extends Zg{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.performRequest({method:l.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,checkAuth:!1});let n;try{n=await a}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!n.access)throw new Error("Missing access token");return{accessToken:n.access,refreshToken:n.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Fu(!1)),this.clearTokens(),this.dispatch(F()),this.dispatch(F())}async renewTokens(){const i=this.getRefreshToken();if(!i)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const a=await this._getRenewedTokens(i);if(!a)return;console.log("Got renewed tokens"),this.setTokens(a)}catch(a){throw console.error("Could not renew tokens; clearing auth",a),this.clearAuth(),a}}tokenIsExpiringSoon(){const i=this.getAccessToken();if(!i)return!1;const a=Date.now()/1e3;let n;try{n=Lp(i).exp??a}catch{n=a}return n-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 z&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??Je).toString()))}}}async handleUnauthorized(i,a){const n=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw n.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new z({message:"You have been signed out due to inactivity.",response:a,discard:!0});if(n.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new z({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Ke.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:a,method:l.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1}).then(n=>{this.setTokens(JF(n))})}}class QF extends R{update(e){const{store:i}=this.client,a=fn(e.uuid)(i.getState()),n={...a,...e};this.dispatch(Ht(n));const c=this.enqueueRequest({description:"Edit organization access",method:l.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(Ht(r))}).catch(r=>{throw this.dispatch(Ht(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=fn(e)(a),c=Wh(n.user)(a);this.dispatch(Jh(n.uuid)),this.dispatch(Gh(n.user));try{await this.enqueueRequest({description:"Remove organization access",method:l.DELETE,url:`/organization-accesses/${n.uuid}/`,blockers:[n.uuid],blocks:[]})}catch(r){throw this.dispatch(Zh(n)),this.dispatch(Lh(c)),r}}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/organization-accesses/",queryParams:{organization:e}},i);return this.dispatch(Yh(a)),a}}class xF extends R{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:l.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(tm(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(sm(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.performRequest({method:l.GET,url:"/organizations/"},e);return this.dispatch(em(i)),i}}class eP extends R{add(e){var c;const{store:i}=this.client,a=P({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.uuid});this.dispatch(gn(a));const n=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 n.then(r=>{this.dispatch(It(r))}).catch(r=>{throw this.dispatch(Pn(a.uuid)),r}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.uuid,n=e.map(u=>P({...u,created_by:a}));this.dispatch(Fn(n));const c=this.enqueueRequest({description:"Add project accesses",method:l.POST,url:"/project-accesses/bulk/",payload:{project_accesses:n.map(u=>v(u))},blockers:n.flatMap(u=>[u.project,u.organization_access]),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(mm(u))}).catch(u=>{throw this.dispatch(bn(n.map(m=>m.uuid))),u}),[n,c]}update(e){const{store:i}=this.client,a=On(e.uuid)(i.getState()),n={...a,...e};this.dispatch(It(n));const c=this.enqueueRequest({description:"Edit project access",method:l.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return c.then(r=>{this.dispatch(It(r))}).catch(r=>{throw this.dispatch(It(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=On(e)(i.getState());this.dispatch(Pn(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(gn(a)),n}}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/project-accesses/",queryParams:{project__organization:e}},i);return this.dispatch(hm(a)),a}}class tP extends ke{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"initializeAttachments",vn);S(this,"addAttachments",fm);S(this,"updateAttachments",Im);S(this,"removeAttachments",wn);S(this,"removeAttachment",gm);S(this,"setAttachment",Sm);S(this,"selectAttachment",bm)}getId(i){return i.uuid}buildModel(i){return P({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 n=await this.performRequest({method:l.GET,url:`${this.url}/`,queryParams:{project__organization:i}},a);return this.dispatch(vn(n)),n}}class sP extends R{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(n=>{this.dispatch(Vn(n))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const n=i.projectFileReducer.instances[a];if(!n)throw new Error("No active project file");if(!n.bounds&&!n.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let c;if(typeof n.file=="string"&&!n.file.startsWith("blob:")){const m={...n};delete m.file,c={method:l.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else c=new Promise((m,o)=>{this.client.files.uploadFileToS3(n.file_sha1).then(([h])=>{m({method:l.POST,url:"/project-files/",payload:{...n,...h},blockers:[a],blocks:[a]})}).catch(o)});const u=Promise.resolve(c).then(m=>this.enqueueRequest(m));return u.then(m=>{this.dispatch(Vn(m))}),this.dispatch(qm),this.dispatch(jm(null)),this.dispatch(Em(!1)),[n,u]}delete(e){return this.dispatch(Mm(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const n=(await this.performPagination({method:l.GET,url:"/project-files/",queryParams:{project:e}},i)).flat();return this.dispatch(vm(n)),n}}class iP extends R{async add(e){const i=await this.enqueueRequest({description:"Create project",method:l.POST,url:"/projects/",payload:v(e),blockers:[],blocks:[]});return this.dispatch(jn(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($m(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(),n=Gm(e)(a);if(!n)throw new Error("Expected project to exist");const c=Um(a).filter(m=>m.project===e);this.dispatch(Vm(c.map(({uuid:m})=>m)));const r=_m(n.uuid)(a);this.dispatch(wn(r.map(({uuid:m})=>m)));const u=Am(e)(a);this.dispatch(bn(u.map(({uuid:m})=>m))),this.dispatch(qn(n.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(qn(n.uuid))}catch(m){throw this.dispatch(jn(n)),this.dispatch(Fn(Object.values(u))),this.dispatch(wm(c)),this.dispatch(Tm(r)),m}}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/projects/",queryParams:{organization:e}},i);return this.dispatch(Bm(a)),a}}class aP extends R{add(e){var c;const{store:i}=this.client,a=P({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.uuid});this.dispatch(Km(a));const n=this.enqueueRequest({description:"Create team membership",method:l.POST,url:"/team-memberships/",payload:v(a),blockers:[e.team],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Dn(r))}).catch(()=>{this.dispatch(Bn(a.uuid))}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.uuid,n=e.map(u=>P({...u,created_by:a}));this.dispatch(Ym(n));const c=this.enqueueRequest({description:"Create team memberships",method:l.POST,url:"/team-memberships/bulk/",payload:{team_memberships:n.map(u=>v(u))},blockers:n.map(u=>u.team),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(Zm(u))}).catch(()=>{this.dispatch(Jm(n.map(u=>u.uuid)))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=xm(e)(a);if(!n)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(Bn(e));try{return await this.enqueueRequest({description:"Delete team membership",method:l.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(Dn(n)),c}}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/team-memberships/",queryParams:{team__organization:e}},i);return this.dispatch(Wm(a)),a}}class nP extends R{add(e){var c;const{store:i}=this.client,a=P({...e,submitted_at:new Date().toISOString(),created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.uuid});this.dispatch(sp(a));const n=this.enqueueRequest({description:"Create team",method:l.POST,url:"/teams/",payload:v(a),blockers:[],blocks:[a.uuid]});return n.then(r=>{this.dispatch(gt(r))}).catch(()=>{this.dispatch(Ln(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=Nn(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ip(n));const c=this.enqueueRequest({description:"Update team",method:l.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(gt(r))}).catch(()=>{this.dispatch(gt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Nn(e)(a);if(!n)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(Ln(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(gt(n)),c}}async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:"/teams/",queryParams:{organization:e}},i);return this.dispatch(tp(a)),a}}class cP extends R{async refreshStore(e,i){const a=await this.performRequest({method:l.GET,url:`/organizations/${e}/users/`},i);return this.dispatch(kh(a)),a}}async function Jn(t,e,i,a,n){const c=a instanceof R;c&&e.checkAuth!==!1&&await a.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:u,payload:m,headers:o,method:h,queryParams:p,attachmentHash:A,isExternalUrl:y,isAuthNeeded:I,isResponseBlob:g}={...r,...e};let O=e.url;const w=A?await i.files.fetchCache(A):void 0;if(A&&!w)throw new Error(`Cannot upload file ${A} because it's not cached.`);!y&&!O.startsWith("http")&&(!O.startsWith("/")&&!O.startsWith("blob:")&&(O="/"+O),O=t+O);const j=q=>{if(A){if(!u)throw new Error(`No S3 URL for file ${A}`);if("warning"in u)throw new Error(`S3 URL warning for file ${A}`);if(!w)throw new Error(`No file for file ${A}`);const Ge=u.fields["x-amz-checksum-sha1"];if(!Ge)throw new Error(`No checksum for file ${A}`);return q.set("x-amz-checksum-sha1",Ge).field({...m,...u.fields}).attach("file",w)}return q.send(m)},oP={[l.GET]:()=>g?We.get(O.toString()).responseType("blob"):We.get(O.toString()),[l.POST]:()=>{const q=We.post(O.toString());return j(q)},[l.PATCH]:()=>{const q=We.patch(O.toString());return j(q)},[l.PUT]:()=>{const q=We.put(O.toString());return j(q)},[l.DELETE]:()=>{const q=We.delete(O.toString());return j(q)}}[h];let Le=oP();if(n==null||n.addEventListener("abort",()=>{console.debug("aborting request:",e),Le.abort()}),I&&c){const q=a.auth.getAuthHeader();Le=Le.set("Authorization",q)}o&&(Le=Le.set(o));try{return await Le.query(p)}catch(q){const Ge=Fp(q),qp=Ge==null?void 0:Ge.status;if(c&&qp===401)return await a.auth.handleUnauthorized(Le,Ge),Le.query(p);throw new z({response:Ge,innerError:q,discard:Wn.includes(qp)})}}class rP{constructor(e){S(this,"store");this.store=e}_performRequest(e,i,a,n){const c=new Xt,r={...i,uuid:i.uuid??Ke.v4()};return Jn(e,r,this,a,n).then(u=>{c.resolve(u.body)}).catch(u=>{u instanceof Error?c.reject(u):c.reject(new Error((u??Je).toString()))}),c}async performRequest(e,i,a,n){return this._performRequest(e,i,a,n).then(c=>{if(c instanceof z)throw c;return c})}async enqueueRequest(e,i,a){return this._enqueueRequest(e,i,a).then(n=>{if(n instanceof z)throw n;return n})}_enqueueRequest(e,i,a){const n=new Xt,c={...e,BASE_URL:i,serviceName:a},r=this.store.dispatch(rm(c)),u=o=>{if(o)n.resolve(o.body);else{const h=new z({message:"Could not get a response from the server.",response:o,discard:!0});n.reject(h)}},m=o=>{o instanceof z?o.options.discard=!0:(console.error("Received an unexpected error while processing a request:",o,`
|
|
15
|
-
Converting error to APIError and discarding.`),o=new z({message:"An error occurred while processing the request.",innerError:o,discard:!0})),n.reject(o)};return r.then(u,m),n}async performPagination(e,i,a,n,c){const r={...i,queryParams:{...i.queryParams,paginate:!0,limit:a}},{url:u,method:m}=r,o=[];let h=await this.performRequest(e,r,n,c);for(o.push(h.results);h.next;)h=await this.performRequest(e,{url:u,method:m},n,c),o.push(h.results);return o}}class Xe{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new Gp.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new Xe;for(let a=0;a<e.length;a++){const n=e[a];if(!n){console.error("Outbox item was undefined");continue}i.sneakRequest(n);for(let c=0;c<a;c++){const r=e[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==n.payload.uuid&&r.payload.blocks.some(u=>n.payload.blockers.includes(u))&&Xe._addDependency(n.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){Xe._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(n=>a.payload.blocks.includes(n))&&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(n=>e.payload.blocks.includes(n))&&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 n of e){const c=this.requestAttemptCounter[n]||0;c<i&&(i=c,a=n)}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),n=e.findIndex(c=>c.payload.uuid===a.payload.uuid);n!==-1&&(e.splice(n,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 n=this.requestAttemptCounter[i.payload.uuid]||0,c=this.requestAttemptCounter[a.payload.uuid]||0;return n-c}),e}registerRetry(e){this.requestAttemptCounter[e]=(this.requestAttemptCounter[e]||0)+1}}let Pp;function bp(t){Pp=t}function Qe(){return Pp}let _p;function Op(t){_p=t}function Rp(){return _p}let Xn=null;function He(){const t=Qe();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Xn)return Xn;const e=t.getState().offline.outbox,i=Xe._fromOutbox(e);return Xn=i,i}const dP=(t,e)=>{const i=new e(t);return Op(i),bp(t),i};class uP{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 Qn{constructor(){S(this,"next");this.next=null}then(e){return new uP(this).then(e)}async run(e){if(this.next)return this.next.run(e);{if(console.debug("Middleware finished. Performing request:",e),!Qe())throw new Error("Client store not set");const a=Rp();if(!a)throw new Error("Client SDK not set");return Tp(e,a)}}}class vp extends Qn{async run(e){return super.run(e)}}class wp extends Qn{async run(e){return super.run(e)}}const Mp=new vp().then(new wp).compile();function Vp(t){var e;return(e=Mp[0])==null?void 0:e.run(t)}var Ep=(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))(Ep||{});s.ALL_MIDDLEWARE=Mp,s.APIError=z,s.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=op,s.AgentService=Jg,s.AssetAttachmentService=Xg,s.AssetProcedureService=iF,s.AssetProcedureStepFieldValuesAttachmentService=rF,s.AssetProcedureStepFieldValuesService=dF,s.AssetProcedureStepFieldsAttachmentService=nF,s.AssetProcedureStepFieldsService=cF,s.AssetProcedureStepService=uF,s.AssetProcedureTypeAttachmentService=Qg,s.AssetProcedureTypeFieldValuesAttachmentService=tF,s.AssetProcedureTypeFieldValuesService=sF,s.AssetProcedureTypeFieldsAttachmentService=xg,s.AssetProcedureTypeFieldsService=eF,s.AssetProcedureTypeService=aF,s.AssetService=oF,s.AssetStageCompletionService=lF,s.AssetStageService=hF,s.AssetTypeAttachmentService=mF,s.AssetTypeFieldValuesAttachmentService=yF,s.AssetTypeFieldValuesService=fF,s.AssetTypeFieldsAttachmentService=pF,s.AssetTypeFieldsService=AF,s.AssetTypeIdentifierService=SF,s.AssetTypeIdentifierValueService=TF,s.AssetTypeService=IF,s.AttachmentModel=ac,s.BaseApiService=R,s.BaseSDK=rP,s.COMMON_AUTO_FIELDS=oc,s.CategoryService=gF,s.DEFAULT_ISSUE_PRIORITY=Hp,s.DEFAULT_ISSUE_STATUS=Np,s.DEFAULT_PAGE_SIZE=up,s.DISCARD_HTTP_STATUSES=Wn,s.DeferredPromise=Xt,s.DocumentAttachmentService=FF,s.DocumentService=PF,s.EMPTY_ARRAY=tc,s.EMPTY_OBJECT=sc,s.EmailVerificationService=bF,s.FileService=OF,s.FormIdentifierService=RF,s.FormIdentifierValueService=vF,s.FormRevisionAttachmentService=wF,s.FormRevisionService=MF,s.FormService=VF,s.FormSubmissionAttachmentService=EF,s.FormSubmissionService=jF,s.GeoImageService=qF,s.HttpMethod=l,s.IssueAssociationService=zF,s.IssueAttachmentService=UF,s.IssueCommentAttachmentService=CF,s.IssueCommentService=DF,s.IssuePriority=Zt,s.IssueService=BF,s.IssueStatus=Jt,s.IssueTypeAttachmentService=$F,s.IssueTypeFieldValuesAttachmentService=GF,s.IssueTypeFieldValuesService=NF,s.IssueTypeFieldsAttachmentService=kF,s.IssueTypeFieldsService=LF,s.IssueTypeIdentifierService=HF,s.IssueTypeIdentifierValueService=WF,s.IssueTypeService=KF,s.IssueUpdateChange=V,s.IssueUpdateService=YF,s.JWTService=XF,s.OUTBOX_RETRY_DELAY=nc,s.OfflineAnalyticsMiddleware=vp,s.OfflineMiddleware=Qn,s.OrganizationAccessLevel=ic,s.OrganizationAccessService=QF,s.OrganizationService=xF,s.OutboxCoordinator=Xe,s.ProjectAccessService=eP,s.ProjectAttachmentService=tP,s.ProjectFileService=sP,s.ProjectService=iP,s.RESET_ORGANIZATION_STATE=_,s.RESET_PROJECT_STATE=M,s.RESET_STATE=F,s.RateLimitingMiddleware=wp,s.SelectorBuilder=Ug,s.TeamMembershipService=aP,s.TeamService=nP,s.UNKNOWN_ERROR_MESSAGE=Je,s.UserService=cP,s.VERSION_REDUCER_KEY=et,s.VerificationCodeType=Ep,s._setLatestRetryTime=um,s.addAsset=Ws,s.addAssetAttachment=IA,s.addAssetAttachments=cs,s.addAssetProcedure=gs,s.addAssetProcedureStep=ed,s.addAssetProcedureStepFieldValues=$s,s.addAssetProcedureStepFieldValuesAttachment=Oy,s.addAssetProcedureStepFieldValuesAttachments=_t,s.addAssetProcedureStepFieldValuesMany=Wr,s.addAssetProcedureStepFields=js,s.addAssetProcedureStepFieldsAttachment=oy,s.addAssetProcedureStepFieldsAttachments=vr,s.addAssetProcedureStepFieldsMany=fy,s.addAssetProcedureSteps=td,s.addAssetProcedureType=Rs,s.addAssetProcedureTypeAttachment=PA,s.addAssetProcedureTypeAttachments=Ec,s.addAssetProcedureTypeFieldValues=ys,s.addAssetProcedureTypeFieldValuesAttachment=LA,s.addAssetProcedureTypeFieldValuesAttachments=Pt,s.addAssetProcedureTypeFieldValuesMany=lr,s.addAssetProcedureTypeFields=Xc,s.addAssetProcedureTypeFieldsAttachment=RA,s.addAssetProcedureTypeFieldsAttachments=Gc,s.addAssetProcedureTypeFieldsMany=qA,s.addAssetProcedureTypes=iy,s.addAssetProcedures=Sr,s.addAssetStage=ni,s.addAssetStageCompletion=xs,s.addAssetStageCompletions=ei,s.addAssetStages=Jy,s.addAssetType=Vi,s.addAssetTypeAttachment=sf,s.addAssetTypeAttachments=oi,s.addAssetTypeFieldValues=fi,s.addAssetTypeFieldValuesAttachment=gf,s.addAssetTypeFieldValuesAttachments=jt,s.addAssetTypeFieldValuesMany=iu,s.addAssetTypeFields=Gd,s.addAssetTypeFieldsAttachment=cf,s.addAssetTypeFieldsAttachments=zd,s.addAssetTypeFieldsMany=mf,s.addAssetTypeIdentifier=Fi,s.addAssetTypeIdentifierValue=Oi,s.addAssetTypeIdentifierValues=Cf,s.addAssetTypeIdentifiers=Vf,s.addAssetTypes=Wf,s.addAssets=wt,s.addCategories=tS,s.addCategory=Ui,s.addConversation=Sc,s.addConversations=mA,s.addDocumentAttachment=dS,s.addDocumentAttachments=Vu,s.addDocuments=Lu,s.addForm=ra,s.addFormIdentifier=Wi,s.addFormIdentifierValue=Ji,s.addFormIdentifierValues=FS,s.addFormIdentifiers=yS,s.addFormRevision=sa,s.addFormRevisionAttachment=wS,s.addFormRevisionAttachments=ro,s.addFormRevisions=Ao,s.addFormSubmission=ha,s.addFormSubmissionAttachment=KS,s.addFormSubmissionAttachments=Ct,s.addFormSubmissions=zo,s.addForms=$S,s.addGeoImage=Go,s.addGeoImages=No,s.addIssue=Ua,s.addIssueAssociation=Ia,s.addIssueAssociations=ga,s.addIssueAttachment=rT,s.addIssueAttachments=Oa,s.addIssueComment=Va,s.addIssueCommentAttachment=oT,s.addIssueCommentAttachments=pl,s.addIssueComments=AT,s.addIssueType=Oh,s.addIssueTypeAttachment=_T,s.addIssueTypeAttachments=ql,s.addIssueTypeFieldValues=Ha,s.addIssueTypeFieldValuesAttachment=XT,s.addIssueTypeFieldValuesAttachments=Lt,s.addIssueTypeFieldValuesMany=UT,s.addIssueTypeFields=ih,s.addIssueTypeFieldsAttachment=wT,s.addIssueTypeFieldsAttachments=Hl,s.addIssueTypeFieldsMany=LT,s.addIssueTypeIdentifier=xa,s.addIssueTypeIdentifierValue=an,s.addIssueTypeIdentifierValues=uI,s.addIssueTypeIdentifiers=iI,s.addIssueTypes=yI,s.addIssueUpdate=Eh,s.addIssueUpdates=jh,s.addIssues=wl,s.addOrganization=tm,s.addOrganizationAccess=Zh,s.addOrganizationAccesses=zI,s.addOrganizations=NI,s.addProject=jn,s.addProjectAccess=gn,s.addProjectAccesses=Fn,s.addProjectAttachment=ig,s.addProjectAttachments=fm,s.addProjectFile=rg,s.addProjectFiles=wm,s.addProjects=pg,s.addTeam=sp,s.addTeamMembership=Km,s.addTeamMemberships=Ym,s.addTeams=Og,s.addUser=Lh,s.addUsers=wI,s.agentsReducer=gc,s.agentsSlice=ss,s.areArraysEqual=Yp,s.assetAttachmentReducer=Mc,s.assetAttachmentSlice=as,s.assetProcedureReducer=Ir,s.assetProcedureSlice=Is,s.assetProcedureStepFieldValuesAttachmentReducer=Gr,s.assetProcedureStepFieldValuesAttachmentSlice=Cs,s.assetProcedureStepFieldValuesReducer=Jr,s.assetProcedureStepFieldValuesSlice=Bs,s.assetProcedureStepFieldsAttachmentReducer=jr,s.assetProcedureStepFieldsAttachmentSlice=Vs,s.assetProcedureStepFieldsReducer=Ur,s.assetProcedureStepFieldsSlice=Es,s.assetProcedureStepReducer=ad,s.assetProcedureStepSlice=Gs,s.assetProcedureTypeAttachmentReducer=Cc,s.assetProcedureTypeAttachmentSlice=ds,s.assetProcedureTypeFieldValuesAttachmentReducer=nr,s.assetProcedureTypeFieldValuesAttachmentSlice=ms,s.assetProcedureTypeFieldValuesReducer=pr,s.assetProcedureTypeFieldValuesSlice=As,s.assetProcedureTypeFieldsAttachmentReducer=Wc,s.assetProcedureTypeFieldsAttachmentSlice=os,s.assetProcedureTypeFieldsReducer=er,s.assetProcedureTypeFieldsSlice=ls,s.assetProcedureTypeReducer=br,s.assetProcedureTypeSlice=Os,s.assetReducer=ld,s.assetSlice=Hs,s.assetStageCompletionReducer=yd,s.assetStageCompletionSlice=Qs,s.assetStageReducer=Fd,s.assetStageSlice=ai,s.assetTypeAttachmentReducer=Ed,s.assetTypeAttachmentSlice=di,s.assetTypeFieldValuesAttachmentReducer=eu,s.assetTypeFieldValuesAttachmentSlice=pi,s.assetTypeFieldValuesReducer=ru,s.assetTypeFieldValuesSlice=yi,s.assetTypeFieldsAttachmentReducer=$d,s.assetTypeFieldsAttachmentSlice=hi,s.assetTypeFieldsReducer=Kd,s.assetTypeFieldsSlice=mi,s.assetTypeIdentifierReducer=hu,s.assetTypeIdentifierSlice=gi,s.assetTypeIdentifierValueReducer=yu,s.assetTypeIdentifierValueSlice=_i,s.assetTypeReducer=Iu,s.assetTypeSlice=Mi,s.authReducer=Pu,s.authSlice=zt,s.baseReducer=jg,s.baseReducers=Hn,s.blobToBase64=iA,s.categoryReducer=wu,s.categorySlice=zi,s.clearTokens=Qf,s.constructUploadedFilePayloads=sA,s.createModelAdapter=b,s.createOfflineAction=nm,s.createPayload=v,s.createSelectionAdapter=Wp,s.deleteAsset=Ks,s.deleteAssetAttachment=_c,s.deleteAssetAttachments=rs,s.deleteAssetProcedure=Fs,s.deleteAssetProcedureStep=sd,s.deleteAssetProcedureStepFieldValues=ks,s.deleteAssetProcedureStepFieldValuesAttachment=My,s.deleteAssetProcedureStepFieldValuesAttachments=Ot,s.deleteAssetProcedureStepFieldValuesMany=Yr,s.deleteAssetProcedureStepFields=qs,s.deleteAssetProcedureStepFieldsAttachment=py,s.deleteAssetProcedureStepFieldsAttachments=Mr,s.deleteAssetProcedureStepFieldsMany=gy,s.deleteAssetProcedureSteps=id,s.deleteAssetProcedureType=vs,s.deleteAssetProcedureTypeAttachment=zc,s.deleteAssetProcedureTypeAttachments=Uc,s.deleteAssetProcedureTypeFieldValues=fs,s.deleteAssetProcedureTypeFieldValuesAttachment=WA,s.deleteAssetProcedureTypeFieldValuesAttachments=bt,s.deleteAssetProcedureTypeFieldValuesMany=mr,s.deleteAssetProcedureTypeFields=xc,s.deleteAssetProcedureTypeFieldsAttachment=VA,s.deleteAssetProcedureTypeFieldsAttachments=Hc,s.deleteAssetProcedureTypeFieldsMany=DA,s.deleteAssetProcedureTypes=ny,s.deleteAssetProcedures=Tr,s.deleteAssetStage=ci,s.deleteAssetStageCompletion=ti,s.deleteAssetStageCompletions=si,s.deleteAssetStages=Qy,s.deleteAssetType=Ei,s.deleteAssetTypeAttachment=Rd,s.deleteAssetTypeAttachments=li,s.deleteAssetTypeFieldValues=Si,s.deleteAssetTypeFieldValuesAttachment=_f,s.deleteAssetTypeFieldValuesAttachments=qt,s.deleteAssetTypeFieldValuesMany=nu,s.deleteAssetTypeFields=Hd,s.deleteAssetTypeFieldsAttachment=of,s.deleteAssetTypeFieldsAttachments=Cd,s.deleteAssetTypeFieldsMany=ff,s.deleteAssetTypeIdentifier=Pi,s.deleteAssetTypeIdentifierValue=Ri,s.deleteAssetTypeIdentifierValues=kf,s.deleteAssetTypeIdentifiers=zf,s.deleteAssetTypes=Yf,s.deleteAssets=Ys,s.deleteCategories=nS,s.deleteCategory=Ru,s.deleteConversation=yA,s.deleteConversations=fA,s.deleteDocumentAttachment=qu,s.deleteDocumentAttachments=zu,s.deleteForm=da,s.deleteFormIdentifier=Ki,s.deleteFormIdentifierValue=Xi,s.deleteFormIdentifierValues=OS,s.deleteFormIdentifiers=IS,s.deleteFormRevision=ia,s.deleteFormRevisionAttachment=jS,s.deleteFormRevisionAttachments=oo,s.deleteFormRevisions=fo,s.deleteFormSubmission=ma,s.deleteFormSubmissionAttachment=XS,s.deleteFormSubmissionAttachments=Dt,s.deleteFormSubmissions=Co,s.deleteForms=HS,s.deleteGeoImage=fa,s.deleteGeoImages=Wo,s.deleteIssue=Ca,s.deleteIssueAssociation=Fa,s.deleteIssueAssociations=Pa,s.deleteIssueAttachment=rl,s.deleteIssueAttachments=Ra,s.deleteIssueComment=ja,s.deleteIssueCommentAttachment=fl,s.deleteIssueCommentAttachments=Sl,s.deleteIssueComments=ST,s.deleteIssueType=TI,s.deleteIssueTypeAttachment=Cl,s.deleteIssueTypeAttachments=Dl,s.deleteIssueTypeFieldValues=Wa,s.deleteIssueTypeFieldValuesAttachment=tI,s.deleteIssueTypeFieldValuesAttachments=Gt,s.deleteIssueTypeFieldValuesMany=$T,s.deleteIssueTypeFields=nh,s.deleteIssueTypeFieldsAttachment=jT,s.deleteIssueTypeFieldsAttachments=Kl,s.deleteIssueTypeFieldsMany=WT,s.deleteIssueTypeIdentifier=en,s.deleteIssueTypeIdentifierValue=nn,s.deleteIssueTypeIdentifierValues=mI,s.deleteIssueTypeIdentifiers=rI,s.deleteIssueTypes=II,s.deleteIssueUpdate=qh,s.deleteIssueUpdates=zh,s.deleteIssues=Ml,s.deleteOrganization=WI,s.deleteOrganizationAccess=Jh,s.deleteOrganizationAccesses=BI,s.deleteOrganizations=KI,s.deleteProject=qn,s.deleteProjectAccess=Pn,s.deleteProjectAccesses=bn,s.deleteProjectAttachment=gm,s.deleteProjectAttachments=wn,s.deleteProjectFile=Mm,s.deleteProjectFiles=Vm,s.deleteProjects=yg,s.deleteTeam=Ln,s.deleteTeamMembership=Bn,s.deleteTeamMemberships=Jm,s.deleteTeams=wg,s.deleteUser=Gh,s.deleteUsers=EI,s.dequeue=Sp,s.discard=Ip,s.documentAttachmentReducer=Bu,s.documentAttachmentSlice=Bi,s.documentSlice=ki,s.documentsReducer=Nu,s.downloadFile=aA,s.downloadInMemoryFile=tA,s.emailRegex=lA,s.enqueue=fp,s.enqueueRequest=rm,s.extractResponseFromError=Fp,s.fallbackToEmptyArray=T,s.fallbackToEmptyObject=Ft,s.fileReducer=Zu,s.fileSlice=Ni,s.fileToBlob=dc,s.formIdentifierReducer=eo,s.formIdentifierSlice=Hi,s.formIdentifierValueReducer=ao,s.formIdentifierValueSlice=Zi,s.formReducer=Fo,s.formRevisionAttachmentReducer=ho,s.formRevisionAttachmentSlice=ea,s.formRevisionReducer=To,s.formRevisionsSlice=ta,s.formSlice=ca,s.formSubmissionAttachmentReducer=Eo,s.formSubmissionAttachmentSlice=ua,s.formSubmissionReducer=Bo,s.formSubmissionSlice=la,s.geoImageReducer=Zo,s.geoImageSlice=ya,s.getAssetProcedureStepSubTree=Ac,s.getAssetProcedureStepTrees=hA,s.getClientSDK=Rp,s.getClientStore=Qe,s.getFileIdentifier=eA,s.getFileS3Key=ts,s.getLocalDateString=cc,s.getLocalRelativeDateString=Qp,s.getOutboxCoordinator=He,s.getRenamedFile=rc,s.hashFile=Ye,s.initSDK=dP,s.initializeAssetAttachments=ns,s.initializeAssetProcedureStepFieldValues=Hr,s.initializeAssetProcedureStepFieldValuesAttachments=Dr,s.initializeAssetProcedureStepFields=zr,s.initializeAssetProcedureStepFieldsAttachments=Rr,s.initializeAssetProcedureSteps=Qr,s.initializeAssetProcedureTypeAttachments=us,s.initializeAssetProcedureTypeFieldValues=or,s.initializeAssetProcedureTypeFieldValuesAttachments=ir,s.initializeAssetProcedureTypeFields=Jc,s.initializeAssetProcedureTypeFieldsAttachments=Lc,s.initializeAssetProcedureTypes=Pr,s.initializeAssetProcedures=fr,s.initializeAssetStageCompletions=md,s.initializeAssetStages=Id,s.initializeAssetTypeAttachments=ui,s.initializeAssetTypeFieldValues=su,s.initializeAssetTypeFieldValuesAttachments=Zd,s.initializeAssetTypeFields=Ld,s.initializeAssetTypeFieldsAttachments=qd,s.initializeAssetTypeIdentifierValues=pu,s.initializeAssetTypeIdentifiers=uu,s.initializeAssetTypes=Su,s.initializeAssets=dd,s.initializeCategories=_u,s.initializeConversations=fc,s.initializeDocumentAttachments=$i,s.initializeFormIdentifierValues=so,s.initializeFormIdentifiers=Xu,s.initializeFormRevisionAttachments=co,s.initializeFormRevisions=po,s.initializeFormSubmissionAttachments=Ro,s.initializeFormSubmissions=qo,s.initializeForms=go,s.initializeGeoImages=ko,s.initializeIssueAssociations=Xo,s.initializeIssueAttachments=_a,s.initializeIssueCommentAttachments=wa,s.initializeIssueComments=pT,s.initializeIssueTypeAttachments=La,s.initializeIssueTypeFieldValues=Ql,s.initializeIssueTypeFieldValuesAttachments=uh,s.initializeIssueTypeFields=sh,s.initializeIssueTypeFieldsAttachments=Nl,s.initializeIssueTypeIdentifierValues=gh,s.initializeIssueTypeIdentifiers=yh,s.initializeIssueTypes=_h,s.initializeIssueUpdates=Vh,s.initializeIssues=vl,s.initializeOrganizationAccesses=Yh,s.initializeOrganizations=em,s.initializeProjectAccesses=hm,s.initializeProjectAttachments=vn,s.initializeProjectFiles=vm,s.initializeProjects=Bm,s.initializeTeamMemberships=Wm,s.initializeTeams=tp,s.initializeUsers=kh,s.isToday=Xp,s.issueAssociationReducer=il,s.issueAssociationSlice=Ta,s.issueAttachmentReducer=hl,s.issueAttachmentSlice=ba,s.issueCommentAttachmentReducer=Fl,s.issueCommentAttachmentSlice=va,s.issueCommentReducer=Ol,s.issueCommentSlice=Ma,s.issueReducer=El,s.issueSlice=za,s.issueTypeAttachmentReducer=Ll,s.issueTypeAttachmentSlice=ka,s.issueTypeFieldValuesAttachmentReducer=ph,s.issueTypeFieldValuesAttachmentSlice=Ja,s.issueTypeFieldValuesReducer=eh,s.issueTypeFieldValuesSlice=Na,s.issueTypeFieldsAttachmentReducer=Jl,s.issueTypeFieldsAttachmentSlice=Ga,s.issueTypeFieldsReducer=rh,s.issueTypeFieldsSlice=Za,s.issueTypeIdentifierReducer=Th,s.issueTypeIdentifierSlice=Qa,s.issueTypeIdentifierValueReducer=Ph,s.issueTypeIdentifierValueSlice=sn,s.issueTypeReducer=wh,s.issueTypeSlice=dn,s.issueUpdateReducer=Bh,s.issueUpdateSlice=hn,s.logOnlyOnce=nA,s.markAsDeleted=dm,s.markForDeletion=QI,s.memoize=xt,s.onlyUniqueHashes=oA,s.onlyUniqueOfflineIds=mc,s.organizationAccessReducer=Xh,s.organizationAccessSlice=An,s.organizationReducer=am,s.organizationSlice=Sn,s.outboxReducer=om,s.outboxSlice=Tn,s.overmapEnhancer=Ng,s.overmapReducer=qg,s.overmapReducers=dp,s.performRequest=Jn,s.performRequestFromAction=Tp,s.projectAccessReducer=pm,s.projectAccessSlice=In,s.projectAttachmentReducer=Om,s.projectAttachmentSlice=Rn,s.projectFileReducer=Cm,s.projectFileSlice=Mn,s.projectReducer=km,s.projectSlice=En,s.rehydratedReducer=Nm,s.rehydratedSlice=Un,s.removeDocuments=Li,s.removeIssueType=un,s.restructureCreateSelectorWithArgs=f,s.runMiddleware=Vp,s.saveActiveProjectFileBounds=qm,s.selectAccessToken=xf,s.selectAccessesByUserOfProject=tg,s.selectAccessibleProjects=fg,s.selectActiveOrganizationAccess=$I,s.selectActiveProjectFileId=og,s.selectAllDocumentAttachments=Cu,s.selectAllProjectAttachments=Pm,s.selectAssetAttachmentById=vc,s.selectAssetAttachmentMapping=Oc,s.selectAssetAttachments=Rc,s.selectAssetById=Xs,s.selectAssetProcedureById=_s,s.selectAssetProcedureStepById=Ns,s.selectAssetProcedureStepFieldValues=Rt,s.selectAssetProcedureStepFieldValuesAttachmentById=Vy,s.selectAssetProcedureStepFieldValuesAttachments=$r,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=kr,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=Ds,s.selectAssetProcedureStepFieldValuesById=Ls,s.selectAssetProcedureStepFieldValuesMapping=Zr,s.selectAssetProcedureStepFieldValuesOfAsset=qy,s.selectAssetProcedureStepFieldValuesOfAssetProcedure=zy,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Uy,s.selectAssetProcedureStepFields=Us,s.selectAssetProcedureStepFieldsAttachmentById=yy,s.selectAssetProcedureStepFieldsAttachments=Er,s.selectAssetProcedureStepFieldsAttachmentsMapping=Vr,s.selectAssetProcedureStepFieldsById=_y,s.selectAssetProcedureStepFieldsMapping=zs,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=Fy,s.selectAssetProcedureStepMapping=ct,s.selectAssetProcedureSteps=nd,s.selectAssetProcedureStepsByIds=ky,s.selectAssetProcedureStepsMappingOfAssetProcedureType=By,s.selectAssetProcedureStepsOfAssetProcedureType=$y,s.selectAssetProcedureTypeAttachmentById=$c,s.selectAssetProcedureTypeAttachmentMapping=Dc,s.selectAssetProcedureTypeAttachments=Bc,s.selectAssetProcedureTypeById=Ms,s.selectAssetProcedureTypeFieldValues=Ss,s.selectAssetProcedureTypeFieldValuesAttachmentById=KA,s.selectAssetProcedureTypeFieldValuesAttachments=cr,s.selectAssetProcedureTypeFieldValuesAttachmentsByIds=rr,s.selectAssetProcedureTypeFieldValuesAttachmentsMapping=ps,s.selectAssetProcedureTypeFieldValuesById=Ts,s.selectAssetProcedureTypeFieldValuesMapping=Ar,s.selectAssetProcedureTypeFieldValuesOfAsset=JA,s.selectAssetProcedureTypeFields=hs,s.selectAssetProcedureTypeFieldsAttachmentById=jA,s.selectAssetProcedureTypeFieldsAttachments=Yc,s.selectAssetProcedureTypeFieldsAttachmentsMapping=Kc,s.selectAssetProcedureTypeFieldsById=kA,s.selectAssetProcedureTypeFieldsMapping=tr,s.selectAssetProcedureTypeFieldsOfAssetProcedureType=BA,s.selectAssetProcedureTypes=_r,s.selectAssetProcedureTypesByIds=dy,s.selectAssetProcedureTypesMapping=ws,s.selectAssetProcedureTypesOfOrganization=uy,s.selectAssetProcedures=bs,s.selectAssetProceduresByIds=sy,s.selectAssetProceduresMapping=Ps,s.selectAssetProceduresOfAssetProcedureType=gr,s.selectAssetProceduresOfAssetType=ty,s.selectAssetStageById=ri,s.selectAssetStageCompletionById=fd,s.selectAssetStageCompletionMapping=ii,s.selectAssetStageCompletions=Yy,s.selectAssetStageCompletionsByIds=Sd,s.selectAssetStages=Pd,s.selectAssetStagesByIds=tf,s.selectAssetStagesMappingOfAssetProcedureType=xy,s.selectAssetStagesOfAssetProcedureType=ef,s.selectAssetTypeAttachmentById=Md,s.selectAssetTypeAttachmentMapping=vd,s.selectAssetTypeAttachments=wd,s.selectAssetTypeById=qi,s.selectAssetTypeFieldValues=Ti,s.selectAssetTypeFieldValuesAttachmentById=Of,s.selectAssetTypeFieldValuesAttachments=Xd,s.selectAssetTypeFieldValuesAttachmentsByIds=Qd,s.selectAssetTypeFieldValuesAttachmentsMapping=Ai,s.selectAssetTypeFieldValuesById=Ii,s.selectAssetTypeFieldValuesMapping=cu,s.selectAssetTypeFieldValuesOfAsset=wf,s.selectAssetTypeFields=Et,s.selectAssetTypeFieldsAttachmentById=hf,s.selectAssetTypeFieldsAttachments=Bd,s.selectAssetTypeFieldsAttachmentsMapping=Dd,s.selectAssetTypeFieldsById=If,s.selectAssetTypeFieldsMapping=Wd,s.selectAssetTypeFieldsOfAssetType=Sf,s.selectAssetTypeIdentifierById=bi,s.selectAssetTypeIdentifierMapping=ou,s.selectAssetTypeIdentifierValueById=wi,s.selectAssetTypeIdentifierValueMapping=Au,s.selectAssetTypeIdentifierValues=vi,s.selectAssetTypeIdentifierValuesOfAsset=Lf,s.selectAssetTypeIdentifierValuesOfIdentifier=Gf,s.selectAssetTypeIdentifiers=lu,s.selectAssetTypeIdentifiersOfAssetType=Uf,s.selectAssetTypeValuesOfAssetType=Mf,s.selectAssetTypes=Tu,s.selectAssetTypesByIds=Zf,s.selectAssetTypesMapping=ji,s.selectAssetTypesOfOrganization=Jf,s.selectAssets=ud,s.selectAssetsByIds=od,s.selectAssetsMapping=Zs,s.selectAssetsOfAssetType=Js,s.selectAttachmentsOfAsset=wc,s.selectAttachmentsOfAssetProcedureStepFieldValues=Lr,s.selectAttachmentsOfAssetProcedureStepFields=Ay,s.selectAttachmentsOfAssetProcedureType=OA,s.selectAttachmentsOfAssetProcedureTypeFieldValues=dr,s.selectAttachmentsOfAssetProcedureTypeFields=EA,s.selectAttachmentsOfAssetType=Vd,s.selectAttachmentsOfAssetTypeFieldValues=xd,s.selectAttachmentsOfAssetTypeFields=lf,s.selectAttachmentsOfDocument=lS,s.selectAttachmentsOfFormRevision=qS,s.selectAttachmentsOfFormSubmission=Vo,s.selectAttachmentsOfIssue=ol,s.selectAttachmentsOfIssueComment=mT,s.selectAttachmentsOfIssueType=vT,s.selectAttachmentsOfIssueTypeFieldValues=mh,s.selectAttachmentsOfIssueTypeFields=qT,s.selectAttachmentsOfProject=_m,s.selectCategories=vu,s.selectCategoriesByIds=cS,s.selectCategoriesOfProject=rS,s.selectCategoryById=Di,s.selectCategoryMapping=Ci,s.selectCommentsOfIssue=TT,s.selectConversation=TA,s.selectConversationMapping=is,s.selectConversations=SA,s.selectCurrentUser=Hh,s.selectDeletedRequests=JI,s.selectDescendantsOfAssetProcedureStep=cd,s.selectDocumentAttachmentById=Du,s.selectDocumentAttachmentMapping=Uu,s.selectDocumentById=Gu,s.selectDocuments=Gi,s.selectDocumentsByIds=hS,s.selectDocumentsMapping=Ut,s.selectFieldValuesOfAssetProcedure=XA,s.selectFormById=_o,s.selectFormIdentifierById=Yi,s.selectFormIdentifierMapping=Qu,s.selectFormIdentifierValueById=xi,s.selectFormIdentifierValueMapping=io,s.selectFormIdentifierValues=Qi,s.selectFormIdentifierValuesOfFormSubmission=RS,s.selectFormIdentifierValuesOfIdentifier=vS,s.selectFormIdentifiers=xu,s.selectFormIdentifiersOfForm=gS,s.selectFormMapping=Po,s.selectFormRevisionAttachmentsMapping=lo,s.selectFormRevisionById=DS,s.selectFormRevisionMapping=aa,s.selectFormRevisions=na,s.selectFormRevisionsOfForm=So,s.selectFormSubmissionAttachemntsByIds=Mo,s.selectFormSubmissionAttachments=oa,s.selectFormSubmissionAttachmentsMapping=wo,s.selectFormSubmissionById=Aa,s.selectFormSubmissions=eT,s.selectFormSubmissionsMapping=pa,s.selectFormSubmissionsOfForm=Do,s.selectForms=bo,s.selectFormsOfOrganization=WS,s.selectGeoImageById=Sa,s.selectGeoImageMapping=Ko,s.selectGeoImages=Yo,s.selectGeoImagesOfProject=sT,s.selectIsImportingProjectFile=lg,s.selectIsLoggedIn=eS,s.selectIssueAssociationById=xo,s.selectIssueAssociationMapping=At,s.selectIssueAssociations=cT,s.selectIssueAssociationsOfAsset=sl,s.selectIssueAssociationsOfIssue=tl,s.selectIssueAssociationsToIssue=el,s.selectIssueAttachmentById=ll,s.selectIssueAttachmentMapping=dl,s.selectIssueAttachments=ul,s.selectIssueById=$a,s.selectIssueCommentAttachmentById=gl,s.selectIssueCommentAttachmentMapping=Tl,s.selectIssueCommentAttachments=Il,s.selectIssueCommentById=qa,s.selectIssueCommentMapping=_l,s.selectIssueMapping=Da,s.selectIssueTypeAttachmentById=kl,s.selectIssueTypeAttachmentMapping=Bl,s.selectIssueTypeAttachments=$l,s.selectIssueTypeById=ln,s.selectIssueTypeFieldValues=Ka,s.selectIssueTypeFieldValuesAttachmentById=sI,s.selectIssueTypeFieldValuesAttachments=Xa,s.selectIssueTypeFieldValuesAttachmentsByIds=hh,s.selectIssueTypeFieldValuesAttachmentsMapping=lh,s.selectIssueTypeFieldValuesById=Ya,s.selectIssueTypeFieldValuesMapping=xl,s.selectIssueTypeFieldValuesOfIssue=kT,s.selectIssueTypeFields=kt,s.selectIssueTypeFieldsAttachmentById=zT,s.selectIssueTypeFieldsAttachments=Zl,s.selectIssueTypeFieldsAttachmentsMapping=Yl,s.selectIssueTypeFieldsById=JT,s.selectIssueTypeFieldsMapping=ch,s.selectIssueTypeFieldsOfIssueType=KT,s.selectIssueTypeIdentifierById=tn,s.selectIssueTypeIdentifierMapping=fh,s.selectIssueTypeIdentifierValueById=rn,s.selectIssueTypeIdentifierValueMapping=Fh,s.selectIssueTypeIdentifierValues=cn,s.selectIssueTypeIdentifierValuesOfIdentifier=AI,s.selectIssueTypeIdentifierValuesOfIssue=pI,s.selectIssueTypeIdentifiers=Sh,s.selectIssueTypeIdentifiersOfIssueType=dI,s.selectIssueTypeMapping=on,s.selectIssueTypeValuesOfIssueType=ZT,s.selectIssueTypes=vh,s.selectIssueTypesByIds=gI,s.selectIssueTypesOfOrganization=FI,s.selectIssueUpdateMapping=Uh,s.selectIssueUpdates=Ch,s.selectIssueUpdatesOfIssue=Dh,s.selectIssues=Ba,s.selectIssuesByIds=PT,s.selectIssuesOfIssueType=Vl,s.selectIssuesOfProject=bT,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=Py,s.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=$A,s.selectLatestAssetTypeFieldsOfAssetType=Tf,s.selectLatestFieldsByAssetProcedureStep=by,s.selectLatestFormRevisionOfForm=BS,s.selectLatestIssueTypeFieldsOfIssueType=YT,s.selectLatestRetryTime=XI,s.selectMembershipsByUserOfTeam=bg,s.selectNumberOfAssetsOfAssetType=Hy,s.selectOrganizationAccessById=fn,s.selectOrganizationAccessMapping=yn,s.selectOrganizationAccessUserMapping=Qh,s.selectOrganizationById=ZI,s.selectOrganizationDocuments=pS,s.selectOrganizations=YI,s.selectOrganizationsMapping=im,s.selectProjectAccessById=On,s.selectProjectAccessMapping=_n,s.selectProjectAccesses=Wt,s.selectProjectAccessesOfProject=Am,s.selectProjectAttachmentById=bm,s.selectProjectAttachmentMapping=Fm,s.selectProjectById=Gm,s.selectProjectDocuments=mS,s.selectProjectFileById=ug,s.selectProjectFileMapping=zm,s.selectProjectFiles=Um,s.selectProjectMapping=Lm,s.selectProjects=zn,s.selectProjectsOfOrganization=Sg,s.selectRehydrated=gg,s.selectStageMapping=Vt,s.selectTeamById=Nn,s.selectTeamMembershipById=xm,s.selectTeamMemberships=$n,s.selectTeamMembershipsMapping=Qm,s.selectTeams=ap,s.selectTeamsByIds=Mg,s.selectTeamsMapping=Gn,s.selectTeamsOfOrganization=Vg,s.selectUploadUrl=Yu,s.selectUserById=Wh,s.selectUsers=pn,s.selectUsersByIds=qI,s.selectUsersMapping=Nt,s.selectUsersOfOrganization=kI,s.selectUsersOfProject=sg,s.selectUsersOfTeam=_g,s.setActiveProjectFileId=jm,s.setAsset=Gy,s.setAssetAttachment=Pc,s.setAssetAttachments=gA,s.setAssetProcedure=xA,s.setAssetProcedureStep=xr,s.setAssetProcedureStepFieldValues=Ey,s.setAssetProcedureStepFieldValuesAttachment=Ry,s.setAssetProcedureStepFieldValuesAttachments=vy,s.setAssetProcedureStepFieldValuesMany=jy,s.setAssetProcedureStepFields=Sy,s.setAssetProcedureStepFieldsAttachment=ly,s.setAssetProcedureStepFieldsAttachments=hy,s.setAssetProcedureStepFieldsMany=Ty,s.setAssetProcedureSteps=Cy,s.setAssetProcedureType=cy,s.setAssetProcedureTypeAttachment=jc,s.setAssetProcedureTypeAttachments=bA,s.setAssetProcedureTypeFieldValues=YA,s.setAssetProcedureTypeFieldValuesAttachment=GA,s.setAssetProcedureTypeFieldValuesAttachments=NA,s.setAssetProcedureTypeFieldValuesMany=ZA,s.setAssetProcedureTypeFields=zA,s.setAssetProcedureTypeFieldsAttachment=vA,s.setAssetProcedureTypeFieldsAttachments=wA,s.setAssetProcedureTypeFieldsMany=UA,s.setAssetProcedureTypes=ry,s.setAssetProcedures=ey,s.setAssetStage=gd,s.setAssetStageCompletion=Wy,s.setAssetStageCompletions=Ky,s.setAssetStages=Zy,s.setAssetType=Nf,s.setAssetTypeAttachment=_d,s.setAssetTypeAttachments=af,s.setAssetTypeFieldValues=Rf,s.setAssetTypeFieldValuesAttachment=Ff,s.setAssetTypeFieldValuesAttachments=Pf,s.setAssetTypeFieldValuesMany=vf,s.setAssetTypeFields=pf,s.setAssetTypeFieldsAttachment=rf,s.setAssetTypeFieldsAttachments=df,s.setAssetTypeFieldsMany=Af,s.setAssetTypeIdentifier=Ef,s.setAssetTypeIdentifierValue=Df,s.setAssetTypeIdentifierValues=Bf,s.setAssetTypeIdentifiers=jf,s.setAssetTypes=Hf,s.setAssets=Ny,s.setCategories=iS,s.setCategory=sS,s.setClientSDK=Op,s.setClientStore=bp,s.setConversation=Tc,s.setConversations=pA,s.setCurrentUser=jI,s.setDocumentAttachment=Eu,s.setDocumentAttachments=uS,s.setDocuments=ku,s.setForm=kS,s.setFormIdentifier=fS,s.setFormIdentifierValue=PS,s.setFormIdentifierValues=bS,s.setFormIdentifiers=SS,s.setFormRevision=yo,s.setFormRevisionAttachment=MS,s.setFormRevisionAttachments=VS,s.setFormRevisions=zS,s.setFormSubmission=Bt,s.setFormSubmissionAttachment=YS,s.setFormSubmissionAttachments=ZS,s.setFormSubmissions=QS,s.setForms=LS,s.setGeoImage=pt,s.setGeoImages=Lo,s.setIsImportingProjectFile=Em,s.setIssue=IT,s.setIssueAssociation=aT,s.setIssueAssociations=iT,s.setIssueAttachment=nl,s.setIssueAttachments=dT,s.setIssueComment=Ea,s.setIssueCommentAttachment=Al,s.setIssueCommentAttachments=lT,s.setIssueComments=bl,s.setIssueType=Tt,s.setIssueTypeAttachment=zl,s.setIssueTypeAttachments=OT,s.setIssueTypeFieldValues=CT,s.setIssueTypeFieldValuesAttachment=QT,s.setIssueTypeFieldValuesAttachments=xT,s.setIssueTypeFieldValuesMany=DT,s.setIssueTypeFields=GT,s.setIssueTypeFieldsAttachment=MT,s.setIssueTypeFieldsAttachments=VT,s.setIssueTypeFieldsMany=NT,s.setIssueTypeIdentifier=aI,s.setIssueTypeIdentifierValue=oI,s.setIssueTypeIdentifierValues=lI,s.setIssueTypeIdentifiers=nI,s.setIssueTypes=fI,s.setIssueUpdate=PI,s.setIssueUpdates=bI,s.setIssues=gT,s.setLoggedIn=Fu,s.setOrganization=GI,s.setOrganizationAccess=UI,s.setOrganizationAccesses=CI,s.setOrganizations=LI,s.setProject=mg,s.setProjectAccess=xI,s.setProjectAccesses=eg,s.setProjectAttachment=Sm,s.setProjectAttachments=Tm,s.setProjectFile=ng,s.setProjectFiles=cg,s.setProjects=hg,s.setRehydrated=Ig,s.setTeam=gt,s.setTeamMembership=Dn,s.setTeamMemberships=Zm,s.setTeams=Rg,s.setTokens=Xf,s.setUploadUrl=Ku,s.setUser=vI,s.setUsers=RI,s.shallowEqual=Kp,s.slugify=dA,s.spacesToDashesLower=rA,s.teamMembershipReducer=Xm,s.teamMembershipSlice=Cn,s.teamReducer=np,s.teamSlice=kn,s.toFileNameSafeString=cA,s.toUuidArray=hc,s.toUuidIdRecord=lc,s.truncate=uA,s.updateAsset=rt,s.updateAssetAttachment=FA,s.updateAssetAttachments=bc,s.updateAssetProcedure=st,s.updateAssetProcedureStep=vt,s.updateAssetProcedureStepFieldValues=nt,s.updateAssetProcedureStepFieldValuesAttachment=wy,s.updateAssetProcedureStepFieldValuesAttachments=Br,s.updateAssetProcedureStepFieldValuesMany=Kr,s.updateAssetProcedureStepFields=at,s.updateAssetProcedureStepFieldsAttachment=my,s.updateAssetProcedureStepFieldsAttachments=wr,s.updateAssetProcedureStepFieldsMany=Iy,s.updateAssetProcedureSteps=Dy,s.updateAssetProcedureType=it,s.updateAssetProcedureTypeAttachment=_A,s.updateAssetProcedureTypeAttachments=qc,s.updateAssetProcedureTypeFieldValues=tt,s.updateAssetProcedureTypeFieldValuesAttachment=HA,s.updateAssetProcedureTypeFieldValuesAttachments=ar,s.updateAssetProcedureTypeFieldValuesMany=hr,s.updateAssetProcedureTypeFields=Qc,s.updateAssetProcedureTypeFieldsAttachment=MA,s.updateAssetProcedureTypeFieldsAttachments=Nc,s.updateAssetProcedureTypeFieldsMany=CA,s.updateAssetProcedureTypes=ay,s.updateAssetProcedures=QA,s.updateAssetStage=Mt,s.updateAssetStageCompletion=pd,s.updateAssetStageCompletions=Ad,s.updateAssetStages=Xy,s.updateAssetType=lt,s.updateAssetTypeAttachment=nf,s.updateAssetTypeAttachments=Od,s.updateAssetTypeFieldValues=dt,s.updateAssetTypeFieldValuesAttachment=bf,s.updateAssetTypeFieldValuesAttachments=Jd,s.updateAssetTypeFieldValuesMany=au,s.updateAssetTypeFields=Nd,s.updateAssetTypeFieldsAttachment=uf,s.updateAssetTypeFieldsAttachments=Ud,s.updateAssetTypeFieldsMany=yf,s.updateAssetTypeIdentifier=ut,s.updateAssetTypeIdentifierValue=ot,s.updateAssetTypeIdentifierValues=$f,s.updateAssetTypeIdentifiers=qf,s.updateAssetTypes=Kf,s.updateAssets=Ly,s.updateCategories=aS,s.updateCategory=Ou,s.updateConversation=Ic,s.updateConversations=AA,s.updateDocumentAttachment=oS,s.updateDocumentAttachments=ju,s.updateDocuments=Ze,s.updateForm=GS,s.updateFormIdentifier=ht,s.updateFormIdentifierValue=mt,s.updateFormIdentifierValues=_S,s.updateFormIdentifiers=TS,s.updateFormRevision=US,s.updateFormRevisionAttachment=ES,s.updateFormRevisionAttachments=uo,s.updateFormRevisions=CS,s.updateFormSubmission=Uo,s.updateFormSubmissionAttachment=JS,s.updateFormSubmissionAttachments=vo,s.updateFormSubmissions=xS,s.updateForms=NS,s.updateGeoImage=Ho,s.updateGeoImages=tT,s.updateIssue=$t,s.updateIssueAssociation=Qo,s.updateIssueAssociations=nT,s.updateIssueAttachment=uT,s.updateIssueAttachments=cl,s.updateIssueComment=yT,s.updateIssueCommentAttachment=hT,s.updateIssueCommentAttachments=yl,s.updateIssueComments=fT,s.updateIssueType=Rh,s.updateIssueTypeAttachment=RT,s.updateIssueTypeAttachments=Ul,s.updateIssueTypeFieldValues=yt,s.updateIssueTypeFieldValuesAttachment=eI,s.updateIssueTypeFieldValuesAttachments=oh,s.updateIssueTypeFieldValuesMany=BT,s.updateIssueTypeFields=ah,s.updateIssueTypeFieldsAttachment=ET,s.updateIssueTypeFieldsAttachments=Wl,s.updateIssueTypeFieldsMany=HT,s.updateIssueTypeIdentifier=ft,s.updateIssueTypeIdentifierValue=St,s.updateIssueTypeIdentifierValues=hI,s.updateIssueTypeIdentifiers=cI,s.updateIssueTypes=SI,s.updateIssueUpdate=_I,s.updateIssueUpdates=OI,s.updateIssues=FT,s.updateOrganization=sm,s.updateOrganizationAccess=Ht,s.updateOrganizationAccesses=DI,s.updateOrganizations=HI,s.updateProject=$m,s.updateProjectAccess=It,s.updateProjectAccesses=mm,s.updateProjectAttachment=ag,s.updateProjectAttachments=Im,s.updateProjectFile=Vn,s.updateProjectFiles=dg,s.updateProjects=Ag,s.updateTeam=ip,s.updateTeamMembership=Fg,s.updateTeamMemberships=Pg,s.updateTeams=vg,s.updateUser=VI,s.updateUsers=MI,s.useSelectorBuilder=zg,s.userReducer=Nh,s.userSlice=mn,s.uuidObj=P,s.versioningReducer=rp,s.versioningSlice=cp,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 Dt(e),file_type:e.type,extension:Mc(e),size:e.size};return await this.client.files.addCache(e),c}}class fM extends v{constructor(){super(...arguments);h(this,"name","Form Identifier");h(this,"url","/form-identifiers");h(this,"actions",{addOne:ku,addMany:Nu,setOne:Gu,setMany:Hu,updateOne:Wu,updateMany:Ku,deleteOne:Yu,deleteMany:Zu,initialize:Lu});h(this,"selectors",{selectById:Xu,selectByIds:Qu})}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=P({...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 SM extends v{constructor(){super(...arguments);h(this,"name","Form Identifier Value");h(this,"url","/form-identifier-values");h(this,"actions",{addOne:sl,addMany:il,setOne:nl,setMany:cl,updateOne:al,updateMany:rl,deleteOne:dl,deleteMany:ul,initialize:tl});h(this,"selectors",{selectById:ol,selectByIds:hl})}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=P({...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 this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class AM extends j{constructor(){super(...arguments);h(this,"name","Form Revision Attachment");h(this,"url","/form-revision-attachments");h(this,"actions",{addOne:fl,addMany:Sl,setOne:Al,setMany:Il,updateOne:Tl,updateMany:Pl,deleteOne:Ol,deleteMany:Fl,initialize:yl});h(this,"selectors",{selectById:_l,selectByIds:gl})}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 P({...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 IM extends v{constructor(){super(...arguments);h(this,"name","Form Revision");h(this,"url","/form-revisions");h(this,"actions",{addOne:vl,addMany:ei,setOne:El,setMany:Bl,updateOne:Vl,updateMany:zl,deleteOne:Dl,deleteMany:ti,initialize:wl});h(this,"selectors",{selectById:ql,selectByIds:Cl})}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=P({...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 TM extends v{constructor(){super(...arguments);h(this,"name","Form");h(this,"url","/forms");h(this,"actions",{addOne:Nl,addMany:Gl,setOne:Hl,setMany:Wl,updateOne:Kl,updateMany:Yl,deleteOne:Zl,deleteMany:Jl,initialize:kl});h(this,"selectors",{selectById:xl,selectByIds:eo})}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=P({...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(_o(e)),d=this.select($l(e));this.dispatch(n(e)),this.dispatch(hi(E(u))),this.dispatch(ti(E(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(ei(d)),this.dispatch(oi(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 PM extends j{constructor(){super(...arguments);h(this,"name","Form Submission Attachment");h(this,"url","/form-submission-attachments");h(this,"actions",{addOne:io,addMany:ci,setOne:no,setMany:co,updateOne:ao,updateMany:ro,deleteOne:uo,deleteMany:ai,initialize:so});h(this,"selectors",{selectById:lo,selectByIds:oo})}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 P({...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(ui(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 this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(c(a)),a}}class OM extends v{constructor(){super(...arguments);h(this,"name","Form Submission");h(this,"url","/form-submissions");h(this,"actions",{addOne:Ao,addMany:oi,setOne:fo,setMany:So,updateOne:Io,updateMany:To,deleteOne:Po,deleteMany:hi,initialize:yo});h(this,"selectors",{selectById:Fo,selectByIds:bo})}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=P({...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(ho(e));this.dispatch(n(e)),this.dispatch(ai(E(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(ci(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(c(a)),a}}class FM extends j{constructor(){super(...arguments);h(this,"name","Geo Image");h(this,"url","/geo-images");h(this,"actions",{addOne:Eo,addMany:Bo,setOne:wo,setMany:vo,updateOne:Vo,updateMany:zo,deleteOne:Do,deleteMany:jo,initialize:Ro});h(this,"selectors",{selectById:Co,selectByIds:$o})}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 P({...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 bM extends v{constructor(){super(...arguments);h(this,"name","Issue Association");h(this,"url","/issue-associations");h(this,"actions",{addOne:Ko,addMany:ft,setOne:Go,setMany:No,updateOne:Ho,updateMany:Wo,deleteOne:Yo,deleteMany:St,initialize:ko});h(this,"selectors",{selectById:Jo,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=P({...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=>P({...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:E(d)});return p.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(c(E(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 _M extends j{constructor(){super(...arguments);h(this,"name","Issue Attachment");h(this,"url","/issue-attachments");h(this,"actions",{addOne:ch,addMany:Ai,setOne:ah,setMany:rh,updateOne:dh,updateMany:uh,deleteOne:lh,deleteMany:Ii,initialize:nh});h(this,"selectors",{selectById:mh,selectByIds:ph})}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 P({...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 gM extends j{constructor(){super(...arguments);h(this,"name","Issue Comment Attachment");h(this,"url","/issue-comment-attachments");h(this,"actions",{addOne:Ah,addMany:Ih,setOne:Th,setMany:Ph,updateOne:Oh,updateMany:Fh,deleteOne:bh,deleteMany:_h,initialize:Sh});h(this,"selectors",{selectById:Mh,selectByIds:Rh})}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 P({...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 MM extends v{constructor(){super(...arguments);h(this,"name","Issue Comment");h(this,"url","/issue-comments");h(this,"actions",{addOne:Bh,addMany:Vh,setOne:zh,setMany:Dh,updateOne:jh,updateMany:qh,deleteOne:Ch,deleteMany:$h,initialize:Eh});h(this,"selectors",{selectById:Uh,selectByIds:Lh})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=P({...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 RM extends v{constructor(){super(...arguments);h(this,"name","Issue");h(this,"url","/issues");h(this,"actions",{addOne:Hh,addMany:gi,setOne:Wh,setMany:Kh,updateOne:Yh,updateMany:Zh,deleteOne:Jh,deleteMany:Mi,initialize:Gh});h(this,"selectors",{selectById:Qh,selectByIds:xh})}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=P({...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(Ni(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(Yi(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(Qt(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=P({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(Ji(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(Qi(d.uuid))}),[a,p]}bulkUpdate(e,n){const{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,a=E(e).toSorted(jt);if(a.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=this.select(r(a)).toSorted(hs);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=at(e,Math.min(n??e.length,k)),m=[];let f=null;for(const I of p){const R=rt.v4(),b=E(I),g=I.map(({status:B})=>B).filter(Boolean),_=I.map(({priority:B})=>B).filter(Boolean),w=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(w),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(xo(e)),d=this.select(hh(e)),p=this.select($y(e));this.dispatch(n(e)),this.dispatch(Ii(E(d))),this.dispatch(xi(E(p))),this.dispatch(St(E(u)));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(a)),this.dispatch(Ai(d)),this.dispatch(Xi(p)),this.dispatch(ft(u)),m}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e)),u=this.select(Qo(e));this.dispatch(c(e)),this.dispatch(St(E(u)));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(d){throw this.dispatch(n(a)),this.dispatch(ft(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 wM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Attachment");h(this,"url","/issue-type-attachments");h(this,"actions",{addOne:nm,addMany:cm,setOne:am,setMany:rm,updateOne:dm,updateMany:um,deleteOne:lm,deleteMany:om,initialize:im});h(this,"selectors",{selectById:mm,selectByIds:pm})}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 P({...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 vM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Fields Attachment");h(this,"url","/issue-type-fields-attachments");h(this,"actions",{addOne:Am,addMany:Im,setOne:Tm,setMany:Pm,updateOne:Om,updateMany:Fm,deleteOne:bm,deleteMany:_m,initialize:Sm});h(this,"selectors",{selectById:Mm,selectByIds:Rm})}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 P({...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 EM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Fields");h(this,"url","/issue-type-fields");h(this,"actions",{addOne:Wm,addMany:Km,setOne:Ym,setMany:Zm,updateOne:Jm,updateMany:Xm,deleteOne:Qm,deleteMany:xm,initialize:Hm});h(this,"selectors",{selectById:tp,selectByIds:sp})}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=P({...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:ap,addMany:Di,setOne:rp,setMany:dp,updateOne:up,updateMany:lp,deleteOne:op,deleteMany:ji,initialize:cp});h(this,"selectors",{selectById:mp,selectByIds:pp})}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 P({...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 VM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Field Values");h(this,"url","/issue-type-field-values");h(this,"actions",{addOne:Bm,addMany:Vm,setOne:zm,setMany:Dm,updateOne:jm,updateMany:qm,deleteOne:Cm,deleteMany:$m,initialize:Em});h(this,"selectors",{selectById:Lm,selectByIds:km})}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=P({...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(yp(e));this.dispatch(n(e)),this.dispatch(ji(E(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(Di(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 zM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier");h(this,"url","/issue-type-identifiers");h(this,"actions",{addOne:Ip,addMany:Tp,setOne:Pp,setMany:Op,updateOne:Fp,updateMany:bp,deleteOne:_p,deleteMany:gp,initialize:Ap});h(this,"selectors",{selectById:Rp,selectByIds:wp})}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=P({...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 DM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier Value");h(this,"url","/issue-type-identifier-values");h(this,"actions",{addOne:Vp,addMany:zp,setOne:Dp,setMany:jp,updateOne:qp,updateMany:Cp,deleteOne:$p,deleteMany:Up,initialize:Bp});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=P({...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 jM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Priority");h(this,"url","/issue-type-priorities");h(this,"actions",{addOne:Kp,addMany:Yp,setOne:Zp,setMany:Jp,updateOne:Xp,updateMany:Qp,deleteOne:xp,deleteMany:ey,initialize:Wp});h(this,"selectors",{selectById:Ni,selectByIds:sy})}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=P({...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 qM extends v{constructor(){super(...arguments);h(this,"name","Issue Type");h(this,"url","/issue-types");h(this,"actions",{addOne:ay,addMany:ry,setOne:dy,setMany:uy,updateOne:ly,updateMany:oy,deleteOne:hy,deleteMany:my,initialize:cy});h(this,"selectors",{selectById:yy,selectByIds:fy})}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=P({...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(em(e));this.dispatch(n(e)),this.dispatch(Mi(E(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(gi(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 CM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Status");h(this,"url","/issue-type-statuses");h(this,"actions",{addOne:Ty,addMany:Py,setOne:Oy,setMany:Fy,updateOne:by,updateMany:_y,deleteOne:gy,deleteMany:My,initialize:Iy});h(this,"selectors",{selectById:Yi,selectByIds:wy})}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=P({...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 $M extends v{constructor(){super(...arguments);h(this,"name","Issue Update");h(this,"url","/issue-updates");h(this,"actions",{addOne:Ji,addMany:Xi,setOne:Vy,setMany:zy,updateOne:Dy,updateMany:jy,deleteOne:Qi,deleteMany:xi,initialize:By});h(this,"selectors",{selectById:qy,selectByIds:Cy})}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 UM=1800;function LM(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 kM extends Xg{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(Kd(!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=mb(e).exp??n}catch{c=n}return c-n<UM}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??Pt).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=rt.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(LM(c))})}}class NM extends ht{constructor(){super(...arguments);h(this,"name","Organization Access");h(this,"url","/organization-accesses");h(this,"actions",{addOne:ef,addMany:tf,setOne:sf,setMany:nf,updateOne:cf,updateMany:af,deleteOne:rf,deleteMany:df,initialize:xy});h(this,"selectors",{selectById:lf,selectByIds:of})}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(Qt(a.user));this.dispatch(n(a.uuid)),this.dispatch(cn(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(nn(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 GM extends ht{constructor(){super(...arguments);h(this,"name","Organization");h(this,"url","/organizations");h(this,"actions",{addOne:Af,addMany:Sf,setOne:ff,setMany:yf,updateOne:Tf,updateMany:If,deleteOne:Pf,deleteMany:Of,initialize:pf});h(this,"selectors",{selectById:_f,selectByIds:gf})}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 HM extends v{constructor(){super(...arguments);h(this,"name","Project Access");h(this,"url","/project-accesses");h(this,"actions",{addOne:jf,addMany:qf,setOne:Cf,setMany:$f,updateOne:Uf,updateMany:Lf,deleteOne:kf,deleteMany:Nf,initialize:Df});h(this,"selectors",{selectById:Hf,selectByIds:Wf})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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=>P({...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 WM extends j{constructor(){super(...arguments);h(this,"name","Project Attachment");h(this,"url","/project-attachments");h(this,"actions",{addOne:Zf,addMany:Jf,setOne:Xf,setMany:Qf,updateOne:xf,updateMany:eS,deleteOne:tS,deleteMany:sS,initialize:Yf});h(this,"selectors",{selectById:nS,selectByIds:cS})}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 P({...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 KM extends v{constructor(){super(...arguments);h(this,"name","Project Comment");h(this,"url","/project-comments");h(this,"actions",{addOne:uS,addMany:lS,setOne:oS,setMany:hS,updateOne:mS,updateMany:pS,deleteOne:yS,deleteMany:fS,initialize:dS});h(this,"selectors",{selectById:AS,selectByIds:IS})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=P({...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 YM extends j{constructor(){super(...arguments);h(this,"name","Project File");h(this,"url","/project-files");h(this,"actions",{addOne:_S,addMany:gS,setOne:FS,setMany:bS,updateOne:MS,updateMany:RS,deleteOne:wS,deleteMany:vS,initialize:OS});h(this,"selectors",{selectById:VS,selectByIds:zS})}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 P({...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 ZM extends ht{constructor(){super(...arguments);h(this,"name","Project");h(this,"url","/projects");h(this,"actions",{addOne:LS,addMany:US,setOne:$S,setMany:CS,updateOne:NS,updateMany:kS,deleteOne:GS,deleteMany:HS,initialize:qS});h(this,"selectors",{selectById:YS,selectByIds:ZS})}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 JM extends v{constructor(){super(...arguments);h(this,"name","Procedure");h(this,"url","/procedures");h(this,"actions",{addOne:hA,addMany:It,setOne:mA,setMany:pA,updateOne:yA,updateMany:fA,deleteOne:SA,deleteMany:Tt,initialize:oA});h(this,"selectors",{selectById:TA,selectByIds:PA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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=at(e,Math.min(n??e.length,k)),I=[];for(const g of f){const _=[],w=[],B=[];for(const D of g){const z=P({...D,submitted_at:d,created_by:p});m.push(z),_.push(M(z)),w.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:w,blocks:B};I.push(C)}this.dispatch(r(m));const R=I.map(g=>{const{payload:_,blocks:w,blockers:B}=g;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:_,blockers:B,blocks:w})});return Promise.all(R).then(g=>{this.dispatch(a(g.flat()))}).catch(()=>{this.dispatch(u(E(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(E(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 XM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Assignee");h(this,"url","/procedure-step-assignees");h(this,"actions",{addOne:RA,addMany:wA,setOne:vA,setMany:EA,updateOne:BA,updateMany:VA,deleteOne:zA,deleteMany:DA,initialize:MA});h(this,"selectors",{selectById:qA,selectByIds:CA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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=>P({...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:E(d)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(E(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 QM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Comment");h(this,"url","/procedure-step-comments");h(this,"actions",{addOne:kA,addMany:NA,setOne:GA,setMany:HA,updateOne:WA,updateMany:KA,deleteOne:YA,deleteMany:ZA,initialize:LA});h(this,"selectors",{selectById:XA,selectByIds:QA})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=P({...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 xM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Assignee");h(this,"url","/procedure-step-default-assignees");h(this,"actions",{addOne:sI,addMany:iI,setOne:nI,setMany:cI,updateOne:aI,updateMany:rI,deleteOne:dI,deleteMany:uI,initialize:tI});h(this,"selectors",{selectById:oI,selectByIds:hI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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 eR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Reviewer");h(this,"url","/procedure-step-default-reviewers");h(this,"actions",{addOne:fI,addMany:SI,setOne:AI,setMany:II,updateOne:TI,updateMany:PI,deleteOne:OI,deleteMany:FI,initialize:yI});h(this,"selectors",{selectById:_I,selectByIds:gI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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 tR extends ht{constructor(){super(...arguments);h(this,"name","Procedure Step Event");h(this,"url","/procedure-step-events");h(this,"actions",{addOne:vI,addMany:EI,setOne:BI,setMany:VI,updateOne:zI,updateMany:DI,deleteOne:jI,deleteMany:qI,initialize:wI});h(this,"selectors",{selectById:$I,selectByIds:UI})}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 sR extends j{constructor(){super(...arguments);h(this,"name","Procedure Step Fields Attachment");h(this,"url","/procedure-step-fields-attachments");h(this,"actions",{addOne:GI,addMany:Mn,setOne:HI,setMany:WI,updateOne:KI,updateMany:YI,deleteOne:ZI,deleteMany:Rn,initialize:NI});h(this,"selectors",{selectById:QI,selectByIds:xI})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){return P({...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 iR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Fields");h(this,"url","/procedure-step-fields");h(this,"actions",{addOne:iT,addMany:nT,setOne:cT,setMany:aT,updateOne:rT,updateMany:dT,deleteOne:uT,deleteMany:lT,initialize:sT});h(this,"selectors",{selectById:oT,selectByIds:hT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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(Rn(E(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(Mn(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 nR 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:fT,addMany:Vn,setOne:ST,setMany:AT,updateOne:IT,updateMany:TT,deleteOne:PT,deleteMany:zn,initialize:yT});h(this,"selectors",{selectById:FT,selectByIds:bT})}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 P({...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 cR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values Review");h(this,"url","/procedure-step-field-values-reviews");h(this,"actions",{addOne:NT,addMany:Cn,setOne:GT,setMany:HT,updateOne:WT,updateMany:KT,deleteOne:YT,deleteMany:$n,initialize:kT});h(this,"selectors",{selectById:JT,selectByIds:XT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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 aR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values");h(this,"url","/procedure-step-field-values");h(this,"actions",{addOne:wT,addMany:vT,setOne:ET,setMany:BT,updateOne:VT,updateMany:zT,deleteOne:DT,deleteMany:jT,initialize:RT});h(this,"selectors",{selectById:$T,selectByIds:UT})}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=P({...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=at(e,Math.min(n??e.length,k)),f=[];for(const R of m){const b=[],g=[],_=[];for(const w of R){const B=P({...w,values:w.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(E(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(_T(e)),d=this.select(QT(e));this.dispatch(n(e)),this.dispatch(zn(E(u))),this.dispatch($n(E(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(Vn(u)),this.dispatch(Cn(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 rR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Reviewer");h(this,"url","/procedure-step-reviewers");h(this,"actions",{addOne:sP,addMany:iP,setOne:nP,setMany:cP,updateOne:aP,updateMany:rP,deleteOne:dP,deleteMany:uP,initialize:tP});h(this,"selectors",{selectById:oP,selectByIds:hP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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=>P({...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 dR extends v{constructor(){super(...arguments);h(this,"name","Procedure Initiative");h(this,"url","/procedure-initiatives");h(this,"actions",{addOne:QS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:cA,initialize:XS});h(this,"selectors",{selectById:dA,selectByIds:uA})}add(e){var p;const{store:n}=this.client,{addOne:c,setOne:r,deleteOne:a}=this.actions,u=P({...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(_A(e));this.dispatch(n(e)),this.dispatch(Tt(E(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(It(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 uR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step");h(this,"url","/procedure-steps");h(this,"actions",{addOne:AP,addMany:IP,setOne:fP,setMany:SP,updateOne:TP,updateMany:PP,deleteOne:OP,deleteMany:FP,initialize:yP});h(this,"selectors",{selectById:_P,selectByIds:gP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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 lR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Attachment");h(this,"url","/procedure-type-attachments");h(this,"actions",{addOne:wP,addMany:vP,setOne:EP,setMany:BP,updateOne:VP,updateMany:zP,deleteOne:DP,deleteMany:jP,initialize:RP});h(this,"selectors",{selectById:$P,selectByIds:UP})}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 P({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 oR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Fields Attachment");h(this,"url","/procedure-type-fields-attachments");h(this,"actions",{addOne:NP,addMany:GP,setOne:HP,setMany:WP,updateOne:KP,updateMany:YP,deleteOne:ZP,deleteMany:JP,initialize:kP});h(this,"selectors",{selectById:xP,selectByIds:eO})}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 P({...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 hR extends v{constructor(){super(...arguments);h(this,"name","Procedure Type Fields");h(this,"url","/procedure-type-fields");h(this,"actions",{addOne:iO,addMany:nO,setOne:cO,setMany:aO,updateOne:rO,updateMany:dO,deleteOne:uO,deleteMany:lO,initialize:sO});h(this,"selectors",{selectById:mO,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=P({...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 mR extends j{constructor(){super(...arguments);h(this,"name","Procedure Field Values Attachment");h(this,"url","/procedure-field-values-attachments");h(this,"actions",{addOne:SO,addMany:Jn,setOne:AO,setMany:IO,updateOne:TO,updateMany:PO,deleteOne:OO,deleteMany:Xn,initialize:fO});h(this,"selectors",{selectById:_O,selectByIds:gO})}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 P({...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 pR extends v{constructor(){super(...arguments);h(this,"name","Procedure Field Values");h(this,"url","/procedure-field-values");h(this,"actions",{addOne:vO,addMany:EO,setOne:BO,setMany:VO,updateOne:zO,updateMany:DO,deleteOne:jO,deleteMany:qO,initialize:wO});h(this,"selectors",{selectById:UO,selectByIds:LO})}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=P({...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=at(e,Math.min(n??e.length,k)),f=[];for(const R of m){const b=[],g=[],_=[];for(const w of R){const B=P({...w,values:w.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(E(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(MO(e));this.dispatch(n(e)),this.dispatch(Xn(E(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(Jn(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 yR extends v{constructor(){super(...arguments);h(this,"name","Procedure Type");h(this,"url","/procedure-types");h(this,"actions",{addOne:GO,addMany:HO,setOne:WO,setMany:KO,updateOne:YO,updateMany:ZO,deleteOne:JO,deleteMany:XO,initialize:NO});h(this,"selectors",{selectById:eF,selectByIds:tF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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(OA(e));this.dispatch(n(e)),this.dispatch(Tt(E(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(It(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 fR extends v{constructor(){super(...arguments);h(this,"name","Team Membership");h(this,"url","/team-memberships");h(this,"actions",{addOne:cF,addMany:aF,setOne:rF,setMany:dF,updateOne:uF,updateMany:lF,deleteOne:oF,deleteMany:hF,initialize:nF});h(this,"selectors",{selectById:yF,selectByIds:fF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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=>P({...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 SR extends v{constructor(){super(...arguments);h(this,"name","Team");h(this,"url","/teams");h(this,"actions",{addOne:IF,addMany:TF,setOne:PF,setMany:OF,updateOne:FF,updateMany:bF,deleteOne:_F,deleteMany:gF,initialize:AF});h(this,"selectors",{selectById:RF,selectByIds:wF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...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 AR extends ht{constructor(){super(...arguments);h(this,"name","User");h(this,"url","/user");h(this,"actions",{addOne:nn,addMany:Hy,setOne:Gy,setMany:Ny,updateOne:Ky,updateMany:Wy,deleteOne:cn,deleteMany:Yy,initialize:ky});h(this,"selectors",{selectById:Qt,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 lc(t,s,e,n,c){const r=n instanceof ot;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 w=I?await e.files.fetchCache(I):void 0;if(I&&!w)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(!w)throw new Error(`No file for file ${I}`);const N=u.fields["x-amz-checksum-sha1"];if(!N)throw new Error(`No checksum for file ${I}`);return q.set("x-amz-checksum-sha1",N).field({...d,...u.fields}).attach("file",w)}return q.send(d)},D={[o.GET]:()=>g?pt.get(_.toString()).responseType("blob"):pt.get(_.toString()),[o.POST]:()=>{const q=pt.post(_.toString());return B(q)},[o.PATCH]:()=>{const q=pt.patch(_.toString());return B(q)},[o.PUT]:()=>{const q=pt.put(_.toString());return B(q)},[o.DELETE]:()=>{const q=pt.delete(_.toString());return B(q)}}[m];let z=D();const bt=()=>{console.debug("aborting request:",s.url),z.abort()};if(c==null||c.addEventListener("abort",bt),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 N=KF(q),as=N==null?void 0:N.status;if(r&&as===401)return await n.auth.handleUnauthorized(z,N),z.query(f);throw new U({response:N,innerError:q,discard:dc.includes(as)})}finally{c==null||c.removeEventListener("abort",bt)}}class IR{constructor(s){h(this,"store");this.store=s}_performRequest(s,e,n,c){const r=new rs,a={...e,uuid:e.uuid??rt.v4()};return lc(s,a,this,n,c).then(u=>{r.resolve(u.body)}).catch(u=>{u instanceof Error?r.reject(u):r.reject(new Error((u??Pt).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 rs,r={...s,BASE_URL:e,serviceName:n},a=this.store.dispatch(vf(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 Ot{constructor(){h(this,"graph");h(this,"requestAttemptCounter");this.graph=new pb.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Ot;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))&&Ot._addDependency(c.payload.uuid,a.payload.uuid,e.graph)}}return e}_addDependency(s,e){Ot._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 YF;function ZF(t){YF=t}function Ft(){return YF}let JF;function XF(t){JF=t}function QF(){return JF}let oc=null;function mt(){const t=Ft();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(oc)return oc;const s=t.getState().offline.outbox,e=Ot._fromOutbox(s);return oc=e,e}const TR=(t,s)=>{const e=new s(t);return XF(e),ZF(t),e};class PR{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 hc{constructor(){h(this,"next");this.next=null}then(s){return new PR(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Ft())throw new Error("Client store not set");const n=QF();if(!n)throw new Error("Client SDK not set");return GF(s,n)}}}class xF extends hc{async run(s){return super.run(s)}}class eb extends hc{async run(s){return super.run(s)}}const tb=new xF().then(new eb).compile();function sb(t){var s;return(s=tb[0])==null?void 0:s.run(t)}var ib=(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))(ib||{});i.ALL_MIDDLEWARE=tb,i.APIError=U,i.AgentService=Qg,i.AssetAttachmentService=xg,i.AssetCommentService=eM,i.AssetService=tM,i.AssetStatusType=Tc,i.AssetTypeAttachmentService=sM,i.AssetTypeFieldValuesAttachmentService=cM,i.AssetTypeFieldValuesService=aM,i.AssetTypeFieldsAttachmentService=iM,i.AssetTypeFieldsService=nM,i.AssetTypeIdentifierService=rM,i.AssetTypeIdentifierValueService=dM,i.AssetTypeService=uM,i.AssetTypeStatusService=lM,i.AttachmentModel=Pc,i.BaseApiService=ot,i.BaseModelApiService=ht,i.BaseOfflineFileModelApiService=j,i.BaseOfflineModelApiService=v,i.BaseSDK=IR,i.COMMON_AUTO_FIELDS=Bc,i.DEFAULT_PAGE_SIZE=zF,i.DISCARD_HTTP_STATUSES=dc,i.DeferredPromise=rs,i.DocumentAttachmentService=oM,i.DocumentService=hM,i.EMPTY_ARRAY=fc,i.EMPTY_OBJECT=Sc,i.EmailDomainsService=mM,i.EmailVerificationService=pM,i.FILE_MODEL_DEFAULT_PAGE_SIZE=DF,i.FileService=yM,i.FormIdentifierService=fM,i.FormIdentifierValueService=SM,i.FormRevisionAttachmentService=AM,i.FormRevisionService=IM,i.FormService=TM,i.FormSubmissionAttachmentService=PM,i.FormSubmissionService=OM,i.GeoImageService=FM,i.HttpMethod=o,i.IssueAssociationService=bM,i.IssueAttachmentService=_M,i.IssueCommentAttachmentService=gM,i.IssueCommentService=MM,i.IssuePriorityType=Fc,i.IssueService=RM,i.IssueStatusType=Oc,i.IssueTypeAttachmentService=wM,i.IssueTypeFieldValuesAttachmentService=BM,i.IssueTypeFieldValuesService=VM,i.IssueTypeFieldsAttachmentService=vM,i.IssueTypeFieldsService=EM,i.IssueTypeIdentifierService=zM,i.IssueTypeIdentifierValueService=DM,i.IssueTypePriorityService=jM,i.IssueTypeService=qM,i.IssueTypeStatusService=CM,i.IssueUpdateChange=$,i.IssueUpdateService=$M,i.JWTService=kM,i.MAX_SERVICE_BATCH_SIZE=k,i.OUTBOX_RETRY_DELAY=Ac,i.OfflineAnalyticsMiddleware=xF,i.OfflineMiddleware=hc,i.OrganizationAccessLevel=Ic,i.OrganizationAccessService=NM,i.OrganizationService=GM,i.OutboxCoordinator=Ot,i.ProcdureInitiativeService=dR,i.ProcedureFieldValuesAttachmentService=mR,i.ProcedureFieldValuesService=pR,i.ProcedureService=JM,i.ProcedureStepAssigneeService=XM,i.ProcedureStepCommentService=QM,i.ProcedureStepDefaultAssigneeService=xM,i.ProcedureStepDefaultReviewerService=eR,i.ProcedureStepEventService=tR,i.ProcedureStepEventType=bc,i.ProcedureStepFieldValuesAttachmentService=nR,i.ProcedureStepFieldValuesReviewService=cR,i.ProcedureStepFieldValuesReviewType=_c,i.ProcedureStepFieldValuesService=aR,i.ProcedureStepFieldsAttachmentService=sR,i.ProcedureStepFieldsService=iR,i.ProcedureStepReviewerService=rR,i.ProcedureStepService=uR,i.ProcedureTypeAttachmentService=lR,i.ProcedureTypeFieldsAttachmentService=oR,i.ProcedureTypeFieldsService=hR,i.ProcedureTypeService=yR,i.ProjectAccessService=HM,i.ProjectAttachmentService=WM,i.ProjectCommentService=KM,i.ProjectFileService=YM,i.ProjectService=ZM,i.RESET_ORGANIZATION_STATE=F,i.RESET_PROJECT_STATE=V,i.RESET_STATE=T,i.RateLimitingMiddleware=eb,i.SelectorBuilder=jb,i.TeamMembershipService=fR,i.TeamService=SR,i.UNKNOWN_ERROR_MESSAGE=Pt,i.UserService=AR,i.VERSION_REDUCER_KEY=gt,i.VerificationCodeType=ib,i._setLatestRetryTime=Bf,i.addAsset=Ia,i.addAssetAttachment=Wc,i.addAssetAttachments=fs,i.addAssetComment=ca,i.addAssetComments=qt,i.addAssetType=Od,i.addAssetTypeAttachment=Ba,i.addAssetTypeAttachments=bs,i.addAssetTypeFieldValues=Br,i.addAssetTypeFieldValuesAttachment=Ir,i.addAssetTypeFieldValuesAttachments=Es,i.addAssetTypeFieldValuesMany=Vr,i.addAssetTypeFields=cr,i.addAssetTypeFieldsAttachment=Ha,i.addAssetTypeFieldsAttachments=Wa,i.addAssetTypeFieldsMany=ar,i.addAssetTypeIdentifier=Wr,i.addAssetTypeIdentifierValue=ad,i.addAssetTypeIdentifierValues=rd,i.addAssetTypeIdentifiers=Kr,i.addAssetTypeStatus=zd,i.addAssetTypeStatuses=Dd,i.addAssetTypes=Fd,i.addAssets=Ps,i.addConversation=Uc,i.addConversations=qb,i.addDocument=ou,i.addDocumentAttachment=Xd,i.addDocumentAttachments=Qd,i.addDocuments=hu,i.addEmailDomain=_u,i.addEmailDomains=gu,i.addForm=Nl,i.addFormIdentifier=ku,i.addFormIdentifierValue=sl,i.addFormIdentifierValues=il,i.addFormIdentifiers=Nu,i.addFormRevision=vl,i.addFormRevisionAttachment=fl,i.addFormRevisionAttachments=Sl,i.addFormRevisions=ei,i.addFormSubmission=Ao,i.addFormSubmissionAttachment=io,i.addFormSubmissionAttachments=ci,i.addFormSubmissions=oi,i.addForms=Gl,i.addGeoImage=Eo,i.addGeoImages=Bo,i.addIssue=Hh,i.addIssueAssociation=Ko,i.addIssueAssociations=ft,i.addIssueAttachment=ch,i.addIssueAttachments=Ai,i.addIssueComment=Bh,i.addIssueCommentAttachment=Ah,i.addIssueCommentAttachments=Ih,i.addIssueComments=Vh,i.addIssueType=ay,i.addIssueTypeAttachment=nm,i.addIssueTypeAttachments=cm,i.addIssueTypeFieldValues=Bm,i.addIssueTypeFieldValuesAttachment=ap,i.addIssueTypeFieldValuesAttachments=Di,i.addIssueTypeFieldValuesMany=Vm,i.addIssueTypeFields=Wm,i.addIssueTypeFieldsAttachment=Am,i.addIssueTypeFieldsAttachments=Im,i.addIssueTypeFieldsMany=Km,i.addIssueTypeIdentifier=Ip,i.addIssueTypeIdentifierValue=Vp,i.addIssueTypeIdentifierValues=zp,i.addIssueTypeIdentifiers=Tp,i.addIssueTypePriorities=Yp,i.addIssueTypePriority=Kp,i.addIssueTypeStatus=Ty,i.addIssueTypeStatuses=Py,i.addIssueTypes=ry,i.addIssueUpdate=Ji,i.addIssueUpdates=Xi,i.addIssues=gi,i.addOrganization=Af,i.addOrganizationAccess=ef,i.addOrganizationAccesses=tf,i.addOrganizations=Sf,i.addProcedure=hA,i.addProcedureFieldValues=vO,i.addProcedureFieldValuesAttachment=SO,i.addProcedureFieldValuesAttachments=Jn,i.addProcedureFieldValuesMany=EO,i.addProcedureInitiative=QS,i.addProcedureInitiatives=xS,i.addProcedureStep=AP,i.addProcedureStepAssignee=RA,i.addProcedureStepAssignees=wA,i.addProcedureStepComment=kA,i.addProcedureStepComments=NA,i.addProcedureStepDefaultAssignee=sI,i.addProcedureStepDefaultAssignees=iI,i.addProcedureStepDefaultReviewer=fI,i.addProcedureStepDefaultReviewers=SI,i.addProcedureStepEvent=vI,i.addProcedureStepEvents=EI,i.addProcedureStepFieldValues=wT,i.addProcedureStepFieldValuesAttachment=fT,i.addProcedureStepFieldValuesAttachments=Vn,i.addProcedureStepFieldValuesMany=vT,i.addProcedureStepFieldValuesReview=NT,i.addProcedureStepFieldValuesReviews=Cn,i.addProcedureStepFields=iT,i.addProcedureStepFieldsAttachment=GI,i.addProcedureStepFieldsAttachments=Mn,i.addProcedureStepFieldsMany=nT,i.addProcedureStepReviewer=sP,i.addProcedureStepReviewers=iP,i.addProcedureSteps=IP,i.addProcedureType=GO,i.addProcedureTypeAttachment=wP,i.addProcedureTypeAttachments=vP,i.addProcedureTypeFields=iO,i.addProcedureTypeFieldsAttachment=NP,i.addProcedureTypeFieldsAttachments=GP,i.addProcedureTypeFieldsMany=nO,i.addProcedureTypes=HO,i.addProcedures=It,i.addProject=LS,i.addProjectAccess=jf,i.addProjectAccesses=qf,i.addProjectAttachment=Zf,i.addProjectAttachments=Jf,i.addProjectComment=uS,i.addProjectComments=lS,i.addProjectFile=_S,i.addProjectFiles=gS,i.addProjects=US,i.addTeam=IF,i.addTeamMembership=cF,i.addTeamMemberships=aF,i.addTeams=TF,i.addUser=nn,i.addUsers=Hy,i.agentsReducer=Nc,i.agentsSlice=ms,i.areArraysEqual=Ab,i.assetAttachmentReducer=sa,i.assetAttachmentSlice=ys,i.assetCommentReducer=fa,i.assetCommentSlice=Is,i.assetReducer=wa,i.assetSlice=Ts,i.assetTypeAttachmentReducer=ka,i.assetTypeAttachmentSlice=Fs,i.assetTypeFieldValuesAttachmentReducer=wr,i.assetTypeFieldValuesAttachmentSlice=vs,i.assetTypeFieldValuesReducer=Nr,i.assetTypeFieldValuesSlice=zs,i.assetTypeFieldsAttachmentReducer=sr,i.assetTypeFieldsAttachmentSlice=Ms,i.assetTypeFieldsReducer=fr,i.assetTypeFieldsSlice=ws,i.assetTypeIdentifierReducer=id,i.assetTypeIdentifierSlice=Ds,i.assetTypeIdentifierValueReducer=Sd,i.assetTypeIdentifierValueSlice=qs,i.assetTypeReducer=Ed,i.assetTypeSlice=Cs,i.assetTypeStatusReducer=Hd,i.assetTypeStatusSlice=Us,i.assetTypeStatusSortFn=Vc,i.authReducer=Yd,i.authSlice=Nt,i.baseReducer=qg,i.baseReducers=rc,i.clearTokens=s_,i.createModelAdapter=O,i.createOfflineAction=Rf,i.createPayload=M,i.createSelectionAdapter=yb,i.deleteAsset=Oa,i.deleteAssetAttachment=Xc,i.deleteAssetAttachments=Ss,i.deleteAssetComment=la,i.deleteAssetComments=Ct,i.deleteAssetType=gd,i.deleteAssetTypeAttachment=qa,i.deleteAssetTypeAttachments=_s,i.deleteAssetTypeFieldValues=Cr,i.deleteAssetTypeFieldValuesAttachment=br,i.deleteAssetTypeFieldValuesAttachments=Bs,i.deleteAssetTypeFieldValuesMany=$r,i.deleteAssetTypeFields=or,i.deleteAssetTypeFieldsAttachment=Xa,i.deleteAssetTypeFieldsAttachments=Qa,i.deleteAssetTypeFieldsMany=hr,i.deleteAssetTypeIdentifier=Qr,i.deleteAssetTypeIdentifierValue=hd,i.deleteAssetTypeIdentifierValues=md,i.deleteAssetTypeIdentifiers=xr,i.deleteAssetTypeStatus=Ud,i.deleteAssetTypeStatuses=Ld,i.deleteAssetTypes=Md,i.deleteAssets=Os,i.deleteConversation=Ub,i.deleteConversations=Lb,i.deleteDocument=Su,i.deleteDocumentAttachment=iu,i.deleteDocumentAttachments=nu,i.deleteDocuments=Au,i.deleteEmailDomain=Eu,i.deleteEmailDomains=Bu,i.deleteForm=Zl,i.deleteFormIdentifier=Yu,i.deleteFormIdentifierValue=dl,i.deleteFormIdentifierValues=ul,i.deleteFormIdentifiers=Zu,i.deleteFormRevision=Dl,i.deleteFormRevisionAttachment=Ol,i.deleteFormRevisionAttachments=Fl,i.deleteFormRevisions=ti,i.deleteFormSubmission=Po,i.deleteFormSubmissionAttachment=uo,i.deleteFormSubmissionAttachments=ai,i.deleteFormSubmissions=hi,i.deleteForms=Jl,i.deleteGeoImage=Do,i.deleteGeoImages=jo,i.deleteIssue=Jh,i.deleteIssueAssociation=Yo,i.deleteIssueAssociations=St,i.deleteIssueAttachment=lh,i.deleteIssueAttachments=Ii,i.deleteIssueComment=Ch,i.deleteIssueCommentAttachment=bh,i.deleteIssueCommentAttachments=_h,i.deleteIssueComments=$h,i.deleteIssueType=hy,i.deleteIssueTypeAttachment=lm,i.deleteIssueTypeAttachments=om,i.deleteIssueTypeFieldValues=Cm,i.deleteIssueTypeFieldValuesAttachment=op,i.deleteIssueTypeFieldValuesAttachments=ji,i.deleteIssueTypeFieldValuesMany=$m,i.deleteIssueTypeFields=Qm,i.deleteIssueTypeFieldsAttachment=bm,i.deleteIssueTypeFieldsAttachments=_m,i.deleteIssueTypeFieldsMany=xm,i.deleteIssueTypeIdentifier=_p,i.deleteIssueTypeIdentifierValue=$p,i.deleteIssueTypeIdentifierValues=Up,i.deleteIssueTypeIdentifiers=gp,i.deleteIssueTypePriorities=ey,i.deleteIssueTypePriority=xp,i.deleteIssueTypeStatus=gy,i.deleteIssueTypeStatuses=My,i.deleteIssueTypes=my,i.deleteIssueUpdate=Qi,i.deleteIssueUpdates=xi,i.deleteIssues=Mi,i.deleteOrganization=Pf,i.deleteOrganizationAccess=rf,i.deleteOrganizationAccesses=df,i.deleteOrganizations=Of,i.deleteProcedure=SA,i.deleteProcedureFieldValues=jO,i.deleteProcedureFieldValuesAttachment=OO,i.deleteProcedureFieldValuesAttachments=Xn,i.deleteProcedureFieldValuesMany=qO,i.deleteProcedureInitiative=nA,i.deleteProcedureInitiatives=cA,i.deleteProcedureStep=OP,i.deleteProcedureStepAssignee=zA,i.deleteProcedureStepAssignees=DA,i.deleteProcedureStepComment=YA,i.deleteProcedureStepComments=ZA,i.deleteProcedureStepDefaultAssignee=dI,i.deleteProcedureStepDefaultAssignees=uI,i.deleteProcedureStepDefaultReviewer=OI,i.deleteProcedureStepDefaultReviewers=FI,i.deleteProcedureStepEvent=jI,i.deleteProcedureStepEvents=qI,i.deleteProcedureStepFieldValues=DT,i.deleteProcedureStepFieldValuesAttachment=PT,i.deleteProcedureStepFieldValuesAttachments=zn,i.deleteProcedureStepFieldValuesMany=jT,i.deleteProcedureStepFieldValuesReview=YT,i.deleteProcedureStepFieldValuesReviews=$n,i.deleteProcedureStepFields=uT,i.deleteProcedureStepFieldsAttachment=ZI,i.deleteProcedureStepFieldsAttachments=Rn,i.deleteProcedureStepFieldsMany=lT,i.deleteProcedureStepReviewer=dP,i.deleteProcedureStepReviewers=uP,i.deleteProcedureSteps=FP,i.deleteProcedureType=JO,i.deleteProcedureTypeAttachment=DP,i.deleteProcedureTypeAttachments=jP,i.deleteProcedureTypeFields=uO,i.deleteProcedureTypeFieldsAttachment=ZP,i.deleteProcedureTypeFieldsAttachments=JP,i.deleteProcedureTypeFieldsMany=lO,i.deleteProcedureTypes=XO,i.deleteProcedures=Tt,i.deleteProject=GS,i.deleteProjectAccess=kf,i.deleteProjectAccesses=Nf,i.deleteProjectAttachment=tS,i.deleteProjectAttachments=sS,i.deleteProjectComment=yS,i.deleteProjectComments=fS,i.deleteProjectFile=wS,i.deleteProjectFiles=vS,i.deleteProjects=HS,i.deleteTeam=_F,i.deleteTeamMembership=oF,i.deleteTeamMemberships=hF,i.deleteTeams=gF,i.deleteUser=cn,i.deleteUsers=Yy,i.dequeue=NF,i.discard=HF,i.documentAttachmentReducer=du,i.documentAttachmentSlice=ks,i.documentSlice=Gs,i.documentsReducer=Iu,i.downloadFile=gb,i.emailDomainsReducer=ju,i.emailDomainsSlice=Ws,i.emailRegex=zb,i.enqueue=kF,i.enqueueRequest=vf,i.extractResponseFromError=KF,i.fallbackToEmptyArray=S,i.fallbackToEmptyObject=ls,i.fetchBlobFromObjectUrl=Rc,i.fetchFileFromObjectUrl=wc,i.fileReducer=$u,i.fileSlice=Ys,i.formIdentifierReducer=xu,i.formIdentifierSlice=Zs,i.formIdentifierValueReducer=ml,i.formIdentifierValueSlice=Xs,i.formReducer=Xl,i.formRevisionAttachmentReducer=Ml,i.formRevisionAttachmentSlice=Qs,i.formRevisionReducer=Ul,i.formRevisionsSlice=xs,i.formSlice=si,i.formSubmissionAttachmentReducer=mo,i.formSubmissionAttachmentSlice=ni,i.formSubmissionReducer=go,i.formSubmissionSlice=li,i.geoImageReducer=Uo,i.geoImageSlice=pi,i.getClientSDK=QF,i.getClientStore=Ft,i.getDocumentSubTree=qc,i.getDocumentTrees=Db,i.getFileExtension=Mc,i.getLocalDateString=gc,i.getLocalRelativeDateString=Ob,i.getOutboxCoordinator=mt,i.getRenamedFile=_b,i.getRequestDescription=A,i.getS3FileKey=bb,i.hashFile=Dt,i.initSDK=TR,i.initializeAssetAttachments=Hc,i.initializeAssetComments=na,i.initializeAssetTypeAttachments=Ea,i.initializeAssetTypeFieldValues=Er,i.initializeAssetTypeFieldValuesAttachments=Ar,i.initializeAssetTypeFields=nr,i.initializeAssetTypeFieldsAttachments=Ga,i.initializeAssetTypeIdentifierValues=cd,i.initializeAssetTypeIdentifiers=Hr,i.initializeAssetTypeStatuses=Vd,i.initializeAssetTypes=Id,i.initializeAssets=Aa,i.initializeConversations=$c,i.initializeDocumentAttachments=Jd,i.initializeDocuments=lu,i.initializeEmailDomains=bu,i.initializeFormIdentifierValues=tl,i.initializeFormIdentifiers=Lu,i.initializeFormRevisionAttachments=yl,i.initializeFormRevisions=wl,i.initializeFormSubmissionAttachments=so,i.initializeFormSubmissions=yo,i.initializeForms=kl,i.initializeGeoImages=Ro,i.initializeIssueAssociations=ko,i.initializeIssueAttachments=nh,i.initializeIssueCommentAttachments=Sh,i.initializeIssueComments=Eh,i.initializeIssueTypeAttachments=im,i.initializeIssueTypeFieldValues=Em,i.initializeIssueTypeFieldValuesAttachments=cp,i.initializeIssueTypeFields=Hm,i.initializeIssueTypeFieldsAttachments=Sm,i.initializeIssueTypeIdentifierValues=Bp,i.initializeIssueTypeIdentifiers=Ap,i.initializeIssueTypePriorities=Wp,i.initializeIssueTypeStatuses=Iy,i.initializeIssueTypes=cy,i.initializeIssueUpdates=By,i.initializeIssues=Gh,i.initializeOrganizationAccesses=xy,i.initializeOrganizations=pf,i.initializeProcedureFieldValues=wO,i.initializeProcedureFieldValuesAttachments=fO,i.initializeProcedureInitiatives=XS,i.initializeProcedureStepAssignees=MA,i.initializeProcedureStepComments=LA,i.initializeProcedureStepDefaultAssignees=tI,i.initializeProcedureStepDefaultReviewers=yI,i.initializeProcedureStepEvents=wI,i.initializeProcedureStepFieldValues=RT,i.initializeProcedureStepFieldValuesAttachments=yT,i.initializeProcedureStepFieldValuesReviews=kT,i.initializeProcedureStepFields=sT,i.initializeProcedureStepFieldsAttachments=NI,i.initializeProcedureStepReviewers=tP,i.initializeProcedureSteps=yP,i.initializeProcedureTypeAttachments=RP,i.initializeProcedureTypeFields=sO,i.initializeProcedureTypeFieldsAttachments=kP,i.initializeProcedureTypes=NO,i.initializeProcedures=oA,i.initializeProjectAccesses=Df,i.initializeProjectAttachments=Yf,i.initializeProjectComments=dS,i.initializeProjectFiles=OS,i.initializeProjects=qS,i.initializeTeamMemberships=nF,i.initializeTeams=AF,i.initializeUsers=ky,i.isImageFile=Mb,i.isObjectUrl=vc,i.isToday=Pb,i.issueAssociationReducer=sh,i.issueAssociationSlice=fi,i.issueAttachmentReducer=yh,i.issueAttachmentSlice=Si,i.issueCommentAttachmentReducer=wh,i.issueCommentAttachmentSlice=Pi,i.issueCommentReducer=kh,i.issueCommentSlice=Fi,i.issueReducer=tm,i.issueSlice=_i,i.issueTypeAttachmentReducer=ym,i.issueTypeAttachmentSlice=Ri,i.issueTypeFieldValuesAttachmentReducer=fp,i.issueTypeFieldValuesAttachmentSlice=zi,i.issueTypeFieldValuesReducer=Nm,i.issueTypeFieldValuesSlice=Bi,i.issueTypeFieldsAttachmentReducer=wm,i.issueTypeFieldsAttachmentSlice=vi,i.issueTypeFieldsReducer=ip,i.issueTypeFieldsSlice=Vi,i.issueTypeIdentifierReducer=vp,i.issueTypeIdentifierSlice=Ci,i.issueTypeIdentifierValueReducer=Gp,i.issueTypeIdentifierValueSlice=Ui,i.issueTypePriorityReducer=iy,i.issueTypePrioritySlice=Li,i.issueTypePrioritySortFn=Dc,i.issueTypeReducer=Sy,i.issueTypeSlice=Gi,i.issueTypeStatusReducer=vy,i.issueTypeStatusSlice=Wi,i.issueTypeStatusSortFn=zc,i.issueUpdateReducer=Uy,i.issueUpdateSlice=Zi,i.logOnlyOnce=Rb,i.markAsDeleted=Ef,i.markForDeletion=U_,i.memoize=us,i.organizationAccessReducer=uf,i.organizationAccessSlice=rn,i.organizationReducer=Mf,i.organizationSlice=dn,i.outboxReducer=Vf,i.outboxSlice=un,i.overmapEnhancer=Wg,i.overmapReducer=Cg,i.overmapReducers=VF,i.performRequest=lc,i.performRequestFromAction=GF,i.procedureFieldValuesAttachmentReducer=FO,i.procedureFieldValuesAttachmentSlice=Zn,i.procedureFieldValuesReducer=CO,i.procedureFieldValuesSlice=xn,i.procedureInitiativeReducer=aA,i.procedureInitiativeSlice=Sn,i.procedureReducer=AA,i.procedureSlice=An,i.procedureStepAssigneeReducer=$A,i.procedureStepAssigneeSlice=In,i.procedureStepCommentReducer=xA,i.procedureStepCommentSlice=Tn,i.procedureStepDefaultAssigneeReducer=mI,i.procedureStepDefaultAssigneeSlice=Pn,i.procedureStepDefaultReviewerReducer=MI,i.procedureStepDefaultReviewerSlice=Fn,i.procedureStepEventReducer=LI,i.procedureStepEventSlice=_n,i.procedureStepFieldValuesAttachmentReducer=gT,i.procedureStepFieldValuesAttachmentSlice=Bn,i.procedureStepFieldValuesReducer=qT,i.procedureStepFieldValuesReviewReducer=xT,i.procedureStepFieldValuesReviewSlice=qn,i.procedureStepFieldValuesSlice=jn,i.procedureStepFieldsAttachmentReducer=eT,i.procedureStepFieldsAttachmentSlice=gn,i.procedureStepFieldsReducer=mT,i.procedureStepFieldsSlice=vn,i.procedureStepReducer=bP,i.procedureStepReviewerReducer=mP,i.procedureStepReviewerSlice=Un,i.procedureStepSlice=Ln,i.procedureTypeAttachmentReducer=qP,i.procedureTypeAttachmentSlice=Gn,i.procedureTypeFieldsAttachmentReducer=XP,i.procedureTypeFieldsAttachmentSlice=Wn,i.procedureTypeFieldsReducer=oO,i.procedureTypeFieldsSlice=Yn,i.procedureTypeReducer=QO,i.procedureTypeSlice=tc,i.projectAccessReducer=Gf,i.projectAccessSlice=ln,i.projectAttachmentReducer=aS,i.projectAttachmentSlice=hn,i.projectCommentReducer=TS,i.projectCommentSlice=pn,i.projectFileReducer=DS,i.projectFileSlice=yn,i.projectReducer=WS,i.projectSlice=fn,i.rehydratedReducer=sF,i.rehydratedSlice=ic,i.restructureSelectorWithArgs=y,i.runMiddleware=sb,i.selectAccessToken=i_,i.selectAccessesByUserOfProject=k_,i.selectAccessibleProjects=K_,i.selectActiveOrganizationAccess=j_,i.selectAllDocumentAttachments=Ns,i.selectAssetAttachmentById=xc,i.selectAssetAttachmentMapping=Qc,i.selectAssetAttachments=As,i.selectAssetAttachmentsByIds=ea,i.selectAssetById=Ma,i.selectAssetCommentById=ha,i.selectAssetCommentMapping=oa,i.selectAssetComments=$t,i.selectAssetCommentsByIds=ma,i.selectAssetTypeAttachmentById=$a,i.selectAssetTypeAttachmentMapping=Ca,i.selectAssetTypeAttachments=gs,i.selectAssetTypeAttachmentsByIds=Ua,i.selectAssetTypeById=wd,i.selectAssetTypeFieldValues=Lt,i.selectAssetTypeFieldValuesAttachmentById=gr,i.selectAssetTypeFieldValuesAttachments=Vs,i.selectAssetTypeFieldValuesAttachmentsByIds=Mr,i.selectAssetTypeFieldValuesAttachmentsMapping=_r,i.selectAssetTypeFieldValuesById=Lr,i.selectAssetTypeFieldValuesByIds=kr,i.selectAssetTypeFieldValuesMapping=Ur,i.selectAssetTypeFieldValuesOfAsset=Yb,i.selectAssetTypeFields=Mt,i.selectAssetTypeFieldsAttachmentById=er,i.selectAssetTypeFieldsAttachments=Rs,i.selectAssetTypeFieldsAttachmentsByIds=tr,i.selectAssetTypeFieldsAttachmentsMapping=xa,i.selectAssetTypeFieldsById=pr,i.selectAssetTypeFieldsByIds=yr,i.selectAssetTypeFieldsMapping=mr,i.selectAssetTypeFieldsOfAssetType=Wb,i.selectAssetTypeIdentifierById=td,i.selectAssetTypeIdentifierMapping=ed,i.selectAssetTypeIdentifierValueById=yd,i.selectAssetTypeIdentifierValueMapping=pd,i.selectAssetTypeIdentifierValues=kt,i.selectAssetTypeIdentifierValuesByIds=fd,i.selectAssetTypeIdentifierValuesOfAsset=Xb,i.selectAssetTypeIdentifierValuesOfIdentifier=Qb,i.selectAssetTypeIdentifiers=js,i.selectAssetTypeIdentifiersByIds=sd,i.selectAssetTypeIdentifiersOfAssetType=Jb,i.selectAssetTypeStatusById=Nd,i.selectAssetTypeStatusMapping=kd,i.selectAssetTypeStatuses=Ls,i.selectAssetTypeStatusesByIds=Gd,i.selectAssetTypeStatusesOfAssetType=e_,i.selectAssetTypeValuesOfAssetType=Zb,i.selectAssetTypes=$s,i.selectAssetTypesByIds=vd,i.selectAssetTypesMapping=Rd,i.selectAssetTypesOfOrganization=xb,i.selectAssets=Ut,i.selectAssetsByIds=Ra,i.selectAssetsMapping=_a,i.selectAssetsOfAssetType=ga,i.selectAssetsOfProject=Gb,i.selectAttachmentsOfAsset=ta,i.selectAttachmentsOfAssetType=La,i.selectAttachmentsOfAssetTypeFieldValues=Rr,i.selectAttachmentsOfAssetTypeFields=Hb,i.selectAttachmentsOfDocument=c_,i.selectAttachmentsOfFormRevision=y_,i.selectAttachmentsOfFormSubmission=ho,i.selectAttachmentsOfIssue=hh,i.selectAttachmentsOfIssueComment=I_,i.selectAttachmentsOfIssueType=O_,i.selectAttachmentsOfIssueTypeFieldValues=yp,i.selectAttachmentsOfIssueTypeFields=F_,i.selectAttachmentsOfProcedureFieldValues=MO,i.selectAttachmentsOfProcedureStepFieldValues=_T,i.selectAttachmentsOfProcedureStepFields=XI,i.selectAttachmentsOfProcedureType=bg,i.selectAttachmentsOfProcedureTypeFields=_g,i.selectAttachmentsOfProject=G_,i.selectCommentsOfAsset=pa,i.selectCommentsOfAssets=ya,i.selectCommentsOfIssue=T_,i.selectCommentsOfProject=H_,i.selectCommentsOfProjects=W_,i.selectConversation=Nb,i.selectConversationMapping=ps,i.selectConversations=kb,i.selectCurrentUser=Jy,i.selectDeletedRequests=C_,i.selectDescendantsOfDocument=Ou,i.selectDocumentAttachmentById=au,i.selectDocumentAttachmentMapping=cu,i.selectDocumentAttachmentsByIds=ru,i.selectDocumentById=Tu,i.selectDocuments=Gt,i.selectDocumentsByIds=Pu,i.selectDocumentsMapping=Hs,i.selectEmailDomainById=zu,i.selectEmailDomains=Ks,i.selectEmailDomainsAsMapping=Vu,i.selectEmailDomainsByIds=Du,i.selectEmailDomainsOfOrganization=d_,i.selectFieldValuesOfProcedure=Rg,i.selectFormById=xl,i.selectFormIdentifierById=Xu,i.selectFormIdentifierMapping=Ju,i.selectFormIdentifierValueById=ol,i.selectFormIdentifierValueMapping=ll,i.selectFormIdentifierValues=Ht,i.selectFormIdentifierValuesByIds=hl,i.selectFormIdentifierValuesOfFormSubmission=m_,i.selectFormIdentifierValuesOfIdentifier=p_,i.selectFormIdentifiers=Js,i.selectFormIdentifiersByIds=Qu,i.selectFormIdentifiersOfForm=h_,i.selectFormMapping=Ql,i.selectFormRevisionAttachmentById=_l,i.selectFormRevisionAttachments=bl,i.selectFormRevisionAttachmentsByIds=gl,i.selectFormRevisionAttachmentsMapping=Wt,i.selectFormRevisionById=ql,i.selectFormRevisionMapping=jl,i.selectFormRevisions=Kt,i.selectFormRevisionsByIds=Cl,i.selectFormRevisionsOfForm=$l,i.selectFormSubmissionAttachemntsByIds=ui,i.selectFormSubmissionAttachmentById=lo,i.selectFormSubmissionAttachments=di,i.selectFormSubmissionAttachmentsByIds=oo,i.selectFormSubmissionAttachmentsMapping=ri,i.selectFormSubmissionById=Fo,i.selectFormSubmissions=mi,i.selectFormSubmissionsByIds=bo,i.selectFormSubmissionsMapping=Oo,i.selectFormSubmissionsOfForm=_o,i.selectForms=ii,i.selectFormsByIds=eo,i.selectFormsOfOrganization=S_,i.selectGeoImageById=Co,i.selectGeoImageMapping=qo,i.selectGeoImages=yi,i.selectGeoImagesByIds=$o,i.selectGeoImagesOfProject=A_,i.selectIsLoggedIn=n_,i.selectIssueAssociationById=Jo,i.selectIssueAssociationMapping=Zo,i.selectIssueAssociations=At,i.selectIssueAssociationsByIds=Xo,i.selectIssueAssociationsOfAsset=eh,i.selectIssueAssociationsOfAssets=th,i.selectIssueAssociationsOfIssue=xo,i.selectIssueAssociationsOfIssues=Qo,i.selectIssueAttachmentById=mh,i.selectIssueAttachmentMapping=oh,i.selectIssueAttachments=Ti,i.selectIssueAttachmentsByIds=ph,i.selectIssueById=Qh,i.selectIssueCommentAttachmentById=Mh,i.selectIssueCommentAttachmentMapping=gh,i.selectIssueCommentAttachments=Oi,i.selectIssueCommentAttachmentsByIds=Rh,i.selectIssueCommentById=Uh,i.selectIssueCommentMapping=bi,i.selectIssueCommentsByIds=Lh,i.selectIssueMapping=Xh,i.selectIssueTypeAttachmentById=mm,i.selectIssueTypeAttachmentMapping=hm,i.selectIssueTypeAttachments=wi,i.selectIssueTypeAttachmentsByIds=pm,i.selectIssueTypeById=yy,i.selectIssueTypeFieldValues=Zt,i.selectIssueTypeFieldValuesAttachmentById=mp,i.selectIssueTypeFieldValuesAttachments=qi,i.selectIssueTypeFieldValuesAttachmentsByIds=pp,i.selectIssueTypeFieldValuesAttachmentsMapping=hp,i.selectIssueTypeFieldValuesById=Lm,i.selectIssueTypeFieldValuesByIds=km,i.selectIssueTypeFieldValuesMapping=Um,i.selectIssueTypeFieldValuesOfIssue=b_,i.selectIssueTypeFields=Rt,i.selectIssueTypeFieldsAttachmentById=Mm,i.selectIssueTypeFieldsAttachments=Ei,i.selectIssueTypeFieldsAttachmentsByIds=Rm,i.selectIssueTypeFieldsAttachmentsMapping=gm,i.selectIssueTypeFieldsById=tp,i.selectIssueTypeFieldsByIds=sp,i.selectIssueTypeFieldsMapping=ep,i.selectIssueTypeFieldsOfIssueType=__,i.selectIssueTypeIdentifierById=Rp,i.selectIssueTypeIdentifierMapping=Mp,i.selectIssueTypeIdentifierValueById=kp,i.selectIssueTypeIdentifierValueMapping=Lp,i.selectIssueTypeIdentifierValues=Jt,i.selectIssueTypeIdentifierValuesByIds=Np,i.selectIssueTypeIdentifierValuesOfIdentifier=v_,i.selectIssueTypeIdentifierValuesOfIssue=w_,i.selectIssueTypeIdentifiers=$i,i.selectIssueTypeIdentifiersByIds=wp,i.selectIssueTypeIdentifiersOfIssueType=R_,i.selectIssueTypeMapping=py,i.selectIssueTypePriorities=ki,i.selectIssueTypePrioritiesByIds=sy,i.selectIssueTypePrioritiesOfIssueType=E_,i.selectIssueTypePriorityById=Ni,i.selectIssueTypePriorityMapping=ty,i.selectIssueTypeStatusById=Yi,i.selectIssueTypeStatusMapping=Ry,i.selectIssueTypeStatuses=Ki,i.selectIssueTypeStatusesByIds=wy,i.selectIssueTypeStatusesOfIssueType=V_,i.selectIssueTypeValuesOfIssueType=M_,i.selectIssueTypes=Hi,i.selectIssueTypesByIds=fy,i.selectIssueTypesOfOrganization=B_,i.selectIssueUpdateById=qy,i.selectIssueUpdateMapping=en,i.selectIssueUpdates=tn,i.selectIssueUpdatesByIds=Cy,i.selectIssueUpdatesOfIssue=$y,i.selectIssues=Yt,i.selectIssuesByIds=xh,i.selectIssuesOfIssueType=em,i.selectIssuesOfProject=P_,i.selectLatestAssetTypeFieldsOfAssetType=Kb,i.selectLatestFieldsByProcedureStep=og,i.selectLatestFormRevisionOfForm=f_,i.selectLatestIssueTypeFieldsOfIssueType=g_,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=Ag,i.selectLatestProcedureStepFieldsOfProcedureStep=lg,i.selectLatestProcedureTypeFieldsOfProcedureType=Mg,i.selectLatestRetryTime=$_,i.selectLatestReviewOfProcedureStepFieldValues=yg,i.selectMembershipsByUserOfTeam=Vg,i.selectOrganizationAccessById=lf,i.selectOrganizationAccessMapping=xt,i.selectOrganizationAccessUserMapping=hf,i.selectOrganizationAccessesByIds=of,i.selectOrganizationById=_f,i.selectOrganizationDocuments=r_,i.selectOrganizations=bf,i.selectOrganizationsByIds=gf,i.selectOrganizationsMapping=Ff,i.selectProcedureById=TA,i.selectProcedureFieldValues=ec,i.selectProcedureFieldValuesAttachmentById=_O,i.selectProcedureFieldValuesAttachments=Qn,i.selectProcedureFieldValuesAttachmentsByIds=gO,i.selectProcedureFieldValuesAttachmentsMapping=bO,i.selectProcedureFieldValuesById=UO,i.selectProcedureFieldValuesByIds=LO,i.selectProcedureFieldValuesMapping=$O,i.selectProcedureInitiativeById=dA,i.selectProcedureInitiatives=ss,i.selectProcedureInitiativesByIds=uA,i.selectProcedureInitiativesMapping=rA,i.selectProcedureInitiativesOfProcedureType=J_,i.selectProcedureInitiativesOfProject=Z_,i.selectProcedureStepAssigneeById=qA,i.selectProcedureStepAssignees=vt,i.selectProcedureStepAssigneesByIds=CA,i.selectProcedureStepAssigneesMapping=jA,i.selectProcedureStepAssigneesOfProcedure=Q_,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=eg,i.selectProcedureStepAssigneesOfProcedureStep=x_,i.selectProcedureStepById=_P,i.selectProcedureStepCommentById=XA,i.selectProcedureStepComments=Et,i.selectProcedureStepCommentsByIds=QA,i.selectProcedureStepCommentsMapping=JA,i.selectProcedureStepCommentsOfProcedure=tg,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=ig,i.selectProcedureStepCommentsOfProcedureStep=sg,i.selectProcedureStepDefaultAssigneeById=oI,i.selectProcedureStepDefaultAssignees=On,i.selectProcedureStepDefaultAssigneesByIds=hI,i.selectProcedureStepDefaultAssigneesMapping=lI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=ng,i.selectProcedureStepDefaultReviewerById=_I,i.selectProcedureStepDefaultReviewers=bn,i.selectProcedureStepDefaultReviewersByIds=gI,i.selectProcedureStepDefaultReviewersMapping=bI,i.selectProcedureStepDefaultReviewersOfProcedureStep=cg,i.selectProcedureStepEventById=$I,i.selectProcedureStepEvents=Bt,i.selectProcedureStepEventsByIds=UI,i.selectProcedureStepEventsMapping=CI,i.selectProcedureStepEventsOfProcedure=ag,i.selectProcedureStepEventsOfProcedureAndProcedureStep=dg,i.selectProcedureStepEventsOfProcedureStep=rg,i.selectProcedureStepFieldValues=ut,i.selectProcedureStepFieldValuesAttachmentById=FT,i.selectProcedureStepFieldValuesAttachments=Dn,i.selectProcedureStepFieldValuesAttachmentsByIds=bT,i.selectProcedureStepFieldValuesAttachmentsMapping=OT,i.selectProcedureStepFieldValuesById=$T,i.selectProcedureStepFieldValuesByIds=UT,i.selectProcedureStepFieldValuesMapping=CT,i.selectProcedureStepFieldValuesOfProcedure=hg,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=pg,i.selectProcedureStepFieldValuesOfProcedureStep=mg,i.selectProcedureStepFieldValuesReviewById=JT,i.selectProcedureStepFieldValuesReviews=lt,i.selectProcedureStepFieldValuesReviewsByIds=XT,i.selectProcedureStepFieldValuesReviewsMapping=ZT,i.selectProcedureStepFieldValuesReviewsOfProcedure=fg,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=Sg,i.selectProcedureStepFields=is,i.selectProcedureStepFieldsAttachmentById=QI,i.selectProcedureStepFieldsAttachments=wn,i.selectProcedureStepFieldsAttachmentsByIds=xI,i.selectProcedureStepFieldsAttachmentsMapping=JI,i.selectProcedureStepFieldsById=oT,i.selectProcedureStepFieldsByIds=hT,i.selectProcedureStepFieldsMapping=En,i.selectProcedureStepFieldsOfProcedureStep=ug,i.selectProcedureStepReviewerById=oP,i.selectProcedureStepReviewers=Vt,i.selectProcedureStepReviewersByIds=hP,i.selectProcedureStepReviewersMapping=lP,i.selectProcedureStepReviewersOfProcedure=Ig,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=Pg,i.selectProcedureStepReviewersOfProcedureStep=Tg,i.selectProcedureSteps=Nn,i.selectProcedureStepsByIds=gP,i.selectProcedureStepsMapping=kn,i.selectProcedureStepsMappingOfProcedureType=Og,i.selectProcedureStepsOfProcedureType=Fg,i.selectProcedureTypeAttachmentById=$P,i.selectProcedureTypeAttachmentMapping=CP,i.selectProcedureTypeAttachments=Hn,i.selectProcedureTypeAttachmentsByIds=UP,i.selectProcedureTypeById=eF,i.selectProcedureTypeFields=ns,i.selectProcedureTypeFieldsAttachmentById=xP,i.selectProcedureTypeFieldsAttachments=Kn,i.selectProcedureTypeFieldsAttachmentsByIds=eO,i.selectProcedureTypeFieldsAttachmentsMapping=QP,i.selectProcedureTypeFieldsById=mO,i.selectProcedureTypeFieldsByIds=pO,i.selectProcedureTypeFieldsMapping=hO,i.selectProcedureTypeFieldsOfProcedureType=gg,i.selectProcedureTypes=sc,i.selectProcedureTypesByIds=tF,i.selectProcedureTypesMapping=xO,i.selectProcedureTypesOfOrganization=wg,i.selectProcedures=dt,i.selectProceduresByIds=PA,i.selectProceduresMapping=IA,i.selectProceduresOfAsset=FA,i.selectProceduresOfAssets=bA,i.selectProceduresOfProcedureInitiative=_A,i.selectProceduresOfProcedureType=OA,i.selectProceduresOfProject=X_,i.selectProjectAccessById=Hf,i.selectProjectAccessMapping=on,i.selectProjectAccesses=wt,i.selectProjectAccessesByIds=Wf,i.selectProjectAccessesOfProject=L_,i.selectProjectAttachmentById=nS,i.selectProjectAttachmentMapping=iS,i.selectProjectAttachments=mn,i.selectProjectAttachmentsByIds=cS,i.selectProjectById=YS,i.selectProjectCommentById=AS,i.selectProjectCommentMapping=SS,i.selectProjectComments=es,i.selectProjectCommentsByIds=IS,i.selectProjectDocuments=a_,i.selectProjectFileById=VS,i.selectProjectFileMapping=ES,i.selectProjectFiles=BS,i.selectProjectFilesByIds=zS,i.selectProjectMapping=KS,i.selectProjects=ts,i.selectProjectsByIds=ZS,i.selectProjectsOfOrganization=Y_,i.selectRehydrated=Bg,i.selectReviewsOfProcedureStepFieldValues=QT,i.selectTeamById=RF,i.selectTeamMembershipById=yF,i.selectTeamMemberships=cs,i.selectTeamMembershipsByIds=fF,i.selectTeamMembershipsMapping=pF,i.selectTeams=ac,i.selectTeamsByIds=wF,i.selectTeamsMapping=MF,i.selectTeamsOfOrganization=Dg,i.selectUploadUrl=o_,i.selectUserById=Qt,i.selectUsers=Xt,i.selectUsersByIds=Xy,i.selectUsersMapping=an,i.selectUsersOfOrganization=q_,i.selectUsersOfProject=N_,i.selectUsersOfTeam=zg,i.setAsset=Fa,i.setAssetAttachment=Kc,i.setAssetAttachments=Yc,i.setAssetComment=aa,i.setAssetComments=ra,i.setAssetType=Td,i.setAssetTypeAttachment=Va,i.setAssetTypeAttachments=za,i.setAssetTypeFieldValues=zr,i.setAssetTypeFieldValuesAttachment=Tr,i.setAssetTypeFieldValuesAttachments=Pr,i.setAssetTypeFieldValuesMany=Dr,i.setAssetTypeFields=rr,i.setAssetTypeFieldsAttachment=Ka,i.setAssetTypeFieldsAttachments=Ya,i.setAssetTypeFieldsMany=dr,i.setAssetTypeIdentifier=Yr,i.setAssetTypeIdentifierValue=dd,i.setAssetTypeIdentifierValues=ud,i.setAssetTypeIdentifiers=Zr,i.setAssetTypeStatus=jd,i.setAssetTypeStatuses=qd,i.setAssetTypes=Pd,i.setAssets=ba,i.setClientSDK=XF,i.setClientStore=ZF,i.setConversation=Lc,i.setConversations=Cb,i.setCurrentUser=z_,i.setCurrentUserProfile=D_,i.setDocument=mu,i.setDocumentAttachment=xd,i.setDocumentAttachments=eu,i.setDocuments=pu,i.setEmailDomain=Mu,i.setEmailDomains=Ru,i.setForm=Hl,i.setFormIdentifier=Gu,i.setFormIdentifierValue=nl,i.setFormIdentifierValues=cl,i.setFormIdentifiers=Hu,i.setFormRevision=El,i.setFormRevisionAttachment=Al,i.setFormRevisionAttachments=Il,i.setFormRevisions=Bl,i.setFormSubmission=fo,i.setFormSubmissionAttachment=no,i.setFormSubmissionAttachments=co,i.setFormSubmissions=So,i.setForms=Wl,i.setGeoImage=wo,i.setGeoImages=vo,i.setIssue=Wh,i.setIssueAssociation=Go,i.setIssueAssociations=No,i.setIssueAttachment=ah,i.setIssueAttachments=rh,i.setIssueComment=zh,i.setIssueCommentAttachment=Th,i.setIssueCommentAttachments=Ph,i.setIssueComments=Dh,i.setIssueType=dy,i.setIssueTypeAttachment=am,i.setIssueTypeAttachments=rm,i.setIssueTypeFieldValues=zm,i.setIssueTypeFieldValuesAttachment=rp,i.setIssueTypeFieldValuesAttachments=dp,i.setIssueTypeFieldValuesMany=Dm,i.setIssueTypeFields=Ym,i.setIssueTypeFieldsAttachment=Tm,i.setIssueTypeFieldsAttachments=Pm,i.setIssueTypeFieldsMany=Zm,i.setIssueTypeIdentifier=Pp,i.setIssueTypeIdentifierValue=Dp,i.setIssueTypeIdentifierValues=jp,i.setIssueTypeIdentifiers=Op,i.setIssueTypePriorities=Jp,i.setIssueTypePriority=Zp,i.setIssueTypeStatus=Oy,i.setIssueTypeStatuses=Fy,i.setIssueTypes=uy,i.setIssueUpdate=Vy,i.setIssueUpdates=zy,i.setIssues=Kh,i.setLoggedIn=Kd,i.setOrganization=ff,i.setOrganizationAccess=sf,i.setOrganizationAccesses=nf,i.setOrganizations=yf,i.setProcedure=mA,i.setProcedureFieldValues=BO,i.setProcedureFieldValuesAttachment=AO,i.setProcedureFieldValuesAttachments=IO,i.setProcedureFieldValuesMany=VO,i.setProcedureInitiative=eA,i.setProcedureInitiatives=tA,i.setProcedureStep=fP,i.setProcedureStepAssignee=vA,i.setProcedureStepAssignees=EA,i.setProcedureStepComment=GA,i.setProcedureStepComments=HA,i.setProcedureStepDefaultAssignee=nI,i.setProcedureStepDefaultAssignees=cI,i.setProcedureStepDefaultReviewer=AI,i.setProcedureStepDefaultReviewers=II,i.setProcedureStepEvent=BI,i.setProcedureStepEvents=VI,i.setProcedureStepFieldValues=ET,i.setProcedureStepFieldValuesAttachment=ST,i.setProcedureStepFieldValuesAttachments=AT,i.setProcedureStepFieldValuesMany=BT,i.setProcedureStepFieldValuesReview=GT,i.setProcedureStepFieldValuesReviews=HT,i.setProcedureStepFields=cT,i.setProcedureStepFieldsAttachment=HI,i.setProcedureStepFieldsAttachments=WI,i.setProcedureStepFieldsMany=aT,i.setProcedureStepReviewer=nP,i.setProcedureStepReviewers=cP,i.setProcedureSteps=SP,i.setProcedureType=WO,i.setProcedureTypeAttachment=EP,i.setProcedureTypeAttachments=BP,i.setProcedureTypeFields=cO,i.setProcedureTypeFieldsAttachment=HP,i.setProcedureTypeFieldsAttachments=WP,i.setProcedureTypeFieldsMany=aO,i.setProcedureTypes=KO,i.setProcedures=pA,i.setProject=$S,i.setProjectAccess=Cf,i.setProjectAccesses=$f,i.setProjectAttachment=Xf,i.setProjectAttachments=Qf,i.setProjectComment=oS,i.setProjectComments=hS,i.setProjectFile=FS,i.setProjectFiles=bS,i.setProjects=CS,i.setRehydrated=Eg,i.setTeam=PF,i.setTeamMembership=rF,i.setTeamMemberships=dF,i.setTeams=OF,i.setTokens=t_,i.setUploadUrl=l_,i.setUser=Gy,i.setUsers=Ny,i.shallowEqual=Sb,i.slugify=Bb,i.spacesToDashesLower=Eb,i.submittedAtModelSortFn=yt,i.teamMembershipReducer=mF,i.teamMembershipSlice=nc,i.teamReducer=vF,i.teamSlice=cc,i.toFileNameSafeString=vb,i.toUuidArray=E,i.toUuidIdRecord=wb,i.truncate=Vb,i.updateAsset=Ta,i.updateAssetAttachment=Zc,i.updateAssetAttachments=Jc,i.updateAssetComment=da,i.updateAssetComments=ua,i.updateAssetType=bd,i.updateAssetTypeAttachment=Da,i.updateAssetTypeAttachments=ja,i.updateAssetTypeFieldValues=jr,i.updateAssetTypeFieldValuesAttachment=Or,i.updateAssetTypeFieldValuesAttachments=Fr,i.updateAssetTypeFieldValuesMany=qr,i.updateAssetTypeFields=ur,i.updateAssetTypeFieldsAttachment=Za,i.updateAssetTypeFieldsAttachments=Ja,i.updateAssetTypeFieldsMany=lr,i.updateAssetTypeIdentifier=Jr,i.updateAssetTypeIdentifierValue=ld,i.updateAssetTypeIdentifierValues=od,i.updateAssetTypeIdentifiers=Xr,i.updateAssetTypeStatus=Cd,i.updateAssetTypeStatuses=$d,i.updateAssetTypes=_d,i.updateAssets=Pa,i.updateConversation=kc,i.updateConversations=$b,i.updateDocument=yu,i.updateDocumentAttachment=tu,i.updateDocumentAttachments=su,i.updateDocuments=fu,i.updateEmailDomain=wu,i.updateEmailDomains=vu,i.updateForm=Kl,i.updateFormIdentifier=Wu,i.updateFormIdentifierValue=al,i.updateFormIdentifierValues=rl,i.updateFormIdentifiers=Ku,i.updateFormRevision=Vl,i.updateFormRevisionAttachment=Tl,i.updateFormRevisionAttachments=Pl,i.updateFormRevisions=zl,i.updateFormSubmission=Io,i.updateFormSubmissionAttachment=ao,i.updateFormSubmissionAttachments=ro,i.updateFormSubmissions=To,i.updateForms=Yl,i.updateGeoImage=Vo,i.updateGeoImages=zo,i.updateIssue=Yh,i.updateIssueAssociation=Ho,i.updateIssueAssociations=Wo,i.updateIssueAttachment=dh,i.updateIssueAttachments=uh,i.updateIssueComment=jh,i.updateIssueCommentAttachment=Oh,i.updateIssueCommentAttachments=Fh,i.updateIssueComments=qh,i.updateIssueType=ly,i.updateIssueTypeAttachment=dm,i.updateIssueTypeAttachments=um,i.updateIssueTypeFieldValues=jm,i.updateIssueTypeFieldValuesAttachment=up,i.updateIssueTypeFieldValuesAttachments=lp,i.updateIssueTypeFieldValuesMany=qm,i.updateIssueTypeFields=Jm,i.updateIssueTypeFieldsAttachment=Om,i.updateIssueTypeFieldsAttachments=Fm,i.updateIssueTypeFieldsMany=Xm,i.updateIssueTypeIdentifier=Fp,i.updateIssueTypeIdentifierValue=qp,i.updateIssueTypeIdentifierValues=Cp,i.updateIssueTypeIdentifiers=bp,i.updateIssueTypePriorities=Qp,i.updateIssueTypePriority=Xp,i.updateIssueTypeStatus=by,i.updateIssueTypeStatuses=_y,i.updateIssueTypes=oy,i.updateIssueUpdate=Dy,i.updateIssueUpdates=jy,i.updateIssues=Zh,i.updateOrganization=Tf,i.updateOrganizationAccess=cf,i.updateOrganizationAccesses=af,i.updateOrganizations=If,i.updateProcedure=yA,i.updateProcedureFieldValues=zO,i.updateProcedureFieldValuesAttachment=TO,i.updateProcedureFieldValuesAttachments=PO,i.updateProcedureFieldValuesMany=DO,i.updateProcedureInitiative=sA,i.updateProcedureInitiatives=iA,i.updateProcedureStep=TP,i.updateProcedureStepAssignee=BA,i.updateProcedureStepAssignees=VA,i.updateProcedureStepComment=WA,i.updateProcedureStepComments=KA,i.updateProcedureStepDefaultAssignee=aI,i.updateProcedureStepDefaultAssignees=rI,i.updateProcedureStepDefaultReviewer=TI,i.updateProcedureStepDefaultReviewers=PI,i.updateProcedureStepEvent=zI,i.updateProcedureStepEvents=DI,i.updateProcedureStepFieldValues=VT,i.updateProcedureStepFieldValuesAttachment=IT,i.updateProcedureStepFieldValuesAttachments=TT,i.updateProcedureStepFieldValuesMany=zT,i.updateProcedureStepFieldValuesReview=WT,i.updateProcedureStepFieldValuesReviews=KT,i.updateProcedureStepFields=rT,i.updateProcedureStepFieldsAttachment=KI,i.updateProcedureStepFieldsAttachments=YI,i.updateProcedureStepFieldsMany=dT,i.updateProcedureStepReviewer=aP,i.updateProcedureStepReviewers=rP,i.updateProcedureSteps=PP,i.updateProcedureType=YO,i.updateProcedureTypeAttachment=VP,i.updateProcedureTypeAttachments=zP,i.updateProcedureTypeFields=rO,i.updateProcedureTypeFieldsAttachment=KP,i.updateProcedureTypeFieldsAttachments=YP,i.updateProcedureTypeFieldsMany=dO,i.updateProcedureTypes=ZO,i.updateProcedures=fA,i.updateProject=NS,i.updateProjectAccess=Uf,i.updateProjectAccesses=Lf,i.updateProjectAttachment=xf,i.updateProjectAttachments=eS,i.updateProjectComment=mS,i.updateProjectComments=pS,i.updateProjectFile=MS,i.updateProjectFiles=RS,i.updateProjects=kS,i.updateTeam=FF,i.updateTeamMembership=uF,i.updateTeamMemberships=lF,i.updateTeams=bF,i.updateUser=Ky,i.updateUsers=Wy,i.useSelectorBuilder=fb,i.userReducer=Zy,i.userSlice=sn,i.uuidObj=P,i.uuidObjSortFn=hs,i.uuidSortFn=jt,i.versioningReducer=BF,i.versioningSlice=EF,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|