@overmap-ai/core 1.0.78-custom-page-sizes.0 → 1.0.78-debug.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/defaults.d.ts +1 -2
- package/dist/enums/asset.d.ts +8 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/issue.d.ts +7 -5
- package/dist/overmap-core.js +8730 -7506
- package/dist/overmap-core.umd.cjs +11 -11
- package/dist/sdk/base.d.ts +6 -2
- package/dist/sdk/constants.d.ts +1 -0
- package/dist/sdk/errors.d.ts +5 -0
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/performRequest.d.ts +6 -0
- package/dist/sdk/services/AgentService.d.ts +1 -0
- package/dist/sdk/services/AssetAttachmentService.d.ts +24 -26
- package/dist/sdk/services/AssetProcedureService.d.ts +21 -4
- package/dist/sdk/services/AssetProcedureStepFieldValuesAttachmentService.d.ts +19 -2
- package/dist/sdk/services/AssetProcedureStepFieldValuesService.d.ts +19 -2
- package/dist/sdk/services/AssetProcedureStepFieldsAttachmentService.d.ts +19 -2
- package/dist/sdk/services/AssetProcedureStepFieldsService.d.ts +20 -3
- package/dist/sdk/services/AssetProcedureStepService.d.ts +20 -3
- package/dist/sdk/services/AssetProcedureTypeAttachmentService.d.ts +24 -25
- package/dist/sdk/services/AssetProcedureTypeFieldValuesAttachmentService.d.ts +19 -2
- package/dist/sdk/services/AssetProcedureTypeFieldValuesService.d.ts +19 -2
- package/dist/sdk/services/AssetProcedureTypeFieldsAttachmentService.d.ts +19 -2
- package/dist/sdk/services/AssetProcedureTypeFieldsService.d.ts +20 -3
- package/dist/sdk/services/AssetProcedureTypeService.d.ts +21 -4
- package/dist/sdk/services/AssetService.d.ts +21 -4
- package/dist/sdk/services/AssetStageCompletionService.d.ts +20 -3
- package/dist/sdk/services/AssetStageService.d.ts +20 -3
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +24 -25
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +19 -2
- package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +19 -2
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +20 -3
- 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 +20 -3
- 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/BaseOfflineAttachmentModelService.d.ts +23 -0
- package/dist/sdk/services/BaseOfflineModelApiService.d.ts +27 -0
- package/dist/sdk/services/BaseService.d.ts +4 -3
- package/dist/sdk/services/CategoryService.d.ts +21 -4
- package/dist/sdk/services/DocumentAttachmentService.d.ts +24 -25
- package/dist/sdk/services/DocumentService.d.ts +21 -4
- package/dist/sdk/services/EmailDomainsService.d.ts +20 -3
- package/dist/sdk/services/FileService.d.ts +4 -0
- package/dist/sdk/services/FormIdentifierService.d.ts +20 -3
- package/dist/sdk/services/FormIdentifierValueService.d.ts +20 -3
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +19 -2
- package/dist/sdk/services/FormRevisionService.d.ts +19 -2
- package/dist/sdk/services/FormService.d.ts +19 -2
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +19 -2
- package/dist/sdk/services/FormSubmissionService.d.ts +20 -3
- package/dist/sdk/services/GeoImageService.d.ts +22 -5
- package/dist/sdk/services/IssueAssociationService.d.ts +20 -3
- package/dist/sdk/services/IssueAttachmentService.d.ts +24 -26
- package/dist/sdk/services/IssueCommentAttachmentService.d.ts +24 -26
- package/dist/sdk/services/IssueCommentService.d.ts +21 -4
- package/dist/sdk/services/IssueService.d.ts +21 -4
- package/dist/sdk/services/IssueTypeAttachmentService.d.ts +24 -26
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +19 -2
- package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +19 -2
- 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 -3
- 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 +19 -2
- package/dist/sdk/services/OrganizationAccessService.d.ts +20 -3
- package/dist/sdk/services/OrganizationService.d.ts +19 -2
- package/dist/sdk/services/ProjectAccessService.d.ts +22 -5
- package/dist/sdk/services/ProjectAttachmentService.d.ts +24 -25
- package/dist/sdk/services/ProjectFileService.d.ts +19 -2
- 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 +5 -0
- package/dist/sdk/typings.d.ts +14 -57
- package/dist/sdk/utils.d.ts +2 -0
- package/dist/store/adapters/modelAdapter.d.ts +13 -14
- package/dist/store/adapters/typings.d.ts +19 -0
- package/dist/store/reducers.d.ts +9 -3
- package/dist/store/slices/agentsSlice.d.ts +9 -36
- package/dist/store/slices/assetAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/assetProcedureSlice.d.ts +12 -37
- package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +12 -37
- package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +13 -37
- package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +13 -37
- package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +16 -38
- package/dist/store/slices/assetProcedureStepSlice.d.ts +12 -37
- package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +12 -37
- package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +13 -37
- package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +13 -37
- package/dist/store/slices/assetProcedureTypeFieldsSlice.d.ts +10 -36
- package/dist/store/slices/assetProcedureTypeSlice.d.ts +9 -36
- package/dist/store/slices/assetSlice.d.ts +12 -37
- package/dist/store/slices/assetStageCompletionSlice.d.ts +12 -37
- package/dist/store/slices/assetStageSlice.d.ts +12 -37
- package/dist/store/slices/assetTypeAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +12 -37
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +13 -37
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +13 -37
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +13 -37
- package/dist/store/slices/assetTypeIdentifierSlice.d.ts +11 -37
- package/dist/store/slices/assetTypeIdentifierValueSlice.d.ts +11 -37
- package/dist/store/slices/assetTypeSlice.d.ts +9 -36
- package/dist/store/slices/assetTypeStatusSlice.d.ts +112 -0
- package/dist/store/slices/categorySlice.d.ts +12 -37
- package/dist/store/slices/documentAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/documentSlice.d.ts +15 -22
- package/dist/store/slices/emailDomainsSlice.d.ts +15 -38
- package/dist/store/slices/formIdentifierSlice.d.ts +11 -37
- package/dist/store/slices/formIdentifierValueSlice.d.ts +11 -37
- package/dist/store/slices/formRevisionAttachmentSlice.d.ts +102 -36
- package/dist/store/slices/formRevisionSlice.d.ts +13 -37
- package/dist/store/slices/formSlice.d.ts +14 -38
- package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +11 -36
- package/dist/store/slices/formSubmissionSlice.d.ts +10 -36
- package/dist/store/slices/geoImageSlice.d.ts +13 -37
- package/dist/store/slices/index.d.ts +2 -0
- package/dist/store/slices/issueAssociationSlice.d.ts +13 -37
- 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 +9 -36
- package/dist/store/slices/issueTypeAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +12 -37
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +13 -37
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +13 -37
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +13 -37
- package/dist/store/slices/issueTypeIdentifierSlice.d.ts +11 -37
- package/dist/store/slices/issueTypeIdentifierValueSlice.d.ts +11 -37
- package/dist/store/slices/issueTypeSlice.d.ts +11 -42
- package/dist/store/slices/issueTypeStatusSlice.d.ts +112 -0
- package/dist/store/slices/issueUpdateSlice.d.ts +11 -36
- package/dist/store/slices/organizationAccessSlice.d.ts +10 -36
- package/dist/store/slices/organizationSlice.d.ts +14 -38
- package/dist/store/slices/outboxSlice.d.ts +6 -7
- package/dist/store/slices/projectAccessSlice.d.ts +10 -36
- package/dist/store/slices/projectAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/projectFileSlice.d.ts +14 -39
- package/dist/store/slices/projectSlice.d.ts +14 -38
- package/dist/store/slices/teamMembershipSlice.d.ts +11 -37
- package/dist/store/slices/teamSlice.d.ts +11 -38
- package/dist/store/slices/userSlice.d.ts +12 -37
- package/dist/store/store.d.ts +4 -13
- package/dist/store/typings.d.ts +18 -1
- package/dist/typings/files.d.ts +15 -14
- package/dist/typings/models/agents.d.ts +2 -1
- package/dist/typings/models/assets.d.ts +19 -9
- package/dist/typings/models/base.d.ts +1 -11
- package/dist/typings/models/categories.d.ts +1 -1
- package/dist/typings/models/documents.d.ts +5 -8
- package/dist/typings/models/fields.d.ts +4 -4
- package/dist/typings/models/forms.d.ts +1 -1
- package/dist/typings/models/geoImages.d.ts +7 -7
- package/dist/typings/models/issues.d.ts +34 -22
- package/dist/typings/models/projects.d.ts +5 -5
- package/dist/typings/models/teams.d.ts +2 -3
- package/dist/typings/models/users.d.ts +2 -1
- package/dist/utils/models/assets.d.ts +2 -1
- package/dist/utils/models/documents.d.ts +4 -0
- package/dist/utils/models/index.d.ts +2 -0
- package/dist/utils/models/issues.d.ts +2 -0
- package/package.json +3 -3
- package/dist/sdk/services/BaseAttachmentService.d.ts +0 -39
- package/dist/sdk/services/BaseUploadService.d.ts +0 -10
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
(function(s,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("react"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("buffer"),require("localforage"),require("redux-persist-migrate"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","file-saver","fast-tree-builder","ts-tree-lib","react","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","buffer","localforage","redux-persist-migrate","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],z):(s=typeof globalThis<"u"?globalThis:s||self,z(s["overmap-core"]={},null,s.toolkit,s.request,s.uuid,s.fileSaver,s.buildTree,s.tsTreeLib,s.react,s.reduxOffline,s.offlineConfig,null,s.localforage,s.createMigration,null,s.idb,s.jwtDecode,s.dependencyGraph))})(this,function(s,z,d,Ze,Je,Gp,Lp,Qn,Np,Hp,xn,EF,Wp,Kp,VF,Yp,Zp,Jp){"use strict";var wF=Object.defineProperty;var MF=(s,z,d)=>z in s?wF(s,z,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[z]=d;var S=(s,z,d)=>MF(s,typeof z!="symbol"?z+"":z,d);var $p;const ec=Object.freeze([]),tc=Object.freeze({});var sc=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(sc||{}),l=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(l||{}),ic=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(ic||{}),Qt=(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))(Qt||{}),xt=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.SELECTED=2]="SELECTED",t[t.DONE=4]="DONE",t))(xt||{}),E=(t=>(t.STATUS="status",t.PRIORITY="priority",t.CATEGORY="category",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))(E||{});const Xp=xt.BACKLOG,Qp=Qt.MEDIUM,ac=6e4;function P(t){return{addOne:(p,y)=>{const A=t(y.payload);p.instances[A]=y.payload},addMany:(p,y)=>{for(const A of y.payload){const I=t(A);p.instances[I]=A}},setOne:(p,y)=>{const A=t(y.payload);p.instances[A]=y.payload},setMany:(p,y)=>{for(const A of y.payload){const I=t(A);p.instances[I]=A}},updateOne:(p,y)=>{const A=t(y.payload);p.instances[A]=y.payload},updateMany:(p,y)=>{for(const A of y.payload){const I=t(A);p.instances[I]=A}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const A of y.payload)delete p.instances[A]},initialize:(p,y)=>{p.instances={};const A=new Set;for(const I of y.payload){const g=t(I);A.add(g),p.instances[g]=I}A.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")},getInitialState:p=>({...p,instances:{}})}}function xp(){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 st="versioning",b=d.createAction("RESET"),M=d.createAction("RESET_PROJECT_STATE"),O=d.createAction("RESET_ORGANIZATION_STATE");$p=Symbol.toStringTag;class nc{constructor(){S(this,$p,"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 es=!1;["true","1"].includes("".toLowerCase())&&(es=!0);function ey(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 ts(t){const e={};return function(){const i=Array.prototype.slice.call(arguments);return i in e?(es&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,i,")"),e[i]):(es&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,i,")"),e[i]=t.apply(this,i))}}function ty(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?ec:t,Ot=t=>Object.keys(t).length===0?tc:t,cc=ts(t=>{if(!t)return"";const e=new Date(t),i=e.getFullYear()===ss.getFullYear(),a={day:"numeric",month:"short"};return i||(a.year="numeric"),e.toLocaleDateString([],a)}),sy=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),iy=1e3*86400,ss=new Date,ay=t=>new Date(t).toDateString()===ss.toDateString(),ny=ts((t,e,i)=>{const a=Math.round((new Date(t).getTime()-ss.getTime())/iy);return a<e||a>i?cc(t):sy.format(a,"days")});function cy(t){return new Uint8Array(t).reduce((i,a)=>i+a.toString(16).padStart(2,"0"),"")}const is=async(t,e)=>{e||(e=await Xe(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 Xe(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=cy(c);e(r)})},a.readAsArrayBuffer(t)})}function ry(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 dy(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 uy=async t=>{const e={};for(const i of t){const a=await Xe(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(),oy=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 ly(t){const e=new Blob([t]);Gp.saveAs(e,t.name)}const uc={};function hy(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 F(t){return{...t,uuid:Je.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 my(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 py(t){return t.toLowerCase().replace(" ","-")}function yy(t,e=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,e?"_":"-")}function Ay(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 fy(t,e,i){return i.findIndex(a=>a.file_sha1===t.file_sha1)===e}const Sy=/^.+@.+\..+$/;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 Lp(e,{id:i=>i.uuid,parentId:i=>i.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Ty=t=>{const{roots:e}=pc(t);return e.map(i=>new Qn.Tree(i))},yc=(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 Qn.Tree(a)},C=P(t=>t.uuid),Ac=C.getInitialState({}),as=d.createSlice({name:"agents",initialState:Ac,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Ac)),reducers:{initializeConversations:C.initialize,addConversation:C.addOne,addConversations:C.addMany,setConversation:C.setOne,setConversations:C.setMany,updateConversation:C.updateOne,updateConversations:C.updateMany,deleteConversation:C.deleteOne,deleteConversations:C.deleteMany}}),{initializeConversations:fc,addConversation:Sc,addConversations:gy,setConversation:Tc,setConversations:Iy,updateConversation:gc,updateConversations:by,deleteConversation:Fy,deleteConversations:Py}=as.actions,ns=t=>t.agentsReducer.instances,Oy=d.createSelector([ns],t=>Object.values(t)),_y=f(d.createSelector([ns,(t,e)=>e],(t,e)=>t[e])),Ic=as.reducer,k=P(t=>t.uuid),bc=k.getInitialState({}),cs=d.createSlice({name:"assetAttachments",initialState:bc,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,bc)),reducers:{initializeAssetAttachments:k.initialize,addAssetAttachment:k.addOne,addAssetAttachments:k.addMany,setAssetAttachment:k.setOne,setAssetAttachments:k.setMany,updateAssetAttachment:k.updateOne,updateAssetAttachments:k.updateMany,deleteAssetAttachment:k.deleteOne,deleteAssetAttachments:k.deleteMany}}),{initializeAssetAttachments:rs,addAssetAttachment:Ry,addAssetAttachments:ds,setAssetAttachment:Fc,setAssetAttachments:vy,updateAssetAttachment:wy,updateAssetAttachments:Pc,deleteAssetAttachment:Oc,deleteAssetAttachments:us}=cs.actions,_c=t=>t.assetAttachmentReducer.instances,Rc=d.createSelector([_c],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=cs.reducer,B=P(({uuid:t})=>t),Ec=B.getInitialState({}),os=d.createSlice({name:"assetProcedureTypeAttachments",initialState:Ec,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Ec)),reducers:{initializeAssetProcedureTypeAttachments:B.initialize,addAssetProcedureTypeAttachment:B.addOne,addAssetProcedureTypeAttachments:B.addMany,setAssetProcedureTypeAttachment:B.setOne,setAssetProcedureTypeAttachments:B.setMany,updateAssetProcedureTypeAttachment:B.updateOne,updateAssetProcedureTypeAttachments:B.updateMany,deleteAssetProcedureTypeAttachment:B.deleteOne,deleteAssetProcedureTypeAttachments:B.deleteMany}}),{initializeAssetProcedureTypeAttachments:Vc,addAssetProcedureTypeAttachment:My,addAssetProcedureTypeAttachments:jc,setAssetProcedureTypeAttachment:qc,setAssetProcedureTypeAttachments:Ey,updateAssetProcedureTypeAttachment:Vy,updateAssetProcedureTypeAttachments:zc,deleteAssetProcedureTypeAttachment:Uc,deleteAssetProcedureTypeAttachments:Dc}=os.actions,Cc=os.reducer,kc=t=>t.assetProcedureTypeAttachmentReducer.instances,Bc=d.createSelector([kc],t=>Object.values(t)),$c=t=>e=>e.assetProcedureTypeAttachmentReducer.instances[t],jy=f(d.createSelector([Bc,(t,e)=>e],(t,e)=>T(t.filter(({asset_procedure_type:i})=>e===i)))),$=P(({uuid:t})=>t),Gc=$.getInitialState({}),ls=d.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Gc,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Gc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:$.initialize,addAssetProcedureTypeFieldsAttachment:$.addOne,addAssetProcedureTypeFieldsAttachments:$.addMany,setAssetProcedureTypeFieldsAttachment:$.setOne,setAssetProcedureTypeFieldsAttachments:$.setMany,updateAssetProcedureTypeFieldsAttachment:$.updateOne,updateAssetProcedureTypeFieldsAttachments:$.updateMany,deleteAssetProcedureTypeFieldsAttachment:$.deleteOne,deleteAssetProcedureTypeFieldsAttachments:$.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:Lc,addAssetProcedureTypeFieldsAttachment:qy,addAssetProcedureTypeFieldsAttachments:Nc,setAssetProcedureTypeFieldsAttachment:zy,setAssetProcedureTypeFieldsAttachments:Uy,updateAssetProcedureTypeFieldsAttachment:Dy,updateAssetProcedureTypeFieldsAttachments:Hc,deleteAssetProcedureTypeFieldsAttachment:Cy,deleteAssetProcedureTypeFieldsAttachments:Wc}=ls.actions,Kc=ls.reducer,Yc=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,Zc=d.createSelector([Yc],t=>Object.values(t)),ky=f(d.createSelector([Zc,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),By=t=>e=>e.assetProcedureTypeFieldsAttachmentReducer.instances[t],G=P(({uuid:t})=>t),Jc=G.getInitialState({}),hs=d.createSlice({name:"assetProcedureTypeFields",initialState:Jc,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Jc)),reducers:{initializeAssetProcedureTypeFields:G.initialize,addAssetProcedureTypeFields:G.addOne,addAssetProcedureTypeFieldsMany:G.addMany,setAssetProcedureTypeFields:G.setOne,setAssetProcedureTypeFieldsMany:G.setMany,updateAssetProcedureTypeFields:G.updateOne,updateAssetProcedureTypeFieldsMany:G.updateMany,deleteAssetProcedureTypeFields:G.deleteOne,deleteAssetProcedureTypeFieldsMany:G.deleteMany}}),{initializeAssetProcedureTypeFields:Xc,addAssetProcedureTypeFields:Qc,addAssetProcedureTypeFieldsMany:$y,setAssetProcedureTypeFields:Gy,setAssetProcedureTypeFieldsMany:Ly,updateAssetProcedureTypeFields:xc,updateAssetProcedureTypeFieldsMany:Ny,deleteAssetProcedureTypeFields:er,deleteAssetProcedureTypeFieldsMany:Hy}=hs.actions,tr=hs.reducer,sr=t=>t.assetProcedureTypeFieldsReducer.instances,ms=d.createSelector([sr],t=>Object.values(t)),Wy=f(d.createSelector([ms,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),Ky=f(d.createSelector([ms,(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])),Yy=t=>e=>e.assetProcedureTypeFieldsReducer.instances[t],L=P(({uuid:t})=>t),ir=L.getInitialState({}),ps=d.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:ir,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,ir)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:L.initialize,addAssetProcedureTypeFieldValuesAttachment:L.addOne,addAssetProcedureTypeFieldValuesAttachments:L.addMany,setAssetProcedureTypeFieldValuesAttachment:L.setOne,setAssetProcedureTypeFieldValuesAttachments:L.setMany,updateAssetProcedureTypeFieldValuesAttachment:L.updateOne,updateAssetProcedureTypeFieldValuesAttachments:L.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:L.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:L.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:ar,addAssetProcedureTypeFieldValuesAttachment:Zy,addAssetProcedureTypeFieldValuesAttachments:_t,setAssetProcedureTypeFieldValuesAttachment:Jy,setAssetProcedureTypeFieldValuesAttachments:Xy,updateAssetProcedureTypeFieldValuesAttachment:Qy,updateAssetProcedureTypeFieldValuesAttachments:nr,deleteAssetProcedureTypeFieldValuesAttachment:xy,deleteAssetProcedureTypeFieldValuesAttachments:Rt}=ps.actions,cr=ps.reducer,ys=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,rr=d.createSelector([ys],t=>Object.values(t)),eA=t=>e=>e.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],dr=f(d.createSelector([ys,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),ur=f(d.createSelector([rr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),N=P(({uuid:t})=>t),or=N.getInitialState({}),As=d.createSlice({name:"assetProcedureTypeFieldValues",initialState:or,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,or)),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:lr,addAssetProcedureTypeFieldValues:fs,addAssetProcedureTypeFieldValuesMany:hr,setAssetProcedureTypeFieldValues:tA,setAssetProcedureTypeFieldValuesMany:sA,updateAssetProcedureTypeFieldValues:it,updateAssetProcedureTypeFieldValuesMany:mr,deleteAssetProcedureTypeFieldValues:Ss,deleteAssetProcedureTypeFieldValuesMany:pr}=As.actions,yr=As.reducer,Ar=t=>t.assetProcedureFieldValuesReducer.instances,Ts=d.createSelector([Ar],t=>Object.values(t)),iA=f(d.createSelector([Ts,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),aA=f(d.createSelector([Ts,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),gs=t=>e=>e.assetProcedureFieldValuesReducer.instances[t],H=P(({uuid:t})=>t),fr=H.getInitialState({}),Is=d.createSlice({name:"assetProcedures",initialState:fr,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,fr)),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:Sr,addAssetProcedure:bs,addAssetProcedures:Tr,updateAssetProcedure:at,updateAssetProcedures:nA,deleteAssetProcedure:Fs,deleteAssetProcedures:gr,setAssetProcedure:cA,setAssetProcedures:rA}=Is.actions,Ir=Is.reducer,Ps=t=>t.assetProcedureReducer.instances,Os=d.createSelector([Ps],t=>Object.values(t)),br=f(d.createSelector([Os,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),dA=f(d.createSelector([Os,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),_s=t=>e=>e.assetProcedureReducer.instances[t],uA=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=P(t=>t.uuid),Fr=W.getInitialState({}),Rs=d.createSlice({name:"assetProcedureTypes",initialState:Fr,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),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:vs,addAssetProcedureTypes:oA,updateAssetProcedureType:nt,updateAssetProcedureTypes:lA,deleteAssetProcedureType:ws,deleteAssetProcedureTypes:hA,setAssetProcedureType:mA,setAssetProcedureTypes:pA}=Rs.actions,Or=Rs.reducer,Ms=t=>t.assetProcedureTypeReducer.instances,_r=d.createSelector([Ms],t=>Object.values(t)),Es=t=>e=>e.assetProcedureTypeReducer.instances[t],yA=f(d.createSelector([Ms,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n&&i.push(n)}return T(i)})),AA=f(d.createSelector([_r,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),K=P(t=>t.uuid),Rr=K.getInitialState({}),Vs=d.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Rr,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Rr)),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:vr,addAssetProcedureStepFieldsAttachment:fA,addAssetProcedureStepFieldsAttachments:wr,setAssetProcedureStepFieldsAttachment:SA,setAssetProcedureStepFieldsAttachments:TA,updateAssetProcedureStepFieldsAttachment:gA,updateAssetProcedureStepFieldsAttachments:Mr,deleteAssetProcedureStepFieldsAttachment:IA,deleteAssetProcedureStepFieldsAttachments:Er}=Vs.actions,Vr=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,jr=d.createSelector([Vr],t=>Object.values(t)),bA=f(d.createSelector([jr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),FA=t=>e=>e.assetProcedureStepFieldsAttachmentReducer.instances[t],qr=Vs.reducer,Y=P(t=>t.uuid),zr=Y.getInitialState({}),js=d.createSlice({name:"assetProcedureStepFields",initialState:zr,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,zr)),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:Ur,addAssetProcedureStepFields:qs,addAssetProcedureStepFieldsMany:PA,setAssetProcedureStepFields:OA,setAssetProcedureStepFieldsMany:_A,updateAssetProcedureStepFields:ct,updateAssetProcedureStepFieldsMany:RA,deleteAssetProcedureStepFields:zs,deleteAssetProcedureStepFieldsMany:vA}=js.actions,Us=t=>t.assetProcedureStepFieldsReducer.instances,Ds=d.createSelector([Us],t=>Object.values(t)),wA=f(d.createSelector([Ds,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),MA=f(d.createSelector([Ds,(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])),EA=d.createSelector([Us],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}),VA=t=>e=>e.assetProcedureStepFieldsReducer.instances[t],Dr=js.reducer,Z=P(t=>t.uuid),Cr=Z.getInitialState({}),Cs=d.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Cr,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),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:kr,addAssetProcedureStepFieldValuesAttachment:jA,addAssetProcedureStepFieldValuesAttachments:vt,setAssetProcedureStepFieldValuesAttachment:qA,setAssetProcedureStepFieldValuesAttachments:zA,updateAssetProcedureStepFieldValuesAttachment:UA,updateAssetProcedureStepFieldValuesAttachments:Br,deleteAssetProcedureStepFieldValuesAttachment:DA,deleteAssetProcedureStepFieldValuesAttachments:wt}=Cs.actions,ks=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,$r=d.createSelector([ks],t=>Object.values(t)),CA=t=>e=>e.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Gr=f(d.createSelector([ks,(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)))),Nr=Cs.reducer,J=P(t=>t.uuid),Hr=J.getInitialState({}),Bs=d.createSlice({name:"assetProcedureStepFieldValues",initialState:Hr,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Hr)),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:Wr,addAssetProcedureStepFieldValues:$s,addAssetProcedureStepFieldValuesMany:Kr,setAssetProcedureStepFieldValues:kA,setAssetProcedureStepFieldValuesMany:BA,updateAssetProcedureStepFieldValues:rt,updateAssetProcedureStepFieldValuesMany:Yr,deleteAssetProcedureStepFieldValues:Gs,deleteAssetProcedureStepFieldValuesMany:Zr}=Bs.actions,Jr=t=>t.assetProcedureStepFieldValuesReducer.instances,Mt=d.createSelector([Jr],t=>Object.values(t)),$A=f(d.createSelector([Mt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),GA=f(d.createSelector([Mt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),LA=f(d.createSelector([Mt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),Ls=t=>e=>e.assetProcedureStepFieldValuesReducer.instances[t],Xr=Bs.reducer,X=P(t=>t.uuid),Qr=X.getInitialState({}),Ns=d.createSlice({name:"assetProcedureSteps",initialState:Qr,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Qr)),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:xr,setAssetProcedureStep:ed,setAssetProcedureSteps:NA,addAssetProcedureStep:td,addAssetProcedureSteps:sd,updateAssetProcedureStep:Et,updateAssetProcedureSteps:HA,deleteAssetProcedureStep:id,deleteAssetProcedureSteps:ad}=Ns.actions,nd=Ns.reducer,dt=t=>t.assetProcedureStepReducer.instances,Hs=t=>e=>e.assetProcedureStepReducer.instances[t],cd=d.createSelector([dt],t=>Object.values(t)),WA=f(d.createSelector([dt,(t,e)=>e],(t,e)=>{const i={};for(const[a,n]of Object.entries(t))n.asset_procedure_type===e&&(i[a]=n);return Ot(i)})),KA=f(d.createSelector([cd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),YA=f(d.createSelector([dt,(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)})),rd=f(d.createSelector([dt,(t,e)=>e],(t,e)=>{if(!t[e])return T([]);const n=yc(e,Object.values(t)).all().map(({model:c})=>c);return T(n)})),Q=P(t=>t.uuid),dd=Q.getInitialState({}),Ws=d.createSlice({name:"assets",initialState:dd,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,dd)),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:ud,addAsset:Ks,addAssets:Vt,updateAsset:ut,updateAssets:ZA,deleteAsset:Ys,deleteAssets:Zs,setAsset:JA,setAssets:XA}=Ws.actions,Js=t=>t.assetReducer.instances,od=d.createSelector([Js],t=>T(Object.values(t))),Xs=f(d.createSelector([od,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),Qs=t=>e=>e.assetReducer.instances[t],ld=f(d.createSelector([Js,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n&&i.push(n)}return T(i)})),QA=t=>e=>Xs(t)(e).length,hd=Ws.reducer,x=P(t=>t.uuid),md=x.getInitialState({}),xs=d.createSlice({name:"assetStageCompletions",initialState:md,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,md)),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:pd,addAssetStageCompletion:ei,addAssetStageCompletions:ti,setAssetStageCompletion:xA,setAssetStageCompletions:ef,updateAssetStageCompletion:yd,updateAssetStageCompletions:Ad,deleteAssetStageCompletion:si,deleteAssetStageCompletions:ii}=xs.actions,fd=xs.reducer,ai=t=>t.assetStageCompletionReducer.instances,tf=d.createSelector([ai],t=>Object.values(t)),Sd=t=>e=>e.assetStageCompletionReducer.instances[t],Td=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)))})),ee=P(t=>t.uuid),gd=ee.getInitialState({}),ni=d.createSlice({name:"assetStages",initialState:gd,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,gd)),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:bd,setAssetStages:sf,addAssetStage:ci,addAssetStages:af,updateAssetStage:jt,updateAssetStages:nf,deleteAssetStage:ri,deleteAssetStages:cf}=ni.actions,Fd=ni.reducer,qt=t=>t.assetStageReducer.instances,di=t=>e=>e.assetStageReducer.instances[t],Pd=d.createSelector([qt],t=>Object.values(t)),rf=f(d.createSelector([qt,(t,e)=>e],(t,e)=>{const i={};for(const[a,n]of Object.entries(t))n.asset_procedure_type===e&&(i[a]=n);return Ot(i)})),df=f(d.createSelector([Pd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),uf=f(d.createSelector([qt,(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=P(t=>t.uuid),Od=te.getInitialState({}),ui=d.createSlice({name:"assetTypeAttachments",initialState:Od,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Od)),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:_d,addAssetTypeAttachment:of,addAssetTypeAttachments:oi,setAssetTypeAttachment:Rd,setAssetTypeAttachments:lf,updateAssetTypeAttachment:hf,updateAssetTypeAttachments:vd,deleteAssetTypeAttachment:wd,deleteAssetTypeAttachments:li}=ui.actions,Md=t=>t.assetTypeAttachmentReducer.instances,Ed=d.createSelector([Md],t=>Object.values(t)),Vd=t=>e=>e.assetTypeAttachmentReducer.instances[t],jd=f(d.createSelector([Ed,(t,e)=>e],(t,e)=>T(t.filter(({asset_type:i})=>e===i)))),qd=ui.reducer,se=P(t=>t.uuid),zd=se.getInitialState({}),hi=d.createSlice({name:"assetTypeFieldsAttachments",initialState:zd,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,zd)),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:Ud,addAssetTypeFieldsAttachment:mf,addAssetTypeFieldsAttachments:Dd,setAssetTypeFieldsAttachment:pf,setAssetTypeFieldsAttachments:yf,updateAssetTypeFieldsAttachment:Af,updateAssetTypeFieldsAttachments:Cd,deleteAssetTypeFieldsAttachment:ff,deleteAssetTypeFieldsAttachments:kd}=hi.actions,Bd=t=>t.assetTypeFieldsAttachmentReducer.instances,$d=d.createSelector([Bd],t=>Object.values(t)),Sf=f(d.createSelector([$d,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),Tf=t=>e=>e.assetTypeFieldsAttachmentReducer.instances[t],Gd=hi.reducer,ie=P(t=>t.uuid),Ld=ie.getInitialState({}),mi=d.createSlice({name:"assetTypeFields",initialState:Ld,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Ld)),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:Nd,addAssetTypeFields:Hd,addAssetTypeFieldsMany:gf,setAssetTypeFields:If,setAssetTypeFieldsMany:bf,updateAssetTypeFields:Wd,updateAssetTypeFieldsMany:Ff,deleteAssetTypeFields:Kd,deleteAssetTypeFieldsMany:Pf}=mi.actions,Yd=t=>t.assetTypeFieldsReducer.instances,zt=d.createSelector([Yd],t=>Object.values(t)),Of=f(d.createSelector([zt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),_f=f(d.createSelector([zt,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),Rf=t=>e=>e.assetTypeFieldsReducer.instances[t],Zd=mi.reducer,ae=P(t=>t.uuid),Jd=ae.getInitialState({}),pi=d.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Jd,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Jd)),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:Xd,addAssetTypeFieldValuesAttachment:vf,addAssetTypeFieldValuesAttachments:Ut,setAssetTypeFieldValuesAttachment:wf,setAssetTypeFieldValuesAttachments:Mf,updateAssetTypeFieldValuesAttachment:Ef,updateAssetTypeFieldValuesAttachments:Qd,deleteAssetTypeFieldValuesAttachment:Vf,deleteAssetTypeFieldValuesAttachments:Dt}=pi.actions,yi=t=>t.assetTypeFieldValuesAttachmentReducer.instances,xd=d.createSelector([yi],t=>Object.values(t)),jf=t=>e=>e.assetTypeFieldValuesAttachmentReducer.instances[t],eu=f(d.createSelector([yi,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),tu=f(d.createSelector([xd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),su=pi.reducer,ne=P(t=>t.uuid),iu=ne.getInitialState({}),Ai=d.createSlice({name:"assetTypeFieldValues",initialState:iu,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,iu)),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:au,addAssetTypeFieldValues:fi,addAssetTypeFieldValuesMany:nu,setAssetTypeFieldValues:qf,setAssetTypeFieldValuesMany:zf,updateAssetTypeFieldValues:ot,updateAssetTypeFieldValuesMany:cu,deleteAssetTypeFieldValues:Si,deleteAssetTypeFieldValuesMany:ru}=Ai.actions,du=t=>t.assetTypeFieldValuesReducer.instances,Ti=d.createSelector([du],t=>Object.values(t)),Uf=f(d.createSelector([Ti,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),Df=f(d.createSelector([zt,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)))})),gi=t=>e=>e.assetTypeFieldValuesReducer.instances[t],uu=Ai.reducer,ce=P(t=>t.uuid),ou=ce.getInitialState({}),Ii=d.createSlice({name:"assetTypeIdentifiers",initialState:ou,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,ou)),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:lu,addAssetTypeIdentifier:bi,addAssetTypeIdentifiers:Cf,setAssetTypeIdentifier:kf,setAssetTypeIdentifiers:Bf,updateAssetTypeIdentifier:lt,updateAssetTypeIdentifiers:$f,deleteAssetTypeIdentifier:Fi,deleteAssetTypeIdentifiers:Gf}=Ii.actions,hu=t=>t.assetTypeIdentifierReducer.instances,mu=d.createSelector([hu],t=>Object.values(t)),Pi=t=>e=>e.assetTypeIdentifierReducer.instances[t],Lf=f(d.createSelector([mu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),pu=Ii.reducer,re=P(t=>t.uuid),yu=re.getInitialState({}),Oi=d.createSlice({name:"assetTypeIdentifierValues",initialState:yu,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,yu)),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:Au,addAssetTypeIdentifierValue:_i,addAssetTypeIdentifierValues:Nf,setAssetTypeIdentifierValue:Hf,setAssetTypeIdentifierValues:Wf,updateAssetTypeIdentifierValue:ht,updateAssetTypeIdentifierValues:Kf,deleteAssetTypeIdentifierValue:Ri,deleteAssetTypeIdentifierValues:Yf}=Oi.actions,fu=t=>t.assetTypeIdentifierValueReducer.instances,vi=d.createSelector([fu],t=>Object.values(t)),wi=t=>e=>e.assetTypeIdentifierValueReducer.instances[t],Zf=f(d.createSelector([vi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),Jf=f(d.createSelector([vi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type_identifier===e)))),Su=Oi.reducer,de=P(t=>t.uuid),Tu=de.getInitialState({}),Mi=d.createSlice({name:"assetTypes",initialState:Tu,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Tu)),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:gu,setAssetType:Xf,setAssetTypes:Qf,addAssetType:Ei,addAssetTypes:xf,updateAssetType:mt,updateAssetTypes:eS,deleteAssetType:Vi,deleteAssetTypes:tS}=Mi.actions,ji=t=>t.assetTypeReducer.instances,Iu=d.createSelector([ji],t=>Object.values(t)),qi=t=>e=>e.assetTypeReducer.instances[t],sS=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)})),iS=f(d.createSelector([Iu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),bu=Mi.reducer,Fu={accessToken:"",refreshToken:"",isLoggedIn:!1},Ct=d.createSlice({name:"auth",initialState:Fu,extraReducers:t=>t.addCase(b,e=>Object.assign(e,Fu)),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||Ct.caseReducers.clearTokens(t),t.isLoggedIn=e.payload}}}),{setTokens:aS,clearTokens:nS,setLoggedIn:Pu}=Ct.actions,cS=t=>t.authReducer.accessToken,rS=t=>t.authReducer.isLoggedIn,Ou=Ct.reducer,ue=P(t=>t.uuid),_u=ue.getInitialState({}),zi=d.createSlice({name:"categories",initialState:_u,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,_u)),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:Ru,addCategory:Ui,addCategories:dS,setCategory:uS,setCategories:oS,updateCategory:vu,updateCategories:lS,deleteCategory:wu,deleteCategories:hS}=zi.actions,Di=t=>t.categoryReducer.instances,Mu=d.createSelector([Di],t=>Object.values(t)),Ci=t=>e=>e.categoryReducer.instances[t],mS=f(d.createSelector([Di,(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)})),pS=f(d.createSelector([Mu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),Eu=zi.reducer,oe=P(t=>t.uuid),Vu=oe.getInitialState({}),ki=d.createSlice({name:"documentAttachments",initialState:Vu,extraReducers:t=>t.addCase(b,e=>Object.assign(e,Vu)),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:ju,addDocumentAttachment:yS,addDocumentAttachments:qu,setDocumentAttachment:zu,setDocumentAttachments:AS,updateDocumentAttachment:fS,updateDocumentAttachments:Uu,deleteDocumentAttachment:Du,deleteDocumentAttachments:Cu}=ki.actions,ku=t=>t.documentAttachmentReducer.instances,Bu=d.createSelector([ku],t=>Object.values(t)),$u=t=>e=>e.documentAttachmentReducer.instances[t],SS=f(d.createSelector([Bu,(t,e)=>e],(t,e)=>T(t.filter(({document:i})=>e===i)))),Gu=ki.reducer,Lu={documents:{}},Bi=d.createSlice({name:"documents",initialState:Lu,extraReducers:t=>t.addCase(b,e=>{Object.assign(e,Lu)}),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:Nu,addDocuments:Hu,updateDocuments:Qe,removeDocuments:$i}=Bi.actions,kt=t=>t.documentsReducer.documents,Gi=d.createSelector([kt],t=>Object.values(t)),Wu=t=>e=>e.documentsReducer.documents[t],TS=f(d.createSelector([kt,(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)})),gS=f(d.createSelector([Gi,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),IS=f(d.createSelector([Gi,(t,e)=>e],(t,e)=>t.filter(i=>i.organization===e))),Ku=Bi.reducer,le=P(t=>t.uuid),Yu=le.getInitialState({}),Li=d.createSlice({name:"emailDomains",initialState:Yu,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Yu)),reducers:{initializeEmailDomains:le.initialize,addEmailDomain:le.addOne,addEmailDomains:le.addMany,setEmailDomain:le.setOne,setEmailDomains:le.setMany,updateEmailDomain:le.updateOne,updateEmailDomains:le.updateMany,deleteEmailDomain:le.deleteOne,deleteEmailDomains:le.deleteMany}}),{initializeEmailDomains:Zu,addEmailDomain:Ju,addEmailDomains:bS,setEmailDomain:FS,setEmailDomains:PS,updateEmailDomain:OS,updateEmailDomains:_S,deleteEmailDomain:Xu,deleteEmailDomains:RS}=Li.actions,Qu=t=>t.emailDomainsReducer.instances,xu=d.createSelector([Qu],t=>Object.values(t)),vS=f(d.createSelector([xu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),eo=Li.reducer,to={s3Urls:{}},so=1e3*60*60,wS=so*24*7,Ni=d.createSlice({name:"file",initialState:to,extraReducers:t=>t.addCase(b,e=>Object.assign(e,to)),reducers:{setUploadUrl:(t,e)=>{const{url:i,fields:a,sha1:n}=e.payload,c=new Date,r=new Date(c.getTime()+wS);t.s3Urls[n]={url:i,fields:a,exp:r.getTime()}}}}),{setUploadUrl:io}=Ni.actions,ao=t=>e=>{const i=e.fileReducer.s3Urls[t];if(!i)return;const a=new Date().getTime();if(!((i.exp??a)-a<so))return i},no=Ni.reducer,he=P(t=>t.uuid),co=he.getInitialState({}),Hi=d.createSlice({name:"formIdentifiers",initialState:co,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,co)),reducers:{initializeFormIdentifiers:he.initialize,addFormIdentifier:he.addOne,addFormIdentifiers:he.addMany,setFormIdentifier:he.setOne,setFormIdentifiers:he.setMany,updateFormIdentifier:he.updateOne,updateFormIdentifiers:he.updateMany,deleteFormIdentifier:he.deleteOne,deleteFormIdentifiers:he.deleteMany}}),{initializeFormIdentifiers:ro,addFormIdentifier:Wi,addFormIdentifiers:MS,setFormIdentifier:ES,setFormIdentifiers:VS,updateFormIdentifier:pt,updateFormIdentifiers:jS,deleteFormIdentifier:Ki,deleteFormIdentifiers:qS}=Hi.actions,uo=t=>t.formIdentifierReducer.instances,oo=d.createSelector([uo],t=>Object.values(t)),Yi=t=>e=>e.formIdentifierReducer.instances[t],zS=f(d.createSelector([oo,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),lo=Hi.reducer,me=P(t=>t.uuid),ho=me.getInitialState({}),Zi=d.createSlice({name:"formIdentifierValues",initialState:ho,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,ho)),reducers:{initializeFormIdentifierValues:me.initialize,addFormIdentifierValue:me.addOne,addFormIdentifierValues:me.addMany,setFormIdentifierValue:me.setOne,setFormIdentifierValues:me.setMany,updateFormIdentifierValue:me.updateOne,updateFormIdentifierValues:me.updateMany,deleteFormIdentifierValue:me.deleteOne,deleteFormIdentifierValues:me.deleteMany}}),{initializeFormIdentifierValues:mo,addFormIdentifierValue:Ji,addFormIdentifierValues:US,setFormIdentifierValue:DS,setFormIdentifierValues:CS,updateFormIdentifierValue:yt,updateFormIdentifierValues:kS,deleteFormIdentifierValue:Xi,deleteFormIdentifierValues:BS}=Zi.actions,po=t=>t.formIdentifierValueReducer.instances,Qi=d.createSelector([po],t=>Object.values(t)),xi=t=>e=>e.formIdentifierValueReducer.instances[t],$S=f(d.createSelector([Qi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),GS=f(d.createSelector([Qi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_identifier===e)))),yo=Zi.reducer,pe=P(t=>t.uuid),Ao=pe.getInitialState({}),ea=d.createSlice({name:"formRevisionAttachments",initialState:Ao,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Ao)),reducers:{initializeFormRevisionAttachments:pe.initialize,addFormRevisionAttachment:pe.addOne,addFormRevisionAttachments:pe.addMany,setFormRevisionAttachment:pe.setOne,setFormRevisionAttachments:pe.setMany,updateFormRevisionAttachment:pe.updateOne,updateFormRevisionAttachments:pe.updateMany,deleteFormRevisionAttachment:pe.deleteOne,deleteFormRevisionAttachments:pe.deleteMany}}),{initializeFormRevisionAttachments:fo,addFormRevisionAttachment:LS,addFormRevisionAttachments:So,setFormRevisionAttachment:NS,setFormRevisionAttachments:HS,updateFormRevisionAttachment:WS,updateFormRevisionAttachments:To,deleteFormRevisionAttachment:KS,deleteFormRevisionAttachments:go}=ea.actions,Io=t=>t.formRevisionAttachmentReducer.instances,YS=f(d.createSelector([Io,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.form_revision===e)))),bo=ea.reducer,ye=P(t=>t.uuid),Fo=ye.getInitialState({}),ta=d.createSlice({name:"formRevisions",initialState:Fo,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Fo)),reducers:{initializeFormRevisions:ye.initialize,addFormRevision:ye.addOne,addFormRevisions:ye.addMany,setFormRevision:ye.setOne,setFormRevisions:ye.setMany,updateFormRevision:ye.updateOne,updateFormRevisions:ye.updateMany,deleteFormRevision:ye.deleteOne,deleteFormRevisions:ye.deleteMany}}),{initializeFormRevisions:Po,addFormRevision:sa,addFormRevisions:Oo,setFormRevision:_o,setFormRevisions:ZS,updateFormRevision:JS,updateFormRevisions:XS,deleteFormRevision:ia,deleteFormRevisions:Ro}=ta.actions,aa=t=>t.formRevisionReducer.instances,na=d.createSelector([aa],t=>Object.values(t)),QS=t=>e=>e.formRevisionReducer.instances[t],xS=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])),vo=f(d.createSelector([na,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),wo=ta.reducer,Ae=P(t=>t.uuid),Mo=Ae.getInitialState({}),ca=d.createSlice({name:"forms",initialState:Mo,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Mo)),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:Eo,addForm:ra,addForms:eT,setForm:tT,setForms:sT,updateForm:iT,updateForms:aT,deleteForm:da,deleteForms:nT}=ca.actions,Vo=ca.reducer,jo=t=>t.formReducer.instances,qo=d.createSelector([jo],t=>Object.values(t)),zo=t=>e=>e.formReducer.instances[t],cT=f(d.createSelector([qo,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),fe=P(t=>t.uuid),Uo=fe.getInitialState({}),ua=d.createSlice({name:"formSubmissionAttachments",initialState:Uo,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Uo)),reducers:{initializeFormSubmissionAttachments:fe.initialize,addFormSubmissionAttachment:fe.addOne,addFormSubmissionAttachments:fe.addMany,setFormSubmissionAttachment:fe.setOne,setFormSubmissionAttachments:fe.setMany,updateFormSubmissionAttachment:fe.updateOne,updateFormSubmissionAttachments:fe.updateMany,deleteFormSubmissionAttachment:fe.deleteOne,deleteFormSubmissionAttachments:fe.deleteMany}}),{initializeFormSubmissionAttachments:Do,addFormSubmissionAttachment:rT,addFormSubmissionAttachments:Bt,setFormSubmissionAttachment:dT,setFormSubmissionAttachments:uT,updateFormSubmissionAttachment:oT,updateFormSubmissionAttachments:Co,deleteFormSubmissionAttachment:lT,deleteFormSubmissionAttachments:$t}=ua.actions,ko=t=>t.formSubmissionAttachmentReducer.instances,oa=d.createSelector([ko],t=>Object.values(t)),Bo=f(d.createSelector([oa,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),$o=f(d.createSelector([oa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),Go=ua.reducer,Se=P(t=>t.uuid),Lo=Se.getInitialState({}),la=d.createSlice({name:"formSubmissions",initialState:Lo,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Lo)),reducers:{initializeFormSubmissions:Se.initialize,setFormSubmission:Se.setOne,setFormSubmissions:Se.setMany,addFormSubmission:Se.addOne,addFormSubmissions:Se.addMany,updateFormSubmission:Se.updateOne,updateFormSubmissions:Se.updateMany,deleteFormSubmission:Se.deleteOne,deleteFormSubmissions:Se.deleteMany}}),{initializeFormSubmissions:No,setFormSubmission:Gt,setFormSubmissions:hT,addFormSubmission:ha,addFormSubmissions:Ho,updateFormSubmission:Wo,updateFormSubmissions:mT,deleteFormSubmission:ma,deleteFormSubmissions:Ko}=la.actions,pa=t=>t.formSubmissionReducer.instances,pT=d.createSelector([pa],t=>Object.values(t)),ya=t=>e=>e.formSubmissionReducer.instances[t],Yo=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))})),Zo=la.reducer,Te=P(t=>t.uuid),Jo=Te.getInitialState({}),Aa=d.createSlice({name:"geoImages",initialState:Jo,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Jo)),reducers:{initializeGeoImages:Te.initialize,setGeoImage:Te.setOne,setGeoImages:Te.setMany,addGeoImage:Te.addOne,addGeoImages:Te.addMany,updateGeoImage:Te.updateOne,updateGeoImages:Te.updateMany,deleteGeoImage:Te.deleteOne,deleteGeoImages:Te.deleteMany}}),{initializeGeoImages:Xo,setGeoImage:At,setGeoImages:Qo,addGeoImage:xo,addGeoImages:el,updateGeoImage:tl,updateGeoImages:yT,deleteGeoImage:fa,deleteGeoImages:sl}=Aa.actions,il=t=>t.geoImageReducer.instances,al=d.createSelector([il],t=>Object.values(t)),Sa=t=>e=>e.geoImageReducer.instances[t],AT=f(d.createSelector([al,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),nl=Aa.reducer,ge=P(t=>t.uuid),cl=ge.getInitialState({}),Ta=d.createSlice({name:"issueAssociations",initialState:cl,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,cl)),reducers:{initializeIssueAssociations:ge.initialize,addIssueAssociation:ge.addOne,addIssueAssociations:ge.addMany,setIssueAssociation:ge.setOne,setIssueAssociations:ge.setMany,updateIssueAssociation:ge.updateOne,updateIssueAssociations:ge.updateMany,deleteIssueAssociation:ge.deleteOne,deleteIssueAssociations:ge.deleteMany}}),{initializeIssueAssociations:rl,setIssueAssociations:fT,setIssueAssociation:ST,updateIssueAssociation:dl,updateIssueAssociations:TT,addIssueAssociation:ga,addIssueAssociations:Ia,deleteIssueAssociation:ba,deleteIssueAssociations:Fa}=Ta.actions,ft=t=>t.issueAssociationReducer.instances,gT=d.createSelector([ft],t=>Object.values(t)),ul=t=>e=>e.issueAssociationReducer.instances[t],ol=f(d.createSelector([ft,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.associated_issue===e)))),ll=f(d.createSelector([ft,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),hl=f(d.createSelector([ft,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.asset===e)))),ml=Ta.reducer,Ie=P(t=>t.uuid),pl=Ie.getInitialState({}),Pa=d.createSlice({name:"issueAttachments",initialState:pl,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,pl)),reducers:{initializeIssueAttachments:Ie.initialize,addIssueAttachment:Ie.addOne,addIssueAttachments:Ie.addMany,setIssueAttachment:Ie.setOne,setIssueAttachments:Ie.setMany,updateIssueAttachment:Ie.updateOne,updateIssueAttachments:Ie.updateMany,deleteIssueAttachment:Ie.deleteOne,deleteIssueAttachments:Ie.deleteMany}}),{initializeIssueAttachments:Oa,addIssueAttachment:IT,addIssueAttachments:_a,setIssueAttachment:yl,setIssueAttachments:bT,updateIssueAttachment:FT,updateIssueAttachments:Al,deleteIssueAttachment:fl,deleteIssueAttachments:Ra}=Pa.actions,Sl=t=>t.issueAttachmentReducer.instances,Tl=d.createSelector([Sl],t=>Object.values(t)),gl=f(d.createSelector([Tl,(t,e)=>e],(t,e)=>T(t.filter(({issue:i})=>e===i)))),Il=t=>e=>e.issueAttachmentReducer.instances[t],bl=Pa.reducer,be=P(t=>t.uuid),Fl=be.getInitialState({}),va=d.createSlice({name:"issueCommentAttachments",initialState:Fl,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Fl)),reducers:{initializeIssueCommentAttachments:be.initialize,addIssueCommentAttachment:be.addOne,addIssueCommentAttachments:be.addMany,setIssueCommentAttachment:be.setOne,setIssueCommentAttachments:be.setMany,updateIssueCommentAttachment:be.updateOne,updateIssueCommentAttachments:be.updateMany,deleteIssueCommentAttachment:be.deleteOne,deleteIssueCommentAttachments:be.deleteMany}}),{initializeIssueCommentAttachments:wa,addIssueCommentAttachment:PT,addIssueCommentAttachments:Pl,setIssueCommentAttachment:Ol,setIssueCommentAttachments:OT,updateIssueCommentAttachment:_T,updateIssueCommentAttachments:_l,deleteIssueCommentAttachment:Rl,deleteIssueCommentAttachments:vl}=va.actions,wl=t=>t.issueCommentAttachmentReducer.instances,Ml=d.createSelector([wl],t=>Object.values(t)),El=t=>e=>e.issueCommentAttachmentReducer.instances[t],RT=f(d.createSelector([Ml,(t,e)=>e],(t,e)=>T(t.filter(({issue_comment:i})=>e===i)))),Vl=va.reducer,Fe=P(t=>t.uuid),jl=Fe.getInitialState({}),Ma=d.createSlice({name:"issueComments",initialState:jl,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,jl)),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:vT,addIssueComment:Ea,addIssueComments:wT,setIssueComment:Va,setIssueComments:ql,updateIssueComment:MT,updateIssueComments:ET,deleteIssueComment:ja,deleteIssueComments:VT}=Ma.actions,zl=t=>t.issueCommentReducer.instances,qa=t=>e=>e.issueCommentReducer.instances[t],jT=f(d.createSelector([zl,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),Ul=Ma.reducer,Pe=P(t=>t.uuid),Dl=Pe.getInitialState({}),za=d.createSlice({name:"issues",initialState:Dl,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Dl)),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:Cl,addIssue:Ua,addIssues:kl,setIssue:qT,setIssues:zT,updateIssue:Lt,updateIssues:UT,deleteIssue:Da,deleteIssues:Bl}=za.actions,Ca=t=>t.issueReducer.instances,ka=d.createSelector([Ca],t=>Object.values(t)),Ba=t=>e=>e.issueReducer.instances[t],DT=f(d.createSelector([Ca,(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)})),CT=f(d.createSelector([ka,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),$l=f(d.createSelector([ka,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e))),Gl=za.reducer,Oe=P(t=>t.uuid),Ll=Oe.getInitialState({}),$a=d.createSlice({name:"issueTypeAttachments",initialState:Ll,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Ll)),reducers:{initializeIssueTypeAttachments:Oe.initialize,addIssueTypeAttachment:Oe.addOne,addIssueTypeAttachments:Oe.addMany,setIssueTypeAttachment:Oe.setOne,setIssueTypeAttachments:Oe.setMany,updateIssueTypeAttachment:Oe.updateOne,updateIssueTypeAttachments:Oe.updateMany,deleteIssueTypeAttachment:Oe.deleteOne,deleteIssueTypeAttachments:Oe.deleteMany}}),{initializeIssueTypeAttachments:Ga,addIssueTypeAttachment:kT,addIssueTypeAttachments:Nl,setIssueTypeAttachment:Hl,setIssueTypeAttachments:BT,updateIssueTypeAttachment:$T,updateIssueTypeAttachments:Wl,deleteIssueTypeAttachment:Kl,deleteIssueTypeAttachments:Yl}=$a.actions,Zl=t=>t.issueTypeAttachmentReducer.instances,Jl=d.createSelector([Zl],t=>Object.values(t)),Xl=t=>e=>e.issueTypeAttachmentReducer.instances[t],GT=f(d.createSelector([Jl,(t,e)=>e],(t,e)=>T(t.filter(({issue_type:i})=>e===i)))),Ql=$a.reducer,_e=P(t=>t.uuid),xl=_e.getInitialState({}),La=d.createSlice({name:"issueTypeFieldsAttachments",initialState:xl,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,xl)),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:eh,addIssueTypeFieldsAttachment:LT,addIssueTypeFieldsAttachments:th,setIssueTypeFieldsAttachment:NT,setIssueTypeFieldsAttachments:HT,updateIssueTypeFieldsAttachment:WT,updateIssueTypeFieldsAttachments:sh,deleteIssueTypeFieldsAttachment:KT,deleteIssueTypeFieldsAttachments:ih}=La.actions,ah=t=>t.issueTypeFieldsAttachmentReducer.instances,nh=d.createSelector([ah],t=>Object.values(t)),YT=f(d.createSelector([nh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),ZT=t=>e=>e.issueTypeFieldsAttachmentReducer.instances[t],ch=La.reducer,Re=P(t=>t.uuid),rh=Re.getInitialState({}),Na=d.createSlice({name:"issueTypeFieldValues",initialState:rh,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,rh)),reducers:{initializeIssueTypeFieldValues:Re.initialize,addIssueTypeFieldValues:Re.addOne,addIssueTypeFieldValuesMany:Re.addMany,setIssueTypeFieldValues:Re.setOne,setIssueTypeFieldValuesMany:Re.setMany,updateIssueTypeFieldValues:Re.updateOne,updateIssueTypeFieldValuesMany:Re.updateMany,deleteIssueTypeFieldValues:Re.deleteOne,deleteIssueTypeFieldValuesMany:Re.deleteMany}}),{initializeIssueTypeFieldValues:dh,addIssueTypeFieldValues:Ha,addIssueTypeFieldValuesMany:JT,setIssueTypeFieldValues:XT,setIssueTypeFieldValuesMany:QT,updateIssueTypeFieldValues:St,updateIssueTypeFieldValuesMany:xT,deleteIssueTypeFieldValues:Wa,deleteIssueTypeFieldValuesMany:eg}=Na.actions,uh=t=>t.issueTypeFieldValuesReducer.instances,Ka=d.createSelector([uh],t=>Object.values(t)),tg=f(d.createSelector([Ka,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),Ya=t=>e=>e.issueTypeFieldValuesReducer.instances[t],oh=Na.reducer,ve=P(t=>t.uuid),lh=ve.getInitialState({}),Za=d.createSlice({name:"issueTypeFields",initialState:lh,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,lh)),reducers:{initializeIssueTypeFields:ve.initialize,addIssueTypeFields:ve.addOne,addIssueTypeFieldsMany:ve.addMany,setIssueTypeFields:ve.setOne,setIssueTypeFieldsMany:ve.setMany,updateIssueTypeFields:ve.updateOne,updateIssueTypeFieldsMany:ve.updateMany,deleteIssueTypeFields:ve.deleteOne,deleteIssueTypeFieldsMany:ve.deleteMany}}),{initializeIssueTypeFields:hh,addIssueTypeFields:mh,addIssueTypeFieldsMany:sg,setIssueTypeFields:ig,setIssueTypeFieldsMany:ag,updateIssueTypeFields:ph,updateIssueTypeFieldsMany:ng,deleteIssueTypeFields:yh,deleteIssueTypeFieldsMany:cg}=Za.actions,Ah=t=>t.issueTypeFieldsReducer.instances,Nt=d.createSelector([Ah],t=>Object.values(t)),rg=f(d.createSelector([Nt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),dg=f(d.createSelector([Nt,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),ug=f(d.createSelector([Nt,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)))})),og=t=>e=>e.issueTypeFieldsReducer.instances[t],fh=Za.reducer,we=P(t=>t.uuid),Sh=we.getInitialState({}),Ja=d.createSlice({name:"issueTypeFieldValuesAttachments",initialState:Sh,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Sh)),reducers:{initializeIssueTypeFieldValuesAttachments:we.initialize,addIssueTypeFieldValuesAttachment:we.addOne,addIssueTypeFieldValuesAttachments:we.addMany,setIssueTypeFieldValuesAttachment:we.setOne,setIssueTypeFieldValuesAttachments:we.setMany,updateIssueTypeFieldValuesAttachment:we.updateOne,updateIssueTypeFieldValuesAttachments:we.updateMany,deleteIssueTypeFieldValuesAttachment:we.deleteOne,deleteIssueTypeFieldValuesAttachments:we.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:Th,addIssueTypeFieldValuesAttachment:lg,addIssueTypeFieldValuesAttachments:Ht,setIssueTypeFieldValuesAttachment:hg,setIssueTypeFieldValuesAttachments:mg,updateIssueTypeFieldValuesAttachment:pg,updateIssueTypeFieldValuesAttachments:gh,deleteIssueTypeFieldValuesAttachment:yg,deleteIssueTypeFieldValuesAttachments:Wt}=Ja.actions,Ih=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Xa=d.createSelector([Ih],t=>Object.values(t)),Ag=t=>e=>e.issueTypeFieldValuesAttachmentReducer.instances[t],bh=f(d.createSelector([Xa,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),Fh=f(d.createSelector([Xa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),Ph=Ja.reducer,Me=P(t=>t.uuid),Oh=Me.getInitialState({}),Qa=d.createSlice({name:"issueTypeIdentifiers",initialState:Oh,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Oh)),reducers:{initializeIssueTypeIdentifiers:Me.initialize,addIssueTypeIdentifier:Me.addOne,addIssueTypeIdentifiers:Me.addMany,setIssueTypeIdentifier:Me.setOne,setIssueTypeIdentifiers:Me.setMany,updateIssueTypeIdentifier:Me.updateOne,updateIssueTypeIdentifiers:Me.updateMany,deleteIssueTypeIdentifier:Me.deleteOne,deleteIssueTypeIdentifiers:Me.deleteMany}}),{initializeIssueTypeIdentifiers:_h,addIssueTypeIdentifier:xa,addIssueTypeIdentifiers:fg,setIssueTypeIdentifier:Sg,setIssueTypeIdentifiers:Tg,updateIssueTypeIdentifier:Tt,updateIssueTypeIdentifiers:gg,deleteIssueTypeIdentifier:en,deleteIssueTypeIdentifiers:Ig}=Qa.actions,Rh=t=>t.issueTypeIdentifierReducer.instances,vh=d.createSelector([Rh],t=>Object.values(t)),tn=t=>e=>e.issueTypeIdentifierReducer.instances[t],bg=f(d.createSelector([vh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),wh=Qa.reducer,Ee=P(t=>t.uuid),Mh=Ee.getInitialState({}),sn=d.createSlice({name:"issueTypeIdentifierValues",initialState:Mh,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Mh)),reducers:{initializeIssueTypeIdentifierValues:Ee.initialize,addIssueTypeIdentifierValue:Ee.addOne,addIssueTypeIdentifierValues:Ee.addMany,setIssueTypeIdentifierValue:Ee.setOne,setIssueTypeIdentifierValues:Ee.setMany,updateIssueTypeIdentifierValue:Ee.updateOne,updateIssueTypeIdentifierValues:Ee.updateMany,deleteIssueTypeIdentifierValue:Ee.deleteOne,deleteIssueTypeIdentifierValues:Ee.deleteMany}}),{initializeIssueTypeIdentifierValues:Eh,addIssueTypeIdentifierValue:an,addIssueTypeIdentifierValues:Fg,setIssueTypeIdentifierValue:Pg,setIssueTypeIdentifierValues:Og,updateIssueTypeIdentifierValue:gt,updateIssueTypeIdentifierValues:_g,deleteIssueTypeIdentifierValue:nn,deleteIssueTypeIdentifierValues:Rg}=sn.actions,Vh=t=>t.issueTypeIdentifierValueReducer.instances,cn=d.createSelector([Vh],t=>Object.values(t)),rn=t=>e=>e.issueTypeIdentifierValueReducer.instances[t],vg=f(d.createSelector([cn,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),wg=f(d.createSelector([cn,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type_identifier===e)))),jh=sn.reducer,D=P(t=>t.uuid),qh=D.getInitialState({}),dn=d.createSlice({name:"issueTypes",initialState:qh,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,qh)),reducers:{initializeIssueTypes:D.initialize,addIssueType:D.addOne,addIssueTypes:D.addMany,setIssueType:D.setOne,setIssueTypes:D.setMany,updateIssueType:D.updateOne,updateIssueTypes:D.updateMany,deleteIssueType:D.deleteOne,deleteIssueTypes:D.deleteMany,removeIssueType:D.deleteOne}}),{initializeIssueTypes:zh,addIssueType:Uh,addIssueTypes:Mg,setIssueType:It,setIssueTypes:Eg,updateIssueType:Dh,updateIssueTypes:Vg,deleteIssueType:jg,deleteIssueTypes:qg,removeIssueType:un}=dn.actions,on=t=>t.issueTypeReducer.instances,Ch=d.createSelector(on,t=>Object.values(t)),ln=t=>e=>e.issueTypeReducer.instances[t],zg=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})),Ug=f(d.createSelector([Ch,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),kh=dn.reducer,Ve=P(t=>t.uuid),Bh=Ve.getInitialState({}),hn=d.createSlice({name:"issueUpdates",initialState:Bh,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Bh)),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:$h,addIssueUpdate:Gh,addIssueUpdates:Lh,setIssueUpdate:Dg,setIssueUpdates:Cg,updateIssueUpdate:kg,updateIssueUpdates:Bg,deleteIssueUpdate:Nh,deleteIssueUpdates:Hh}=hn.actions,Wh=t=>t.issueUpdateReducer.instances,Kh=d.createSelector([Wh],t=>Object.values(t)),Yh=f(d.createSelector([Kh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),Zh=hn.reducer,je=P(t=>t.id),Jh=je.getInitialState({currentUser:null}),mn=d.createSlice({name:"users",initialState:Jh,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Jh)),reducers:{initializeUsers:je.initialize,setUsers:je.setMany,setUser:je.setOne,addUsers:je.addMany,addUser:je.addOne,updateUsers:je.updateMany,updateUser:je.updateOne,deleteUser:je.deleteOne,deleteUsers:je.deleteMany,setCurrentUser:(t,e)=>{t.currentUser=e.payload},setProfilePicture:(t,e)=>{if(!t.currentUser)return;t.currentUser.profile.file=e.payload.file??null,t.currentUser.profile.file_sha1=e.payload.file_sha1??null;const i=t.instances[t.currentUser.id];if(!i)throw new Error("Unable to find current user in users slice");i.profile.file=e.payload.file??null,i.profile.file_sha1=e.payload.file_sha1??null}}}),{initializeUsers:Xh,setUsers:$g,setUser:Gg,addUsers:Lg,addUser:Qh,updateUsers:Ng,updateUser:Hg,deleteUser:xh,deleteUsers:Wg,setCurrentUser:Kg,setProfilePicture:Yg}=mn.actions,em=mn.reducer,tm=t=>t.userReducer.currentUser,Kt=t=>t.userReducer.instances,pn=d.createSelector([Kt],t=>Object.values(t)),sm=t=>e=>e.userReducer.instances[t],Zg=f(d.createSelector([Kt,(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)})),qe=P(t=>t.uuid),im=qe.getInitialState({}),yn=d.createSlice({name:"organizationAccess",initialState:im,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,im)),reducers:{initializeOrganizationAccesses:qe.initialize,addOrganizationAccess:qe.addOne,addOrganizationAccesses:qe.addMany,setOrganizationAccess:qe.setOne,setOrganizationAccesses:qe.setMany,updateOrganizationAccess:qe.updateOne,updateOrganizationAccesses:qe.updateMany,deleteOrganizationAccess:qe.deleteOne,deleteOrganizationAccesses:qe.deleteMany}}),{initializeOrganizationAccesses:am,addOrganizationAccess:nm,addOrganizationAccesses:Jg,setOrganizationAccess:Xg,setOrganizationAccesses:Qg,updateOrganizationAccess:Yt,updateOrganizationAccesses:xg,deleteOrganizationAccess:cm,deleteOrganizationAccesses:eI}=yn.actions,rm=yn.reducer,An=t=>t.organizationAccessReducer.instances,fn=t=>e=>e.organizationAccessReducer.instances[t],tI=d.createSelector([tm,An],(t,e)=>Object.values(e).find(a=>a.user===(t==null?void 0:t.id))??null),dm=d.createSelector([An],t=>{const e={};for(const i of Object.values(t))e[i.user]=i;return Ot(e)}),sI=f(d.createSelector([Kt,dm,(t,e)=>e],(t,e,i)=>T(Object.values(t).filter(a=>{const n=e[a.id];return!!n&&n.organization===i})))),ze=P(t=>t.uuid),um=ze.getInitialState({}),Sn=d.createSlice({name:"organizations",initialState:um,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,um)),reducers:{initializeOrganizations:ze.initialize,setOrganizations:ze.setMany,setOrganization:ze.setOne,addOrganizations:ze.addMany,addOrganization:ze.addOne,updateOrganizations:ze.updateMany,updateOrganization:ze.updateOne,deleteOrganization:ze.deleteOne,deleteOrganizations:ze.deleteMany}}),{initializeOrganizations:om,setOrganizations:iI,setOrganization:aI,addOrganizations:nI,addOrganization:lm,updateOrganizations:cI,updateOrganization:hm,deleteOrganization:rI,deleteOrganizations:dI}=Sn.actions,mm=t=>t.organizationReducer.instances,uI=d.createSelector([mm],t=>Object.values(t)),oI=t=>e=>e.organizationReducer.instances[t],pm=Sn.reducer,ym=(t,e,i)=>{const a=t.uuid?t:{...t,uuid:Je.v4()};return{payload:a,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:a,BASE_URL:e,serviceName:i}}}}},Am={deletedRequests:[],latestRetryTime:0},Tn=d.createSlice({name:"outbox",initialState:Am,extraReducers:t=>t.addCase(b,e=>Object.assign(e,Am)),reducers:{enqueueRequest:{reducer:(t,e)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t);const{BASE_URL:e,serviceName:i,...a}=t;return ym(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}}}),lI=t=>t.outboxReducer.deletedRequests,hI=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:fm,markForDeletion:mI,markAsDeleted:Sm,_setLatestRetryTime:Tm}=Tn.actions,gm=Tn.reducer,Ue=P(t=>t.uuid),Im=Ue.getInitialState({}),gn=d.createSlice({name:"projectAccess",initialState:Im,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Im)),reducers:{initializeProjectAccesses:Ue.initialize,addProjectAccess:Ue.addOne,addProjectAccesses:Ue.addMany,setProjectAccess:Ue.setOne,setProjectAccesses:Ue.setMany,updateProjectAccess:Ue.updateOne,updateProjectAccesses:Ue.updateMany,deleteProjectAccess:Ue.deleteOne,deleteProjectAccesses:Ue.deleteMany}}),{initializeProjectAccesses:bm,addProjectAccess:In,addProjectAccesses:bn,setProjectAccess:pI,setProjectAccesses:yI,updateProjectAccess:bt,updateProjectAccesses:Fm,deleteProjectAccess:Fn,deleteProjectAccesses:Pn}=gn.actions,Pm=gn.reducer,On=t=>t.projectAccessReducer.instances,Zt=d.createSelector(On,t=>Object.values(t)),_n=t=>e=>e.projectAccessReducer.instances[t],Om=f(d.createSelector([On,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.project===e)))),AI=f(d.createSelector([Zt,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(n=>n.project===e))i[a.user]=a;return i})),fI=f(d.createSelector([pn,Zt,(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.id)))})),De=P(t=>t.uuid),_m=De.getInitialState({}),Rn=d.createSlice({name:"projectAttachments",initialState:_m,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,_m)),reducers:{initializeProjectAttachments:De.initialize,addProjectAttachment:De.addOne,addProjectAttachments:De.addMany,setProjectAttachment:De.setOne,setProjectAttachments:De.setMany,updateProjectAttachment:De.updateOne,updateProjectAttachments:De.updateMany,deleteProjectAttachment:De.deleteOne,deleteProjectAttachments:De.deleteMany}}),{initializeProjectAttachments:Rm,addProjectAttachment:SI,addProjectAttachments:vm,setProjectAttachment:wm,setProjectAttachments:Mm,updateProjectAttachment:TI,updateProjectAttachments:Em,deleteProjectAttachment:Vm,deleteProjectAttachments:vn}=Rn.actions,jm=t=>t.projectAttachmentReducer.instances,qm=d.createSelector([jm],t=>Object.values(t)),zm=t=>e=>e.projectAttachmentReducer.instances[t],Um=f(d.createSelector([qm,(t,e)=>e],(t,e)=>T(t.filter(({project:i})=>e===i)))),Dm=Rn.reducer,Ce=P(t=>t.uuid),Cm=Ce.getInitialState({activeProjectFileId:null,isImportingProjectFile:!1}),wn=d.createSlice({name:"projectFiles",initialState:Cm,extraReducers:t=>t.addMatcher(d.isAnyOf(b,M,O),e=>Object.assign(e,Cm)),reducers:{initializeProjectFiles:Ce.initialize,setProjectFile:Ce.setOne,setProjectFiles:Ce.setMany,addProjectFile:Ce.addOne,addProjectFiles:Ce.addMany,updateProjectFile:Ce.updateOne,updateProjectFiles:Ce.updateMany,deleteProjectFile:Ce.deleteOne,deleteProjectFiles:Ce.deleteMany,setIsImportingProjectFile:(t,e)=>{t.isImportingProjectFile=e.payload},saveActiveProjectFileBounds:(t,e)=>{const i=t.activeProjectFileId;if(!i)throw new Error("Tried to save bounds for active project file, but no active project file was set.");if(!t.instances[i])throw new Error(`Tried to save bounds for active project file, but project file with ID ${i}
|
|
2
|
-
doesn't exist.`);t.instances[i].bounds=e.payload},setActiveProjectFileId:(t,e)=>{t.activeProjectFileId=e.payload},resetProjectFileObjectUrls:(t,...e)=>{for(const i in t.instances)delete t.instances[i].objectURL}}}),{initializeProjectFiles:km,setProjectFile:gI,setProjectFiles:II,addProjectFile:bI,addProjectFiles:Bm,updateProjectFile:Mn,updateProjectFiles:FI,deleteProjectFile:$m,deleteProjectFiles:Gm,setIsImportingProjectFile:Lm,setActiveProjectFileId:Nm,saveActiveProjectFileBounds:Hm,resetProjectFileObjectUrls:PI}=wn.actions,Wm=t=>t.projectFileReducer.instances,Km=d.createSelector([Wm],t=>T(Object.values(t).sort((e,i)=>e.z_index-i.z_index))),OI=t=>e=>e.projectFileReducer.instances[t],_I=t=>t.projectFileReducer.activeProjectFileId,RI=t=>t.projectFileReducer.isImportingProjectFile,Ym=wn.reducer,ke=P(t=>t.uuid),Zm=ke.getInitialState({}),En=d.createSlice({name:"projects",initialState:Zm,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,Zm)),reducers:{initializeProjects:ke.initialize,setProjects:ke.setMany,setProject:ke.setOne,addProjects:ke.addMany,addProject:ke.addOne,updateProjects:ke.updateMany,updateProject:ke.updateOne,deleteProject:ke.deleteOne,deleteProjects:ke.deleteMany}}),{initializeProjects:Jm,setProjects:vI,setProject:wI,addProjects:MI,addProject:Vn,updateProjects:EI,updateProject:Xm,deleteProject:jn,deleteProjects:VI}=En.actions,Qm=En.reducer,xm=t=>t.projectReducer.instances,qn=d.createSelector([xm],t=>T(Object.values(t))),ep=t=>e=>e.projectReducer.instances[t],jI=f(d.createSelector([qn,Zt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(n=>n.user===i).map(n=>n.project));return T(t.filter(n=>a.has(n.uuid)))})),qI=f(d.createSelector([qn,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),zI={isRehydrated:!1},zn=d.createSlice({name:"rehydrated",initialState:zI,reducers:{setRehydrated:(t,e)=>{t.isRehydrated=e.payload}}}),{setRehydrated:UI}=zn.actions,DI=t=>t.rehydratedReducer.isRehydrated,tp=zn.reducer,Be=P(t=>t.uuid),sp=Be.getInitialState({}),Un=d.createSlice({name:"teamMemberships",initialState:sp,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,sp)),reducers:{initializeTeamMemberships:Be.initialize,addTeamMembership:Be.addOne,addTeamMemberships:Be.addMany,setTeamMembership:Be.setOne,setTeamMemberships:Be.setMany,updateTeamMembership:Be.updateOne,updateTeamMemberships:Be.updateMany,deleteTeamMembership:Be.deleteOne,deleteTeamMemberships:Be.deleteMany}}),{initializeTeamMemberships:ip,addTeamMembership:ap,addTeamMemberships:np,setTeamMembership:Dn,setTeamMemberships:cp,updateTeamMembership:CI,updateTeamMemberships:kI,deleteTeamMembership:Cn,deleteTeamMemberships:rp}=Un.actions,dp=Un.reducer,up=t=>t.teamMembershipReducer.instances,kn=d.createSelector([up],t=>Object.values(t)),op=t=>e=>e.teamMembershipReducer.instances[t],BI=f(d.createSelector([kn,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(n=>n.team===e))i[a.user]=a;return i})),$I=f(d.createSelector([pn,kn,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(n=>n.team===i).map(n=>n.user));return T(t.filter(n=>a.has(n.id)))})),$e=P(t=>t.uuid),lp=$e.getInitialState({}),Bn=d.createSlice({name:"teams",initialState:lp,extraReducers:t=>t.addMatcher(d.isAnyOf(b,O),e=>Object.assign(e,lp)),reducers:{initializeTeams:$e.initialize,addTeam:$e.addOne,addTeams:$e.addMany,setTeam:$e.setOne,setTeams:$e.setMany,updateTeam:$e.updateOne,updateTeams:$e.updateMany,deleteTeam:$e.deleteOne,deleteTeams:$e.deleteMany}}),{initializeTeams:hp,addTeam:mp,addTeams:GI,setTeam:Ft,setTeams:LI,updateTeam:pp,updateTeams:NI,deleteTeam:$n,deleteTeams:HI}=Bn.actions,Gn=t=>t.teamReducer.instances,yp=d.createSelector([Gn],t=>Object.values(t)),Ln=t=>e=>e.teamReducer.instances[t],WI=f(d.createSelector([Gn,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectTeamsByIds: No team exists with the id",a)}return T(i)})),KI=f(d.createSelector([yp,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Ap=Bn.reducer,YI={version:0},fp=d.createSlice({name:"versioning",initialState:YI,reducers:{}}),Sp=fp.reducer,Nn={outboxReducer:gm,fileReducer:no,authReducer:Ou},ZI=d.combineReducers(Nn),Tp={...Nn,[st]:Sp,categoryReducer:Eu,assetReducer:hd,assetAttachmentReducer:Mc,assetStageCompletionReducer:fd,assetStageReducer:Fd,assetTypeReducer:bu,assetTypeAttachmentReducer:qd,issueReducer:Gl,issueAttachmentReducer:bl,issueTypeReducer:kh,issueTypeAttachmentReducer:Ql,organizationReducer:pm,projectReducer:Qm,projectAttachmentReducer:Dm,projectAccessReducer:Pm,organizationAccessReducer:rm,projectFileReducer:Ym,rehydratedReducer:tp,formReducer:Vo,formRevisionReducer:wo,formRevisionAttachmentReducer:bo,formSubmissionAttachmentReducer:Go,formSubmissionReducer:Zo,formIdentifierReducer:lo,formIdentifierValueReducer:yo,userReducer:em,emailDomainsReducer:eo,documentsReducer:Ku,documentAttachmentReducer:Gu,teamReducer:Ap,agentsReducer:Ic,issueCommentReducer:Ul,issueCommentAttachmentReducer:Vl,issueUpdateReducer:Zh,geoImageReducer:nl,issueAssociationReducer:ml,issueTypeFieldsReducer:fh,issueTypeFieldValuesReducer:oh,issueTypeFieldsAttachmentReducer:ch,issueTypeFieldValuesAttachmentReducer:Ph,issueTypeIdentifierReducer:wh,issueTypeIdentifierValueReducer:jh,assetTypeFieldsReducer:Zd,assetTypeFieldValuesReducer:uu,assetTypeFieldsAttachmentReducer:Gd,assetTypeFieldValuesAttachmentReducer:su,assetTypeIdentifierReducer:pu,assetTypeIdentifierValueReducer:Su,assetProcedureTypeReducer:Or,assetProcedureReducer:Ir,assetProcedureTypeFieldsReducer:tr,assetProcedureFieldValuesReducer:yr,assetProcedureTypeFieldsAttachmentReducer:Kc,assetProcedureTypeFieldValuesAttachmentReducer:cr,assetProcedureTypeAttachmentReducer:Cc,assetProcedureStepFieldsAttachmentReducer:qr,assetProcedureStepFieldsReducer:Dr,assetProcedureStepFieldValuesAttachmentReducer:Nr,assetProcedureStepFieldValuesReducer:Xr,assetProcedureStepReducer:nd,teamMembershipReducer:dp},JI=d.combineReducers(Tp);function XI(t,e){return Np.useMemo(t,e)}class QI{constructor(e){S(this,"operations",[]);S(this,"getData");this.getData=e}performOperations(e){let i=e;for(const a of this.operations)i=a(i);return i}filter(e,i){return this.operations.push(a=>a.filter(n=>n[e]===i)),this}exclude(e,i){return this.operations.push(a=>a.filter(n=>n[e]!==i)),this}orderBy(e){return this.operations.push(i=>[...i].sort((a,n)=>a[e]<=n[e]?1:-1)),this}reverse(){return this.operations.push(e=>[...e].reverse()),this}all(){return this.operations.push(e=>e),this}get(e,i){return d.createSelector([this.getData],a=>this.performOperations(a).find(n=>n[e]===i))}count(){return d.createSelector([this.getData],e=>this.performOperations(e).length)}first(){return d.createSelector([this.getData],e=>this.performOperations(e)[0])}last(){return d.createSelector([this.getData],e=>{const i=this.performOperations(e);return i[i.length-1]})}exists(){return d.createSelector([this.getData],e=>this.performOperations(e).length>0)}toSelector(){return d.createSelector([this.getData],e=>T(this.performOperations(e)))}}const gp=1e4,Ge=200,Ip={};class bp{constructor(e){S(this,"client");S(this,"pageSize",gp);Ip[this.constructor.name]=this,this.client=e}async enqueueRequest(e,i){return this.client.enqueueRequest(e,this.host,this.constructor.name,i)}async performPagination(e,i,a){const n=[];let c=await this.client.enqueueRequest(e,this.host,this.constructor.name,a);for(n.push(c.results);c.next;)c=await this.client.enqueueRequest(i(c.next),this.host,this.constructor.name,a),n.push(c.results);return n}dispatch(e){this.client.store.dispatch(e)}}const Fp=()=>_p.length-1,Pp=t=>(t[st]={version:Fp()},t),Op=()=>Pp({}),xI=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),eb=t=>e=>{var i;return e===void 0&&(e={}),((i=e[st])==null?void 0:i.version)===Fp()?e:t(e)},_p=[Pp,Op,Op,xI],tb=Object.fromEntries(_p.map((t,e)=>[e,eb(t)])),sb=t=>{if(t)throw t;const e=tt();e?e.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},Rp=(t,e,i)=>{const a=Ye();return a?(a.addRequest(e),a.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},vp=(t,e,i)=>{const a=Ye();if(!a)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=e.meta.offlineAction.payload.uuid;return a.remove(c),a.getQueue()};async function ib(t,e){if(!e.payload)throw new Error("Received empty payload");return kp(e)}const ab={...xn,effect:ib,discard:Wn,returnPromises:!0,persistCallback:sb,retry:ub,persistOptions:{storage:Wp},queue:{...xn.queue,enqueue:Rp,dequeue:vp,peek:(...t)=>db(...t)}},nb=Kp(tb,st),cb=d.compose(Hp.offline(ab),nb);function rb(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}}async function Hn(t,e,i){const a=Ip[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);const n=a instanceof R;if(e.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");n&&t.payload.checkAuth!==!1&&await a.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},u=t.meta.offline.effect,{payload:m,headers:o,method:h,queryParams:p,attachmentHash:y,isExternalUrl:A,isAuthNeeded:I,isResponseBlob:g}={...r,...u.request},_=u.request;let w=_.url;const q=y?await e.files.fetchCache(y):void 0;if(y&&!q)throw new Error(`Cannot upload file ${y} because it's not cached.`);!A&&!w.startsWith("http")&&(!w.startsWith("/")&&!w.startsWith("blob:")&&(w="/"+w),w=t.meta.offline.effect.BASE_URL+w);const Le=j=>{if(y){const Ne=_.s3url;if(!Ne)throw new Error(`No S3 URL for file ${y}`);if("warning"in Ne)throw new Error(`S3 URL warning for file ${y}`);if(!q)throw new Error(`No file for file ${y}`);const Pt=Ne.fields["x-amz-checksum-sha1"];if(!Pt)throw new Error(`No checksum for file ${y}`);return j.set("x-amz-checksum-sha1",Pt).field({...m,...Ne.fields}).attach("file",q)}return j.send(m)},vF={[l.GET]:()=>g?Ze.get(w.toString()).responseType("blob"):Ze.get(w.toString()),[l.POST]:()=>{const j=Ze.post(w.toString());return Le(j)},[l.PATCH]:()=>{const j=Ze.patch(w.toString());return Le(j)},[l.PUT]:()=>{const j=Ze.put(w.toString());return Le(j)},[l.DELETE]:()=>{const j=Ze.delete(w.toString());return Le(j)}}[h];let We=vF();if(i==null||i.addEventListener("abort",()=>{console.debug("aborting request:",_),We.abort()}),I&&n){const j=a.auth.getAuthHeader();We=We.set("Authorization",j)}o&&(We=We.set(o));try{return await We.query(p)}catch(j){const Ne=rb(j),Pt=Ne==null?void 0:Ne.status;if(n&&Pt===401)return await a.auth.handleUnauthorized(We,Ne),We.query(p);throw new U({response:Ne,innerError:j,discard:wp.includes(Pt)})}}const wp=[400,409,403,404,405,500];function Wn(t,e,i=0){var o;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
3
|
-
Action:`,
|
|
4
|
-
Retries:`,
|
|
5
|
-
Action:`,
|
|
6
|
-
`):c.map(r=>`${
|
|
7
|
-
`):`${
|
|
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>ob?xe:i}class U extends Error{constructor(i){super(xe);S(this,"status");S(this,"response");S(this,"message");S(this,"options");const{response:a,innerError:n}=i;this.message=i.message??lb(a,n)??xe,this.status=(a==null?void 0:a.status)??0,this.response=a,i.discard=i.discard??!1,this.options=i}}class hb extends bp{constructor(e){super(e)}}class R extends bp{constructor(i,a){super(i);S(this,"auth");this.auth=a}}class mb 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(gc(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.enqueueRequest({immediate:!0,description:"Get agent conversation history",method:l.GET,url:"/agents/conversations/",queryParams:{project:e},blockers:["agent-conversations"],blocks:["agent-conversations"]},i);return this.dispatch(fc(a)),a}}class V 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:y,issueTypeFieldValuesAttachmentReducer:A}=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(y.instances),Object.values(A.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 Xe(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 He extends V{constructor(){super(...arguments);S(this,"pageSize",Ge)}async _bulkAdd(i){var h;const{store:a}=this.client,n=(h=a.getState().userReducer.currentUser)==null?void 0:h.id,c=new Date().toISOString(),r=[],u=[],m={};for(const p of i){const{modelUuid:y,file:A}=p,I=await this.getFilePayload(A);I.sha1 in m||(m[I.sha1]=I);const g=this.buildOfflineAttachment({file:A,file_sha1:I.sha1,submitted_at:c,created_by:n,description:"",modelUuid:y});r.push(g),u.push(this.buildAttachmentPayload({uuid:g.uuid,file_name:g.file_name,file_sha1:g.file_sha1,file_extension:I.extension,description:g.description,modelUuid:y}))}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=>p.uuid),blockers:r.map(p=>p.file_sha1)});return o.then(({attachments:p,presigned_urls:y})=>{this.dispatch(this.updateAttachments(p)),this.processPresignedUrls(y)}).catch(()=>{this.dispatch(this.removeAttachments(r.map(p=>p.uuid)))}),[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(n.uuid));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 pb extends He{constructor(){super(...arguments);S(this,"name","Asset Attachment");S(this,"url","/asset-attachments");S(this,"initializeAttachments",rs);S(this,"addAttachments",ds);S(this,"updateAttachments",Pc);S(this,"removeAttachments",us);S(this,"removeAttachment",Oc);S(this,"setAttachment",Fc);S(this,"selectAttachment",vc)}buildOfflineAttachment(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get asset attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:Ge,paginate:!0,asset__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get asset attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(rs(c)),c}}class yb extends He{constructor(){super(...arguments);S(this,"name","Asset Procedure Attachment");S(this,"url","/asset-procedure-type-attachments");S(this,"addAttachments",jc);S(this,"updateAttachments",zc);S(this,"removeAttachments",Dc);S(this,"removeAttachment",Uc);S(this,"setAttachment",qc);S(this,"selectAttachment",$c)}buildOfflineAttachment(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_procedure_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_procedure_type:i.modelUuid}}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.enqueueRequest({immediate:!0,description:"Get asset procedure attachments",method:l.GET,url:`${this.url}/`,queryParams:{asset_procedure_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Vc(n)),n}}class Ab extends V{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,fields_revision:h};r.push(g)}this.dispatch(Nc(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(Hc(o.attachments))}).catch(()=>{this.dispatch(Wc(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure type fields attachments",method:l.GET,url:"/asset-procedure-type-fields-attachments/",queryParams:{fields_revision__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Lc(a)),a}}class fb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(Qc(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(xc(m))}).catch(m=>{throw this.dispatch(er(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Type Fields",method:l.GET,url:"/asset-procedure-type-fields/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Xc(a)),a}}function Ke(t,e){const i=[];let a=0;const n=t.length;for(;a<n;)i.push(t.slice(a,a+=e));return i}class Sb extends V{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ke(e,i??e.length),r=[],u=[];for(const h of c){const p={},y=[];for(const A of h){const{fieldValuesUuid:I,fieldIdentifier:g,file:_}=A,w=await this.getFilePayload(_);w.sha1 in p||(p[w.sha1]=w);const q=F({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:g});r.push(q);const Le={uuid:q.uuid,file_name:_.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:g,field_values:I};y.push(Le)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(_t(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset procedure type field values attachments",method:l.POST,url:"/asset-procedure-type-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(nr(p))}).catch(h=>{throw this.dispatch(Rt(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=dr(e)(a);this.dispatch(Rt(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(_t(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure type field values attachments",method:l.GET,url:"/asset-procedure-type-field-values-attachments/",queryParams:{limit:Ge,paginate:!0,field_values__asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ar(n)),n}}class Tb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,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(fs(n)),c.then(u=>(this.dispatch(it(u)),u)).catch(()=>{this.dispatch(Ss(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ke(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const y=F({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.push(y),h.push({uuid:y.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure:p.asset_procedure,published_at:p.published_at,values:y.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(hr(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),y=o.field_values.map(g=>g.asset_procedure),A=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,...y],blocks:A});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(mr(o.flat()))}).catch(()=>{this.dispatch(pr(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=gs(e.uuid)(a);if(!n)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(it(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(it(u))}).catch(()=>{this.dispatch(it(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=gs(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=ur(e)(a);this.dispatch(Ss(e)),this.dispatch(Rt(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(fs(n)),this.dispatch(_t(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure type field values",method:l.GET,url:"/asset-procedure-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(lr(n)),n}}class gb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(bs(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(at(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(at(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(at(r))}).catch(()=>{this.dispatch(at(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(bs(n)),c})}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedures",method:l.GET,url:"/asset-procedures/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedures",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Sr(n)),n}}class Ib extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(vs(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(nt(m))}).catch(()=>{this.dispatch(ws(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Es(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(nt(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(nt(r))}).catch(()=>{this.dispatch(nt(a))}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Es(e)(a);if(!n)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const c=br(e)(a);return this.dispatch(ws(e)),this.dispatch(gr(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(vs(n)),this.dispatch(Tr(c)),r})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure types",method:l.GET,url:"/asset-procedure-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Pr(a)),a}}class bb extends V{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,fields_revision:h};r.push(g)}this.dispatch(wr(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(Mr(o.attachments))}).catch(()=>{this.dispatch(Er(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure step fields attachments",method:l.GET,url:"/asset-procedure-step-fields-attachments/",queryParams:{fields_revision__asset_procedure_step__organization:e},blockers:[],blocks:[]},i);return this.dispatch(vr(a)),a}}class Fb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(qs(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(ct(m))}).catch(m=>{throw this.dispatch(zs(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(ct(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(ct(r))}).catch(r=>{throw this.dispatch(ct(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(zs(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(qs(a)),c}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Step Fields",method:l.GET,url:"/asset-procedure-step-fields/",queryParams:{asset_procedure_step__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Ur(a)),a}}class Pb extends V{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ke(e,i??e.length),r=[],u=[];for(const h of c){const p={},y=[];for(const A of h){const{fieldValuesUuid:I,fieldIdentifier:g,file:_}=A,w=await this.getFilePayload(_);w.sha1 in p||(p[w.sha1]=w);const q=F({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:g});r.push(q);const Le={uuid:q.uuid,file_name:_.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:g,field_values:I};y.push(Le)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(vt(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset procedure step field values attachments",method:l.POST,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(Br(p))}).catch(h=>{throw this.dispatch(wt(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=Gr(e)(a);this.dispatch(wt(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(vt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:"/asset-procedure-step-field-values-attachments/",queryParams:{limit:Ge,paginate:!0,field_values__asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(kr(n)),n}}class Ob extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,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(rt(u)),u)).catch(()=>{this.dispatch(Gs(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ke(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const y=F({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.push(y),h.push({uuid:y.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure:p.asset_procedure,asset_procedure_step:p.asset_procedure_step,published_at:p.published_at,values:y.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(Kr(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),y=o.field_values.map(g=>g.asset_procedure),A=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,...y],blocks:A});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(Yr(o.flat()))}).catch(()=>{this.dispatch(Zr(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(rt(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(rt(u))}).catch(()=>{this.dispatch(rt(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(Gs(e)),this.dispatch(wt(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(vt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:"/asset-procedure-step-field-values/",queryParams:{limit:this.pageSize,paginate:!0,asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Wr(n)),n}}class _b extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(td(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(Et(m))}).catch(()=>{this.dispatch(id(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Hs(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(Et(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(Et(r))}).catch(()=>{this.dispatch(ed(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Hs(e)(a);if(!n)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const c=rd(e)(a);return this.dispatch(ad([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(sd([n,...c])),r})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure steps",method:l.GET,url:"/asset-procedure-steps/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(xr(a)),a}}class Rb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(Ks(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(ut(m))}).catch(()=>{this.dispatch(Ys(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Qs(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(ut(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(ut(r))}).catch(()=>{this.dispatch(ut(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Qs(e)(a);if(!n)throw new Error(`No asset with uuid ${e} found in the store`);const c=wc(e)(a),r=hl(e)(a);if(this.dispatch(Ys(e)),c.length>0){const u=c.map(({uuid:m})=>m);this.dispatch(us(u))}if(r.length>0){const u=r.map(({uuid:m})=>m);this.dispatch(Fa(u))}return this.enqueueRequest({description:"Delete asset",method:l.DELETE,url:`/assets/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(Ks(n)),this.dispatch(ds(c)),this.dispatch(Ia(r)),u})}bulkAdd(e,i,a,n){const c=new Date().toISOString(),r=Je.v4(),u=Ke(e,n).map(h=>{const p=h.map(y=>F(y));return{batchId:Je.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:y}=h,A=y.assets.map(w=>w.uuid),I=[i];o&&I.push(o);const g=A;g.push(p);const _=this.enqueueRequest({description:"Batch create assets",method:l.POST,url:"/assets/bulk/",payload:y,blockers:I,blocks:g});o=h.batchId,m.push(_)}return Promise.all(m).then(h=>{const p=h.flat();this.dispatch(Vt(p))}),m}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=ld(e)(a);this.dispatch(Zs(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(Vt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get assets",method:l.GET,url:"/assets/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get assets",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ud(n)),n}}class vb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(ei(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(yd(m))}).catch(()=>{this.dispatch(si(c.uuid))}),[c,r]}delete(e){const{store:i}=this.client,a=Sd(e)(i.getState());if(!a)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(si(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(ei(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.id,c=e.map(h=>F(h)),r=c.map(h=>({...h,created_by:n,submitted_at:a})),u=r.map(({uuid:h})=>h);this.dispatch(ti(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(ii(u))}),[r,m]}bulkDelete(e){const{store:i}=this.client,a=Td(e)(i.getState());this.dispatch(ii(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(ti(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset stage completions",method:l.GET,url:"/asset-stage-completions/",queryParams:{limit:this.pageSize,paginate:!0,asset_procedure__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset stage completions",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(pd(n)),n}}class wb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(ci(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(jt(m))}).catch(()=>{this.dispatch(ri(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=di(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(jt(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(jt(r))}).catch(()=>{this.dispatch(bd(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=di(e)(a);if(!n)throw new Error(`No asset stage with uuid ${e} found in the store`);return this.dispatch(ri(e)),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(ci(n)),c})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset stages",method:l.GET,url:"/asset-stages/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Id(a)),a}}class Mb extends He{constructor(){super(...arguments);S(this,"name","Asset Type Attachment");S(this,"url","/asset-type-attachments");S(this,"addAttachments",oi);S(this,"updateAttachments",vd);S(this,"removeAttachments",li);S(this,"removeAttachment",wd);S(this,"setAttachment",Rd);S(this,"selectAttachment",Vd)}buildOfflineAttachment(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get asset type attachments",method:l.GET,url:`${this.url}/`,queryParams:{asset_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(_d(n)),n}}class Eb extends V{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,fields_revision:h};r.push(g)}this.dispatch(Dd(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(Cd(o.attachments))}).catch(()=>{this.dispatch(kd(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type fields attachments",method:l.GET,url:"/asset-type-fields-attachments/",queryParams:{fields_revision__asset_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Ud(a)),a}}class Vb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(Hd(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(Wd(m))}).catch(m=>{throw this.dispatch(Kd(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Type Fields",method:l.GET,url:"/asset-type-fields/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Nd(a)),a}}class jb extends V{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ke(e,i??e.length),r=[],u=[];for(const h of c){const p={},y=[];for(const A of h){const{fieldValuesUuid:I,fieldIdentifier:g,file:_}=A,w=await this.getFilePayload(_);w.sha1 in p||(p[w.sha1]=w);const q=F({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:g});r.push(q);const Le={uuid:q.uuid,file_name:_.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:g,field_values:I};y.push(Le)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(Ut(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset type field values attachments",method:l.POST,url:"/asset-type-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(Qd(p))}).catch(h=>{throw this.dispatch(Dt(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=eu(e)(a);this.dispatch(Dt(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(Ut(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:"/asset-type-field-values-attachments/",queryParams:{limit:Ge,paginate:!0,field_values__asset__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Xd(n)),n}}class qb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,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(ot(u)),u)).catch(()=>{this.dispatch(Si(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ke(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const y=F({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.push(y),h.push({uuid:y.uuid,asset:p.asset,fields_revision:p.fields_revision,published_at:p.published_at,values:y.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(nu(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),y=o.field_values.map(I=>I.uuid),A=this.enqueueRequest({description:"Bulk add asset type field values",method:l.POST,url:"/asset-type-field-values/bulk/",payload:o,blockers:[...h,...p],blocks:y});u.push(A)}return Promise.all(u).then(o=>{this.dispatch(cu(o.flat()))}).catch(()=>{this.dispatch(ru(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=gi(e.uuid)(a);if(!n)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(ot(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(ot(u))}).catch(()=>{this.dispatch(ot(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=gi(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=tu(e)(a);this.dispatch(Si(e)),this.dispatch(Dt(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(Ut(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type field values",method:l.GET,url:"/asset-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,asset__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(au(n)),n}}class zb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(bi(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(lt(m))}).catch(()=>{this.dispatch(Fi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Pi(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(lt(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(lt(r))}).catch(()=>{this.dispatch(lt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Pi(e)(a);if(!n)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(Fi(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(bi(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type identifiers",method:l.GET,url:"/asset-type-identifiers/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(lu(a)),a}}class Ub extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(_i(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(ht(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(ht(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(ht(r))}).catch(()=>{this.dispatch(ht(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(_i(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:"/asset-type-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,asset__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Au(n)),n}}class Db extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(Ei(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(mt(m))}).catch(()=>{this.dispatch(Vi(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(mt(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(mt(r))}).catch(()=>{this.dispatch(mt(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=Xs(e)(a),r=jd(e)(a);return this.dispatch(Vi(e)),this.dispatch(Zs(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(Ei(n)),this.dispatch(Vt(c)),this.dispatch(oi(r)),u})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset types",method:l.GET,url:"/asset-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(gu(a)),a}}class Cb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...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=Ci(e.uuid)(i);if(!a)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const n={...a,...e};this.dispatch(vu(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=Ci(e)(i.getState());if(!a)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(wu(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.enqueueRequest({immediate:!0,description:"Get categories",method:l.GET,url:"/categories/",queryParams:{project__organization:e},blocks:[],blockers:[]},i);return this.dispatch(Ru(a)),a}}class kb extends He{constructor(){super(...arguments);S(this,"name","Document Attachment");S(this,"url","/document-attachments");S(this,"addAttachments",qu);S(this,"updateAttachments",Uu);S(this,"removeAttachments",Cu);S(this,"removeAttachment",Du);S(this,"setAttachment",zu);S(this,"selectAttachment",$u)}buildOfflineAttachment(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,document:i.modelUuid})}buildAttachmentPayload(i){return{...i,document:i.modelUuid}}async bulkAdd(i){var p;const{store:a}=this.client,n=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,c=new Date().toISOString(),r=[],u=[],m={},o={};for(const y of i){const{documentUuid:A,file:I}=y,g=await this.getFilePayload(I);g.sha1 in m||(m[g.sha1]=g,o[g.sha1]=[]);const _=this.buildOfflineAttachment({file:I,file_sha1:g.sha1,submitted_at:c,created_by:n,description:"",modelUuid:A});r.push(_),u.push({uuid:_.uuid,file_name:_.file_name,file_sha1:_.file_sha1,file_extension:g.extension,description:_.description,document:A}),o[g.sha1].push(_.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(y=>y.uuid),blockers:r.map(y=>y.file_sha1)});return h.then(({attachments:y,presigned_urls:A})=>{this.dispatch(this.updateAttachments(y));const I=this.processPresignedUrls(A);for(const[g,_]of Object.entries(I))_.then(()=>{const w=o[g];for(const q of w)this.makeReadable(q)})}).catch(()=>{this.dispatch(this.removeAttachments(r.map(y=>y.uuid)))}),[r,h.then(({attachments:y})=>y)]}async delete(i){return this._delete(i)}makeReadable(i){this.enqueueRequest({description:"Add attachment to AI assistant",method:l.PATCH,url:`/document-attachments/${i}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",i],blocks:["index-document-attachment"]})}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__project__organization:i},blocks:[],blockers:[]},a),c=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__organization:i},blocks:[],blockers:[]},a),r=[...n,...c];return this.dispatch(ju(r)),r}}class Bb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(Hu([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($i([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(Qe([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(()=>{Qe([a])}),[n,c]}delete(e){const{store:i}=this.client,a=kt(i.getState()),n=Wu(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($i([e]));const r=this.enqueueRequest({description:"Delete Document",method:l.DELETE,url:`/documents/${e}/`,blockers:[e],blocks:[]});return r.then(u=>{this.dispatch(Qe(u))}).catch(()=>{this.dispatch(Qe([n])),c&&this.dispatch(Qe([c]))}),r}async refreshStore(e,i){const a=this.enqueueRequest({immediate:!0,description:"Get project documents",method:l.GET,url:"/documents/",queryParams:{project__organization:e},blockers:[],blocks:[]},i),n=this.enqueueRequest({immediate:!0,description:"Get organization documents",method:l.GET,url:"/documents/",queryParams:{organization:e},blockers:[],blocks:[]},i),c=[...await a,...await n];return this.dispatch(Nu(c)),c}}class $b extends R{async add(e,i){return this.enqueueRequest({description:"Add email domain to organization",method:l.POST,url:"/organization-email-domains/",payload:{email:i,organization:e},blockers:[e,"create-org"],blocks:[]})}async remove(e){return this.dispatch(Xu(e.uuid)),this.enqueueRequest({description:"Remove email domain from organization",method:l.DELETE,url:`/organization-email-domains/${e.uuid}/`,blockers:[e.domain],blocks:[]}).catch(i=>{throw this.dispatch(Ju(e)),i})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch email domains for organization",method:l.GET,url:"/organization-email-domains/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Zu(a)),a}}class Gb 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 Jt={},Kn=new Set;let Xt=0,Yn=0,Zn=0;const Lb=20;class Nb extends R{constructor(){super(...arguments);S(this,"host");S(this,"_dbPromise",Yp.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 is(a,i),c=await this.enqueueRequest({description:"Get S3 URL",method:l.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await Xe(a),file_type:a.type,extension:a.name.split(".").pop(),size:a.size.toString()},blockers:[],blocks:[`s3-${n}`]});return"url"in c&&this.dispatch(io({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),Xt++):(await n.put("files",i,a),Yn++),Kn.add(a),Zn++,Zn%Lb===0&&console.debug(`File cache summary: ${Xt} hits and ${Yn} misses, ${Xt/(Xt+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 ao(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 is(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=Jt[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 y=new File([p],n??a,{type:p.type});h(y)})}),Jt[c]=u);let o;try{o=await u}catch(h){throw m&&h instanceof U&&delete Jt[c],h}if(m){const h=await Xe(o);if(h!==a){const A=`The hash of the file returned from the server (${h}) does not match the
|
|
9
|
-
expected hash (${
|
|
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("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"],L):(i=typeof globalThis<"u"?globalThis:i||self,L(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.fileSaver,i.buildTree,i.tsTreeLib,i.react,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,L,o,et,tt,gO,Un,mt,bO,_O,Ln,MO,RO,Ob,Pb,wO,EO,vO){"use strict";var Tb=Object.defineProperty;var Ib=(i,L,o)=>L in i?Tb(i,L,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[L]=o;var y=(i,L,o)=>Ib(i,typeof L!="symbol"?L+"":L,o);var PO;const kn=Object.freeze([]),Nn=Object.freeze({});var Gn=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(Gn||{}),m=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(m||{}),Hn=(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))(Hn||{}),Wn=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Wn||{}),$t=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))($t||{}),C=(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))(C||{}),Kn=(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))(Kn||{});const VO=$t.MEDIUM,Yn=6e4;function M(t){return{addOne:(h,p)=>{const A=t(p.payload);h.instances[A]=p.payload},addMany:(h,p)=>{for(const A of p.payload){const f=t(A);h.instances[f]=A}},setOne:(h,p)=>{const A=t(p.payload);h.instances[A]=p.payload},setMany:(h,p)=>{for(const A of p.payload){const f=t(A);h.instances[f]=A}},updateOne:(h,p)=>{const A=t(p.payload);h.instances[A]=p.payload},updateMany:(h,p)=>{for(const A of p.payload){const f=t(A);h.instances[f]=A}},deleteOne:(h,p)=>{delete h.instances[p.payload]},deleteMany:(h,p)=>{for(const A of p.payload)delete h.instances[A]},initialize:(h,p)=>{h.instances={};const A=new Set;for(const f of p.payload){const S=t(f);A.add(S),h.instances[S]=f}A.size!==p.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function zO(){return{initializeSelection:(u,d)=>{u.selection=Array.from(new Set(d.payload))},selectOne:(u,d)=>{new Set(u.selection).has(d.payload)||u.selection.push(d.payload)},selectMany:(u,d)=>{const h=new Set(u.selection);for(const p of d.payload)h.has(p)||h.add(p);u.selection=Array.from(h)},unselectOne:(u,d)=>{const h=new Set(u.selection);h.has(d.payload)&&(h.delete(d.payload),u.selection=Array.from(h))},unselectMany:(u,d)=>{const h=new Set(u.selection);for(const p of d.payload)h.has(p)&&h.delete(p);u.selection=Array.from(h)},toggleOne:(u,d)=>{const h=new Set(u.selection);h.has(d.payload)?h.delete(d.payload):h.add(d.payload),u.selection=Array.from(h)},toggleMany:(u,d)=>{const h=new Set(u.selection);for(const p of d.payload)h.has(p)?h.delete(p):h.add(p);u.selection=Array.from(h)},getInitialState:u=>({...u,selection:[]})}}const dt="versioning",b=o.createAction("RESET"),j=o.createAction("RESET_PROJECT_STATE"),R=o.createAction("RESET_ORGANIZATION_STATE");PO=Symbol.toStringTag;class Ut{constructor(){y(this,PO,"Promise");y(this,"_promise");y(this,"_resolve");y(this,"_reject");y(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 Lt=!1;["true","1"].includes("".toLowerCase())&&(Lt=!0);function BO(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),a=e.length;if(a!==n.length)return!1;for(let c=0;c<a;c++){const r=e[c];if(!Object.prototype.hasOwnProperty.call(s,r)||t[r]!==s[r])return!1}return!0}function kt(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Lt&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Lt&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function jO(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 I=t=>t.length===0?kn:t,yt=t=>Object.keys(t).length===0?Nn:t,Zn=kt(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Nt.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),qO=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),DO=1e3*86400,Nt=new Date,CO=t=>new Date(t).toDateString()===Nt.toDateString(),$O=kt((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Nt.getTime())/DO);return n<s||n>e?Zn(t):qO.format(n,"days")});function UO(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}const Gt=async(t,s)=>{s||(s=await st(t));let e=t.type;if(e.includes("/")&&(e=e.split("/")[1]),!e)throw new Error(`Could not extract file type from ${t.type}`);return`${s}.${e}`};function st(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const a=n.result;if(!a){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",a).then(c=>{const r=UO(c);s(r)})},n.readAsArrayBuffer(t)})}function LO(t){if(!t.name||!t.type||!t.size){const s="File has no name, type, and/or size";throw new Error(s)}return`${t.name}&${t.type}${t.size}`}function Jn(t,s){return new File([t],s,{type:t.type})}function kO(t,s){const e=document.createElement("a");e.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(s)),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}const NO=async t=>{const s={};for(const e of t){const n=await st(e);s[n]={sha1:n,extension:e.name.split(".").pop()||"",file_type:e.type,size:e.size}}return Object.values(s)},Xn=async t=>(await fetch(t)).blob(),GO=t=>new Promise((s,e)=>{const n=new FileReader;n.onloadend=()=>{var a;s(((a=n.result)==null?void 0:a.toString())||"")},n.readAsDataURL(t)});function HO(t){const s=new Blob([t]);gO.saveAs(s,t.name)}const Qn={};function WO(t,s,e,...n){const a=Qn[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Qn[t]={[s]:!0},c=!0),c&&console[e](...n)}const xn=["created_at","updated_at","index","revision"];function _(t){return{...t,uuid:tt.v4()}}function KO(t){const s={};for(const e of t)s[e.uuid]=e;return s}function D(t){return t.map(({uuid:s})=>s)}function YO(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const c=t.split(".");c.length>1&&(s=c[c.length-1])}s&&!s.startsWith(".")&&(s="."+s);const a=s?s.length:0;return n.length+a>e&&(n=n.slice(0,e-a)+(s||"")),n}function ZO(t){return t.toLowerCase().replace(" ","-")}function JO(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function XO(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const T=t=>s=>e=>t(e,s);function QO(t,s,e){return e.findIndex(n=>n.uuid===t.uuid)===s}function xO(t,s,e){return e.findIndex(n=>n.file_sha1===t.file_sha1)===s}const eP=/^.+@.+\..+$/;function z(t){const s={...t};for(const e of[...xn,"created_by"])e in s&&delete s[e];return s}const ea=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Un(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},tP=t=>{const{roots:s}=ea(t);return s.map(e=>new mt.Tree(e))},ta=(t,s)=>{const{nodes:e}=ea(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new mt.Tree(n)},sa=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,ia=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,na=t=>Un(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),sP=t=>{const{roots:s}=na(t);return s.map(e=>new mt.Tree(e))},aa=(t,s)=>{const{nodes:e}=na(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new mt.Tree(n)},k=M(t=>t.uuid),ca={instances:{}},Ht=o.createSlice({name:"agents",initialState:ca,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,ca)),reducers:{initializeConversations:k.initialize,addConversation:k.addOne,addConversations:k.addMany,setConversation:k.setOne,setConversations:k.setMany,updateConversation:k.updateOne,updateConversations:k.updateMany,deleteConversation:k.deleteOne,deleteConversations:k.deleteMany}}),{initializeConversations:da,addConversation:ra,addConversations:iP,setConversation:ua,setConversations:nP,updateConversation:la,updateConversations:aP,deleteConversation:cP,deleteConversations:dP}=Ht.actions,Wt=t=>t.agentsReducer.instances,rP=o.createSelector([Wt],t=>Object.values(t)),uP=T(o.createSelector([Wt,(t,s)=>s],(t,s)=>t[s])),oa=Ht.reducer,N=M(t=>t.uuid),ha={instances:{}},Kt=o.createSlice({name:"assetAttachments",initialState:ha,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,ha)),reducers:{initializeAssetAttachments:N.initialize,addAssetAttachment:N.addOne,addAssetAttachments:N.addMany,setAssetAttachment:N.setOne,setAssetAttachments:N.setMany,updateAssetAttachment:N.updateOne,updateAssetAttachments:N.updateMany,deleteAssetAttachment:N.deleteOne,deleteAssetAttachments:N.deleteMany}}),{initializeAssetAttachments:ma,addAssetAttachment:ya,addAssetAttachments:Yt,setAssetAttachment:pa,setAssetAttachments:Aa,updateAssetAttachment:fa,updateAssetAttachments:Sa,deleteAssetAttachment:Ta,deleteAssetAttachments:Zt}=Kt.actions,Ia=t=>t.assetAttachmentReducer.instances,Jt=o.createSelector([Ia],t=>Object.values(t)),Oa=t=>s=>s.assetAttachmentReducer.instances[t],Pa=T(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),Fa=T(o.createSelector([Jt,(t,s)=>s],(t,s)=>I(t.filter(({asset:e})=>s===e)))),ga=Kt.reducer,G=M(({uuid:t})=>t),ba={instances:{}},Xt=o.createSlice({name:"assetProcedureTypeAttachments",initialState:ba,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,ba)),reducers:{initializeAssetProcedureTypeAttachments:G.initialize,addAssetProcedureTypeAttachment:G.addOne,addAssetProcedureTypeAttachments:G.addMany,setAssetProcedureTypeAttachment:G.setOne,setAssetProcedureTypeAttachments:G.setMany,updateAssetProcedureTypeAttachment:G.updateOne,updateAssetProcedureTypeAttachments:G.updateMany,deleteAssetProcedureTypeAttachment:G.deleteOne,deleteAssetProcedureTypeAttachments:G.deleteMany}}),{initializeAssetProcedureTypeAttachments:_a,addAssetProcedureTypeAttachment:Ma,addAssetProcedureTypeAttachments:Ra,setAssetProcedureTypeAttachment:wa,setAssetProcedureTypeAttachments:Ea,updateAssetProcedureTypeAttachment:va,updateAssetProcedureTypeAttachments:Va,deleteAssetProcedureTypeAttachment:za,deleteAssetProcedureTypeAttachments:Ba}=Xt.actions,ja=Xt.reducer,qa=t=>t.assetProcedureTypeAttachmentReducer.instances,Qt=o.createSelector([qa],t=>Object.values(t)),Da=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],Ca=T(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),lP=T(o.createSelector([Qt,(t,s)=>s],(t,s)=>I(t.filter(({asset_procedure_type:e})=>s===e)))),H=M(({uuid:t})=>t),$a={instances:{}},xt=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:$a,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,$a)),reducers:{initializeAssetProcedureTypeFieldsAttachments:H.initialize,addAssetProcedureTypeFieldsAttachment:H.addOne,addAssetProcedureTypeFieldsAttachments:H.addMany,setAssetProcedureTypeFieldsAttachment:H.setOne,setAssetProcedureTypeFieldsAttachments:H.setMany,updateAssetProcedureTypeFieldsAttachment:H.updateOne,updateAssetProcedureTypeFieldsAttachments:H.updateMany,deleteAssetProcedureTypeFieldsAttachment:H.deleteOne,deleteAssetProcedureTypeFieldsAttachments:H.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:Ua,addAssetProcedureTypeFieldsAttachment:La,addAssetProcedureTypeFieldsAttachments:ka,setAssetProcedureTypeFieldsAttachment:Na,setAssetProcedureTypeFieldsAttachments:Ga,updateAssetProcedureTypeFieldsAttachment:Ha,updateAssetProcedureTypeFieldsAttachments:Wa,deleteAssetProcedureTypeFieldsAttachment:Ka,deleteAssetProcedureTypeFieldsAttachments:Ya}=xt.actions,Za=xt.reducer,Ja=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,es=o.createSelector([Ja],t=>Object.values(t)),oP=T(o.createSelector([es,(t,s)=>s],(t,s)=>I(t.filter(e=>e.fields_revision===s)))),Xa=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Qa=T(o.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),W=M(({uuid:t})=>t),xa={instances:{}},ts=o.createSlice({name:"assetProcedureTypeFields",initialState:xa,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,xa)),reducers:{initializeAssetProcedureTypeFields:W.initialize,addAssetProcedureTypeFields:W.addOne,addAssetProcedureTypeFieldsMany:W.addMany,setAssetProcedureTypeFields:W.setOne,setAssetProcedureTypeFieldsMany:W.setMany,updateAssetProcedureTypeFields:W.updateOne,updateAssetProcedureTypeFieldsMany:W.updateMany,deleteAssetProcedureTypeFields:W.deleteOne,deleteAssetProcedureTypeFieldsMany:W.deleteMany}}),{initializeAssetProcedureTypeFields:ec,addAssetProcedureTypeFields:tc,addAssetProcedureTypeFieldsMany:sc,setAssetProcedureTypeFields:ic,setAssetProcedureTypeFieldsMany:nc,updateAssetProcedureTypeFields:ac,updateAssetProcedureTypeFieldsMany:cc,deleteAssetProcedureTypeFields:dc,deleteAssetProcedureTypeFieldsMany:rc}=ts.actions,uc=ts.reducer,lc=t=>t.assetProcedureTypeFieldsReducer.instances,pt=o.createSelector([lc],t=>Object.values(t)),hP=T(o.createSelector([pt,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_procedure_type===s)))),mP=T(o.createSelector([pt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),oc=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],hc=T(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),K=M(({uuid:t})=>t),mc={instances:{}},ss=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:mc,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,mc)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:K.initialize,addAssetProcedureTypeFieldValuesAttachment:K.addOne,addAssetProcedureTypeFieldValuesAttachments:K.addMany,setAssetProcedureTypeFieldValuesAttachment:K.setOne,setAssetProcedureTypeFieldValuesAttachments:K.setMany,updateAssetProcedureTypeFieldValuesAttachment:K.updateOne,updateAssetProcedureTypeFieldValuesAttachments:K.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:K.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:yc,addAssetProcedureTypeFieldValuesAttachment:pc,addAssetProcedureTypeFieldValuesAttachments:is,setAssetProcedureTypeFieldValuesAttachment:Ac,setAssetProcedureTypeFieldValuesAttachments:fc,updateAssetProcedureTypeFieldValuesAttachment:Sc,updateAssetProcedureTypeFieldValuesAttachments:Tc,deleteAssetProcedureTypeFieldValuesAttachment:Ic,deleteAssetProcedureTypeFieldValuesAttachments:ns}=ss.actions,Oc=ss.reducer,Pc=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,as=o.createSelector([Pc],t=>Object.values(t)),Fc=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],gc=T(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),bc=T(o.createSelector([as,(t,s)=>s],(t,s)=>I(t.filter(e=>e.field_values===s)))),Y=M(({uuid:t})=>t),_c={instances:{}},cs=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:_c,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,_c)),reducers:{initializeAssetProcedureTypeFieldValues:Y.initialize,addAssetProcedureTypeFieldValues:Y.addOne,addAssetProcedureTypeFieldValuesMany:Y.addMany,setAssetProcedureTypeFieldValues:Y.setOne,setAssetProcedureTypeFieldValuesMany:Y.setMany,updateAssetProcedureTypeFieldValues:Y.updateOne,updateAssetProcedureTypeFieldValuesMany:Y.updateMany,deleteAssetProcedureTypeFieldValues:Y.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Y.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Mc,addAssetProcedureTypeFieldValues:Rc,addAssetProcedureTypeFieldValuesMany:wc,setAssetProcedureTypeFieldValues:Ec,setAssetProcedureTypeFieldValuesMany:vc,updateAssetProcedureTypeFieldValues:Vc,updateAssetProcedureTypeFieldValuesMany:zc,deleteAssetProcedureTypeFieldValues:Bc,deleteAssetProcedureTypeFieldValuesMany:jc}=cs.actions,qc=cs.reducer,Dc=t=>t.assetProcedureTypeFieldValuesReducer.instances,At=o.createSelector([Dc],t=>Object.values(t)),yP=T(o.createSelector([At,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset===s)))),pP=T(o.createSelector([At,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_procedure===s)))),Cc=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],$c=T(o.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),Z=M(({uuid:t})=>t),Uc={instances:{}},ds=o.createSlice({name:"assetProcedures",initialState:Uc,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,Uc)),reducers:{initializeAssetProcedures:Z.initialize,addAssetProcedure:Z.addOne,addAssetProcedures:Z.addMany,setAssetProcedure:Z.setOne,setAssetProcedures:Z.setMany,updateAssetProcedure:Z.updateOne,updateAssetProcedures:Z.updateMany,deleteAssetProcedure:Z.deleteOne,deleteAssetProcedures:Z.deleteMany}}),{initializeAssetProcedures:Lc,addAssetProcedure:kc,addAssetProcedures:rs,updateAssetProcedure:Nc,updateAssetProcedures:Gc,deleteAssetProcedure:Hc,deleteAssetProcedures:us,setAssetProcedure:Wc,setAssetProcedures:Kc}=ds.actions,Yc=ds.reducer,Zc=t=>t.assetProcedureReducer.instances,ft=o.createSelector([Zc],t=>Object.values(t)),Jc=T(o.createSelector([ft,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_procedure_type===s)))),AP=T(o.createSelector([ft,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_type===s)))),Xc=t=>s=>s.assetProcedureReducer.instances[t],Qc=T(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),J=M(t=>t.uuid),xc={instances:{}},ls=o.createSlice({name:"assetProcedureTypes",initialState:xc,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,xc)),reducers:{initializeAssetProcedureTypes:J.initialize,addAssetProcedureType:J.addOne,addAssetProcedureTypes:J.addMany,setAssetProcedureType:J.setOne,setAssetProcedureTypes:J.setMany,updateAssetProcedureType:J.updateOne,updateAssetProcedureTypes:J.updateMany,deleteAssetProcedureType:J.deleteOne,deleteAssetProcedureTypes:J.deleteMany}}),{initializeAssetProcedureTypes:ed,addAssetProcedureType:td,addAssetProcedureTypes:sd,updateAssetProcedureType:id,updateAssetProcedureTypes:nd,deleteAssetProcedureType:ad,deleteAssetProcedureTypes:cd,setAssetProcedureType:dd,setAssetProcedureTypes:rd}=ls.actions,ud=ls.reducer,ld=t=>t.assetProcedureTypeReducer.instances,os=o.createSelector([ld],t=>Object.values(t)),od=t=>s=>s.assetProcedureTypeReducer.instances[t],hd=T(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),fP=T(o.createSelector([os,(t,s)=>s],(t,s)=>I(t.filter(e=>e.organization===s)))),X=M(t=>t.uuid),md={instances:{}},hs=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:md,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,md)),reducers:{initializeAssetProcedureStepFieldsAttachments:X.initialize,addAssetProcedureStepFieldsAttachment:X.addOne,addAssetProcedureStepFieldsAttachments:X.addMany,setAssetProcedureStepFieldsAttachment:X.setOne,setAssetProcedureStepFieldsAttachments:X.setMany,updateAssetProcedureStepFieldsAttachment:X.updateOne,updateAssetProcedureStepFieldsAttachments:X.updateMany,deleteAssetProcedureStepFieldsAttachment:X.deleteOne,deleteAssetProcedureStepFieldsAttachments:X.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:yd,addAssetProcedureStepFieldsAttachment:pd,addAssetProcedureStepFieldsAttachments:Ad,setAssetProcedureStepFieldsAttachment:fd,setAssetProcedureStepFieldsAttachments:Sd,updateAssetProcedureStepFieldsAttachment:Td,updateAssetProcedureStepFieldsAttachments:Id,deleteAssetProcedureStepFieldsAttachment:Od,deleteAssetProcedureStepFieldsAttachments:Pd}=hs.actions,Fd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,ms=o.createSelector([Fd],t=>Object.values(t)),SP=T(o.createSelector([ms,(t,s)=>s],(t,s)=>I(t.filter(e=>e.fields_revision===s)))),gd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],bd=T(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),_d=hs.reducer,Q=M(t=>t.uuid),Md={instances:{}},ys=o.createSlice({name:"assetProcedureStepFields",initialState:Md,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Md)),reducers:{initializeAssetProcedureStepFields:Q.initialize,addAssetProcedureStepFields:Q.addOne,addAssetProcedureStepFieldsMany:Q.addMany,setAssetProcedureStepFields:Q.setOne,setAssetProcedureStepFieldsMany:Q.setMany,updateAssetProcedureStepFields:Q.updateOne,updateAssetProcedureStepFieldsMany:Q.updateMany,deleteAssetProcedureStepFields:Q.deleteOne,deleteAssetProcedureStepFieldsMany:Q.deleteMany}}),{initializeAssetProcedureStepFields:Rd,addAssetProcedureStepFields:wd,addAssetProcedureStepFieldsMany:Ed,setAssetProcedureStepFields:vd,setAssetProcedureStepFieldsMany:Vd,updateAssetProcedureStepFields:zd,updateAssetProcedureStepFieldsMany:Bd,deleteAssetProcedureStepFields:jd,deleteAssetProcedureStepFieldsMany:qd}=ys.actions,ps=t=>t.assetProcedureStepFieldsReducer.instances,St=o.createSelector([ps],t=>Object.values(t)),TP=T(o.createSelector([St,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_procedure_step===s)))),IP=T(o.createSelector([St,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),OP=o.createSelector([ps],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),Dd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],Cd=T(o.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),$d=ys.reducer,x=M(t=>t.uuid),Ud={instances:{}},As=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Ud,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,Ud)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:x.initialize,addAssetProcedureStepFieldValuesAttachment:x.addOne,addAssetProcedureStepFieldValuesAttachments:x.addMany,setAssetProcedureStepFieldValuesAttachment:x.setOne,setAssetProcedureStepFieldValuesAttachments:x.setMany,updateAssetProcedureStepFieldValuesAttachment:x.updateOne,updateAssetProcedureStepFieldValuesAttachments:x.updateMany,deleteAssetProcedureStepFieldValuesAttachment:x.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:x.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Ld,addAssetProcedureStepFieldValuesAttachment:kd,addAssetProcedureStepFieldValuesAttachments:fs,setAssetProcedureStepFieldValuesAttachment:Nd,setAssetProcedureStepFieldValuesAttachments:Gd,updateAssetProcedureStepFieldValuesAttachment:Hd,updateAssetProcedureStepFieldValuesAttachments:Wd,deleteAssetProcedureStepFieldValuesAttachment:Kd,deleteAssetProcedureStepFieldValuesAttachments:Ss}=As.actions,Yd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Ts=o.createSelector([Yd],t=>Object.values(t)),Zd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Jd=T(o.createSelector([Ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),Xd=T(o.createSelector([Ts,(t,s)=>s],(t,s)=>I(t.filter(e=>e.field_values===s)))),Qd=As.reducer,ee=M(t=>t.uuid),xd={instances:{}},Is=o.createSlice({name:"assetProcedureStepFieldValues",initialState:xd,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,xd)),reducers:{initializeAssetProcedureStepFieldValues:ee.initialize,addAssetProcedureStepFieldValues:ee.addOne,addAssetProcedureStepFieldValuesMany:ee.addMany,setAssetProcedureStepFieldValues:ee.setOne,setAssetProcedureStepFieldValuesMany:ee.setMany,updateAssetProcedureStepFieldValues:ee.updateOne,updateAssetProcedureStepFieldValuesMany:ee.updateMany,deleteAssetProcedureStepFieldValues:ee.deleteOne,deleteAssetProcedureStepFieldValuesMany:ee.deleteMany}}),{initializeAssetProcedureStepFieldValues:er,addAssetProcedureStepFieldValues:tr,addAssetProcedureStepFieldValuesMany:sr,setAssetProcedureStepFieldValues:ir,setAssetProcedureStepFieldValuesMany:nr,updateAssetProcedureStepFieldValues:ar,updateAssetProcedureStepFieldValuesMany:cr,deleteAssetProcedureStepFieldValues:dr,deleteAssetProcedureStepFieldValuesMany:rr}=Is.actions,ur=t=>t.assetProcedureStepFieldValuesReducer.instances,rt=o.createSelector([ur],t=>Object.values(t)),PP=T(o.createSelector([rt,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset===s)))),FP=T(o.createSelector([rt,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_procedure===s)))),gP=T(o.createSelector([rt,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_procedure_step===s)))),lr=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],or=T(o.createSelector([rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),hr=Is.reducer,te=M(t=>t.uuid),mr={instances:{}},Os=o.createSlice({name:"assetProcedureSteps",initialState:mr,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,mr)),reducers:{initializeAssetProcedureSteps:te.initialize,setAssetProcedureStep:te.setOne,setAssetProcedureSteps:te.setMany,addAssetProcedureStep:te.addOne,addAssetProcedureSteps:te.addMany,updateAssetProcedureStep:te.updateOne,updateAssetProcedureSteps:te.updateMany,deleteAssetProcedureStep:te.deleteOne,deleteAssetProcedureSteps:te.deleteMany}}),{initializeAssetProcedureSteps:yr,setAssetProcedureStep:pr,setAssetProcedureSteps:Ar,addAssetProcedureStep:fr,addAssetProcedureSteps:Sr,updateAssetProcedureStep:Tr,updateAssetProcedureSteps:Ir,deleteAssetProcedureStep:Or,deleteAssetProcedureSteps:Pr}=Os.actions,Fr=Os.reducer,Tt=t=>t.assetProcedureStepReducer.instances,gr=t=>s=>s.assetProcedureStepReducer.instances[t],Ps=o.createSelector([Tt],t=>Object.values(t)),bP=T(o.createSelector([Tt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return yt(e)})),_P=T(o.createSelector([Ps,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_procedure_type===s)))),br=T(o.createSelector([Ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),_r=T(o.createSelector([Tt,(t,s)=>s],(t,s)=>{if(!t[s])return I([]);const a=ta(s,Object.values(t)).all().map(({model:c})=>c);return I(a)})),se=M(t=>t.uuid),Mr={instances:{}},Fs=o.createSlice({name:"assets",initialState:Mr,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,Mr)),reducers:{initializeAssets:se.initialize,addAsset:se.addOne,addAssets:se.addMany,setAsset:se.setOne,setAssets:se.setMany,updateAsset:se.updateOne,updateAssets:se.updateMany,deleteAsset:se.deleteOne,deleteAssets:se.deleteMany}}),{initializeAssets:Rr,addAsset:wr,addAssets:gs,updateAsset:Er,updateAssets:vr,deleteAsset:Vr,deleteAssets:bs,setAsset:zr,setAssets:Br}=Fs.actions,jr=t=>t.assetReducer.instances,_s=o.createSelector([jr],t=>I(Object.values(t))),Ms=T(o.createSelector([_s,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_type===s)))),qr=t=>s=>s.assetReducer.instances[t],Dr=T(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),MP=t=>s=>Ms(t)(s).length,Cr=Fs.reducer,ie=M(t=>t.uuid),$r={instances:{}},Rs=o.createSlice({name:"assetStageCompletions",initialState:$r,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,$r)),reducers:{initializeAssetStageCompletions:ie.initialize,addAssetStageCompletion:ie.addOne,addAssetStageCompletions:ie.addMany,setAssetStageCompletion:ie.setOne,setAssetStageCompletions:ie.setMany,updateAssetStageCompletion:ie.updateOne,updateAssetStageCompletions:ie.updateMany,deleteAssetStageCompletion:ie.deleteOne,deleteAssetStageCompletions:ie.deleteMany}}),{initializeAssetStageCompletions:Ur,addAssetStageCompletion:Lr,addAssetStageCompletions:kr,setAssetStageCompletion:Nr,setAssetStageCompletions:Gr,updateAssetStageCompletion:Hr,updateAssetStageCompletions:Wr,deleteAssetStageCompletion:Kr,deleteAssetStageCompletions:Yr}=Rs.actions,Zr=Rs.reducer,Jr=t=>t.assetStageCompletionReducer.instances,Xr=o.createSelector([Jr],t=>Object.values(t)),Qr=t=>s=>s.assetStageCompletionReducer.instances[t],xr=T(o.createSelector([Xr,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),ne=M(t=>t.uuid),eu={instances:{}},ws=o.createSlice({name:"assetStages",initialState:eu,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,eu)),reducers:{initializeAssetStages:ne.initialize,setAssetStage:ne.setOne,setAssetStages:ne.setMany,addAssetStage:ne.addOne,addAssetStages:ne.addMany,updateAssetStage:ne.updateOne,updateAssetStages:ne.updateMany,deleteAssetStage:ne.deleteOne,deleteAssetStages:ne.deleteMany}}),{initializeAssetStages:tu,setAssetStage:su,setAssetStages:iu,addAssetStage:nu,addAssetStages:au,updateAssetStage:cu,updateAssetStages:du,deleteAssetStage:ru,deleteAssetStages:uu}=ws.actions,lu=ws.reducer,Es=t=>t.assetStageReducer.instances,ou=t=>s=>s.assetStageReducer.instances[t],vs=o.createSelector([Es],t=>Object.values(t)),RP=T(o.createSelector([Es,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return yt(e)})),wP=T(o.createSelector([vs,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_procedure_type===s)))),hu=T(o.createSelector([vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),ae=M(t=>t.uuid),mu={instances:{}},Vs=o.createSlice({name:"assetTypeAttachments",initialState:mu,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,mu)),reducers:{initializeAssetTypeAttachments:ae.initialize,addAssetTypeAttachment:ae.addOne,addAssetTypeAttachments:ae.addMany,setAssetTypeAttachment:ae.setOne,setAssetTypeAttachments:ae.setMany,updateAssetTypeAttachment:ae.updateOne,updateAssetTypeAttachments:ae.updateMany,deleteAssetTypeAttachment:ae.deleteOne,deleteAssetTypeAttachments:ae.deleteMany}}),{initializeAssetTypeAttachments:yu,addAssetTypeAttachment:pu,addAssetTypeAttachments:zs,setAssetTypeAttachment:Au,setAssetTypeAttachments:fu,updateAssetTypeAttachment:Su,updateAssetTypeAttachments:Tu,deleteAssetTypeAttachment:Iu,deleteAssetTypeAttachments:Bs}=Vs.actions,Ou=t=>t.assetTypeAttachmentReducer.instances,js=o.createSelector([Ou],t=>Object.values(t)),Pu=t=>s=>s.assetTypeAttachmentReducer.instances[t],Fu=T(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),gu=T(o.createSelector([js,(t,s)=>s],(t,s)=>I(t.filter(({asset_type:e})=>s===e)))),bu=Vs.reducer,ce=M(t=>t.uuid),_u={instances:{}},qs=o.createSlice({name:"assetTypeFieldsAttachments",initialState:_u,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,_u)),reducers:{initializeAssetTypeFieldsAttachments:ce.initialize,addAssetTypeFieldsAttachment:ce.addOne,addAssetTypeFieldsAttachments:ce.addMany,setAssetTypeFieldsAttachment:ce.setOne,setAssetTypeFieldsAttachments:ce.setMany,updateAssetTypeFieldsAttachment:ce.updateOne,updateAssetTypeFieldsAttachments:ce.updateMany,deleteAssetTypeFieldsAttachment:ce.deleteOne,deleteAssetTypeFieldsAttachments:ce.deleteMany}}),{initializeAssetTypeFieldsAttachments:Mu,addAssetTypeFieldsAttachment:Ru,addAssetTypeFieldsAttachments:wu,setAssetTypeFieldsAttachment:Eu,setAssetTypeFieldsAttachments:vu,updateAssetTypeFieldsAttachment:Vu,updateAssetTypeFieldsAttachments:zu,deleteAssetTypeFieldsAttachment:Bu,deleteAssetTypeFieldsAttachments:ju}=qs.actions,qu=t=>t.assetTypeFieldsAttachmentReducer.instances,Ds=o.createSelector([qu],t=>Object.values(t)),EP=T(o.createSelector([Ds,(t,s)=>s],(t,s)=>I(t.filter(e=>e.fields_revision===s)))),Du=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Cu=T(o.createSelector([Ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),$u=qs.reducer,de=M(t=>t.uuid),Uu={instances:{}},Cs=o.createSlice({name:"assetTypeFields",initialState:Uu,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Uu)),reducers:{initializeAssetTypeFields:de.initialize,addAssetTypeFields:de.addOne,addAssetTypeFieldsMany:de.addMany,setAssetTypeFields:de.setOne,setAssetTypeFieldsMany:de.setMany,updateAssetTypeFields:de.updateOne,updateAssetTypeFieldsMany:de.updateMany,deleteAssetTypeFields:de.deleteOne,deleteAssetTypeFieldsMany:de.deleteMany}}),{initializeAssetTypeFields:Lu,addAssetTypeFields:ku,addAssetTypeFieldsMany:Nu,setAssetTypeFields:Gu,setAssetTypeFieldsMany:Hu,updateAssetTypeFields:Wu,updateAssetTypeFieldsMany:Ku,deleteAssetTypeFields:Yu,deleteAssetTypeFieldsMany:Zu}=Cs.actions,Ju=t=>t.assetTypeFieldsReducer.instances,ut=o.createSelector([Ju],t=>Object.values(t)),vP=T(o.createSelector([ut,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_type===s)))),VP=T(o.createSelector([ut,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Xu=t=>s=>s.assetTypeFieldsReducer.instances[t],Qu=T(o.createSelector([ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),xu=Cs.reducer,re=M(t=>t.uuid),el={instances:{}},$s=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:el,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,el)),reducers:{initializeAssetTypeFieldValuesAttachments:re.initialize,addAssetTypeFieldValuesAttachment:re.addOne,addAssetTypeFieldValuesAttachments:re.addMany,setAssetTypeFieldValuesAttachment:re.setOne,setAssetTypeFieldValuesAttachments:re.setMany,updateAssetTypeFieldValuesAttachment:re.updateOne,updateAssetTypeFieldValuesAttachments:re.updateMany,deleteAssetTypeFieldValuesAttachment:re.deleteOne,deleteAssetTypeFieldValuesAttachments:re.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:tl,addAssetTypeFieldValuesAttachment:sl,addAssetTypeFieldValuesAttachments:Us,setAssetTypeFieldValuesAttachment:il,setAssetTypeFieldValuesAttachments:nl,updateAssetTypeFieldValuesAttachment:al,updateAssetTypeFieldValuesAttachments:cl,deleteAssetTypeFieldValuesAttachment:dl,deleteAssetTypeFieldValuesAttachments:Ls}=$s.actions,rl=t=>t.assetTypeFieldValuesAttachmentReducer.instances,ks=o.createSelector([rl],t=>Object.values(t)),ul=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],ll=T(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),ol=T(o.createSelector([ks,(t,s)=>s],(t,s)=>I(t.filter(e=>e.field_values===s)))),hl=$s.reducer,ue=M(t=>t.uuid),ml={instances:{}},Ns=o.createSlice({name:"assetTypeFieldValues",initialState:ml,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,ml)),reducers:{initializeAssetTypeFieldValues:ue.initialize,addAssetTypeFieldValues:ue.addOne,addAssetTypeFieldValuesMany:ue.addMany,setAssetTypeFieldValues:ue.setOne,setAssetTypeFieldValuesMany:ue.setMany,updateAssetTypeFieldValues:ue.updateOne,updateAssetTypeFieldValuesMany:ue.updateMany,deleteAssetTypeFieldValues:ue.deleteOne,deleteAssetTypeFieldValuesMany:ue.deleteMany}}),{initializeAssetTypeFieldValues:yl,addAssetTypeFieldValues:pl,addAssetTypeFieldValuesMany:Al,setAssetTypeFieldValues:fl,setAssetTypeFieldValuesMany:Sl,updateAssetTypeFieldValues:Tl,updateAssetTypeFieldValuesMany:Il,deleteAssetTypeFieldValues:Ol,deleteAssetTypeFieldValuesMany:Pl}=Ns.actions,Fl=t=>t.assetTypeFieldValuesReducer.instances,It=o.createSelector([Fl],t=>Object.values(t)),zP=T(o.createSelector([It,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset===s)))),BP=T(o.createSelector([ut,It,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return I(s.filter(a=>n.has(a.fields_revision)))})),gl=t=>s=>s.assetTypeFieldValuesReducer.instances[t],bl=T(o.createSelector([It,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),_l=Ns.reducer,le=M(t=>t.uuid),Ml={instances:{}},Gs=o.createSlice({name:"assetTypeIdentifiers",initialState:Ml,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Ml)),reducers:{initializeAssetTypeIdentifiers:le.initialize,addAssetTypeIdentifier:le.addOne,addAssetTypeIdentifiers:le.addMany,setAssetTypeIdentifier:le.setOne,setAssetTypeIdentifiers:le.setMany,updateAssetTypeIdentifier:le.updateOne,updateAssetTypeIdentifiers:le.updateMany,deleteAssetTypeIdentifier:le.deleteOne,deleteAssetTypeIdentifiers:le.deleteMany}}),{initializeAssetTypeIdentifiers:Rl,addAssetTypeIdentifier:wl,addAssetTypeIdentifiers:El,setAssetTypeIdentifier:vl,setAssetTypeIdentifiers:Vl,updateAssetTypeIdentifier:zl,updateAssetTypeIdentifiers:Bl,deleteAssetTypeIdentifier:jl,deleteAssetTypeIdentifiers:ql}=Gs.actions,Dl=t=>t.assetTypeIdentifierReducer.instances,Hs=o.createSelector([Dl],t=>Object.values(t)),Cl=t=>s=>s.assetTypeIdentifierReducer.instances[t],$l=T(o.createSelector([Hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),jP=T(o.createSelector([Hs,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_type===s)))),Ul=Gs.reducer,oe=M(t=>t.uuid),Ll={instances:{}},Ws=o.createSlice({name:"assetTypeIdentifierValues",initialState:Ll,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,Ll)),reducers:{initializeAssetTypeIdentifierValues:oe.initialize,addAssetTypeIdentifierValue:oe.addOne,addAssetTypeIdentifierValues:oe.addMany,setAssetTypeIdentifierValue:oe.setOne,setAssetTypeIdentifierValues:oe.setMany,updateAssetTypeIdentifierValue:oe.updateOne,updateAssetTypeIdentifierValues:oe.updateMany,deleteAssetTypeIdentifierValue:oe.deleteOne,deleteAssetTypeIdentifierValues:oe.deleteMany}}),{initializeAssetTypeIdentifierValues:kl,addAssetTypeIdentifierValue:Nl,addAssetTypeIdentifierValues:Gl,setAssetTypeIdentifierValue:Hl,setAssetTypeIdentifierValues:Wl,updateAssetTypeIdentifierValue:Kl,updateAssetTypeIdentifierValues:Yl,deleteAssetTypeIdentifierValue:Zl,deleteAssetTypeIdentifierValues:Jl}=Ws.actions,Xl=t=>t.assetTypeIdentifierValueReducer.instances,Ot=o.createSelector([Xl],t=>Object.values(t)),Ql=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],xl=T(o.createSelector([Ot,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),qP=T(o.createSelector([Ot,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset===s)))),DP=T(o.createSelector([Ot,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_type_identifier===s)))),eo=Ws.reducer,he=M(t=>t.uuid),to={instances:{}},Ks=o.createSlice({name:"assetTypes",initialState:to,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,to)),reducers:{initializeAssetTypes:he.initialize,setAssetType:he.setOne,setAssetTypes:he.setMany,addAssetType:he.addOne,addAssetTypes:he.addMany,updateAssetType:he.updateOne,updateAssetTypes:he.updateMany,deleteAssetType:he.deleteOne,deleteAssetTypes:he.deleteMany}}),{initializeAssetTypes:so,setAssetType:io,setAssetTypes:no,addAssetType:ao,addAssetTypes:co,updateAssetType:ro,updateAssetTypes:uo,deleteAssetType:lo,deleteAssetTypes:oo}=Ks.actions,ho=t=>t.assetTypeReducer.instances,Ys=o.createSelector([ho],t=>Object.values(t)),mo=t=>s=>s.assetTypeReducer.instances[t],yo=T(o.createSelector([Ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),CP=T(o.createSelector([Ys,(t,s)=>s],(t,s)=>I(t.filter(e=>e.organization===s)))),po=Ks.reducer,me=M(t=>t.uuid),Ao={instances:{}},Zs=o.createSlice({name:"assetTypeStatuses",initialState:Ao,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Ao)),reducers:{initializeAssetTypeStatuses:me.initialize,addAssetTypeStatus:me.addOne,addAssetTypeStatuses:me.addMany,setAssetTypeStatus:me.setOne,setAssetTypeStatuses:me.setMany,updateAssetTypeStatus:me.updateOne,updateAssetTypeStatuses:me.updateMany,deleteAssetTypeStatus:me.deleteOne,deleteAssetTypeStatuses:me.deleteMany}}),{initializeAssetTypeStatuses:fo,addAssetTypeStatus:So,addAssetTypeStatuses:To,setAssetTypeStatus:Io,setAssetTypeStatuses:Oo,updateAssetTypeStatus:Po,updateAssetTypeStatuses:Fo,deleteAssetTypeStatus:go,deleteAssetTypeStatuses:bo}=Zs.actions,_o=t=>t.assetTypeStatusReducer.instances,Js=o.createSelector([_o],t=>I(Object.values(t).toSorted(sa))),Mo=t=>s=>s.assetTypeStatusReducer.instances[t],Ro=T(o.createSelector([Js,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),$P=T(o.createSelector([Js,(t,s)=>s],(t,s)=>I(t.filter(e=>e.asset_type===s)))),wo=Zs.reducer,Eo={accessToken:"",refreshToken:"",isLoggedIn:!1},Pt=o.createSlice({name:"auth",initialState:Eo,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Eo)),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||Pt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:UP,clearTokens:LP,setLoggedIn:vo}=Pt.actions,kP=t=>t.authReducer.accessToken,NP=t=>t.authReducer.isLoggedIn,Vo=Pt.reducer,ye=M(t=>t.uuid),zo={instances:{}},Xs=o.createSlice({name:"categories",initialState:zo,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,zo)),reducers:{initializeCategories:ye.initialize,addCategory:ye.addOne,addCategories:ye.addMany,setCategory:ye.setOne,setCategories:ye.setMany,updateCategory:ye.updateOne,updateCategories:ye.updateMany,deleteCategory:ye.deleteOne,deleteCategories:ye.deleteMany}}),{initializeCategories:Bo,addCategory:jo,addCategories:qo,setCategory:Do,setCategories:Co,updateCategory:$o,updateCategories:Uo,deleteCategory:Lo,deleteCategories:ko}=Xs.actions,No=t=>t.categoryReducer.instances,Qs=o.createSelector([No],t=>Object.values(t)),xs=t=>s=>s.categoryReducer.instances[t],Go=T(o.createSelector([Qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),GP=T(o.createSelector([Qs,(t,s)=>s],(t,s)=>I(t.filter(e=>e.project===s)))),Ho=Xs.reducer,pe=M(t=>t.uuid),Wo={instances:{}},ei=o.createSlice({name:"documentAttachments",initialState:Wo,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Wo)),reducers:{initializeDocumentAttachments:pe.initialize,addDocumentAttachment:pe.addOne,addDocumentAttachments:pe.addMany,setDocumentAttachment:pe.setOne,setDocumentAttachments:pe.setMany,updateDocumentAttachment:pe.updateOne,updateDocumentAttachments:pe.updateMany,deleteDocumentAttachment:pe.deleteOne,deleteDocumentAttachments:pe.deleteMany}}),{initializeDocumentAttachments:Ko,addDocumentAttachment:Yo,addDocumentAttachments:Zo,setDocumentAttachment:Jo,setDocumentAttachments:Xo,updateDocumentAttachment:Qo,updateDocumentAttachments:xo,deleteDocumentAttachment:eh,deleteDocumentAttachments:th}=ei.actions,sh=t=>t.documentAttachmentReducer.instances,ti=o.createSelector([sh],t=>Object.values(t)),ih=t=>s=>s.documentAttachmentReducer.instances[t],nh=T(o.createSelector([ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),HP=T(o.createSelector([ti,(t,s)=>s],(t,s)=>I(t.filter(({document:e})=>s===e)))),ah=ei.reducer,Ae=M(({uuid:t})=>t),ch={instances:{}},si=o.createSlice({name:"documents",initialState:ch,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>{Object.assign(s,ch)}),reducers:{initializeDocuments:Ae.initialize,addDocument:Ae.addOne,addDocuments:Ae.addMany,setDocument:Ae.setOne,setDocuments:Ae.setMany,updateDocument:Ae.updateOne,updateDocuments:Ae.updateMany,deleteDocument:Ae.deleteOne,deleteDocuments:Ae.deleteMany}}),{initializeDocuments:dh,addDocument:rh,addDocuments:uh,setDocument:lh,setDocuments:oh,updateDocument:hh,updateDocuments:mh,deleteDocument:yh,deleteDocuments:ph}=si.actions,Ah=si.reducer,ii=t=>t.documentsReducer.instances,Ft=o.createSelector([ii],t=>Object.values(t)),fh=t=>s=>s.documentsReducer.instances[t],Sh=T(o.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),WP=T(o.createSelector([Ft,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),KP=T(o.createSelector([Ft,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Th=T(o.createSelector([ii,(t,s)=>s],(t,s)=>{if(!t[s])return I([]);const a=aa(s,Object.values(t)).all().map(({model:c})=>c);return I(a)})),fe=M(t=>t.uuid),Ih={instances:{}},ni=o.createSlice({name:"emailDomains",initialState:Ih,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Ih)),reducers:{initializeEmailDomains:fe.initialize,addEmailDomain:fe.addOne,addEmailDomains:fe.addMany,setEmailDomain:fe.setOne,setEmailDomains:fe.setMany,updateEmailDomain:fe.updateOne,updateEmailDomains:fe.updateMany,deleteEmailDomain:fe.deleteOne,deleteEmailDomains:fe.deleteMany}}),{initializeEmailDomains:Oh,addEmailDomain:Ph,addEmailDomains:Fh,setEmailDomain:gh,setEmailDomains:bh,updateEmailDomain:_h,updateEmailDomains:Mh,deleteEmailDomain:Rh,deleteEmailDomains:wh}=ni.actions,Eh=t=>t.emailDomainsReducer.instances,ai=o.createSelector([Eh],t=>Object.values(t)),vh=t=>s=>s.emailDomainsReducer.instances[t],Vh=T(o.createSelector([ai,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),YP=T(o.createSelector([ai,(t,s)=>s],(t,s)=>I(t.filter(e=>e.organization===s)))),zh=ni.reducer,Bh={s3Urls:{}},jh=1e3*60*60,ZP=jh*24*7,ci=o.createSlice({name:"file",initialState:Bh,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Bh)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+ZP);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:qh}=ci.actions,Dh=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<jh))return e},Ch=ci.reducer,Se=M(t=>t.uuid),$h={instances:{}},di=o.createSlice({name:"formIdentifiers",initialState:$h,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,$h)),reducers:{initializeFormIdentifiers:Se.initialize,addFormIdentifier:Se.addOne,addFormIdentifiers:Se.addMany,setFormIdentifier:Se.setOne,setFormIdentifiers:Se.setMany,updateFormIdentifier:Se.updateOne,updateFormIdentifiers:Se.updateMany,deleteFormIdentifier:Se.deleteOne,deleteFormIdentifiers:Se.deleteMany}}),{initializeFormIdentifiers:Uh,addFormIdentifier:Lh,addFormIdentifiers:kh,setFormIdentifier:Nh,setFormIdentifiers:Gh,updateFormIdentifier:Hh,updateFormIdentifiers:Wh,deleteFormIdentifier:Kh,deleteFormIdentifiers:Yh}=di.actions,Zh=t=>t.formIdentifierReducer.instances,ri=o.createSelector([Zh],t=>Object.values(t)),Jh=t=>s=>s.formIdentifierReducer.instances[t],Xh=T(o.createSelector([ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),JP=T(o.createSelector([ri,(t,s)=>s],(t,s)=>I(t.filter(e=>e.form===s)))),Qh=di.reducer,Te=M(t=>t.uuid),xh={instances:{}},ui=o.createSlice({name:"formIdentifierValues",initialState:xh,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,xh)),reducers:{initializeFormIdentifierValues:Te.initialize,addFormIdentifierValue:Te.addOne,addFormIdentifierValues:Te.addMany,setFormIdentifierValue:Te.setOne,setFormIdentifierValues:Te.setMany,updateFormIdentifierValue:Te.updateOne,updateFormIdentifierValues:Te.updateMany,deleteFormIdentifierValue:Te.deleteOne,deleteFormIdentifierValues:Te.deleteMany}}),{initializeFormIdentifierValues:em,addFormIdentifierValue:tm,addFormIdentifierValues:sm,setFormIdentifierValue:im,setFormIdentifierValues:nm,updateFormIdentifierValue:am,updateFormIdentifierValues:cm,deleteFormIdentifierValue:dm,deleteFormIdentifierValues:rm}=ui.actions,um=t=>t.formIdentifierValueReducer.instances,gt=o.createSelector([um],t=>Object.values(t)),lm=t=>s=>s.formIdentifierValueReducer.instances[t],om=T(o.createSelector([gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),XP=T(o.createSelector([gt,(t,s)=>s],(t,s)=>I(t.filter(e=>e.form_submission===s)))),QP=T(o.createSelector([gt,(t,s)=>s],(t,s)=>I(t.filter(e=>e.form_identifier===s)))),hm=ui.reducer,Ie=M(t=>t.uuid),mm={instances:{}},li=o.createSlice({name:"formRevisionAttachments",initialState:mm,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,mm)),reducers:{initializeFormRevisionAttachments:Ie.initialize,addFormRevisionAttachment:Ie.addOne,addFormRevisionAttachments:Ie.addMany,setFormRevisionAttachment:Ie.setOne,setFormRevisionAttachments:Ie.setMany,updateFormRevisionAttachment:Ie.updateOne,updateFormRevisionAttachments:Ie.updateMany,deleteFormRevisionAttachment:Ie.deleteOne,deleteFormRevisionAttachments:Ie.deleteMany}}),{initializeFormRevisionAttachments:ym,addFormRevisionAttachment:pm,addFormRevisionAttachments:Am,setFormRevisionAttachment:fm,setFormRevisionAttachments:Sm,updateFormRevisionAttachment:Tm,updateFormRevisionAttachments:Im,deleteFormRevisionAttachment:Om,deleteFormRevisionAttachments:Pm}=li.actions,bt=t=>t.formRevisionAttachmentReducer.instances,Fm=o.createSelector([bt],t=>Object.values(t)),gm=T(o.createSelector([bt,(t,s)=>s],(t,s)=>t[s])),bm=T(o.createSelector([Fm,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),xP=T(o.createSelector([bt,(t,s)=>s],(t,s)=>I(Object.values(t).filter(e=>e.form_revision===s)))),_m=li.reducer,Oe=M(t=>t.uuid),Mm={instances:{}},oi=o.createSlice({name:"formRevisions",initialState:Mm,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Mm)),reducers:{initializeFormRevisions:Oe.initialize,addFormRevision:Oe.addOne,addFormRevisions:Oe.addMany,setFormRevision:Oe.setOne,setFormRevisions:Oe.setMany,updateFormRevision:Oe.updateOne,updateFormRevisions:Oe.updateMany,deleteFormRevision:Oe.deleteOne,deleteFormRevisions:Oe.deleteMany}}),{initializeFormRevisions:Rm,addFormRevision:hi,addFormRevisions:mi,setFormRevision:wm,setFormRevisions:Em,updateFormRevision:vm,updateFormRevisions:Vm,deleteFormRevision:yi,deleteFormRevisions:pi}=oi.actions,Ai=t=>t.formRevisionReducer.instances,_t=o.createSelector([Ai],t=>Object.values(t)),zm=t=>s=>s.formRevisionReducer.instances[t],Bm=T(o.createSelector([_t,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),eF=T(o.createSelector([_t,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),jm=T(o.createSelector([_t,(t,s)=>s],(t,s)=>I(t.filter(e=>e.form===s)))),qm=oi.reducer,Pe=M(t=>t.uuid),Dm={instances:{}},fi=o.createSlice({name:"forms",initialState:Dm,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Dm)),reducers:{initializeForms:Pe.initialize,addForm:Pe.addOne,addForms:Pe.addMany,setForm:Pe.setOne,setForms:Pe.setMany,updateForm:Pe.updateOne,updateForms:Pe.updateMany,deleteForm:Pe.deleteOne,deleteForms:Pe.deleteMany}}),{initializeForms:Cm,addForm:$m,addForms:Um,setForm:Lm,setForms:km,updateForm:Nm,updateForms:Gm,deleteForm:Hm,deleteForms:Wm}=fi.actions,Km=fi.reducer,Ym=t=>t.formReducer.instances,Si=o.createSelector([Ym],t=>Object.values(t)),Zm=t=>s=>s.formReducer.instances[t],Jm=T(o.createSelector([Si,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),tF=T(o.createSelector([Si,(t,s)=>s],(t,s)=>I(t.filter(e=>e.organization===s)))),Fe=M(t=>t.uuid),Xm={instances:{}},Ti=o.createSlice({name:"formSubmissionAttachments",initialState:Xm,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Xm)),reducers:{initializeFormSubmissionAttachments:Fe.initialize,addFormSubmissionAttachment:Fe.addOne,addFormSubmissionAttachments:Fe.addMany,setFormSubmissionAttachment:Fe.setOne,setFormSubmissionAttachments:Fe.setMany,updateFormSubmissionAttachment:Fe.updateOne,updateFormSubmissionAttachments:Fe.updateMany,deleteFormSubmissionAttachment:Fe.deleteOne,deleteFormSubmissionAttachments:Fe.deleteMany}}),{initializeFormSubmissionAttachments:Qm,addFormSubmissionAttachment:xm,addFormSubmissionAttachments:Ii,setFormSubmissionAttachment:ey,setFormSubmissionAttachments:ty,updateFormSubmissionAttachment:sy,updateFormSubmissionAttachments:iy,deleteFormSubmissionAttachment:ny,deleteFormSubmissionAttachments:Oi}=Ti.actions,Pi=t=>t.formSubmissionAttachmentReducer.instances,Fi=o.createSelector([Pi],t=>Object.values(t)),ay=T(o.createSelector([Pi,(t,s)=>s],(t,s)=>t[s])),gi=T(o.createSelector([Fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(n=>e.has(n.uuid)))})),cy=gi,dy=T(o.createSelector([Fi,(t,s)=>s],(t,s)=>I(t.filter(e=>e.form_submission===s)))),ry=Ti.reducer,ge=M(t=>t.uuid),uy={instances:{}},bi=o.createSlice({name:"formSubmissions",initialState:uy,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,uy)),reducers:{initializeFormSubmissions:ge.initialize,setFormSubmission:ge.setOne,setFormSubmissions:ge.setMany,addFormSubmission:ge.addOne,addFormSubmissions:ge.addMany,updateFormSubmission:ge.updateOne,updateFormSubmissions:ge.updateMany,deleteFormSubmission:ge.deleteOne,deleteFormSubmissions:ge.deleteMany}}),{initializeFormSubmissions:ly,setFormSubmission:oy,setFormSubmissions:hy,addFormSubmission:my,addFormSubmissions:_i,updateFormSubmission:yy,updateFormSubmissions:py,deleteFormSubmission:Ay,deleteFormSubmissions:Mi}=bi.actions,Ri=t=>t.formSubmissionReducer.instances,fy=o.createSelector([Ri],t=>Object.values(t)),Sy=t=>s=>s.formSubmissionReducer.instances[t],Ty=T(o.createSelector([fy,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),Iy=T(o.createSelector([Ri,Ai,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),Oy=bi.reducer,be=M(t=>t.uuid),Py={instances:{}},wi=o.createSlice({name:"geoImages",initialState:Py,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,Py)),reducers:{initializeGeoImages:be.initialize,setGeoImage:be.setOne,setGeoImages:be.setMany,addGeoImage:be.addOne,addGeoImages:be.addMany,updateGeoImage:be.updateOne,updateGeoImages:be.updateMany,deleteGeoImage:be.deleteOne,deleteGeoImages:be.deleteMany}}),{initializeGeoImages:Fy,setGeoImage:gy,setGeoImages:by,addGeoImage:_y,addGeoImages:My,updateGeoImage:Ry,updateGeoImages:wy,deleteGeoImage:Ey,deleteGeoImages:vy}=wi.actions,Vy=t=>t.geoImageReducer.instances,Ei=o.createSelector([Vy],t=>Object.values(t)),zy=t=>s=>s.geoImageReducer.instances[t],By=T(o.createSelector([Ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),sF=T(o.createSelector([Ei,(t,s)=>s],(t,s)=>I(t.filter(e=>e.project===s)))),jy=wi.reducer,_e=M(t=>t.uuid),qy={instances:{}},vi=o.createSlice({name:"issueAssociations",initialState:qy,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,qy)),reducers:{initializeIssueAssociations:_e.initialize,addIssueAssociation:_e.addOne,addIssueAssociations:_e.addMany,setIssueAssociation:_e.setOne,setIssueAssociations:_e.setMany,updateIssueAssociation:_e.updateOne,updateIssueAssociations:_e.updateMany,deleteIssueAssociation:_e.deleteOne,deleteIssueAssociations:_e.deleteMany}}),{initializeIssueAssociations:Dy,setIssueAssociations:Cy,setIssueAssociation:$y,updateIssueAssociation:Uy,updateIssueAssociations:Ly,addIssueAssociation:ky,addIssueAssociations:Mt,deleteIssueAssociation:Ny,deleteIssueAssociations:Rt}=vi.actions,lt=t=>t.issueAssociationReducer.instances,Gy=o.createSelector([lt],t=>Object.values(t)),Hy=t=>s=>s.issueAssociationReducer.instances[t],Wy=T(o.createSelector([Gy,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),Ky=T(o.createSelector([lt,(t,s)=>s],(t,s)=>I(Object.values(t).filter(e=>e.associated_issue===s)))),Yy=T(o.createSelector([lt,(t,s)=>s],(t,s)=>I(Object.values(t).filter(e=>e.issue===s)))),Zy=T(o.createSelector([lt,(t,s)=>s],(t,s)=>I(Object.values(t).filter(e=>e.asset===s)))),Jy=vi.reducer,Me=M(t=>t.uuid),Xy={instances:{}},Vi=o.createSlice({name:"issueAttachments",initialState:Xy,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,Xy)),reducers:{initializeIssueAttachments:Me.initialize,addIssueAttachment:Me.addOne,addIssueAttachments:Me.addMany,setIssueAttachment:Me.setOne,setIssueAttachments:Me.setMany,updateIssueAttachment:Me.updateOne,updateIssueAttachments:Me.updateMany,deleteIssueAttachment:Me.deleteOne,deleteIssueAttachments:Me.deleteMany}}),{initializeIssueAttachments:Qy,addIssueAttachment:xy,addIssueAttachments:zi,setIssueAttachment:ep,setIssueAttachments:tp,updateIssueAttachment:sp,updateIssueAttachments:ip,deleteIssueAttachment:np,deleteIssueAttachments:Bi}=Vi.actions,ap=t=>t.issueAttachmentReducer.instances,ji=o.createSelector([ap],t=>Object.values(t)),cp=T(o.createSelector([ji,(t,s)=>s],(t,s)=>I(t.filter(({issue:e})=>s===e)))),dp=t=>s=>s.issueAttachmentReducer.instances[t],rp=T(o.createSelector([ji,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),up=Vi.reducer,Re=M(t=>t.uuid),lp={instances:{}},qi=o.createSlice({name:"issueCommentAttachments",initialState:lp,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,lp)),reducers:{initializeIssueCommentAttachments:Re.initialize,addIssueCommentAttachment:Re.addOne,addIssueCommentAttachments:Re.addMany,setIssueCommentAttachment:Re.setOne,setIssueCommentAttachments:Re.setMany,updateIssueCommentAttachment:Re.updateOne,updateIssueCommentAttachments:Re.updateMany,deleteIssueCommentAttachment:Re.deleteOne,deleteIssueCommentAttachments:Re.deleteMany}}),{initializeIssueCommentAttachments:op,addIssueCommentAttachment:hp,addIssueCommentAttachments:mp,setIssueCommentAttachment:yp,setIssueCommentAttachments:pp,updateIssueCommentAttachment:Ap,updateIssueCommentAttachments:fp,deleteIssueCommentAttachment:Sp,deleteIssueCommentAttachments:Tp}=qi.actions,Ip=t=>t.issueCommentAttachmentReducer.instances,Di=o.createSelector([Ip],t=>Object.values(t)),Op=t=>s=>s.issueCommentAttachmentReducer.instances[t],Pp=T(o.createSelector([Di,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),iF=T(o.createSelector([Di,(t,s)=>s],(t,s)=>I(t.filter(({issue_comment:e})=>s===e)))),Fp=qi.reducer,we=M(t=>t.uuid),gp={instances:{}},Ci=o.createSlice({name:"issueComments",initialState:gp,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,gp)),reducers:{initializeIssueComments:we.initialize,addIssueComment:we.addOne,addIssueComments:we.addMany,setIssueComment:we.setOne,setIssueComments:we.setMany,updateIssueComment:we.updateOne,updateIssueComments:we.updateMany,deleteIssueComment:we.deleteOne,deleteIssueComments:we.deleteMany}}),{initializeIssueComments:bp,addIssueComment:_p,addIssueComments:Mp,setIssueComment:Rp,setIssueComments:wp,updateIssueComment:Ep,updateIssueComments:vp,deleteIssueComment:Vp,deleteIssueComments:zp}=Ci.actions,$i=t=>t.issueCommentReducer.instances,Bp=t=>s=>s.issueCommentReducer.instances[t],jp=T(o.createSelector([$i,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(Object.values(t).filter(({uuid:n})=>e.has(n)))})),nF=T(o.createSelector([$i,(t,s)=>s],(t,s)=>I(Object.values(t).filter(e=>e.issue===s)))),qp=Ci.reducer,Ee=M(t=>t.uuid),Dp={instances:{}},Ui=o.createSlice({name:"issues",initialState:Dp,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,Dp)),reducers:{initializeIssues:Ee.initialize,addIssue:Ee.addOne,addIssues:Ee.addMany,setIssue:Ee.setOne,setIssues:Ee.setMany,updateIssue:Ee.updateOne,updateIssues:Ee.updateMany,deleteIssue:Ee.deleteOne,deleteIssues:Ee.deleteMany}}),{initializeIssues:Cp,addIssue:$p,addIssues:Li,setIssue:Up,setIssues:Lp,updateIssue:kp,updateIssues:Np,deleteIssue:Gp,deleteIssues:ki}=Ui.actions,Hp=t=>t.issueReducer.instances,wt=o.createSelector([Hp],t=>Object.values(t)),Wp=t=>s=>s.issueReducer.instances[t],Kp=T(o.createSelector([wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),aF=T(o.createSelector([wt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Yp=T(o.createSelector([wt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),Zp=Ui.reducer,ve=M(t=>t.uuid),Jp={instances:{}},Ni=o.createSlice({name:"issueTypeAttachments",initialState:Jp,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Jp)),reducers:{initializeIssueTypeAttachments:ve.initialize,addIssueTypeAttachment:ve.addOne,addIssueTypeAttachments:ve.addMany,setIssueTypeAttachment:ve.setOne,setIssueTypeAttachments:ve.setMany,updateIssueTypeAttachment:ve.updateOne,updateIssueTypeAttachments:ve.updateMany,deleteIssueTypeAttachment:ve.deleteOne,deleteIssueTypeAttachments:ve.deleteMany}}),{initializeIssueTypeAttachments:Xp,addIssueTypeAttachment:Qp,addIssueTypeAttachments:xp,setIssueTypeAttachment:eA,setIssueTypeAttachments:tA,updateIssueTypeAttachment:sA,updateIssueTypeAttachments:iA,deleteIssueTypeAttachment:nA,deleteIssueTypeAttachments:aA}=Ni.actions,cA=t=>t.issueTypeAttachmentReducer.instances,Gi=o.createSelector([cA],t=>Object.values(t)),dA=t=>s=>s.issueTypeAttachmentReducer.instances[t],rA=T(o.createSelector([Gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),cF=T(o.createSelector([Gi,(t,s)=>s],(t,s)=>I(t.filter(({issue_type:e})=>s===e)))),uA=Ni.reducer,Ve=M(t=>t.uuid),lA={instances:{}},Hi=o.createSlice({name:"issueTypeFieldsAttachments",initialState:lA,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,lA)),reducers:{initializeIssueTypeFieldsAttachments:Ve.initialize,addIssueTypeFieldsAttachment:Ve.addOne,addIssueTypeFieldsAttachments:Ve.addMany,setIssueTypeFieldsAttachment:Ve.setOne,setIssueTypeFieldsAttachments:Ve.setMany,updateIssueTypeFieldsAttachment:Ve.updateOne,updateIssueTypeFieldsAttachments:Ve.updateMany,deleteIssueTypeFieldsAttachment:Ve.deleteOne,deleteIssueTypeFieldsAttachments:Ve.deleteMany}}),{initializeIssueTypeFieldsAttachments:oA,addIssueTypeFieldsAttachment:hA,addIssueTypeFieldsAttachments:mA,setIssueTypeFieldsAttachment:yA,setIssueTypeFieldsAttachments:pA,updateIssueTypeFieldsAttachment:AA,updateIssueTypeFieldsAttachments:fA,deleteIssueTypeFieldsAttachment:SA,deleteIssueTypeFieldsAttachments:TA}=Hi.actions,IA=t=>t.issueTypeFieldsAttachmentReducer.instances,Wi=o.createSelector([IA],t=>Object.values(t)),dF=T(o.createSelector([Wi,(t,s)=>s],(t,s)=>I(t.filter(e=>e.fields_revision===s)))),OA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],PA=T(o.createSelector([Wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),FA=Hi.reducer,ze=M(t=>t.uuid),gA={instances:{}},Ki=o.createSlice({name:"issueTypeFieldValues",initialState:gA,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,gA)),reducers:{initializeIssueTypeFieldValues:ze.initialize,addIssueTypeFieldValues:ze.addOne,addIssueTypeFieldValuesMany:ze.addMany,setIssueTypeFieldValues:ze.setOne,setIssueTypeFieldValuesMany:ze.setMany,updateIssueTypeFieldValues:ze.updateOne,updateIssueTypeFieldValuesMany:ze.updateMany,deleteIssueTypeFieldValues:ze.deleteOne,deleteIssueTypeFieldValuesMany:ze.deleteMany}}),{initializeIssueTypeFieldValues:bA,addIssueTypeFieldValues:_A,addIssueTypeFieldValuesMany:MA,setIssueTypeFieldValues:RA,setIssueTypeFieldValuesMany:wA,updateIssueTypeFieldValues:EA,updateIssueTypeFieldValuesMany:vA,deleteIssueTypeFieldValues:VA,deleteIssueTypeFieldValuesMany:zA}=Ki.actions,BA=t=>t.issueTypeFieldValuesReducer.instances,Et=o.createSelector([BA],t=>Object.values(t)),rF=T(o.createSelector([Et,(t,s)=>s],(t,s)=>I(t.filter(e=>e.issue===s)))),jA=t=>s=>s.issueTypeFieldValuesReducer.instances[t],qA=T(o.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),DA=Ki.reducer,Be=M(t=>t.uuid),CA={instances:{}},Yi=o.createSlice({name:"issueTypeFields",initialState:CA,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,CA)),reducers:{initializeIssueTypeFields:Be.initialize,addIssueTypeFields:Be.addOne,addIssueTypeFieldsMany:Be.addMany,setIssueTypeFields:Be.setOne,setIssueTypeFieldsMany:Be.setMany,updateIssueTypeFields:Be.updateOne,updateIssueTypeFieldsMany:Be.updateMany,deleteIssueTypeFields:Be.deleteOne,deleteIssueTypeFieldsMany:Be.deleteMany}}),{initializeIssueTypeFields:$A,addIssueTypeFields:UA,addIssueTypeFieldsMany:LA,setIssueTypeFields:kA,setIssueTypeFieldsMany:NA,updateIssueTypeFields:GA,updateIssueTypeFieldsMany:HA,deleteIssueTypeFields:WA,deleteIssueTypeFieldsMany:KA}=Yi.actions,YA=t=>t.issueTypeFieldsReducer.instances,ot=o.createSelector([YA],t=>Object.values(t)),uF=T(o.createSelector([ot,(t,s)=>s],(t,s)=>I(t.filter(e=>e.issue_type===s)))),lF=T(o.createSelector([ot,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),oF=T(o.createSelector([ot,Et,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return I(s.filter(a=>n.has(a.fields_revision)))})),ZA=t=>s=>s.issueTypeFieldsReducer.instances[t],JA=T(o.createSelector([ot,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),XA=Yi.reducer,je=M(t=>t.uuid),QA={instances:{}},Zi=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:QA,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,QA)),reducers:{initializeIssueTypeFieldValuesAttachments:je.initialize,addIssueTypeFieldValuesAttachment:je.addOne,addIssueTypeFieldValuesAttachments:je.addMany,setIssueTypeFieldValuesAttachment:je.setOne,setIssueTypeFieldValuesAttachments:je.setMany,updateIssueTypeFieldValuesAttachment:je.updateOne,updateIssueTypeFieldValuesAttachments:je.updateMany,deleteIssueTypeFieldValuesAttachment:je.deleteOne,deleteIssueTypeFieldValuesAttachments:je.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:xA,addIssueTypeFieldValuesAttachment:ef,addIssueTypeFieldValuesAttachments:Ji,setIssueTypeFieldValuesAttachment:tf,setIssueTypeFieldValuesAttachments:sf,updateIssueTypeFieldValuesAttachment:nf,updateIssueTypeFieldValuesAttachments:af,deleteIssueTypeFieldValuesAttachment:cf,deleteIssueTypeFieldValuesAttachments:Xi}=Zi.actions,df=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Qi=o.createSelector([df],t=>Object.values(t)),rf=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],uf=T(o.createSelector([Qi,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),lf=T(o.createSelector([Qi,(t,s)=>s],(t,s)=>I(t.filter(e=>e.field_values===s)))),of=Zi.reducer,qe=M(t=>t.uuid),hf={instances:{}},xi=o.createSlice({name:"issueTypeIdentifiers",initialState:hf,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,hf)),reducers:{initializeIssueTypeIdentifiers:qe.initialize,addIssueTypeIdentifier:qe.addOne,addIssueTypeIdentifiers:qe.addMany,setIssueTypeIdentifier:qe.setOne,setIssueTypeIdentifiers:qe.setMany,updateIssueTypeIdentifier:qe.updateOne,updateIssueTypeIdentifiers:qe.updateMany,deleteIssueTypeIdentifier:qe.deleteOne,deleteIssueTypeIdentifiers:qe.deleteMany}}),{initializeIssueTypeIdentifiers:mf,addIssueTypeIdentifier:yf,addIssueTypeIdentifiers:pf,setIssueTypeIdentifier:Af,setIssueTypeIdentifiers:ff,updateIssueTypeIdentifier:Sf,updateIssueTypeIdentifiers:Tf,deleteIssueTypeIdentifier:If,deleteIssueTypeIdentifiers:Of}=xi.actions,Pf=t=>t.issueTypeIdentifierReducer.instances,en=o.createSelector([Pf],t=>Object.values(t)),Ff=t=>s=>s.issueTypeIdentifierReducer.instances[t],gf=T(o.createSelector([en,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),hF=T(o.createSelector([en,(t,s)=>s],(t,s)=>I(t.filter(e=>e.issue_type===s)))),bf=xi.reducer,De=M(t=>t.uuid),_f={instances:{}},tn=o.createSlice({name:"issueTypeIdentifierValues",initialState:_f,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,_f)),reducers:{initializeIssueTypeIdentifierValues:De.initialize,addIssueTypeIdentifierValue:De.addOne,addIssueTypeIdentifierValues:De.addMany,setIssueTypeIdentifierValue:De.setOne,setIssueTypeIdentifierValues:De.setMany,updateIssueTypeIdentifierValue:De.updateOne,updateIssueTypeIdentifierValues:De.updateMany,deleteIssueTypeIdentifierValue:De.deleteOne,deleteIssueTypeIdentifierValues:De.deleteMany}}),{initializeIssueTypeIdentifierValues:Mf,addIssueTypeIdentifierValue:Rf,addIssueTypeIdentifierValues:wf,setIssueTypeIdentifierValue:Ef,setIssueTypeIdentifierValues:vf,updateIssueTypeIdentifierValue:Vf,updateIssueTypeIdentifierValues:zf,deleteIssueTypeIdentifierValue:Bf,deleteIssueTypeIdentifierValues:jf}=tn.actions,qf=t=>t.issueTypeIdentifierValueReducer.instances,vt=o.createSelector([qf],t=>Object.values(t)),Df=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],Cf=T(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),mF=T(o.createSelector([vt,(t,s)=>s],(t,s)=>I(t.filter(e=>e.issue===s)))),yF=T(o.createSelector([vt,(t,s)=>s],(t,s)=>I(t.filter(e=>e.issue_type_identifier===s)))),$f=tn.reducer,Ce=M(t=>t.uuid),Uf={instances:{}},sn=o.createSlice({name:"issueTypes",initialState:Uf,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,Uf)),reducers:{initializeIssueTypes:Ce.initialize,addIssueType:Ce.addOne,addIssueTypes:Ce.addMany,setIssueType:Ce.setOne,setIssueTypes:Ce.setMany,updateIssueType:Ce.updateOne,updateIssueTypes:Ce.updateMany,deleteIssueType:Ce.deleteOne,deleteIssueTypes:Ce.deleteMany}}),{initializeIssueTypes:Lf,addIssueType:kf,addIssueTypes:Nf,setIssueType:Gf,setIssueTypes:Hf,updateIssueType:Wf,updateIssueTypes:Kf,deleteIssueType:Yf,deleteIssueTypes:Zf}=sn.actions,Jf=t=>t.issueTypeReducer.instances,nn=o.createSelector(Jf,t=>Object.values(t)),Xf=t=>s=>s.issueTypeReducer.instances[t],Qf=T(o.createSelector([nn,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),pF=T(o.createSelector([nn,(t,s)=>s],(t,s)=>I(t.filter(e=>e.organization===s)))),xf=sn.reducer,$e=M(t=>t.uuid),eS={instances:{}},an=o.createSlice({name:"issueTypeStatuses",initialState:eS,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,eS)),reducers:{initializeIssueTypeStatuses:$e.initialize,addIssueTypeStatus:$e.addOne,addIssueTypeStatuses:$e.addMany,setIssueTypeStatus:$e.setOne,setIssueTypeStatuses:$e.setMany,updateIssueTypeStatus:$e.updateOne,updateIssueTypeStatuses:$e.updateMany,deleteIssueTypeStatus:$e.deleteOne,deleteIssueTypeStatuses:$e.deleteMany}}),{initializeIssueTypeStatuses:tS,addIssueTypeStatus:sS,addIssueTypeStatuses:iS,setIssueTypeStatus:nS,setIssueTypeStatuses:aS,updateIssueTypeStatus:cS,updateIssueTypeStatuses:dS,deleteIssueTypeStatus:rS,deleteIssueTypeStatuses:uS}=an.actions,lS=t=>t.issueTypeStatusReducer.instances,cn=o.createSelector([lS],t=>I(Object.values(t).toSorted(ia))),dn=t=>s=>s.issueTypeStatusReducer.instances[t],oS=T(o.createSelector([cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),AF=T(o.createSelector([cn,(t,s)=>s],(t,s)=>I(t.filter(e=>e.issue_type===s)))),hS=an.reducer,Ue=M(t=>t.uuid),mS={instances:{}},rn=o.createSlice({name:"issueUpdates",initialState:mS,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,mS)),reducers:{initializeIssueUpdates:Ue.initialize,addIssueUpdate:Ue.addOne,addIssueUpdates:Ue.addMany,setIssueUpdate:Ue.setOne,setIssueUpdates:Ue.setMany,updateIssueUpdate:Ue.updateOne,updateIssueUpdates:Ue.updateMany,deleteIssueUpdate:Ue.deleteOne,deleteIssueUpdates:Ue.deleteMany}}),{initializeIssueUpdates:yS,addIssueUpdate:un,addIssueUpdates:ln,setIssueUpdate:pS,setIssueUpdates:AS,updateIssueUpdate:fS,updateIssueUpdates:SS,deleteIssueUpdate:on,deleteIssueUpdates:hn}=rn.actions,mn=t=>t.issueUpdateReducer.instances,yn=o.createSelector([mn],t=>Object.values(t)),TS=T(o.createSelector([mn,(t,s)=>s],(t,s)=>t[s])),IS=T(o.createSelector([yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),OS=T(o.createSelector([yn,(t,s)=>s],(t,s)=>I(t.filter(e=>e.issue===s)))),PS=rn.reducer,Le=M(t=>t.id),FS={instances:{},currentUser:null},pn=o.createSlice({name:"users",initialState:FS,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,FS)),reducers:{initializeUsers:Le.initialize,setUsers:Le.setMany,setUser:Le.setOne,addUsers:Le.addMany,addUser:Le.addOne,updateUsers:Le.updateMany,updateUser:Le.updateOne,deleteUser:Le.deleteOne,deleteUsers:Le.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setProfilePicture:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile.file=s.payload.file??null,t.currentUser.profile.file_sha1=s.payload.file_sha1??null;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile.file=s.payload.file??null,e.profile.file_sha1=s.payload.file_sha1??null}}}),{initializeUsers:gS,setUsers:bS,setUser:_S,addUsers:MS,addUser:An,updateUsers:RS,updateUser:wS,deleteUser:fn,deleteUsers:ES,setCurrentUser:fF,setProfilePicture:SF}=pn.actions,vS=pn.reducer,VS=t=>t.userReducer.currentUser,Sn=t=>t.userReducer.instances,Vt=o.createSelector([Sn],t=>Object.values(t)),zt=t=>s=>s.userReducer.instances[t],zS=T(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({id:n})=>e.has(n)))})),ke=M(t=>t.uuid),BS={instances:{}},Tn=o.createSlice({name:"organizationAccess",initialState:BS,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,BS)),reducers:{initializeOrganizationAccesses:ke.initialize,addOrganizationAccess:ke.addOne,addOrganizationAccesses:ke.addMany,setOrganizationAccess:ke.setOne,setOrganizationAccesses:ke.setMany,updateOrganizationAccess:ke.updateOne,updateOrganizationAccesses:ke.updateMany,deleteOrganizationAccess:ke.deleteOne,deleteOrganizationAccesses:ke.deleteMany}}),{initializeOrganizationAccesses:jS,addOrganizationAccess:qS,addOrganizationAccesses:DS,setOrganizationAccess:CS,setOrganizationAccesses:$S,updateOrganizationAccess:US,updateOrganizationAccesses:LS,deleteOrganizationAccess:kS,deleteOrganizationAccesses:NS}=Tn.actions,GS=Tn.reducer,Bt=t=>t.organizationAccessReducer.instances,HS=t=>s=>s.organizationAccessReducer.instances[t],WS=T(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(Object.values(t).filter(({uuid:n})=>e.has(n)))})),TF=o.createSelector([VS,Bt],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),KS=o.createSelector([Bt],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return yt(s)}),IF=T(o.createSelector([Sn,KS,(t,s)=>s],(t,s,e)=>I(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ne=M(t=>t.uuid),YS={instances:{}},In=o.createSlice({name:"organizations",initialState:YS,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,YS)),reducers:{initializeOrganizations:Ne.initialize,setOrganizations:Ne.setMany,setOrganization:Ne.setOne,addOrganizations:Ne.addMany,addOrganization:Ne.addOne,updateOrganizations:Ne.updateMany,updateOrganization:Ne.updateOne,deleteOrganization:Ne.deleteOne,deleteOrganizations:Ne.deleteMany}}),{initializeOrganizations:ZS,setOrganizations:JS,setOrganization:XS,addOrganizations:QS,addOrganization:xS,updateOrganizations:eT,updateOrganization:tT,deleteOrganization:sT,deleteOrganizations:iT}=In.actions,nT=t=>t.organizationReducer.instances,aT=o.createSelector([nT],t=>Object.values(t)),cT=t=>s=>s.organizationReducer.instances[t],dT=T(o.createSelector([aT,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),rT=In.reducer,uT=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:tt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},lT={deletedRequests:[],latestRetryTime:0},On=o.createSlice({name:"outbox",initialState:lT,extraReducers:t=>t.addCase(b,s=>Object.assign(s,lT)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t);const{BASE_URL:s,serviceName:e,...n}=t;return uT(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}}}),OF=t=>t.outboxReducer.deletedRequests,PF=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:oT,markForDeletion:FF,markAsDeleted:hT,_setLatestRetryTime:mT}=On.actions,yT=On.reducer,Ge=M(t=>t.uuid),pT={instances:{}},Pn=o.createSlice({name:"projectAccess",initialState:pT,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,pT)),reducers:{initializeProjectAccesses:Ge.initialize,addProjectAccess:Ge.addOne,addProjectAccesses:Ge.addMany,setProjectAccess:Ge.setOne,setProjectAccesses:Ge.setMany,updateProjectAccess:Ge.updateOne,updateProjectAccesses:Ge.updateMany,deleteProjectAccess:Ge.deleteOne,deleteProjectAccesses:Ge.deleteMany}}),{initializeProjectAccesses:AT,addProjectAccess:fT,addProjectAccesses:ST,setProjectAccess:TT,setProjectAccesses:IT,updateProjectAccess:OT,updateProjectAccesses:PT,deleteProjectAccess:FT,deleteProjectAccesses:gT}=Pn.actions,bT=Pn.reducer,Fn=t=>t.projectAccessReducer.instances,ht=o.createSelector(Fn,t=>Object.values(t)),_T=t=>s=>s.projectAccessReducer.instances[t],MT=T(o.createSelector([ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),gF=T(o.createSelector([Fn,(t,s)=>s],(t,s)=>I(Object.values(t).filter(e=>e.project===s)))),bF=T(o.createSelector([ht,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),_F=T(o.createSelector([Vt,ht,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return I(t.filter(a=>n.has(a.id)))})),He=M(t=>t.uuid),RT={instances:{}},gn=o.createSlice({name:"projectAttachments",initialState:RT,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,RT)),reducers:{initializeProjectAttachments:He.initialize,addProjectAttachment:He.addOne,addProjectAttachments:He.addMany,setProjectAttachment:He.setOne,setProjectAttachments:He.setMany,updateProjectAttachment:He.updateOne,updateProjectAttachments:He.updateMany,deleteProjectAttachment:He.deleteOne,deleteProjectAttachments:He.deleteMany}}),{initializeProjectAttachments:wT,addProjectAttachment:ET,addProjectAttachments:vT,setProjectAttachment:VT,setProjectAttachments:zT,updateProjectAttachment:BT,updateProjectAttachments:jT,deleteProjectAttachment:qT,deleteProjectAttachments:DT}=gn.actions,CT=t=>t.projectAttachmentReducer.instances,bn=o.createSelector([CT],t=>Object.values(t)),$T=t=>s=>s.projectAttachmentReducer.instances[t],UT=T(o.createSelector([bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),MF=T(o.createSelector([bn,(t,s)=>s],(t,s)=>I(t.filter(({project:e})=>s===e)))),LT=gn.reducer,We=M(t=>t.uuid),kT={instances:{},activeProjectFileId:null,isImportingProjectFile:!1},_n=o.createSlice({name:"projectFiles",initialState:kT,extraReducers:t=>t.addMatcher(o.isAnyOf(b,j,R),s=>Object.assign(s,kT)),reducers:{initializeProjectFiles:We.initialize,setProjectFile:We.setOne,setProjectFiles:We.setMany,addProjectFile:We.addOne,addProjectFiles:We.addMany,updateProjectFile:We.updateOne,updateProjectFiles:We.updateMany,deleteProjectFile:We.deleteOne,deleteProjectFiles:We.deleteMany,setIsImportingProjectFile:(t,s)=>{t.isImportingProjectFile=s.payload},saveActiveProjectFileBounds:(t,s)=>{const e=t.activeProjectFileId;if(!e)throw new Error("Tried to save bounds for active project file, but no active project file was set.");if(!t.instances[e])throw new Error(`Tried to save bounds for active project file, but project file with ID ${e}
|
|
2
|
+
doesn't exist.`);t.instances[e].bounds=s.payload},setActiveProjectFileId:(t,s)=>{t.activeProjectFileId=s.payload}}}),{initializeProjectFiles:NT,setProjectFile:GT,setProjectFiles:HT,addProjectFile:WT,addProjectFiles:KT,updateProjectFile:YT,updateProjectFiles:ZT,deleteProjectFile:JT,deleteProjectFiles:XT,setIsImportingProjectFile:QT,setActiveProjectFileId:xT,saveActiveProjectFileBounds:eI}=_n.actions,tI=t=>t.projectFileReducer.instances,sI=o.createSelector([tI],t=>I(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),iI=t=>s=>s.projectFileReducer.instances[t],nI=T(o.createSelector([sI,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),RF=t=>t.projectFileReducer.activeProjectFileId,wF=t=>t.projectFileReducer.isImportingProjectFile,aI=_n.reducer,Ke=M(t=>t.uuid),cI={instances:{}},Mn=o.createSlice({name:"projects",initialState:cI,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,cI)),reducers:{initializeProjects:Ke.initialize,setProjects:Ke.setMany,setProject:Ke.setOne,addProjects:Ke.addMany,addProject:Ke.addOne,updateProjects:Ke.updateMany,updateProject:Ke.updateOne,deleteProject:Ke.deleteOne,deleteProjects:Ke.deleteMany}}),{initializeProjects:dI,setProjects:rI,setProject:uI,addProjects:lI,addProject:oI,updateProjects:hI,updateProject:mI,deleteProject:yI,deleteProjects:pI}=Mn.actions,AI=Mn.reducer,fI=t=>t.projectReducer.instances,jt=o.createSelector([fI],t=>I(Object.values(t))),SI=t=>s=>s.projectReducer.instances[t],TI=T(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),EF=T(o.createSelector([jt,ht,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return I(t.filter(a=>n.has(a.uuid)))})),vF=T(o.createSelector([jt,(t,s)=>s],(t,s)=>I(t.filter(e=>e.organization===s)))),VF={isRehydrated:!1},Rn=o.createSlice({name:"rehydrated",initialState:VF,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:zF}=Rn.actions,BF=t=>t.rehydratedReducer.isRehydrated,II=Rn.reducer,Ye=M(t=>t.uuid),OI={instances:{}},wn=o.createSlice({name:"teamMemberships",initialState:OI,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,OI)),reducers:{initializeTeamMemberships:Ye.initialize,addTeamMembership:Ye.addOne,addTeamMemberships:Ye.addMany,setTeamMembership:Ye.setOne,setTeamMemberships:Ye.setMany,updateTeamMembership:Ye.updateOne,updateTeamMemberships:Ye.updateMany,deleteTeamMembership:Ye.deleteOne,deleteTeamMemberships:Ye.deleteMany}}),{initializeTeamMemberships:PI,addTeamMembership:FI,addTeamMemberships:gI,setTeamMembership:bI,setTeamMemberships:_I,updateTeamMembership:MI,updateTeamMemberships:RI,deleteTeamMembership:wI,deleteTeamMemberships:EI}=wn.actions,vI=wn.reducer,VI=t=>t.teamMembershipReducer.instances,qt=o.createSelector([VI],t=>Object.values(t)),zI=t=>s=>s.teamMembershipReducer.instances[t],BI=T(o.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),jF=T(o.createSelector([qt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),qF=T(o.createSelector([Vt,qt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return I(t.filter(a=>n.has(a.id)))})),Ze=M(t=>t.uuid),jI={instances:{}},En=o.createSlice({name:"teams",initialState:jI,extraReducers:t=>t.addMatcher(o.isAnyOf(b,R),s=>Object.assign(s,jI)),reducers:{initializeTeams:Ze.initialize,addTeam:Ze.addOne,addTeams:Ze.addMany,setTeam:Ze.setOne,setTeams:Ze.setMany,updateTeam:Ze.updateOne,updateTeams:Ze.updateMany,deleteTeam:Ze.deleteOne,deleteTeams:Ze.deleteMany}}),{initializeTeams:qI,addTeam:DI,addTeams:CI,setTeam:$I,setTeams:UI,updateTeam:LI,updateTeams:kI,deleteTeam:NI,deleteTeams:GI}=En.actions,HI=t=>t.teamReducer.instances,vn=o.createSelector([HI],t=>Object.values(t)),WI=t=>s=>s.teamReducer.instances[t],KI=T(o.createSelector([vn,(t,s)=>s],(t,s)=>{const e=new Set(s);return I(t.filter(({uuid:n})=>e.has(n)))})),DF=T(o.createSelector([vn,(t,s)=>s],(t,s)=>I(t.filter(e=>e.organization===s)))),YI=En.reducer,CF={version:0},ZI=o.createSlice({name:"versioning",initialState:CF,reducers:{}}),JI=ZI.reducer,Vn={outboxReducer:yT,fileReducer:Ch,authReducer:Vo},$F=o.combineReducers(Vn),XI={...Vn,[dt]:JI,categoryReducer:Ho,assetReducer:Cr,assetAttachmentReducer:ga,assetStageCompletionReducer:Zr,assetStageReducer:lu,assetTypeReducer:po,assetTypeAttachmentReducer:bu,issueReducer:Zp,issueAttachmentReducer:up,issueTypeReducer:xf,issueTypeAttachmentReducer:uA,organizationReducer:rT,projectReducer:AI,projectAttachmentReducer:LT,projectAccessReducer:bT,organizationAccessReducer:GS,projectFileReducer:aI,rehydratedReducer:II,formReducer:Km,formRevisionReducer:qm,formRevisionAttachmentReducer:_m,formSubmissionAttachmentReducer:ry,formSubmissionReducer:Oy,formIdentifierReducer:Qh,formIdentifierValueReducer:hm,userReducer:vS,emailDomainsReducer:zh,documentsReducer:Ah,documentAttachmentReducer:ah,teamReducer:YI,agentsReducer:oa,issueCommentReducer:qp,issueCommentAttachmentReducer:Fp,issueUpdateReducer:PS,geoImageReducer:jy,issueAssociationReducer:Jy,issueTypeFieldsReducer:XA,issueTypeFieldValuesReducer:DA,issueTypeFieldsAttachmentReducer:FA,issueTypeFieldValuesAttachmentReducer:of,issueTypeIdentifierReducer:bf,issueTypeIdentifierValueReducer:$f,issueTypeStatusReducer:hS,assetTypeFieldsReducer:xu,assetTypeFieldValuesReducer:_l,assetTypeFieldsAttachmentReducer:$u,assetTypeFieldValuesAttachmentReducer:hl,assetTypeIdentifierReducer:Ul,assetTypeIdentifierValueReducer:eo,assetTypeStatusReducer:wo,assetProcedureTypeReducer:ud,assetProcedureReducer:Yc,assetProcedureTypeFieldsReducer:uc,assetProcedureTypeFieldValuesReducer:qc,assetProcedureTypeFieldsAttachmentReducer:Za,assetProcedureTypeFieldValuesAttachmentReducer:Oc,assetProcedureTypeAttachmentReducer:ja,assetProcedureStepFieldsAttachmentReducer:_d,assetProcedureStepFieldsReducer:$d,assetProcedureStepFieldValuesAttachmentReducer:Qd,assetProcedureStepFieldValuesReducer:hr,assetProcedureStepReducer:Fr,teamMembershipReducer:vI},UF=o.combineReducers(XI);function LF(t,s){return bO.useMemo(t,s)}class kF{constructor(s){y(this,"operations",[]);y(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return o.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return o.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return o.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return o.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return o.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return o.createSelector([this.getData],s=>I(this.performOperations(s)))}}const QI=1e4,xI=200,zn=[400,409,403,404,405,500],eO={};class tO{constructor(s){y(this,"client");y(this,"pageSize",QI);eO[this.constructor.name]=this,this.client=s}async performRequest(s,e){return this.client.performRequest(this.host,s,this,e)}async enqueueRequest(s){return this.client.enqueueRequest(s,this.host,this.constructor.name)}async performPagination(s,e){return this.client.performPagination(this.host,s,this.pageSize,this,e)}dispatch(s){this.client.store.dispatch(s)}}const sO=()=>aO.length-1,iO=t=>(t[dt]={version:sO()},t),nO=()=>iO({}),NF=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),GF=t=>s=>{var e;return s===void 0&&(s={}),((e=s[dt])==null?void 0:e.version)===sO()?s:t(s)},aO=[iO,nO,nO,NF],HF=Object.fromEntries(aO.map((t,s)=>[s,GF(t)])),WF=t=>{if(t)throw t;const s=ct();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},cO=(t,s,e)=>{const n=xe();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},dO=(t,s,e)=>{const n=xe();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=s.meta.offlineAction.payload.uuid;return n.remove(c),n.getQueue()};async function KF(t,s){if(!s.payload)throw new Error("Received empty payload");return IO(s)}const YF={...Ln,effect:KF,discard:uO,returnPromises:!0,persistCallback:WF,retry:QF,persistOptions:{storage:MO},queue:{...Ln.queue,enqueue:cO,dequeue:dO,peek:(...t)=>XF(...t)}},ZF=RO(HF,dt),JF=o.compose(_O.offline(YF),ZF);async function rO(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=eO[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Dn(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function uO(t,s,e=0){var d;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
3
|
+
Action:`,s,`
|
|
4
|
+
Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=ct(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function l(){n.dispatch(hT(r));const h=xe();if(!h)throw new Error("Outbox coordinator not set");h.remove(s.payload.uuid);const p=s.meta.offline.rollback;throw p&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(p)),t}if(t instanceof U&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s),l()),c.includes(r)&&(console.debug("Discarding request due to deletion:",s),l()),t instanceof U){const h=t.status||((d=t.response)==null?void 0:d.status);if(h||console.warn("Error has no status code:",t),h!==void 0&&zn.includes(h)){console.warn("Discarding request due to error:",t,`
|
|
5
|
+
Action:`,s);const p=xe();if(!p)throw new Error("Outbox coordinator not set");p.remove(s.payload.uuid),t.options.discard=!0,l()}}console.debug("Registering a retry for request:",s.payload.uuid);const u=xe();if(!u)throw new Error("Outbox coordinator not set");return u.registerRetry(s.payload.uuid),!1}function XF(t,s,e){var n;return(n=xe())==null?void 0:n.peek()}function QF(t,s){return ct().dispatch(mT(new Date().getTime())),Yn}const it="An unknown error occurred",xF=500,lO=["non_field_errors","detail"];function eg(t,s){let e;if(t!=null&&t.body)if(typeof t.body=="object"){const n=t.body;if(typeof n.error=="string")e=n.error;else if(typeof n.message=="string")e=n.message;else try{e=Object.entries(n).map(([a,c])=>typeof c=="string"?lO.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?lO.includes(a)?c.join(`
|
|
6
|
+
`):c.map(r=>`${a}: ${r}`).join(`
|
|
7
|
+
`):`${a}: ${JSON.stringify(c)}`).join(`
|
|
8
|
+
`)}catch(a){console.error("Failed to extract error message from response body",a)}}else typeof t.body=="string"&&(e=t.body);else t!=null&&t.text?e=t.text:s instanceof Error&&(e=s.message);return!e||e.length>xF?it:e}class U extends Error{constructor(e){super(it);y(this,"status");y(this,"response");y(this,"message");y(this,"options");const{response:n,innerError:a}=e;this.message=e.message??eg(n,a)??it,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function oO(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(a=>a in e)}if(s(t))return t;if(typeof t=="object"&&t!==null){const e=t;if(s(e.response))return e.response;if(e.response&&s(e.response.response))return e.response.response}}class tg extends tO{constructor(s){super(s)}}class Xe extends tO{constructor(e,n){super(e);y(this,"auth");this.auth=n}}class sg extends Xe{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:m.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(ra(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:m.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(la(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:m.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(ua(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:m.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:m.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(da(n)),n}}function O(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case m.GET:return`Get ${n}`;case m.POST:return`Create ${n}`;case m.PATCH:return`Update ${n}`;case m.PUT:return`Update ${n}`;case m.DELETE:return`Delete ${n}`}}class E extends Xe{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:m.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:m.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:m.GET,...s},e)}}class Je extends E{constructor(){super(...arguments);y(this,"pageSize",xI)}async _bulkAdd(e){var f;const{store:n}=this.client,{addMany:a,updateMany:c,deleteMany:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),d=[],h=[],p={};for(const S of e){const{modelUuid:F,file:P}=S,g=await this.client.files.getFilePayload(P);g.sha1 in p||(p[g.sha1]=g);const w=this.buildModel({file:P,file_sha1:g.sha1,submitted_at:u,created_by:l,modelUuid:F});d.push(w),h.push(this.buildPayload(w,g))}this.dispatch(a(d));const A=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:u,attachments:h,files:Object.values(p)},blocks:d.map(S=>this.getId(S)),blockers:d.map(S=>S.file_sha1)});return A.then(({attachments:S,presigned_urls:F})=>{this.dispatch(c(S)),this.client.files.processPresignedUrls(F)}).catch(()=>{this.dispatch(r(d.map(S=>this.getId(S))))}),[d,A.then(({attachments:S})=>S)]}async _delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Attempting to delete attachment with uuid ${e} that does not exist in the store`);this.dispatch(c(this.getId(l)));const u=this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return u.then(()=>{this.client.files.removeCache(l.file_sha1)}).catch(()=>{this.dispatch(a(l))}),u}}class ig extends Je{constructor(){super(...arguments);y(this,"name","Asset attachment");y(this,"url","/asset-attachments");y(this,"actions",{addOne:ya,addMany:Yt,setOne:pa,setMany:Aa,updateOne:fa,updateMany:Sa,deleteOne:Ta,deleteMany:Zt,initialize:ma});y(this,"selectors",{selectById:Oa,selectByIds:Pa})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset:e.asset}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class ng extends Je{constructor(){super(...arguments);y(this,"name","Asset Procedure Attachment");y(this,"url","/asset-procedure-type-attachments");y(this,"actions",{addOne:Ma,addMany:Ra,setOne:wa,setMany:Ea,updateOne:va,updateMany:Va,deleteOne:za,deleteMany:Ba,initialize:_a});y(this,"selectors",{selectById:Da,selectByIds:Ca})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset_procedure_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset_procedure_type:e.asset_procedure_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetProcedureTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class ag extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Type Fields Attachment");y(this,"url","/asset-procedure-type-fields-attachments");y(this,"actions",{addOne:La,addMany:ka,setOne:Na,setMany:Ga,updateOne:Ha,updateMany:Wa,deleteOne:Ka,deleteMany:Ya,initialize:Ua});y(this,"selectors",{selectById:Xa,selectByIds:Qa})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,u={},d=[],h=[];for(const f of e){const{fieldsRevisionUuid:S,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const w=_({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,fields_revision:S,submitted_at:r,field_identifier:F});d.push(w);const V={uuid:w.uuid,file_name:P.name,field_identifier:F,file_extension:g.extension,file_sha1:g.sha1,fields_revision:S};h.push(V)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.fields_revision),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(()=>{this.dispatch(c(d.map(f=>f.uuid)))}),[d,p.then(({attachments:f})=>f)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class cg extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Type Fields");y(this,"url","/asset-procedure-type-fields");y(this,"actions",{addOne:tc,addMany:sc,setOne:ic,setMany:nc,updateOne:ac,updateMany:cc,deleteOne:dc,deleteMany:rc,initialize:ec});y(this,"selectors",{selectById:oc,selectByIds:hc})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.asset_procedure_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(r(d.uuid)),A}),[d,h]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}function Qe(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}class dg extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Type Field Values Attachment");y(this,"url","/asset-procedure-type-field-values-attachments");y(this,"actions",{addOne:pc,addMany:is,setOne:Ac,setMany:fc,updateOne:Sc,updateMany:Tc,deleteOne:Ic,deleteMany:ns,initialize:yc});y(this,"selectors",{selectById:Fc,selectByIds:gc})}async bulkAdd(e,n){var f;const{addMany:a,setMany:c,deleteMany:r}=this.actions,l=new Date().toISOString(),u=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,d=Qe(e,n??e.length),h=[],p=[];for(const S of d){const F={},P=[];for(const g of S){const{fieldValuesUuid:w,fieldIdentifier:V,file:v}=g,B=await this.client.files.getFilePayload(v);B.sha1 in F||(F[B.sha1]=B);const q=_({file:URL.createObjectURL(v),file_type:v.type,file_name:v.name,file_sha1:B.sha1,created_by:u,field_values:w,submitted_at:l,field_identifier:V});h.push(q);const $={uuid:q.uuid,file_name:v.name,file_sha1:B.sha1,file_extension:B.extension,field_identifier:V,field_values:w};P.push($)}p.push({submitted_at:l,attachments:P,files:Object.values(F)})}this.dispatch(a(h));const A=p.map(S=>this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:S,blockers:S.attachments.map(F=>F.field_values),blocks:S.attachments.map(F=>F.uuid)}));return Promise.all(A).then(S=>{for(const P of S)this.client.files.processPresignedUrls(P.presigned_urls);const F=S.flatMap(P=>P.attachments);this.dispatch(c(F))}).catch(S=>{throw this.dispatch(r(h.map(F=>F.uuid))),S}),[h,A.map(S=>S.then(({attachments:F})=>F))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,l=n.getState(),u=r(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class rg extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Type Field Values");y(this,"url","/asset-procedure-type-field-values");y(this,"actions",{addOne:Rc,addMany:wc,setOne:Ec,setMany:vc,updateOne:Vc,updateMany:zc,deleteOne:Bc,deleteMany:jc,initialize:Mc});y(this,"selectors",{selectById:Cc,selectByIds:$c})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,d=new Date().toISOString(),h=_({...e,created_by:u,submitted_at:d}),p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}bulkAdd(e,n){var f;const{addMany:a,setMany:c,deleteMany:r}=this.actions,l=new Date().toISOString(),u=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,d=[],h=Qe(e.payloads,n??e.payloads.length),p=[];for(const S of h){const F=[];for(const P of S){const g=_({...P,values:P.values,created_by:u,submitted_at:l});d.push(g),F.push({uuid:g.uuid,asset:P.asset,fields_revision:P.fields_revision,asset_procedure:P.asset_procedure,published_at:P.published_at,values:g.values})}p.push({submitted_at:l,values:e.values,field_values:F})}this.dispatch(a(d));const A=[];for(const S of p){const F=S.field_values.map(v=>v.asset),P=S.field_values.map(v=>v.fields_revision),g=S.field_values.map(v=>v.asset_procedure),w=S.field_values.map(v=>v.uuid),V=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:S,blockers:[...F,...P,...g],blocks:w});A.push(V)}return Promise.all(A).then(S=>{this.dispatch(c(S.flat()))}).catch(()=>{this.dispatch(r(d.map(S=>S.uuid)))}),[d,A]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.fields_revision,u.asset,u.asset_procedure],blocks:[u.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const d=bc(e)(l);this.dispatch(a(e)),this.dispatch(ns(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(is(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class ug extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure");y(this,"url","/asset-procedures");y(this,"actions",{addOne:kc,addMany:rs,setOne:Wc,setMany:Kc,updateOne:Nc,updateMany:Gc,deleteOne:Hc,deleteMany:us,initialize:Lc});y(this,"selectors",{selectById:Xc,selectByIds:Qc})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.asset_procedure_type,e.asset_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class lg extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Type");y(this,"url","/asset-procedure-types");y(this,"actions",{addOne:td,addMany:sd,setOne:dd,setMany:rd,updateOne:id,updateMany:nd,deleteOne:ad,deleteMany:cd,initialize:ed});y(this,"selectors",{selectById:od,selectByIds:hd})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const d=Jc(e)(l);this.dispatch(a(e)),this.dispatch(us(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(rs(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class og extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Step Fields Attachment");y(this,"url","/asset-procedure-step-fields-attachments");y(this,"actions",{addOne:pd,addMany:Ad,setOne:fd,setMany:Sd,updateOne:Td,updateMany:Id,deleteOne:Od,deleteMany:Pd,initialize:yd});y(this,"selectors",{selectById:gd,selectByIds:bd})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,u={},d=[],h=[];for(const f of e){const{fieldsRevisionUuid:S,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const w=_({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,fields_revision:S,submitted_at:r,field_identifier:F});d.push(w);const V={uuid:w.uuid,file_name:P.name,field_identifier:F,file_extension:g.extension,file_sha1:g.sha1,fields_revision:S};h.push(V)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.fields_revision),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(()=>{this.dispatch(c(d.map(f=>f.uuid)))}),[d,p.then(({attachments:f})=>f)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_step__organization:e}},n);return this.dispatch(a(c)),c}}class hg extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Step Fields");y(this,"url","/asset-procedure-step-fields");y(this,"actions",{addOne:wd,addMany:Ed,setOne:vd,setMany:Vd,updateOne:zd,updateMany:Bd,deleteOne:jd,deleteMany:qd,initialize:Rd});y(this,"selectors",{selectById:Dd,selectByIds:Cd})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.asset_procedure_step],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(r(d.uuid)),A}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const r={...c,...e};this.dispatch(a(r));const l=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(c)),u}),[r,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,r=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!r)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(l){throw this.dispatch(c(r)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class mg extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Step Field Values Attachment");y(this,"url","/asset-procedure-step-field-values-attachments");y(this,"actions",{addOne:kd,addMany:fs,setOne:Nd,setMany:Gd,updateOne:Hd,updateMany:Wd,deleteOne:Kd,deleteMany:Ss,initialize:Ld});y(this,"selectors",{selectById:Zd,selectByIds:Jd})}async bulkAdd(e,n){var f;const{addMany:a,setMany:c,deleteMany:r}=this.actions,l=new Date().toISOString(),u=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,d=Qe(e,n??e.length),h=[],p=[];for(const S of d){const F={},P=[];for(const g of S){const{fieldValuesUuid:w,fieldIdentifier:V,file:v}=g,B=await this.client.files.getFilePayload(v);B.sha1 in F||(F[B.sha1]=B);const q=_({file:URL.createObjectURL(v),file_type:v.type,file_name:v.name,file_sha1:B.sha1,created_by:u,field_values:w,submitted_at:l,field_identifier:V});h.push(q);const $={uuid:q.uuid,file_name:v.name,file_sha1:B.sha1,file_extension:B.extension,field_identifier:V,field_values:w};P.push($)}p.push({submitted_at:l,attachments:P,files:Object.values(F)})}this.dispatch(a(h));const A=p.map(S=>this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:S,blockers:S.attachments.map(F=>F.field_values),blocks:S.attachments.map(F=>F.uuid)}));return Promise.all(A).then(S=>{for(const P of S)this.client.files.processPresignedUrls(P.presigned_urls);const F=S.flatMap(P=>P.attachments);this.dispatch(c(F))}).catch(S=>{throw this.dispatch(r(h.map(F=>F.uuid))),S}),[h,A.map(S=>S.then(({attachments:F})=>F))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,l=n.getState(),u=r(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class yg extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Step Field Values");y(this,"url","/asset-procedure-step-field-values");y(this,"actions",{addOne:tr,addMany:sr,setOne:ir,setMany:nr,updateOne:ar,updateMany:cr,deleteOne:dr,deleteMany:rr,initialize:er});y(this,"selectors",{selectById:lr,selectByIds:or})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,d=new Date().toISOString(),h=_({...e,created_by:u,submitted_at:d}),p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}bulkAdd(e,n){var f;const{addMany:a,setMany:c,deleteMany:r}=this.actions,l=new Date().toISOString(),u=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,d=[],h=Qe(e.payloads,n??e.payloads.length),p=[];for(const S of h){const F=[];for(const P of S){const g=_({...P,values:P.values,created_by:u,submitted_at:l});d.push(g),F.push({uuid:g.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:g.values})}p.push({submitted_at:l,values:e.values,field_values:F})}this.dispatch(a(d));const A=[];for(const S of p){const F=S.field_values.map(v=>v.asset),P=S.field_values.map(v=>v.fields_revision),g=S.field_values.map(v=>v.asset_procedure),w=S.field_values.map(v=>v.uuid),V=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:S,blockers:[...F,...P,...g],blocks:w});A.push(V)}return Promise.all(A).then(S=>{this.dispatch(c(S.flat()))}).catch(()=>{this.dispatch(r(d.map(S=>S.uuid)))}),[d,A]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.fields_revision,u.asset,u.asset_procedure],blocks:[u.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const d=Xd(e)(l);this.dispatch(a(e)),this.dispatch(Ss(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(fs(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class pg extends E{constructor(){super(...arguments);y(this,"name","Asset Procedure Step");y(this,"url","/asset-procedure-steps");y(this,"actions",{addOne:fr,addMany:Sr,setOne:pr,setMany:Ar,updateOne:Tr,updateMany:Ir,deleteOne:Or,deleteMany:Pr,initialize:yr});y(this,"selectors",{selectById:gr,selectByIds:br})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.asset_procedure_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${r.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:l}=this.actions,{selectById:u}=this.selectors,d=n.getState(),h=u(e)(d);if(!h)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const p=_r(e)(d);this.dispatch(l(e)),this.dispatch(a(D(p)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(A){throw this.dispatch(r(h)),this.dispatch(c(p)),A}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class Ag extends E{constructor(){super(...arguments);y(this,"url","/assets");y(this,"name","Asset");y(this,"actions",{addOne:wr,addMany:gs,setOne:zr,setMany:Br,updateOne:Er,updateMany:vr,deleteOne:Vr,deleteMany:bs,initialize:Rr});y(this,"selectors",{selectById:qr,selectByIds:Dr})}add(e){var p;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.asset_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`No asset with uuid ${e} found in the store`);const d=Fa(e)(l),h=Zy(e)(l);this.dispatch(c(e)),this.dispatch(Zt(D(d))),this.dispatch(Rt(D(h)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(a(u)),this.dispatch(Yt(d)),this.dispatch(Mt(h)),p}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=tt.v4(),l=Qe(e,n).map(h=>{const p=h.map(A=>_(A));return{batchId:tt.v4(),payload:{transaction_id:r,submitted_at:c,assets:p}}}),u=[];let d=null;for(const h of l){const{batchId:p,payload:A}=h,f=A.assets.map(({uuid:V})=>V),S=A.assets.map(({asset_type:V})=>V),F=A.assets.map(({project:V})=>V),P=S.concat(F);d&&P.push(d);const g=f;g.push(p);const w=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:A,blockers:P,blocks:g});d=h.batchId,u.push(w)}return Promise.all(u).then(h=>{const p=h.flat();this.dispatch(a(p))}),u}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,l=n.getState(),u=r(e)(l);this.dispatch(c(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return console.debug(r),this.dispatch(a(r)),r}}class fg extends E{constructor(){super(...arguments);y(this,"name","Asset Stage Completion");y(this,"url","/asset-stage-completions");y(this,"actions",{addOne:Lr,addMany:kr,setOne:Nr,setMany:Gr,updateOne:Hr,updateMany:Wr,deleteOne:Kr,deleteMany:Yr,initialize:Ur});y(this,"selectors",{selectById:Qr,selectByIds:xr})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.asset,e.asset_stage],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}bulkAdd(e){var f;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,l=new Date().toISOString(),u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,d=e.map(S=>_(S)),h=d.map(S=>({...S,created_by:u,submitted_at:l})),p=h.map(({uuid:S})=>S);this.dispatch(a(h));const A=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,completions:d},blockers:[...e.map(S=>S.asset_procedure),...e.map(S=>S.asset_stage),...e.map(S=>S.asset)],blocks:p});return A.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(p))}),[h,A]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,l=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Sg extends E{constructor(){super(...arguments);y(this,"name","Asset Stage");y(this,"url","/asset-stages");y(this,"actions",{addOne:nu,addMany:au,setOne:su,setMany:iu,updateOne:cu,updateMany:du,deleteOne:ru,deleteMany:uu,initialize:tu});y(this,"selectors",{selectById:ou,selectByIds:hu})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.asset_procedure_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class Tg extends Je{constructor(){super(...arguments);y(this,"name","Asset Type Attachment");y(this,"url","/asset-type-attachments");y(this,"actions",{addOne:pu,addMany:zs,setOne:Au,setMany:fu,updateOne:Su,updateMany:Tu,deleteOne:Iu,deleteMany:Bs,initialize:yu});y(this,"selectors",{selectById:Pu,selectByIds:Fu})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset_type:e.asset_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class Ig extends E{constructor(){super(...arguments);y(this,"name","Asset Type Fields Attachment");y(this,"url","/asset-type-fields-attachments");y(this,"actions",{addOne:Ru,addMany:wu,setOne:Eu,setMany:vu,updateOne:Vu,updateMany:zu,deleteOne:Bu,deleteMany:ju,initialize:Mu});y(this,"selectors",{selectById:Du,selectByIds:Cu})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,u={},d=[],h=[];for(const f of e){const{fieldsRevisionUuid:S,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const w=_({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,fields_revision:S,submitted_at:r,field_identifier:F});d.push(w);const V={uuid:w.uuid,file_name:P.name,field_identifier:F,file_extension:g.extension,file_sha1:g.sha1,fields_revision:S};h.push(V)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.fields_revision),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(()=>{this.dispatch(c(d.map(f=>f.uuid)))}),[d,p.then(({attachments:f})=>f)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class Og extends E{constructor(){super(...arguments);y(this,"name","Asset Type Fields");y(this,"url","/asset-type-fields");y(this,"actions",{addOne:ku,addMany:Nu,setOne:Gu,setMany:Hu,updateOne:Wu,updateMany:Ku,deleteOne:Yu,deleteMany:Zu,initialize:Lu});y(this,"selectors",{selectById:Xu,selectByIds:Qu})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.asset_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(r(d.uuid)),A}),[d,h]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class Pg extends E{constructor(){super(...arguments);y(this,"name","Asset Type Field Values Attachment");y(this,"url","/asset-type-field-values-attachments");y(this,"actions",{addOne:sl,addMany:Us,setOne:il,setMany:nl,updateOne:al,updateMany:cl,deleteOne:dl,deleteMany:Ls,initialize:tl});y(this,"selectors",{selectById:ul,selectByIds:ll})}async bulkAdd(e,n){var f;const{addMany:a,setMany:c,deleteMany:r}=this.actions,l=new Date().toISOString(),u=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,d=Qe(e,n??e.length),h=[],p=[];for(const S of d){const F={},P=[];for(const g of S){const{fieldValuesUuid:w,fieldIdentifier:V,file:v}=g,B=await this.client.files.getFilePayload(v);B.sha1 in F||(F[B.sha1]=B);const q=_({file:URL.createObjectURL(v),file_type:v.type,file_name:v.name,file_sha1:B.sha1,created_by:u,field_values:w,submitted_at:l,field_identifier:V});h.push(q);const $={uuid:q.uuid,file_name:v.name,file_sha1:B.sha1,file_extension:B.extension,field_identifier:V,field_values:w};P.push($)}p.push({submitted_at:l,attachments:P,files:Object.values(F)})}this.dispatch(a(h));const A=p.map(S=>this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:S,blockers:S.attachments.map(F=>F.field_values),blocks:S.attachments.map(F=>F.uuid)}));return Promise.all(A).then(S=>{for(const P of S)this.client.files.processPresignedUrls(P.presigned_urls);const F=S.flatMap(P=>P.attachments);this.dispatch(c(F))}).catch(S=>{throw this.dispatch(r(h.map(F=>F.uuid))),S}),[h,A.map(S=>S.then(({attachments:F})=>F))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,l=n.getState(),u=r(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Fg extends E{constructor(){super(...arguments);y(this,"name","Asset Type Field Values");y(this,"url","/asset-type-field-values");y(this,"actions",{addOne:pl,addMany:Al,setOne:fl,setMany:Sl,updateOne:Tl,updateMany:Il,deleteOne:Ol,deleteMany:Pl,initialize:yl});y(this,"selectors",{selectById:gl,selectByIds:bl})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,d=new Date().toISOString(),h=_({...e,created_by:u,submitted_at:d}),p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.asset,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}bulkAdd(e,n){var A;const{addMany:a,setMany:c,deleteMany:r}=this.actions,l=new Date().toISOString(),u=[],d=Qe(e.payloads,n??e.payloads.length),h=[];for(const f of d){const S=[];for(const F of f){const P=_({...F,values:F.values,created_by:((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,submitted_at:l});u.push(P),S.push({uuid:P.uuid,asset:F.asset,fields_revision:F.fields_revision,published_at:F.published_at,values:P.values})}h.push({submitted_at:l,values:e.values,field_values:S})}this.dispatch(a(u));const p=[];for(const f of h){const S=f.field_values.map(w=>w.asset),F=f.field_values.map(w=>w.fields_revision),P=f.field_values.map(w=>w.uuid),g=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:f,blockers:[...S,...F],blocks:P});p.push(g)}return Promise.all(p).then(f=>{this.dispatch(c(f.flat()))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.uuid,u.fields_revision,u.asset],blocks:[u.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const d=ol(e)(l);this.dispatch(a(e)),this.dispatch(Ls(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(Us(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class gg extends E{constructor(){super(...arguments);y(this,"name","Asset Type Identifier");y(this,"url","/asset-type-identifiers");y(this,"actions",{addOne:wl,addMany:El,setOne:vl,setMany:Vl,updateOne:zl,updateMany:Bl,deleteOne:jl,deleteMany:ql,initialize:Rl});y(this,"selectors",{selectById:Cl,selectByIds:$l})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.asset_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class bg extends E{constructor(){super(...arguments);y(this,"name","Asset Type Identifier Value");y(this,"url","/asset-type-identifier-values");y(this,"actions",{addOne:Nl,addMany:Gl,setOne:Hl,setMany:Wl,updateOne:Kl,updateMany:Yl,deleteOne:Zl,deleteMany:Jl,initialize:kl});y(this,"selectors",{selectById:Ql,selectByIds:xl})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.asset,e.asset_type_identifier],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type identifier value with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class _g extends E{constructor(){super(...arguments);y(this,"name","Asset Type");y(this,"url","/asset-types");y(this,"actions",{addOne:ao,addMany:co,setOne:io,setMany:no,updateOne:ro,updateMany:uo,deleteOne:lo,deleteMany:oo,initialize:so});y(this,"selectors",{selectById:mo,selectByIds:yo})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected asset type with uuid ${e} to exist`);const d=Ms(e)(l),h=gu(e)(l);this.dispatch(a(e)),this.dispatch(bs(D(d))),this.dispatch(Bs(D(h)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(u)),this.dispatch(gs(d)),this.dispatch(zs(h)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Mg extends E{constructor(){super(...arguments);y(this,"name","Asset Type Status");y(this,"url","/asset-type-statuses");y(this,"actions",{addOne:So,addMany:To,setOne:Io,setMany:Oo,updateOne:Po,updateMany:Fo,deleteOne:go,deleteMany:bo,initialize:fo});y(this,"selectors",{selectById:Mo,selectByIds:Ro})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.asset_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const l={...r,...e};this.dispatch(n(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.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))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class Rg extends E{constructor(){super(...arguments);y(this,"name","Category");y(this,"url","/categories");y(this,"actions",{addOne:jo,addMany:qo,setOne:Do,setMany:Co,updateOne:$o,updateMany:Uo,deleteOne:Lo,deleteMany:ko,initialize:Bo});y(this,"selectors",{selectById:xs,selectByIds:Go})}add(e){var p;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.project],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const l={...r,...e};this.dispatch(n(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.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))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class wg extends Je{constructor(){super(...arguments);y(this,"name","Document Attachment");y(this,"url","/document-attachments");y(this,"actions",{addOne:Yo,addMany:Zo,setOne:Jo,setMany:Xo,updateOne:Qo,updateMany:xo,deleteOne:eh,deleteMany:th,initialize:Ko});y(this,"selectors",{selectById:ih,selectByIds:nh})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,document:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,document:e.document}}async bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,updateMany:c,deleteMany:r}=this.actions,l=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),d=[],h=[],p={},A={};for(const F of e){const{documentUuid:P,file:g}=F,w=await this.client.files.getFilePayload(g);w.sha1 in p||(p[w.sha1]=w,A[w.sha1]=[]);const V=this.buildModel({file:g,file_sha1:w.sha1,submitted_at:u,created_by:l,modelUuid:P});d.push(V),h.push(this.buildPayload(V,w)),A[w.sha1].push(V.uuid)}this.dispatch(a(d));const f=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:u,attachments:h,files:Object.values(p)},blocks:d.map(F=>F.uuid),blockers:d.map(F=>F.file_sha1)});return f.then(({attachments:F,presigned_urls:P})=>{this.dispatch(c(F));const g=this.client.files.processPresignedUrls(P);for(const[w,V]of Object.entries(g))V.then(()=>{const v=A[w];for(const B of v)this.makeReadable(B)})}).catch(()=>{this.dispatch(r(d.map(F=>F.uuid)))}),[d,f.then(({attachments:F})=>F)]}async delete(e){return this._delete(e)}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:m.PATCH,url:`${this.url}/${e}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",e],blocks:["index-document-attachment"]})}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{document__project__organization:e}},n),r=this.list({queryParams:{document__organization:e}},n),u=(await Promise.all([c,r])).flat();return this.dispatch(a(u)),u}}class Eg extends E{constructor(){super(...arguments);y(this,"name","Document");y(this,"url","/documents");y(this,"actions",{addOne:rh,addMany:uh,setOne:lh,setMany:oh,updateOne:hh,updateMany:mh,deleteOne:yh,deleteMany:ph,initialize:dh});y(this,"selectors",{selectById:fh,selectByIds:Sh})}add(e){var p;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:d.parent_document?[d.parent_document]:[],blocks:[d.uuid]});return h.then(A=>{this.dispatch(r(A))}).catch(()=>{this.dispatch(c(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:l}=this.actions,{selectById:u}=this.selectors,d=n.getState(),h=u(e)(d);if(!h)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const p=Th(e)(d);this.dispatch(a(e)),this.dispatch(l(D(p)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(A){throw this.dispatch(c(h)),this.dispatch(r(p)),A}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),u=(await Promise.all([c,r])).flat();return this.dispatch(a(u)),u}}class nt extends Xe{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:m.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:m.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:m.GET,...s},e)}}class vg extends nt{constructor(){super(...arguments);y(this,"name","Email Domains");y(this,"url","/organization-email-domains");y(this,"actions",{addOne:Ph,addMany:Fh,setOne:gh,setMany:bh,updateOne:_h,updateMany:Mh,deleteOne:Rh,deleteMany:wh,initialize:Oh});y(this,"selectors",{selectById:vh,selectByIds:Vh})}async add(e,n){return this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(c){throw this.dispatch(a(e)),c}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Vg extends Xe{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:m.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:m.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const Dt={},Bn=new Set;let Ct=0,jn=0,qn=0;const zg=20;class Bg extends Xe{constructor(){super(...arguments);y(this,"host");y(this,"_dbPromise",wO.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async renewUploadUrl(e){const n=await this.fetchCache(e);if(!n)throw new Error(`File with sha1 ${e} not found in cache`);const a=await Gt(n,e),c=await this.enqueueRequest({description:"Get S3 URL",method:m.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await st(n),file_type:n.type,extension:n.name.split(".").pop(),size:n.size.toString()},blockers:[],blocks:[`s3-${a}`]});return"url"in c&&this.dispatch(qh({sha1:e,...c})),c}async addCache(e,n){if(Bn.has(n))return;if(!e.type){const r=e.name.split("."),l=r[r.length-1];e=new File([e],e.name,{type:l})}if(!e.name||!e.size||!e.type)throw new Error("Cannot add files to cache that do not have a name, size and type.");const a=await this._dbPromise;!!await a.get("files",n)?(console.error("File already cached (this is unexpected at this point):",e.name,n),Ct++):(await a.put("files",e,n),jn++),Bn.add(n),qn++,qn%zg===0&&console.debug(`File cache summary: ${Ct} hits and ${jn} misses, ${Ct/(Ct+jn)*100}% hit rate over ${qn} calls to addCache.`)}async removeCache(e){await(await this._dbPromise).delete("files",e),Bn.delete(e)}async fetchCache(e){return(await this._dbPromise).get("files",e)}async getOrRenewUploadUrl(e){const n=this.client.store.getState();return Dh(e)(n)??await this.renewUploadUrl(e)}async uploadFileToS3(e){const n=await this.fetchCache(e);if(!n)throw new Error(`File with sha1 ${e} not found in cache`);const a=await Gt(n,e),c={file_name:n.name,file_sha1:e,file:a},r=await this.getOrRenewUploadUrl(e);if("warning"in r){if(r.warning==="already_uploaded")return[c,Promise.resolve(void 0)];throw new Error(r.warning)}const l=r.url,u=this.enqueueRequest({url:l,description:"Upload file",method:m.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${a}`],blocks:[e],s3url:r});return[c,u]}async fetchFileFromUrl(e,n,a){const c=e.split("?")[0]??e,r=await this.fetchCache(n);if(r){if(!r.name)throw new Error("Cached file unexpectedly has no name.");return r}if(e.startsWith("blob:")){const h=await Xn(e),p=new File([h],a??n,{type:h.type});return await this.addCache(p,n),p}let l=Dt[c],u=!0;l?u=!1:(l=new Promise(h=>{this.enqueueRequest({description:"Download file",method:m.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[n],blocks:[n]}).then(p=>{const A=new File([p],a??n,{type:p.type});h(A)})}),Dt[c]=l);let d;try{d=await l}catch(h){throw u&&h instanceof U&&delete Dt[c],h}if(u){const h=await st(d);if(h!==n){const f=`The hash of the file returned from the server (${h}) does not match the
|
|
9
|
+
expected hash (${n}). This can happen if you're using a local development server and the
|
|
10
10
|
isExternalUrl flag in the request details is set to true, because instead of requesting the local
|
|
11
11
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
12
12
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
13
13
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
14
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(A)}const p=o.type.split("/")[1];if(!p)throw new Error("File has no extension");const y=n??h+"."+p;if(o=rc(o,y),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),Jt[c]=new Promise(A=>{A(o)})}return o}}class Hb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...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(pt(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(pt(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(pt(r))}).catch(()=>{this.dispatch(pt(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.enqueueRequest({immediate:!0,description:"Get form identifiers",method:l.GET,url:"/form-identifiers/",queryParams:{form__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ro(a)),a}}class Wb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=F({...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(yt(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(yt(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(yt(r))}).catch(()=>{this.dispatch(yt(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({immediate:!0,description:"Get form identifier values",method:l.GET,url:"/form-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(mo(n)),n}}class Kb extends V{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{revisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,form_revision:h};r.push(g)}this.dispatch(So(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(To(o.attachments))}).catch(()=>{this.dispatch(go(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:l.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(fo(a)),a}}class Yb extends V{add(e){var u;const{store:i}=this.client,n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=F({...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(_o(m))}).catch(()=>{this.dispatch(ia(c.uuid))}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:l.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Po(a)),a}}class Zb extends V{add(e,i){var o;const{store:a}=this.client,n=new Date().toISOString(),c=(o=a.getState().userReducer.currentUser)==null?void 0:o.id,r=F({...e,submitted_at:n,created_by:c}),u=F({...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=zo(e)(a);if(!n)throw new Error("Expected form to exist");const c=Yo(e)(a);c.length>0&&this.dispatch(Ko(c.map(({uuid:u})=>u)));const r=vo(e)(a);r.length>0&&this.dispatch(Ro(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(Oo(r)),c.length>0&&this.dispatch(Ho(c)),u}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:l.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Eo(a)),a}}class Jb extends V{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{submissionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:y.name,file_sha1:A.sha1,file_extension:A.extension,field_identifier:p,form_submission:h};r.push(g)}this.dispatch(Bt(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(Co(o.attachments))}).catch(o=>{throw this.dispatch($t(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=Bo(e)(a);this.dispatch($t(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(Bt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:l.GET,url:"/form-submission-attachments/",queryParams:{limit:Ge,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form submission attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Do(n)),n}}class Xb extends V{add(e){var r;const{store:i}=this.client,a=i.getState(),n=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,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(Gt(u)),u)).catch(()=>{this.dispatch(ma(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 submission with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(Wo(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(Gt(u))}).catch(()=>{this.dispatch(Gt(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=$o(e)(a);this.dispatch(ma(e)),this.dispatch($t(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(Bt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:l.GET,url:"/form-submissions/",queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch form submissions",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(No(n)),n}}class Qb extends V{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.id,u=n.project,m=await this.getFilePayload(a),o=F({...n,file_name:a.name,file_sha1:m.sha1,file:URL.createObjectURL(a),submitted_at:c,created_by:r});this.dispatch(xo(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(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(At(y.geo_image))}).catch(()=>{this.dispatch(fa(o.uuid))}),[o,h.then(y=>y.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,n=new Date().toISOString(),c=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,r=[],u=[],m=[],o={};for(const y of e){const{file:A,...I}=y,g=await this.getFilePayload(A);g.sha1 in o||(o[g.sha1]=g);const _=F({...I,file_name:A.name,file_sha1:g.sha1,file:URL.createObjectURL(A),submitted_at:n,created_by:c,project:i});r.push(_),u.push(_.uuid),m.push({uuid:_.uuid,sha1:_.file_sha1,file_name:_.file_name,title:_.title,description:_.description,geo_marker:_.geo_marker,canvas_marker:_.canvas_marker,direction:_.direction,original_date:_.original_date})}this.dispatch(el(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(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(Qo(y.geo_images))}).catch(()=>{this.dispatch(sl(u))}),[r,h.then(y=>y.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(tl(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(At(u))}).catch(()=>{this.dispatch(At(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(At(n))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:l.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(Xo(a)),a}}class xb 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.id,c=F({...e,submitted_at:a,created_by:n});this.dispatch(ga(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(dl(m))}).catch(()=>{this.dispatch(ba(c.uuid))}),[c,r]}async delete(e){const{store:i}=this.client,a=ul(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(ba(e));const n=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(ga(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:l.GET,url:"/issue-associations/",queryParams:{limit:this.pageSize,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch issue associations",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(rl(n)),n}}class eF extends He{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",Oa);S(this,"addAttachments",_a);S(this,"updateAttachments",Al);S(this,"removeAttachments",Ra);S(this,"removeAttachment",fl);S(this,"setAttachment",yl);S(this,"selectAttachment",Il)}buildOfflineAttachment(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:Ge,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Oa(c)),c}}class tF extends He{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",_l);S(this,"removeAttachments",vl);S(this,"removeAttachment",Rl);S(this,"setAttachment",Ol);S(this,"selectAttachment",El)}buildOfflineAttachment(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_comment:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_comment:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueCommentUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:Ge,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(wa(c)),c}}class sF extends R{add(e){var c;const{store:i}=this.client,a=F({...e,author:(c=i.getState().userReducer.currentUser)==null?void 0:c.id,submitted_at:new Date().toISOString()});this.dispatch(Ea(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(Va(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(Va(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(Ea(a))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:l.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(ql(a)),a}}class iF 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.id,r=F({...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(Lt(o))}).catch(o=>{throw this.dispatch(Da(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=Ba(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(Lt(n));const c={};for(const o of[E.TITLE,E.DESCRIPTION,E.STATUS,E.CATEGORY,E.PRIORITY,E.ASSIGNED_TO,E.DUE_DATE])if(o in e&&e[o]!==a[o])switch(o){case E.PRIORITY:case E.STATUS:{const h=e[o];c[o]=h!==void 0?Number(h):null;break}case E.DUE_DATE:case E.DESCRIPTION:case E.TITLE:c[o]=e[o]??null;break;case E.CATEGORY:{let h=null;const p=e[o];if(p&&(h=i.categoryReducer.instances[p]??null,!h))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);c[o]=h?{name:h.name,color:h.color,uuid:h.uuid}:null;break}case E.ASSIGNED_TO:{let h=null;const p=e[o];if(p&&(h=i.userReducer.instances[p]??null,!h))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);c[o]=h?{full_name:h.username,id:h.id}:null;break}}const r=F({created_by:(m=i.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:a.uuid,changes:c});this.dispatch(Gh(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(Lt(a)),this.dispatch(Nh(r.uuid))}),[n,u]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Ba(e)(a);if(!n)throw new Error(`No issue with uuid ${e} found in the store`);const c=gl(e)(a),r=Yh(e)(a),u={};for(const o of ol(e)(a))u[o.uuid]=o;for(const o of ll(e)(a))u[o.uuid]=o;const m=Object.values(u);this.dispatch(Da(e)),c.length>0&&this.dispatch(Ra(c.map(({uuid:o})=>o))),r.length>0&&this.dispatch(Hh(r.map(({uuid:o})=>o))),m.length>0&&this.dispatch(Fa(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(_a(c)),this.dispatch(Lh(r)),this.dispatch(Ia(m)),o}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issues",method:l.GET,url:"/issues/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issues",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Cl(n)),n}}class aF extends He{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",Ga);S(this,"addAttachments",Nl);S(this,"updateAttachments",Wl);S(this,"removeAttachments",Yl);S(this,"removeAttachment",Kl);S(this,"setAttachment",Hl);S(this,"selectAttachment",Xl)}buildOfflineAttachment(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get issue type attachments",method:l.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Ga(n)),n}}class nF extends V{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:y.name,file_extension:A.extension,field_identifier:p,file_sha1:A.sha1,fields_revision:h};r.push(g)}this.dispatch(th(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(sh(o.attachments))}).catch(()=>{this.dispatch(ih(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:l.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(eh(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.id,n=new Date().toISOString(),c=F({...e,created_by:a,submitted_at:n});this.dispatch(mh(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(ph(m))}).catch(m=>{throw this.dispatch(yh(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:l.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(hh(a)),a}}class rF extends V{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});c.push(I);const g={uuid:I.uuid,file_name:y.name,file_sha1:A.sha1,file_extension:A.extension,field_identifier:p,field_values:h};r.push(g)}this.dispatch(Ht(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(gh(h))}).catch(o=>{throw this.dispatch(Wt(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=bh(e)(a);this.dispatch(Wt(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(Ht(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:Ge,paginate:!0,field_values__issue__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Th(n)),n}}class dF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,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(St(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(St(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(St(u))}).catch(()=>{this.dispatch(St(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=Fh(e)(a);this.dispatch(Wa(e)),this.dispatch(Wt(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(Ht(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:l.GET,url:"/issue-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(dh(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.id,n=new Date().toISOString(),c=F({...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(Tt(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(Tt(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(Tt(r))}).catch(()=>{this.dispatch(Tt(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.enqueueRequest({immediate:!0,description:"Get issue type identifiers",method:l.GET,url:"/issue-type-identifiers/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(_h(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.id,n=new Date().toISOString(),c=F({...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(gt(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(gt(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(gt(r))}).catch(()=>{this.dispatch(gt(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({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:"/issue-type-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Eh(n)),n}}class lF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=F({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.id});this.dispatch(Uh(n));const c=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return c.then(u=>{this.dispatch(It(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(Dh(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(It(u))}).catch(()=>{this.dispatch(It(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=$l(e)(a);this.dispatch(un(e)),this.dispatch(Bl(c.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(It(n)),this.dispatch(kl(c))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:l.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(zh(a)),a}}class hF extends R{async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue updates",method:l.GET,url:"/issue-updates/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue updates",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch($h(n)),n}}const mF=1800;function pF(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 yF extends hb{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:l.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let 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(Pu(!1)),this.clearTokens(),this.dispatch(b()),this.dispatch(b())}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=Zp(i).exp??a}catch{n=a}return n-a<mF}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 U&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??xe).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 U({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 U({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Je.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:l.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(n=>{this.setTokens(pF(n))})}}class AF extends R{update(e){const{store:i}=this.client,a=fn(e.uuid)(i.getState()),n={...a,...e};this.dispatch(Yt(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(Yt(r))}).catch(r=>{throw this.dispatch(Yt(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=fn(e)(a),c=sm(n.user)(a);this.dispatch(cm(n.uuid)),this.dispatch(xh(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(nm(n)),this.dispatch(Qh(c)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:l.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(am(a)),a}}class fF 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(lm(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(hm(i)),i}async invite(e,i){return this.enqueueRequest({description:"Invite user to organization",method:l.POST,url:`/organizations/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const i=await this.enqueueRequest({immediate:!0,description:"Fetch organizations",method:l.GET,url:"/organizations/",blockers:[],blocks:[]},e);return this.dispatch(om(i)),i}}class SF extends R{add(e){var c;const{store:i}=this.client,a=F({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(In(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(bt(r))}).catch(r=>{throw this.dispatch(Fn(a.uuid)),r}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>F({...u,created_by:a}));this.dispatch(bn(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(Fm(u))}).catch(u=>{throw this.dispatch(Pn(n.map(m=>m.uuid))),u}),[n,c]}update(e){const{store:i}=this.client,a=_n(e.uuid)(i.getState()),n={...a,...e};this.dispatch(bt(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(bt(r))}).catch(r=>{throw this.dispatch(bt(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=_n(e)(i.getState());this.dispatch(Fn(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(In(a)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:l.GET,url:"/project-accesses/",queryParams:{project__organization:e},blockers:[],blocks:[]},i);return this.dispatch(bm(a)),a}}class TF extends He{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"addAttachments",vm);S(this,"updateAttachments",Em);S(this,"removeAttachments",vn);S(this,"removeAttachment",Vm);S(this,"setAttachment",wm);S(this,"selectAttachment",zm)}buildOfflineAttachment(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,project:i.modelUuid})}buildAttachmentPayload(i){return{...i,project:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.projectUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get project attachments",method:l.GET,url:`${this.url}/`,queryParams:{project__organization:i},blockers:[],blocks:[]},a);return this.dispatch(Rm(n)),n}}class gF 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(Mn(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(Mn(m))}),this.dispatch(Hm),this.dispatch(Nm(null)),this.dispatch(Lm(!1)),[n,u]}delete(e){return this.dispatch($m(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get project files",method:l.GET,url:"/project-files/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get project files",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(km(n)),n}}class IF 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(Vn(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(Xm(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=ep(e)(a);if(!n)throw new Error("Expected project to exist");const c=Km(a).filter(m=>m.project===e);this.dispatch(Gm(c.map(({uuid:m})=>m)));const r=Um(n.uuid)(a);this.dispatch(vn(r.map(({uuid:m})=>m)));const u=Om(e)(a);this.dispatch(Pn(u.map(({uuid:m})=>m))),this.dispatch(jn(n.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(jn(n.uuid))}catch(m){throw this.dispatch(Vn(n)),this.dispatch(bn(Object.values(u))),this.dispatch(Bm(c)),this.dispatch(Mm(r)),m}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch projects",method:l.GET,url:"/projects/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Jm(a)),a}}class bF extends R{add(e){var c;const{store:i}=this.client,a=F({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(ap(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(Cn(a.uuid))}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>F({...u,created_by:a}));this.dispatch(np(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(cp(u))}).catch(()=>{this.dispatch(rp(n.map(u=>u.uuid)))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=op(e)(a);if(!n)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(Cn(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.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:l.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ip(a)),a}}class FF extends R{add(e){var c;const{store:i}=this.client,a=F({...e,submitted_at:new Date().toISOString(),created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(mp(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(Ft(r))}).catch(()=>{this.dispatch($n(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=Ln(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(pp(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(Ft(r))}).catch(()=>{this.dispatch(Ft(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ln(e)(a);if(!n)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch($n(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(Ft(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:l.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(hp(a)),a}}class PF extends R{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:l.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(Xh(a)),a}}class OF{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,n){return this._enqueueRequest(e,i,a,n).then(c=>{if(c instanceof U)throw c;return c})}_enqueueRequest(e,i,a,n){const c=new nc,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const u={...r,uuid:e.uuid??Je.v4()},m={payload:u,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:u,BASE_URL:i,serviceName:a}}}};Hn(m,this,n).then(o=>{c.resolve(o.body)}).catch(o=>{Wn(o,m),o instanceof Error?c.reject(o):c.reject(new Error((o??xe).toString()))})}else{const u=this.store.dispatch(fm(r)),m=h=>{if(h)c.resolve(h.body);else{const p=new U({message:"Could not get a response from the server.",response:h,discard:!0});c.reject(p)}},o=h=>{h instanceof U?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
|
|
15
|
-
Converting error to APIError and discarding.`),h=new U({message:"An error occurred while processing the request.",innerError:h,discard:!0})),c.reject(h)};u.then(m,o)}return c}}class et{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new Jp.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new et;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))&&et._addDependency(n.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){et._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 Ep;function Vp(t){Ep=t}function tt(){return Ep}let jp;function qp(t){jp=t}function zp(){return jp}let Jn=null;function Ye(){const t=tt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Jn)return Jn;const e=t.getState().offline.outbox,i=et._fromOutbox(e);return Jn=i,i}const _F=(t,e)=>{const i=new e(t);return qp(i),Vp(t),i};class RF{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 Xn{constructor(){S(this,"next");this.next=null}then(e){return new RF(this).then(e)}async run(e){if(this.next)return this.next.run(e);{if(console.debug("Middleware finished. Performing request:",e),!tt())throw new Error("Client store not set");const a=zp();if(!a)throw new Error("Client SDK not set");return Hn(e,a)}}}class Up extends Xn{async run(e){return super.run(e)}}class Dp extends Xn{async run(e){return super.run(e)}}const Cp=new Up().then(new Dp).compile();function kp(t){var e;return(e=Cp[0])==null?void 0:e.run(t)}var Bp=(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))(Bp||{});s.ALL_MIDDLEWARE=Cp,s.APIError=U,s.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=Ge,s.AgentService=mb,s.AssetAttachmentService=pb,s.AssetProcedureService=gb,s.AssetProcedureStepFieldValuesAttachmentService=Pb,s.AssetProcedureStepFieldValuesService=Ob,s.AssetProcedureStepFieldsAttachmentService=bb,s.AssetProcedureStepFieldsService=Fb,s.AssetProcedureStepService=_b,s.AssetProcedureTypeAttachmentService=yb,s.AssetProcedureTypeFieldValuesAttachmentService=Sb,s.AssetProcedureTypeFieldValuesService=Tb,s.AssetProcedureTypeFieldsAttachmentService=Ab,s.AssetProcedureTypeFieldsService=fb,s.AssetProcedureTypeService=Ib,s.AssetService=Rb,s.AssetStageCompletionService=vb,s.AssetStageService=wb,s.AssetTypeAttachmentService=Mb,s.AssetTypeFieldValuesAttachmentService=jb,s.AssetTypeFieldValuesService=qb,s.AssetTypeFieldsAttachmentService=Eb,s.AssetTypeFieldsService=Vb,s.AssetTypeIdentifierService=zb,s.AssetTypeIdentifierValueService=Ub,s.AssetTypeService=Db,s.AttachmentModel=ic,s.BaseApiService=R,s.BaseSDK=OF,s.COMMON_AUTO_FIELDS=oc,s.CategoryService=Cb,s.DEFAULT_ISSUE_PRIORITY=Qp,s.DEFAULT_ISSUE_STATUS=Xp,s.DEFAULT_PAGE_SIZE=gp,s.DeferredPromise=nc,s.DocumentAttachmentService=kb,s.DocumentService=Bb,s.EMPTY_ARRAY=ec,s.EMPTY_OBJECT=tc,s.EmailDomainsService=$b,s.EmailVerificationService=Gb,s.FileService=Nb,s.FormIdentifierService=Hb,s.FormIdentifierValueService=Wb,s.FormRevisionAttachmentService=Kb,s.FormRevisionService=Yb,s.FormService=Zb,s.FormSubmissionAttachmentService=Jb,s.FormSubmissionService=Xb,s.GeoImageService=Qb,s.HttpMethod=l,s.IssueAssociationService=xb,s.IssueAttachmentService=eF,s.IssueCommentAttachmentService=tF,s.IssueCommentService=sF,s.IssuePriority=Qt,s.IssueService=iF,s.IssueStatus=xt,s.IssueTypeAttachmentService=aF,s.IssueTypeFieldValuesAttachmentService=rF,s.IssueTypeFieldValuesService=dF,s.IssueTypeFieldsAttachmentService=nF,s.IssueTypeFieldsService=cF,s.IssueTypeIdentifierService=uF,s.IssueTypeIdentifierValueService=oF,s.IssueTypeService=lF,s.IssueUpdateChange=E,s.IssueUpdateService=hF,s.JWTService=yF,s.OUTBOX_RETRY_DELAY=ac,s.OfflineAnalyticsMiddleware=Up,s.OfflineMiddleware=Xn,s.OrganizationAccessLevel=sc,s.OrganizationAccessService=AF,s.OrganizationService=fF,s.OutboxCoordinator=et,s.ProjectAccessService=SF,s.ProjectAttachmentService=TF,s.ProjectFileService=gF,s.ProjectService=IF,s.RESET_ORGANIZATION_STATE=O,s.RESET_PROJECT_STATE=M,s.RESET_STATE=b,s.RateLimitingMiddleware=Dp,s.SelectorBuilder=QI,s.TeamMembershipService=bF,s.TeamService=FF,s.UNKNOWN_ERROR_MESSAGE=xe,s.UserService=PF,s.VERSION_REDUCER_KEY=st,s.VerificationCodeType=Bp,s._setLatestRetryTime=Tm,s.addAsset=Ks,s.addAssetAttachment=Ry,s.addAssetAttachments=ds,s.addAssetProcedure=bs,s.addAssetProcedureStep=td,s.addAssetProcedureStepFieldValues=$s,s.addAssetProcedureStepFieldValuesAttachment=jA,s.addAssetProcedureStepFieldValuesAttachments=vt,s.addAssetProcedureStepFieldValuesMany=Kr,s.addAssetProcedureStepFields=qs,s.addAssetProcedureStepFieldsAttachment=fA,s.addAssetProcedureStepFieldsAttachments=wr,s.addAssetProcedureStepFieldsMany=PA,s.addAssetProcedureSteps=sd,s.addAssetProcedureType=vs,s.addAssetProcedureTypeAttachment=My,s.addAssetProcedureTypeAttachments=jc,s.addAssetProcedureTypeFieldValues=fs,s.addAssetProcedureTypeFieldValuesAttachment=Zy,s.addAssetProcedureTypeFieldValuesAttachments=_t,s.addAssetProcedureTypeFieldValuesMany=hr,s.addAssetProcedureTypeFields=Qc,s.addAssetProcedureTypeFieldsAttachment=qy,s.addAssetProcedureTypeFieldsAttachments=Nc,s.addAssetProcedureTypeFieldsMany=$y,s.addAssetProcedureTypes=oA,s.addAssetProcedures=Tr,s.addAssetStage=ci,s.addAssetStageCompletion=ei,s.addAssetStageCompletions=ti,s.addAssetStages=af,s.addAssetType=Ei,s.addAssetTypeAttachment=of,s.addAssetTypeAttachments=oi,s.addAssetTypeFieldValues=fi,s.addAssetTypeFieldValuesAttachment=vf,s.addAssetTypeFieldValuesAttachments=Ut,s.addAssetTypeFieldValuesMany=nu,s.addAssetTypeFields=Hd,s.addAssetTypeFieldsAttachment=mf,s.addAssetTypeFieldsAttachments=Dd,s.addAssetTypeFieldsMany=gf,s.addAssetTypeIdentifier=bi,s.addAssetTypeIdentifierValue=_i,s.addAssetTypeIdentifierValues=Nf,s.addAssetTypeIdentifiers=Cf,s.addAssetTypes=xf,s.addAssets=Vt,s.addCategories=dS,s.addCategory=Ui,s.addConversation=Sc,s.addConversations=gy,s.addDocumentAttachment=yS,s.addDocumentAttachments=qu,s.addDocuments=Hu,s.addEmailDomain=Ju,s.addEmailDomains=bS,s.addForm=ra,s.addFormIdentifier=Wi,s.addFormIdentifierValue=Ji,s.addFormIdentifierValues=US,s.addFormIdentifiers=MS,s.addFormRevision=sa,s.addFormRevisionAttachment=LS,s.addFormRevisionAttachments=So,s.addFormRevisions=Oo,s.addFormSubmission=ha,s.addFormSubmissionAttachment=rT,s.addFormSubmissionAttachments=Bt,s.addFormSubmissions=Ho,s.addForms=eT,s.addGeoImage=xo,s.addGeoImages=el,s.addIssue=Ua,s.addIssueAssociation=ga,s.addIssueAssociations=Ia,s.addIssueAttachment=IT,s.addIssueAttachments=_a,s.addIssueComment=Ea,s.addIssueCommentAttachment=PT,s.addIssueCommentAttachments=Pl,s.addIssueComments=wT,s.addIssueType=Uh,s.addIssueTypeAttachment=kT,s.addIssueTypeAttachments=Nl,s.addIssueTypeFieldValues=Ha,s.addIssueTypeFieldValuesAttachment=lg,s.addIssueTypeFieldValuesAttachments=Ht,s.addIssueTypeFieldValuesMany=JT,s.addIssueTypeFields=mh,s.addIssueTypeFieldsAttachment=LT,s.addIssueTypeFieldsAttachments=th,s.addIssueTypeFieldsMany=sg,s.addIssueTypeIdentifier=xa,s.addIssueTypeIdentifierValue=an,s.addIssueTypeIdentifierValues=Fg,s.addIssueTypeIdentifiers=fg,s.addIssueTypes=Mg,s.addIssueUpdate=Gh,s.addIssueUpdates=Lh,s.addIssues=kl,s.addOrganization=lm,s.addOrganizationAccess=nm,s.addOrganizationAccesses=Jg,s.addOrganizations=nI,s.addProject=Vn,s.addProjectAccess=In,s.addProjectAccesses=bn,s.addProjectAttachment=SI,s.addProjectAttachments=vm,s.addProjectFile=bI,s.addProjectFiles=Bm,s.addProjects=MI,s.addTeam=mp,s.addTeamMembership=ap,s.addTeamMemberships=np,s.addTeams=GI,s.addUser=Qh,s.addUsers=Lg,s.agentsReducer=Ic,s.agentsSlice=as,s.areArraysEqual=ty,s.assetAttachmentReducer=Mc,s.assetAttachmentSlice=cs,s.assetProcedureReducer=Ir,s.assetProcedureSlice=Is,s.assetProcedureStepFieldValuesAttachmentReducer=Nr,s.assetProcedureStepFieldValuesAttachmentSlice=Cs,s.assetProcedureStepFieldValuesReducer=Xr,s.assetProcedureStepFieldValuesSlice=Bs,s.assetProcedureStepFieldsAttachmentReducer=qr,s.assetProcedureStepFieldsAttachmentSlice=Vs,s.assetProcedureStepFieldsReducer=Dr,s.assetProcedureStepFieldsSlice=js,s.assetProcedureStepReducer=nd,s.assetProcedureStepSlice=Ns,s.assetProcedureTypeAttachmentReducer=Cc,s.assetProcedureTypeAttachmentSlice=os,s.assetProcedureTypeFieldValuesAttachmentReducer=cr,s.assetProcedureTypeFieldValuesAttachmentSlice=ps,s.assetProcedureTypeFieldValuesReducer=yr,s.assetProcedureTypeFieldValuesSlice=As,s.assetProcedureTypeFieldsAttachmentReducer=Kc,s.assetProcedureTypeFieldsAttachmentSlice=ls,s.assetProcedureTypeFieldsReducer=tr,s.assetProcedureTypeFieldsSlice=hs,s.assetProcedureTypeReducer=Or,s.assetProcedureTypeSlice=Rs,s.assetReducer=hd,s.assetSlice=Ws,s.assetStageCompletionReducer=fd,s.assetStageCompletionSlice=xs,s.assetStageReducer=Fd,s.assetStageSlice=ni,s.assetTypeAttachmentReducer=qd,s.assetTypeAttachmentSlice=ui,s.assetTypeFieldValuesAttachmentReducer=su,s.assetTypeFieldValuesAttachmentSlice=pi,s.assetTypeFieldValuesReducer=uu,s.assetTypeFieldValuesSlice=Ai,s.assetTypeFieldsAttachmentReducer=Gd,s.assetTypeFieldsAttachmentSlice=hi,s.assetTypeFieldsReducer=Zd,s.assetTypeFieldsSlice=mi,s.assetTypeIdentifierReducer=pu,s.assetTypeIdentifierSlice=Ii,s.assetTypeIdentifierValueReducer=Su,s.assetTypeIdentifierValueSlice=Oi,s.assetTypeReducer=bu,s.assetTypeSlice=Mi,s.authReducer=Ou,s.authSlice=Ct,s.baseReducer=ZI,s.baseReducers=Nn,s.blobToBase64=oy,s.categoryReducer=Eu,s.categorySlice=zi,s.clearTokens=nS,s.constructUploadedFilePayloads=uy,s.createModelAdapter=P,s.createOfflineAction=ym,s.createPayload=v,s.createSelectionAdapter=xp,s.deleteAsset=Ys,s.deleteAssetAttachment=Oc,s.deleteAssetAttachments=us,s.deleteAssetProcedure=Fs,s.deleteAssetProcedureStep=id,s.deleteAssetProcedureStepFieldValues=Gs,s.deleteAssetProcedureStepFieldValuesAttachment=DA,s.deleteAssetProcedureStepFieldValuesAttachments=wt,s.deleteAssetProcedureStepFieldValuesMany=Zr,s.deleteAssetProcedureStepFields=zs,s.deleteAssetProcedureStepFieldsAttachment=IA,s.deleteAssetProcedureStepFieldsAttachments=Er,s.deleteAssetProcedureStepFieldsMany=vA,s.deleteAssetProcedureSteps=ad,s.deleteAssetProcedureType=ws,s.deleteAssetProcedureTypeAttachment=Uc,s.deleteAssetProcedureTypeAttachments=Dc,s.deleteAssetProcedureTypeFieldValues=Ss,s.deleteAssetProcedureTypeFieldValuesAttachment=xy,s.deleteAssetProcedureTypeFieldValuesAttachments=Rt,s.deleteAssetProcedureTypeFieldValuesMany=pr,s.deleteAssetProcedureTypeFields=er,s.deleteAssetProcedureTypeFieldsAttachment=Cy,s.deleteAssetProcedureTypeFieldsAttachments=Wc,s.deleteAssetProcedureTypeFieldsMany=Hy,s.deleteAssetProcedureTypes=hA,s.deleteAssetProcedures=gr,s.deleteAssetStage=ri,s.deleteAssetStageCompletion=si,s.deleteAssetStageCompletions=ii,s.deleteAssetStages=cf,s.deleteAssetType=Vi,s.deleteAssetTypeAttachment=wd,s.deleteAssetTypeAttachments=li,s.deleteAssetTypeFieldValues=Si,s.deleteAssetTypeFieldValuesAttachment=Vf,s.deleteAssetTypeFieldValuesAttachments=Dt,s.deleteAssetTypeFieldValuesMany=ru,s.deleteAssetTypeFields=Kd,s.deleteAssetTypeFieldsAttachment=ff,s.deleteAssetTypeFieldsAttachments=kd,s.deleteAssetTypeFieldsMany=Pf,s.deleteAssetTypeIdentifier=Fi,s.deleteAssetTypeIdentifierValue=Ri,s.deleteAssetTypeIdentifierValues=Yf,s.deleteAssetTypeIdentifiers=Gf,s.deleteAssetTypes=tS,s.deleteAssets=Zs,s.deleteCategories=hS,s.deleteCategory=wu,s.deleteConversation=Fy,s.deleteConversations=Py,s.deleteDocumentAttachment=Du,s.deleteDocumentAttachments=Cu,s.deleteEmailDomain=Xu,s.deleteEmailDomains=RS,s.deleteForm=da,s.deleteFormIdentifier=Ki,s.deleteFormIdentifierValue=Xi,s.deleteFormIdentifierValues=BS,s.deleteFormIdentifiers=qS,s.deleteFormRevision=ia,s.deleteFormRevisionAttachment=KS,s.deleteFormRevisionAttachments=go,s.deleteFormRevisions=Ro,s.deleteFormSubmission=ma,s.deleteFormSubmissionAttachment=lT,s.deleteFormSubmissionAttachments=$t,s.deleteFormSubmissions=Ko,s.deleteForms=nT,s.deleteGeoImage=fa,s.deleteGeoImages=sl,s.deleteIssue=Da,s.deleteIssueAssociation=ba,s.deleteIssueAssociations=Fa,s.deleteIssueAttachment=fl,s.deleteIssueAttachments=Ra,s.deleteIssueComment=ja,s.deleteIssueCommentAttachment=Rl,s.deleteIssueCommentAttachments=vl,s.deleteIssueComments=VT,s.deleteIssueType=jg,s.deleteIssueTypeAttachment=Kl,s.deleteIssueTypeAttachments=Yl,s.deleteIssueTypeFieldValues=Wa,s.deleteIssueTypeFieldValuesAttachment=yg,s.deleteIssueTypeFieldValuesAttachments=Wt,s.deleteIssueTypeFieldValuesMany=eg,s.deleteIssueTypeFields=yh,s.deleteIssueTypeFieldsAttachment=KT,s.deleteIssueTypeFieldsAttachments=ih,s.deleteIssueTypeFieldsMany=cg,s.deleteIssueTypeIdentifier=en,s.deleteIssueTypeIdentifierValue=nn,s.deleteIssueTypeIdentifierValues=Rg,s.deleteIssueTypeIdentifiers=Ig,s.deleteIssueTypes=qg,s.deleteIssueUpdate=Nh,s.deleteIssueUpdates=Hh,s.deleteIssues=Bl,s.deleteOrganization=rI,s.deleteOrganizationAccess=cm,s.deleteOrganizationAccesses=eI,s.deleteOrganizations=dI,s.deleteProject=jn,s.deleteProjectAccess=Fn,s.deleteProjectAccesses=Pn,s.deleteProjectAttachment=Vm,s.deleteProjectAttachments=vn,s.deleteProjectFile=$m,s.deleteProjectFiles=Gm,s.deleteProjects=VI,s.deleteTeam=$n,s.deleteTeamMembership=Cn,s.deleteTeamMemberships=rp,s.deleteTeams=HI,s.deleteUser=xh,s.deleteUsers=Wg,s.dequeue=vp,s.discard=Wn,s.documentAttachmentReducer=Gu,s.documentAttachmentSlice=ki,s.documentSlice=Bi,s.documentsReducer=Ku,s.downloadFile=ly,s.downloadInMemoryFile=dy,s.emailDomainsReducer=eo,s.emailDomainsSlice=Li,s.emailRegex=Sy,s.enqueue=Rp,s.enqueueRequest=fm,s.fallbackToEmptyArray=T,s.fallbackToEmptyObject=Ot,s.fileReducer=no,s.fileSlice=Ni,s.fileToBlob=dc,s.formIdentifierReducer=lo,s.formIdentifierSlice=Hi,s.formIdentifierValueReducer=yo,s.formIdentifierValueSlice=Zi,s.formReducer=Vo,s.formRevisionAttachmentReducer=bo,s.formRevisionAttachmentSlice=ea,s.formRevisionReducer=wo,s.formRevisionsSlice=ta,s.formSlice=ca,s.formSubmissionAttachmentReducer=Go,s.formSubmissionAttachmentSlice=ua,s.formSubmissionReducer=Zo,s.formSubmissionSlice=la,s.geoImageReducer=nl,s.geoImageSlice=Aa,s.getAssetProcedureStepSubTree=yc,s.getAssetProcedureStepTrees=Ty,s.getClientSDK=zp,s.getClientStore=tt,s.getFileIdentifier=ry,s.getFileS3Key=is,s.getLocalDateString=cc,s.getLocalRelativeDateString=ny,s.getOutboxCoordinator=Ye,s.getRenamedFile=rc,s.hashFile=Xe,s.initSDK=_F,s.initializeAssetAttachments=rs,s.initializeAssetProcedureStepFieldValues=Wr,s.initializeAssetProcedureStepFieldValuesAttachments=kr,s.initializeAssetProcedureStepFields=Ur,s.initializeAssetProcedureStepFieldsAttachments=vr,s.initializeAssetProcedureSteps=xr,s.initializeAssetProcedureTypeAttachments=Vc,s.initializeAssetProcedureTypeFieldValues=lr,s.initializeAssetProcedureTypeFieldValuesAttachments=ar,s.initializeAssetProcedureTypeFields=Xc,s.initializeAssetProcedureTypeFieldsAttachments=Lc,s.initializeAssetProcedureTypes=Pr,s.initializeAssetProcedures=Sr,s.initializeAssetStageCompletions=pd,s.initializeAssetStages=Id,s.initializeAssetTypeAttachments=_d,s.initializeAssetTypeFieldValues=au,s.initializeAssetTypeFieldValuesAttachments=Xd,s.initializeAssetTypeFields=Nd,s.initializeAssetTypeFieldsAttachments=Ud,s.initializeAssetTypeIdentifierValues=Au,s.initializeAssetTypeIdentifiers=lu,s.initializeAssetTypes=gu,s.initializeAssets=ud,s.initializeCategories=Ru,s.initializeConversations=fc,s.initializeDocumentAttachments=ju,s.initializeEmailDomains=Zu,s.initializeFormIdentifierValues=mo,s.initializeFormIdentifiers=ro,s.initializeFormRevisionAttachments=fo,s.initializeFormRevisions=Po,s.initializeFormSubmissionAttachments=Do,s.initializeFormSubmissions=No,s.initializeForms=Eo,s.initializeGeoImages=Xo,s.initializeIssueAssociations=rl,s.initializeIssueAttachments=Oa,s.initializeIssueCommentAttachments=wa,s.initializeIssueComments=vT,s.initializeIssueTypeAttachments=Ga,s.initializeIssueTypeFieldValues=dh,s.initializeIssueTypeFieldValuesAttachments=Th,s.initializeIssueTypeFields=hh,s.initializeIssueTypeFieldsAttachments=eh,s.initializeIssueTypeIdentifierValues=Eh,s.initializeIssueTypeIdentifiers=_h,s.initializeIssueTypes=zh,s.initializeIssueUpdates=$h,s.initializeIssues=Cl,s.initializeOrganizationAccesses=am,s.initializeOrganizations=om,s.initializeProjectAccesses=bm,s.initializeProjectAttachments=Rm,s.initializeProjectFiles=km,s.initializeProjects=Jm,s.initializeTeamMemberships=ip,s.initializeTeams=hp,s.initializeUsers=Xh,s.isToday=ay,s.issueAssociationReducer=ml,s.issueAssociationSlice=Ta,s.issueAttachmentReducer=bl,s.issueAttachmentSlice=Pa,s.issueCommentAttachmentReducer=Vl,s.issueCommentAttachmentSlice=va,s.issueCommentReducer=Ul,s.issueCommentSlice=Ma,s.issueReducer=Gl,s.issueSlice=za,s.issueTypeAttachmentReducer=Ql,s.issueTypeAttachmentSlice=$a,s.issueTypeFieldValuesAttachmentReducer=Ph,s.issueTypeFieldValuesAttachmentSlice=Ja,s.issueTypeFieldValuesReducer=oh,s.issueTypeFieldValuesSlice=Na,s.issueTypeFieldsAttachmentReducer=ch,s.issueTypeFieldsAttachmentSlice=La,s.issueTypeFieldsReducer=fh,s.issueTypeFieldsSlice=Za,s.issueTypeIdentifierReducer=wh,s.issueTypeIdentifierSlice=Qa,s.issueTypeIdentifierValueReducer=jh,s.issueTypeIdentifierValueSlice=sn,s.issueTypeReducer=kh,s.issueTypeSlice=dn,s.issueUpdateReducer=Zh,s.issueUpdateSlice=hn,s.logOnlyOnce=hy,s.markAsDeleted=Sm,s.markForDeletion=mI,s.memoize=ts,s.onlyUniqueHashes=fy,s.onlyUniqueOfflineIds=mc,s.organizationAccessReducer=rm,s.organizationAccessSlice=yn,s.organizationReducer=pm,s.organizationSlice=Sn,s.outboxReducer=gm,s.outboxSlice=Tn,s.overmapEnhancer=cb,s.overmapReducer=JI,s.overmapReducers=Tp,s.performRequest=Hn,s.projectAccessReducer=Pm,s.projectAccessSlice=gn,s.projectAttachmentReducer=Dm,s.projectAttachmentSlice=Rn,s.projectFileReducer=Ym,s.projectFileSlice=wn,s.projectReducer=Qm,s.projectSlice=En,s.rehydratedReducer=tp,s.rehydratedSlice=zn,s.removeDocuments=$i,s.removeIssueType=un,s.resetProjectFileObjectUrls=PI,s.restructureCreateSelectorWithArgs=f,s.runMiddleware=kp,s.saveActiveProjectFileBounds=Hm,s.selectAccessToken=cS,s.selectAccessesByUserOfProject=AI,s.selectAccessibleProjects=jI,s.selectActiveOrganizationAccess=tI,s.selectActiveProjectFileId=_I,s.selectAllDocumentAttachments=Bu,s.selectAllProjectAttachments=qm,s.selectAssetAttachmentById=vc,s.selectAssetAttachmentMapping=_c,s.selectAssetAttachments=Rc,s.selectAssetById=Qs,s.selectAssetProcedureById=_s,s.selectAssetProcedureStepById=Hs,s.selectAssetProcedureStepFieldValues=Mt,s.selectAssetProcedureStepFieldValuesAttachmentById=CA,s.selectAssetProcedureStepFieldValuesAttachments=$r,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=Gr,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=ks,s.selectAssetProcedureStepFieldValuesById=Ls,s.selectAssetProcedureStepFieldValuesMapping=Jr,s.selectAssetProcedureStepFieldValuesOfAsset=$A,s.selectAssetProcedureStepFieldValuesOfAssetProcedure=GA,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=LA,s.selectAssetProcedureStepFields=Ds,s.selectAssetProcedureStepFieldsAttachmentById=FA,s.selectAssetProcedureStepFieldsAttachments=jr,s.selectAssetProcedureStepFieldsAttachmentsMapping=Vr,s.selectAssetProcedureStepFieldsById=VA,s.selectAssetProcedureStepFieldsMapping=Us,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=wA,s.selectAssetProcedureStepMapping=dt,s.selectAssetProcedureSteps=cd,s.selectAssetProcedureStepsByIds=YA,s.selectAssetProcedureStepsMappingOfAssetProcedureType=WA,s.selectAssetProcedureStepsOfAssetProcedureType=KA,s.selectAssetProcedureTypeAttachmentById=$c,s.selectAssetProcedureTypeAttachmentMapping=kc,s.selectAssetProcedureTypeAttachments=Bc,s.selectAssetProcedureTypeById=Es,s.selectAssetProcedureTypeFieldValues=Ts,s.selectAssetProcedureTypeFieldValuesAttachmentById=eA,s.selectAssetProcedureTypeFieldValuesAttachments=rr,s.selectAssetProcedureTypeFieldValuesAttachmentsByIds=dr,s.selectAssetProcedureTypeFieldValuesAttachmentsMapping=ys,s.selectAssetProcedureTypeFieldValuesById=gs,s.selectAssetProcedureTypeFieldValuesMapping=Ar,s.selectAssetProcedureTypeFieldValuesOfAsset=iA,s.selectAssetProcedureTypeFields=ms,s.selectAssetProcedureTypeFieldsAttachmentById=By,s.selectAssetProcedureTypeFieldsAttachments=Zc,s.selectAssetProcedureTypeFieldsAttachmentsMapping=Yc,s.selectAssetProcedureTypeFieldsById=Yy,s.selectAssetProcedureTypeFieldsMapping=sr,s.selectAssetProcedureTypeFieldsOfAssetProcedureType=Wy,s.selectAssetProcedureTypes=_r,s.selectAssetProcedureTypesByIds=yA,s.selectAssetProcedureTypesMapping=Ms,s.selectAssetProcedureTypesOfOrganization=AA,s.selectAssetProcedures=Os,s.selectAssetProceduresByIds=uA,s.selectAssetProceduresMapping=Ps,s.selectAssetProceduresOfAssetProcedureType=br,s.selectAssetProceduresOfAssetType=dA,s.selectAssetStageById=di,s.selectAssetStageCompletionById=Sd,s.selectAssetStageCompletionMapping=ai,s.selectAssetStageCompletions=tf,s.selectAssetStageCompletionsByIds=Td,s.selectAssetStages=Pd,s.selectAssetStagesByIds=uf,s.selectAssetStagesMappingOfAssetProcedureType=rf,s.selectAssetStagesOfAssetProcedureType=df,s.selectAssetTypeAttachmentById=Vd,s.selectAssetTypeAttachmentMapping=Md,s.selectAssetTypeAttachments=Ed,s.selectAssetTypeById=qi,s.selectAssetTypeFieldValues=Ti,s.selectAssetTypeFieldValuesAttachmentById=jf,s.selectAssetTypeFieldValuesAttachments=xd,s.selectAssetTypeFieldValuesAttachmentsByIds=eu,s.selectAssetTypeFieldValuesAttachmentsMapping=yi,s.selectAssetTypeFieldValuesById=gi,s.selectAssetTypeFieldValuesMapping=du,s.selectAssetTypeFieldValuesOfAsset=Uf,s.selectAssetTypeFields=zt,s.selectAssetTypeFieldsAttachmentById=Tf,s.selectAssetTypeFieldsAttachments=$d,s.selectAssetTypeFieldsAttachmentsMapping=Bd,s.selectAssetTypeFieldsById=Rf,s.selectAssetTypeFieldsMapping=Yd,s.selectAssetTypeFieldsOfAssetType=Of,s.selectAssetTypeIdentifierById=Pi,s.selectAssetTypeIdentifierMapping=hu,s.selectAssetTypeIdentifierValueById=wi,s.selectAssetTypeIdentifierValueMapping=fu,s.selectAssetTypeIdentifierValues=vi,s.selectAssetTypeIdentifierValuesOfAsset=Zf,s.selectAssetTypeIdentifierValuesOfIdentifier=Jf,s.selectAssetTypeIdentifiers=mu,s.selectAssetTypeIdentifiersOfAssetType=Lf,s.selectAssetTypeValuesOfAssetType=Df,s.selectAssetTypes=Iu,s.selectAssetTypesByIds=sS,s.selectAssetTypesMapping=ji,s.selectAssetTypesOfOrganization=iS,s.selectAssets=od,s.selectAssetsByIds=ld,s.selectAssetsMapping=Js,s.selectAssetsOfAssetType=Xs,s.selectAttachmentsOfAsset=wc,s.selectAttachmentsOfAssetProcedureStepFieldValues=Lr,s.selectAttachmentsOfAssetProcedureStepFields=bA,s.selectAttachmentsOfAssetProcedureType=jy,s.selectAttachmentsOfAssetProcedureTypeFieldValues=ur,s.selectAttachmentsOfAssetProcedureTypeFields=ky,s.selectAttachmentsOfAssetType=jd,s.selectAttachmentsOfAssetTypeFieldValues=tu,s.selectAttachmentsOfAssetTypeFields=Sf,s.selectAttachmentsOfDocument=SS,s.selectAttachmentsOfFormRevision=YS,s.selectAttachmentsOfFormSubmission=$o,s.selectAttachmentsOfIssue=gl,s.selectAttachmentsOfIssueComment=RT,s.selectAttachmentsOfIssueType=GT,s.selectAttachmentsOfIssueTypeFieldValues=Fh,s.selectAttachmentsOfIssueTypeFields=YT,s.selectAttachmentsOfProject=Um,s.selectCategories=Mu,s.selectCategoriesByIds=mS,s.selectCategoriesOfProject=pS,s.selectCategoryById=Ci,s.selectCategoryMapping=Di,s.selectCommentsOfIssue=jT,s.selectConversation=_y,s.selectConversationMapping=ns,s.selectConversations=Oy,s.selectCurrentUser=tm,s.selectDeletedRequests=lI,s.selectDescendantsOfAssetProcedureStep=rd,s.selectDocumentAttachmentById=$u,s.selectDocumentAttachmentMapping=ku,s.selectDocumentById=Wu,s.selectDocuments=Gi,s.selectDocumentsByIds=TS,s.selectDocumentsMapping=kt,s.selectEmailDomains=xu,s.selectEmailDomainsAsMapping=Qu,s.selectEmailDomainsOfOrganization=vS,s.selectFieldValuesOfAssetProcedure=aA,s.selectFormById=zo,s.selectFormIdentifierById=Yi,s.selectFormIdentifierMapping=uo,s.selectFormIdentifierValueById=xi,s.selectFormIdentifierValueMapping=po,s.selectFormIdentifierValues=Qi,s.selectFormIdentifierValuesOfFormSubmission=$S,s.selectFormIdentifierValuesOfIdentifier=GS,s.selectFormIdentifiers=oo,s.selectFormIdentifiersOfForm=zS,s.selectFormMapping=jo,s.selectFormRevisionAttachmentsMapping=Io,s.selectFormRevisionById=QS,s.selectFormRevisionMapping=aa,s.selectFormRevisions=na,s.selectFormRevisionsOfForm=vo,s.selectFormSubmissionAttachemntsByIds=Bo,s.selectFormSubmissionAttachments=oa,s.selectFormSubmissionAttachmentsMapping=ko,s.selectFormSubmissionById=ya,s.selectFormSubmissions=pT,s.selectFormSubmissionsMapping=pa,s.selectFormSubmissionsOfForm=Yo,s.selectForms=qo,s.selectFormsOfOrganization=cT,s.selectGeoImageById=Sa,s.selectGeoImageMapping=il,s.selectGeoImages=al,s.selectGeoImagesOfProject=AT,s.selectIsImportingProjectFile=RI,s.selectIsLoggedIn=rS,s.selectIssueAssociationById=ul,s.selectIssueAssociationMapping=ft,s.selectIssueAssociations=gT,s.selectIssueAssociationsOfAsset=hl,s.selectIssueAssociationsOfIssue=ll,s.selectIssueAssociationsToIssue=ol,s.selectIssueAttachmentById=Il,s.selectIssueAttachmentMapping=Sl,s.selectIssueAttachments=Tl,s.selectIssueById=Ba,s.selectIssueCommentAttachmentById=El,s.selectIssueCommentAttachmentMapping=wl,s.selectIssueCommentAttachments=Ml,s.selectIssueCommentById=qa,s.selectIssueCommentMapping=zl,s.selectIssueMapping=Ca,s.selectIssueTypeAttachmentById=Xl,s.selectIssueTypeAttachmentMapping=Zl,s.selectIssueTypeAttachments=Jl,s.selectIssueTypeById=ln,s.selectIssueTypeFieldValues=Ka,s.selectIssueTypeFieldValuesAttachmentById=Ag,s.selectIssueTypeFieldValuesAttachments=Xa,s.selectIssueTypeFieldValuesAttachmentsByIds=bh,s.selectIssueTypeFieldValuesAttachmentsMapping=Ih,s.selectIssueTypeFieldValuesById=Ya,s.selectIssueTypeFieldValuesMapping=uh,s.selectIssueTypeFieldValuesOfIssue=tg,s.selectIssueTypeFields=Nt,s.selectIssueTypeFieldsAttachmentById=ZT,s.selectIssueTypeFieldsAttachments=nh,s.selectIssueTypeFieldsAttachmentsMapping=ah,s.selectIssueTypeFieldsById=og,s.selectIssueTypeFieldsMapping=Ah,s.selectIssueTypeFieldsOfIssueType=rg,s.selectIssueTypeIdentifierById=tn,s.selectIssueTypeIdentifierMapping=Rh,s.selectIssueTypeIdentifierValueById=rn,s.selectIssueTypeIdentifierValueMapping=Vh,s.selectIssueTypeIdentifierValues=cn,s.selectIssueTypeIdentifierValuesOfIdentifier=wg,s.selectIssueTypeIdentifierValuesOfIssue=vg,s.selectIssueTypeIdentifiers=vh,s.selectIssueTypeIdentifiersOfIssueType=bg,s.selectIssueTypeMapping=on,s.selectIssueTypeValuesOfIssueType=ug,s.selectIssueTypes=Ch,s.selectIssueTypesByIds=zg,s.selectIssueTypesOfOrganization=Ug,s.selectIssueUpdateMapping=Wh,s.selectIssueUpdates=Kh,s.selectIssueUpdatesOfIssue=Yh,s.selectIssues=ka,s.selectIssuesByIds=DT,s.selectIssuesOfIssueType=$l,s.selectIssuesOfProject=CT,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=MA,s.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=Ky,s.selectLatestAssetTypeFieldsOfAssetType=_f,s.selectLatestFieldsByAssetProcedureStep=EA,s.selectLatestFormRevisionOfForm=xS,s.selectLatestIssueTypeFieldsOfIssueType=dg,s.selectLatestRetryTime=hI,s.selectMembershipsByUserOfTeam=BI,s.selectNumberOfAssetsOfAssetType=QA,s.selectOrganizationAccessById=fn,s.selectOrganizationAccessMapping=An,s.selectOrganizationAccessUserMapping=dm,s.selectOrganizationById=oI,s.selectOrganizationDocuments=IS,s.selectOrganizations=uI,s.selectOrganizationsMapping=mm,s.selectProjectAccessById=_n,s.selectProjectAccessMapping=On,s.selectProjectAccesses=Zt,s.selectProjectAccessesOfProject=Om,s.selectProjectAttachmentById=zm,s.selectProjectAttachmentMapping=jm,s.selectProjectById=ep,s.selectProjectDocuments=gS,s.selectProjectFileById=OI,s.selectProjectFileMapping=Wm,s.selectProjectFiles=Km,s.selectProjectMapping=xm,s.selectProjects=qn,s.selectProjectsOfOrganization=qI,s.selectRehydrated=DI,s.selectStageMapping=qt,s.selectTeamById=Ln,s.selectTeamMembershipById=op,s.selectTeamMemberships=kn,s.selectTeamMembershipsMapping=up,s.selectTeams=yp,s.selectTeamsByIds=WI,s.selectTeamsMapping=Gn,s.selectTeamsOfOrganization=KI,s.selectUploadUrl=ao,s.selectUserById=sm,s.selectUsers=pn,s.selectUsersByIds=Zg,s.selectUsersMapping=Kt,s.selectUsersOfOrganization=sI,s.selectUsersOfProject=fI,s.selectUsersOfTeam=$I,s.setActiveProjectFileId=Nm,s.setAsset=JA,s.setAssetAttachment=Fc,s.setAssetAttachments=vy,s.setAssetProcedure=cA,s.setAssetProcedureStep=ed,s.setAssetProcedureStepFieldValues=kA,s.setAssetProcedureStepFieldValuesAttachment=qA,s.setAssetProcedureStepFieldValuesAttachments=zA,s.setAssetProcedureStepFieldValuesMany=BA,s.setAssetProcedureStepFields=OA,s.setAssetProcedureStepFieldsAttachment=SA,s.setAssetProcedureStepFieldsAttachments=TA,s.setAssetProcedureStepFieldsMany=_A,s.setAssetProcedureSteps=NA,s.setAssetProcedureType=mA,s.setAssetProcedureTypeAttachment=qc,s.setAssetProcedureTypeAttachments=Ey,s.setAssetProcedureTypeFieldValues=tA,s.setAssetProcedureTypeFieldValuesAttachment=Jy,s.setAssetProcedureTypeFieldValuesAttachments=Xy,s.setAssetProcedureTypeFieldValuesMany=sA,s.setAssetProcedureTypeFields=Gy,s.setAssetProcedureTypeFieldsAttachment=zy,s.setAssetProcedureTypeFieldsAttachments=Uy,s.setAssetProcedureTypeFieldsMany=Ly,s.setAssetProcedureTypes=pA,s.setAssetProcedures=rA,s.setAssetStage=bd,s.setAssetStageCompletion=xA,s.setAssetStageCompletions=ef,s.setAssetStages=sf,s.setAssetType=Xf,s.setAssetTypeAttachment=Rd,s.setAssetTypeAttachments=lf,s.setAssetTypeFieldValues=qf,s.setAssetTypeFieldValuesAttachment=wf,s.setAssetTypeFieldValuesAttachments=Mf,s.setAssetTypeFieldValuesMany=zf,s.setAssetTypeFields=If,s.setAssetTypeFieldsAttachment=pf,s.setAssetTypeFieldsAttachments=yf,s.setAssetTypeFieldsMany=bf,s.setAssetTypeIdentifier=kf,s.setAssetTypeIdentifierValue=Hf,s.setAssetTypeIdentifierValues=Wf,s.setAssetTypeIdentifiers=Bf,s.setAssetTypes=Qf,s.setAssets=XA,s.setCategories=oS,s.setCategory=uS,s.setClientSDK=qp,s.setClientStore=Vp,s.setConversation=Tc,s.setConversations=Iy,s.setCurrentUser=Kg,s.setDocumentAttachment=zu,s.setDocumentAttachments=AS,s.setDocuments=Nu,s.setEmailDomain=FS,s.setEmailDomains=PS,s.setForm=tT,s.setFormIdentifier=ES,s.setFormIdentifierValue=DS,s.setFormIdentifierValues=CS,s.setFormIdentifiers=VS,s.setFormRevision=_o,s.setFormRevisionAttachment=NS,s.setFormRevisionAttachments=HS,s.setFormRevisions=ZS,s.setFormSubmission=Gt,s.setFormSubmissionAttachment=dT,s.setFormSubmissionAttachments=uT,s.setFormSubmissions=hT,s.setForms=sT,s.setGeoImage=At,s.setGeoImages=Qo,s.setIsImportingProjectFile=Lm,s.setIssue=qT,s.setIssueAssociation=ST,s.setIssueAssociations=fT,s.setIssueAttachment=yl,s.setIssueAttachments=bT,s.setIssueComment=Va,s.setIssueCommentAttachment=Ol,s.setIssueCommentAttachments=OT,s.setIssueComments=ql,s.setIssueType=It,s.setIssueTypeAttachment=Hl,s.setIssueTypeAttachments=BT,s.setIssueTypeFieldValues=XT,s.setIssueTypeFieldValuesAttachment=hg,s.setIssueTypeFieldValuesAttachments=mg,s.setIssueTypeFieldValuesMany=QT,s.setIssueTypeFields=ig,s.setIssueTypeFieldsAttachment=NT,s.setIssueTypeFieldsAttachments=HT,s.setIssueTypeFieldsMany=ag,s.setIssueTypeIdentifier=Sg,s.setIssueTypeIdentifierValue=Pg,s.setIssueTypeIdentifierValues=Og,s.setIssueTypeIdentifiers=Tg,s.setIssueTypes=Eg,s.setIssueUpdate=Dg,s.setIssueUpdates=Cg,s.setIssues=zT,s.setLoggedIn=Pu,s.setOrganization=aI,s.setOrganizationAccess=Xg,s.setOrganizationAccesses=Qg,s.setOrganizations=iI,s.setProfilePicture=Yg,s.setProject=wI,s.setProjectAccess=pI,s.setProjectAccesses=yI,s.setProjectAttachment=wm,s.setProjectAttachments=Mm,s.setProjectFile=gI,s.setProjectFiles=II,s.setProjects=vI,s.setRehydrated=UI,s.setTeam=Ft,s.setTeamMembership=Dn,s.setTeamMemberships=cp,s.setTeams=LI,s.setTokens=aS,s.setUploadUrl=io,s.setUser=Gg,s.setUsers=$g,s.shallowEqual=ey,s.slugify=yy,s.spacesToDashesLower=py,s.teamMembershipReducer=dp,s.teamMembershipSlice=Un,s.teamReducer=Ap,s.teamSlice=Bn,s.toFileNameSafeString=my,s.toUuidArray=hc,s.toUuidIdRecord=lc,s.truncate=Ay,s.updateAsset=ut,s.updateAssetAttachment=wy,s.updateAssetAttachments=Pc,s.updateAssetProcedure=at,s.updateAssetProcedureStep=Et,s.updateAssetProcedureStepFieldValues=rt,s.updateAssetProcedureStepFieldValuesAttachment=UA,s.updateAssetProcedureStepFieldValuesAttachments=Br,s.updateAssetProcedureStepFieldValuesMany=Yr,s.updateAssetProcedureStepFields=ct,s.updateAssetProcedureStepFieldsAttachment=gA,s.updateAssetProcedureStepFieldsAttachments=Mr,s.updateAssetProcedureStepFieldsMany=RA,s.updateAssetProcedureSteps=HA,s.updateAssetProcedureType=nt,s.updateAssetProcedureTypeAttachment=Vy,s.updateAssetProcedureTypeAttachments=zc,s.updateAssetProcedureTypeFieldValues=it,s.updateAssetProcedureTypeFieldValuesAttachment=Qy,s.updateAssetProcedureTypeFieldValuesAttachments=nr,s.updateAssetProcedureTypeFieldValuesMany=mr,s.updateAssetProcedureTypeFields=xc,s.updateAssetProcedureTypeFieldsAttachment=Dy,s.updateAssetProcedureTypeFieldsAttachments=Hc,s.updateAssetProcedureTypeFieldsMany=Ny,s.updateAssetProcedureTypes=lA,s.updateAssetProcedures=nA,s.updateAssetStage=jt,s.updateAssetStageCompletion=yd,s.updateAssetStageCompletions=Ad,s.updateAssetStages=nf,s.updateAssetType=mt,s.updateAssetTypeAttachment=hf,s.updateAssetTypeAttachments=vd,s.updateAssetTypeFieldValues=ot,s.updateAssetTypeFieldValuesAttachment=Ef,s.updateAssetTypeFieldValuesAttachments=Qd,s.updateAssetTypeFieldValuesMany=cu,s.updateAssetTypeFields=Wd,s.updateAssetTypeFieldsAttachment=Af,s.updateAssetTypeFieldsAttachments=Cd,s.updateAssetTypeFieldsMany=Ff,s.updateAssetTypeIdentifier=lt,s.updateAssetTypeIdentifierValue=ht,s.updateAssetTypeIdentifierValues=Kf,s.updateAssetTypeIdentifiers=$f,s.updateAssetTypes=eS,s.updateAssets=ZA,s.updateCategories=lS,s.updateCategory=vu,s.updateConversation=gc,s.updateConversations=by,s.updateDocumentAttachment=fS,s.updateDocumentAttachments=Uu,s.updateDocuments=Qe,s.updateEmailDomain=OS,s.updateEmailDomains=_S,s.updateForm=iT,s.updateFormIdentifier=pt,s.updateFormIdentifierValue=yt,s.updateFormIdentifierValues=kS,s.updateFormIdentifiers=jS,s.updateFormRevision=JS,s.updateFormRevisionAttachment=WS,s.updateFormRevisionAttachments=To,s.updateFormRevisions=XS,s.updateFormSubmission=Wo,s.updateFormSubmissionAttachment=oT,s.updateFormSubmissionAttachments=Co,s.updateFormSubmissions=mT,s.updateForms=aT,s.updateGeoImage=tl,s.updateGeoImages=yT,s.updateIssue=Lt,s.updateIssueAssociation=dl,s.updateIssueAssociations=TT,s.updateIssueAttachment=FT,s.updateIssueAttachments=Al,s.updateIssueComment=MT,s.updateIssueCommentAttachment=_T,s.updateIssueCommentAttachments=_l,s.updateIssueComments=ET,s.updateIssueType=Dh,s.updateIssueTypeAttachment=$T,s.updateIssueTypeAttachments=Wl,s.updateIssueTypeFieldValues=St,s.updateIssueTypeFieldValuesAttachment=pg,s.updateIssueTypeFieldValuesAttachments=gh,s.updateIssueTypeFieldValuesMany=xT,s.updateIssueTypeFields=ph,s.updateIssueTypeFieldsAttachment=WT,s.updateIssueTypeFieldsAttachments=sh,s.updateIssueTypeFieldsMany=ng,s.updateIssueTypeIdentifier=Tt,s.updateIssueTypeIdentifierValue=gt,s.updateIssueTypeIdentifierValues=_g,s.updateIssueTypeIdentifiers=gg,s.updateIssueTypes=Vg,s.updateIssueUpdate=kg,s.updateIssueUpdates=Bg,s.updateIssues=UT,s.updateOrganization=hm,s.updateOrganizationAccess=Yt,s.updateOrganizationAccesses=xg,s.updateOrganizations=cI,s.updateProject=Xm,s.updateProjectAccess=bt,s.updateProjectAccesses=Fm,s.updateProjectAttachment=TI,s.updateProjectAttachments=Em,s.updateProjectFile=Mn,s.updateProjectFiles=FI,s.updateProjects=EI,s.updateTeam=pp,s.updateTeamMembership=CI,s.updateTeamMemberships=kI,s.updateTeams=NI,s.updateUser=Hg,s.updateUsers=Ng,s.useSelectorBuilder=XI,s.userReducer=em,s.userSlice=mn,s.uuidObj=F,s.versioningReducer=Sp,s.versioningSlice=fp,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
14
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}const p=d.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=a??h+"."+p;if(d=Jn(d,A),!d.name)throw new Error("Failed to set file's name");await this.addCache(d,h),Dt[c]=new Promise(f=>{f(d)})}return d}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:m.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return n}async getFilePayload(e){const n=await st(e),a={sha1:n,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,n),a}}class jg extends E{constructor(){super(...arguments);y(this,"name","Form Identifier");y(this,"url","/form-identifiers");y(this,"actions",{addOne:Lh,addMany:kh,setOne:Nh,setMany:Gh,updateOne:Hh,updateMany:Wh,deleteOne:Kh,deleteMany:Yh,initialize:Uh});y(this,"selectors",{selectById:Jh,selectByIds:Xh})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.form],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class qg extends E{constructor(){super(...arguments);y(this,"name","Form Identifier Value");y(this,"url","/form-identifier-values");y(this,"actions",{addOne:tm,addMany:sm,setOne:im,setMany:nm,updateOne:am,updateMany:cm,deleteOne:dm,deleteMany:rm,initialize:em});y(this,"selectors",{selectById:lm,selectByIds:om})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.form_submission,e.form_identifier],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class Dg extends E{constructor(){super(...arguments);y(this,"name","Form Revision Attachment");y(this,"url","/form-revision-attachments");y(this,"actions",{addOne:pm,addMany:Am,setOne:fm,setMany:Sm,updateOne:Tm,updateMany:Im,deleteOne:Om,deleteMany:Pm,initialize:ym});y(this,"selectors",{selectById:gm,selectByIds:bm})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,u={},d=[],h=[];for(const f of e){const{revisionUuid:S,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const w=_({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,form_revision:S,submitted_at:r,field_identifier:F});d.push(w);const V={uuid:w.uuid,file_name:P.name,field_identifier:F,file_extension:g.extension,file_sha1:g.sha1,form_revision:S};h.push(V)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.form_revision),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(()=>{this.dispatch(c(d.map(f=>f.uuid)))}),[d,p.then(({attachments:f})=>f)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class Cg extends E{constructor(){super(...arguments);y(this,"name","Form Revision");y(this,"url","/form-revisions");y(this,"actions",{addOne:hi,addMany:mi,setOne:wm,setMany:Em,updateOne:vm,updateMany:Vm,deleteOne:yi,deleteMany:pi,initialize:Rm});y(this,"selectors",{selectById:zm,selectByIds:Bm})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,d=new Date().toISOString(),h=_({...e,created_by:u,submitted_at:d});this.dispatch(a(h));const p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.form],blocks:[h.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class $g extends E{constructor(){super(...arguments);y(this,"name","Form");y(this,"url","/forms");y(this,"actions",{addOne:$m,addMany:Um,setOne:Lm,setMany:km,updateOne:Nm,updateMany:Gm,deleteOne:Hm,deleteMany:Wm,initialize:Cm});y(this,"selectors",{selectById:Zm,selectByIds:Jm})}add(e,n){var A;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,l=new Date().toISOString(),u=((A=a.getState().userReducer.currentUser)==null?void 0:A.id)??null,d=_({...e,submitted_at:l,created_by:u}),h=_({...n,form:d.uuid,submitted_at:l,created_by:u});this.dispatch(c(d)),this.dispatch(hi(h));const p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{...z(d),initial_revision:{uuid:h.uuid,submitted_at:h.submitted_at,title:h.title,description:h.description,fields:h.fields}},blockers:[],blocks:[d.uuid,h.uuid]});return p.catch(f=>{throw this.dispatch(r(d.uuid)),this.dispatch(yi(h.uuid)),f}),[d,h,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error("Expected form to exist");const d=Iy(e)(l),h=jm(e)(l);this.dispatch(a(e)),this.dispatch(Mi(D(d))),this.dispatch(pi(D(h)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(u)),this.dispatch(mi(h)),this.dispatch(_i(d)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Ug extends E{constructor(){super(...arguments);y(this,"name","Form Submission Attachment");y(this,"url","/form-submission-attachments");y(this,"actions",{addOne:xm,addMany:Ii,setOne:ey,setMany:ty,updateOne:sy,updateMany:iy,deleteOne:ny,deleteMany:Oi,initialize:Qm});y(this,"selectors",{selectById:ay,selectByIds:cy})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,u={},d=[],h=[];for(const f of e){const{submissionUuid:S,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const w=_({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,form_submission:S,submitted_at:r,field_identifier:F});d.push(w);const V={uuid:w.uuid,file_name:P.name,file_sha1:g.sha1,file_extension:g.extension,field_identifier:F,form_submission:S};h.push(V)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.form_submission),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(f=>{throw this.dispatch(c(d.map(S=>S.uuid))),f}),[d,p.then(({attachments:f})=>f)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),l=gi(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class Lg extends E{constructor(){super(...arguments);y(this,"name","Form Submission");y(this,"url","/form-submissions");y(this,"actions",{addOne:my,addMany:_i,setOne:oy,setMany:hy,updateOne:yy,updateMany:py,deleteOne:Ay,deleteMany:Mi,initialize:ly});y(this,"selectors",{selectById:Sy,selectByIds:Ty})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,d=new Date().toISOString(),h=_({...e,created_by:u,submitted_at:d}),p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.form_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${u.uuid}/`,payload:e,blockers:[u.uuid],blocks:[u.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const d=dy(e)(l);this.dispatch(a(e)),this.dispatch(Oi(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(Ii(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(r)),r}}class kg extends E{constructor(){super(...arguments);y(this,"name","Geo Image");y(this,"url","/geo-images");y(this,"actions",{addOne:_y,addMany:My,setOne:gy,setMany:by,updateOne:Ry,updateMany:wy,deleteOne:Ey,deleteMany:vy,initialize:Fy});y(this,"selectors",{selectById:zy,selectByIds:By})}async add(e){var F;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,{file:l,...u}=e,d=new Date().toISOString(),h=((F=n.getState().userReducer.currentUser)==null?void 0:F.id)??null,p=u.project,A=await this.client.files.getFilePayload(l),f=_({...u,file_name:l.name,file_sha1:A.sha1,file_type:l.type,file:URL.createObjectURL(l),submitted_at:d,created_by:h});this.dispatch(a(f));const S=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{uuid:f.uuid,submitted_at:d,title:f.title,description:f.description,geo_marker:f.geo_marker,canvas_marker:f.canvas_marker,sha1:f.file_sha1,project:f.project,file_name:f.file_name,direction:f.direction,original_date:f.original_date,file:A},blocks:[p],blockers:[p]});return S.then(P=>{this.client.files.processPresignedUrls(P.presigned_urls),this.dispatch(c(P.geo_image))}).catch(()=>{this.dispatch(r(f.uuid))}),[f,S.then(P=>P.geo_image)]}async bulkAdd(e,n){var F;const{store:a}=this.client,{addMany:c,setMany:r,deleteMany:l}=this.actions,u=new Date().toISOString(),d=((F=a.getState().userReducer.currentUser)==null?void 0:F.id)??null,h=[],p=[],A=[],f={};for(const P of e){const{file:g,...w}=P,V=await this.client.files.getFilePayload(g);V.sha1 in f||(f[V.sha1]=V);const v=_({...w,file_name:g.name,file_sha1:V.sha1,file_type:g.type,file:URL.createObjectURL(g),submitted_at:u,created_by:d,project:n});h.push(v),p.push(v.uuid),A.push({uuid:v.uuid,sha1:v.file_sha1,file_name:v.file_name,title:v.title,description:v.description,geo_marker:v.geo_marker,canvas_marker:v.canvas_marker,direction:v.direction,original_date:v.original_date})}this.dispatch(c(h));const S=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:u,project:n,geo_images:A,files:Object.values(f)},blocks:[n],blockers:p});return S.then(P=>{this.client.files.processPresignedUrls(P.presigned_urls),this.dispatch(r(P.geo_images))}).catch(()=>{this.dispatch(l(p))}),[h,S.then(P=>P.geo_images)]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blocks:[e],blockers:[e]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.listPaginated({queryParams:{project:e}},n),r=c.flat();return this.dispatch(a(r)),c}}class Ng extends E{constructor(){super(...arguments);y(this,"name","Issue Association");y(this,"url","/issue-associations");y(this,"actions",{addOne:ky,addMany:Mt,setOne:$y,setMany:Cy,updateOne:Uy,updateMany:Ly,deleteOne:Ny,deleteMany:Rt,initialize:Dy});y(this,"selectors",{selectById:Hy,selectByIds:Wy})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=new Date().toISOString(),u=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,d=_({...e,submitted_at:l,created_by:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Gg extends Je{constructor(){super(...arguments);y(this,"name","Issue Attachment");y(this,"url","/issue-attachments");y(this,"actions",{addOne:xy,addMany:zi,setOne:ep,setMany:tp,updateOne:sp,updateMany:ip,deleteOne:np,deleteMany:Bi,initialize:Qy});y(this,"selectors",{selectById:dp,selectByIds:rp})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue:e.issue}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Hg extends Je{constructor(){super(...arguments);y(this,"name","Issue Comment Attachment");y(this,"url","/issue-comment-attachments");y(this,"actions",{addOne:hp,addMany:mp,setOne:yp,setMany:pp,updateOne:Ap,updateMany:fp,deleteOne:Sp,deleteMany:Tp,initialize:op});y(this,"selectors",{selectById:Op,selectByIds:Pp})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_comment:e.issue_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Wg extends E{constructor(){super(...arguments);y(this,"name","Issue Comment");y(this,"url","/issue-comments");y(this,"actions",{addOne:_p,addMany:Mp,setOne:Rp,setMany:wp,updateOne:Ep,updateMany:vp,deleteOne:Vp,deleteMany:zp,initialize:bp});y(this,"selectors",{selectById:Bp,selectByIds:jp})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,l=_({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[e.issue],blocks:[l.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{setMany:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Kg extends E{constructor(){super(...arguments);y(this,"name","Issue");y(this,"url","/issues");y(this,"actions",{addOne:$p,addMany:Li,setOne:Up,setMany:Lp,updateOne:kp,updateMany:Np,deleteOne:Gp,deleteMany:ki,initialize:Cp});y(this,"selectors",{selectById:Wp,selectByIds:Kp})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=n.getState(),u=new Date().toISOString(),d=((A=l.userReducer.currentUser)==null?void 0:A.id)??null,h=_({...e,submitted_at:u,created_by:d});this.dispatch(a(h));const p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[h.project,h.issue_type,...h.category?[h.category]:[]],blocks:[h.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(h.uuid)),f}),[h,p]}update(e){var p;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const l={...r,...e};this.dispatch(n(l));const u={};for(const A of[C.TITLE,C.DESCRIPTION,C.STATUS,C.CATEGORY,C.PRIORITY,C.ASSIGNED_TO,C.DUE_DATE])if(A in e&&e[A]!==r[A])switch(A){case C.PRIORITY:u[A]=e[A];break;case C.DUE_DATE:u[A]=e[A];break;case C.DESCRIPTION:u[A]=e[A];break;case C.TITLE:u[A]=e[A];break;case C.STATUS:{const f=e[A],S=dn(f)(c);if(!S)throw new Error(`Trying to update issue type status with ${f} which does not exist in store`);u[A]={name:S.name,color:S.color,uuid:S.uuid};break}case C.CATEGORY:{const f=e[A];if(f===null)u[A]=null;else{const S=xs(f)(c);if(!S)throw new Error(`Trying to update category with ${f} which does not exist in store.`);u[A]={name:S.name,color:S.color,uuid:S.uuid}}break}case C.ASSIGNED_TO:{const f=e[A];if(f===null)u[A]=null;else{const S=zt(f)(c);if(!S)throw new Error(`Trying to update assigned to with ${f} which does not exist in store.`);u[A]={full_name:S.username,id:S.id}}break}}const d=_({created_by:((p=c.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:u});this.dispatch(un(d));const h=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return h.then(A=>{this.dispatch(n(A))}).catch(()=>{this.dispatch(n(r)),this.dispatch(on(d.uuid))}),[l,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`No issue with uuid ${e} found in the store`);const d=cp(e)(l),h=OS(e)(l),p={};for(const f of Ky(e)(l))p[f.uuid]=f;for(const f of Yy(e)(l))p[f.uuid]=f;const A=Object.values(p);this.dispatch(a(e)),this.dispatch(Bi(D(d))),this.dispatch(hn(D(h))),this.dispatch(Rt(D(A)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(u)),this.dispatch(zi(d)),this.dispatch(ln(h)),this.dispatch(Mt(A)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Yg extends Je{constructor(){super(...arguments);y(this,"name","Issue Type Attachment");y(this,"url","/issue-type-attachments");y(this,"actions",{addOne:Qp,addMany:xp,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:aA,initialize:Xp});y(this,"selectors",{selectById:dA,selectByIds:rA})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_type:e.issue_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Zg extends E{constructor(){super(...arguments);y(this,"name","Issue Type Fields Attachment");y(this,"url","/issue-type-fields-attachments");y(this,"actions",{addOne:hA,addMany:mA,setOne:yA,setMany:pA,updateOne:AA,updateMany:fA,deleteOne:SA,deleteMany:TA,initialize:oA});y(this,"selectors",{selectById:OA,selectByIds:PA})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,u={},d=[],h=[];for(const f of e){const{fieldsRevisionUuid:S,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const w=_({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,fields_revision:S,submitted_at:r,field_identifier:F});d.push(w);const V={uuid:w.uuid,file_name:P.name,file_extension:g.extension,field_identifier:F,file_sha1:g.sha1,fields_revision:S};h.push(V)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.fields_revision),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(()=>{this.dispatch(c(d.map(f=>f.uuid)))}),[d,p.then(({attachments:f})=>f)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Jg extends E{constructor(){super(...arguments);y(this,"name","Issue Type Fields");y(this,"url","/issue-type-fields");y(this,"actions",{addOne:UA,addMany:LA,setOne:kA,setMany:NA,updateOne:GA,updateMany:HA,deleteOne:WA,deleteMany:KA,initialize:$A});y(this,"selectors",{selectById:ZA,selectByIds:JA})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.issue_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(r(d.uuid)),A}),[d,h]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Xg extends E{constructor(){super(...arguments);y(this,"name","Issue Type Field Values Attachment");y(this,"url","/issue-type-field-values-attachments");y(this,"actions",{addOne:ef,addMany:Ji,setOne:tf,setMany:sf,updateOne:nf,updateMany:af,deleteOne:cf,deleteMany:Xi,initialize:xA});y(this,"selectors",{selectById:rf,selectByIds:uf})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,u={},d=[],h=[];for(const f of e){const{fieldValuesUuid:S,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const w=_({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,field_values:S,submitted_at:r,field_identifier:F});d.push(w);const V={uuid:w.uuid,file_name:P.name,file_sha1:g.sha1,file_extension:g.extension,field_identifier:F,field_values:S};h.push(V)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.field_values),blocks:d.map(f=>f.uuid)});return p.then(({presigned_urls:f,attachments:S})=>{this.client.files.processPresignedUrls(f),this.dispatch(a(S))}).catch(f=>{throw this.dispatch(c(d.map(S=>S.uuid))),f}),[d,p.then(({attachments:f})=>f)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,l=n.getState(),u=r(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Qg extends E{constructor(){super(...arguments);y(this,"name","Issue Type Field Values");y(this,"url","/issue-type-field-values");y(this,"actions",{addOne:_A,addMany:MA,setOne:RA,setMany:wA,updateOne:EA,updateMany:vA,deleteOne:VA,deleteMany:zA,initialize:bA});y(this,"selectors",{selectById:jA,selectByIds:qA})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,d=new Date().toISOString(),h=_({...e,created_by:u,submitted_at:d}),p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.issue,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.uuid,u.fields_revision,u.issue],blocks:[u.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const d=lf(e)(l);this.dispatch(a(e)),this.dispatch(Xi(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(Ji(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class xg extends E{constructor(){super(...arguments);y(this,"name","Issue Type Identifier");y(this,"url","/issue-type-identifiers");y(this,"actions",{addOne:yf,addMany:pf,setOne:Af,setMany:ff,updateOne:Sf,updateMany:Tf,deleteOne:If,deleteMany:Of,initialize:mf});y(this,"selectors",{selectById:Ff,selectByIds:gf})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.issue_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class eb extends E{constructor(){super(...arguments);y(this,"name","Issue Type Identifier Value");y(this,"url","/issue-type-identifier-values");y(this,"actions",{addOne:Rf,addMany:wf,setOne:Ef,setMany:vf,updateOne:Vf,updateMany:zf,deleteOne:Bf,deleteMany:jf,initialize:Mf});y(this,"selectors",{selectById:Df,selectByIds:Cf})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.issue,e.issue_type_identifier],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class tb extends E{constructor(){super(...arguments);y(this,"name","Issue Type");y(this,"url","/issue-types");y(this,"actions",{addOne:kf,addMany:Nf,setOne:Gf,setMany:Hf,updateOne:Wf,updateMany:Kf,deleteOne:Yf,deleteMany:Zf,initialize:Lf});y(this,"selectors",{selectById:Xf,selectByIds:Qf})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,d=new Date().toISOString(),h=_({...e,submitted_at:d,created_by:u});this.dispatch(a(h));const p=this.enqueueRequest({method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[],blocks:[h.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const d=Yp(e)(l);this.dispatch(a(e)),this.dispatch(ki(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(Li(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class sb extends E{constructor(){super(...arguments);y(this,"name","Issue Type Status");y(this,"url","/issue-type-statuses");y(this,"actions",{addOne:sS,addMany:iS,setOne:nS,setMany:aS,updateOne:cS,updateMany:dS,deleteOne:rS,deleteMany:uS,initialize:tS});y(this,"selectors",{selectById:dn,selectByIds:oS})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=new Date().toISOString(),d=_({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.issue_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const l={...r,...e};this.dispatch(n(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.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))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class ib extends E{constructor(){super(...arguments);y(this,"name","Issue Update");y(this,"url","/issue-updates");y(this,"actions",{addOne:un,addMany:ln,setOne:pS,setMany:AS,updateOne:fS,updateMany:SS,deleteOne:on,deleteMany:hn,initialize:yS});y(this,"selectors",{selectById:TS,selectByIds:IS})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}const nb=1800;function ab(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 cb extends tg{constructor(){super(...arguments);y(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:m.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(vo(!1)),this.clearTokens(),this.dispatch(b()),this.dispatch(b())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.log("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=EO(e).exp??n}catch{a=n}return a-n<nb}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??it).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new U({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new U({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=tt.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:m.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(ab(a))})}}class db extends nt{constructor(){super(...arguments);y(this,"name","Organization Access");y(this,"url","/organization-accesses");y(this,"actions",{addOne:qS,addMany:DS,setOne:CS,setMany:$S,updateOne:US,updateMany:LS,deleteOne:kS,deleteMany:NS,initialize:jS});y(this,"selectors",{selectById:HS,selectByIds:WS})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(d=>{throw this.dispatch(a(r)),d}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l),d=zt(u.user)(l);this.dispatch(a(u.uuid)),this.dispatch(fn(u.user));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${u.uuid}/`,blockers:[u.uuid],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(An(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class rb extends nt{constructor(){super(...arguments);y(this,"name","Organization");y(this,"url","/organizations");y(this,"actions",{addOne:xS,addMany:QS,setOne:XS,setMany:JS,updateOne:tT,updateMany:eT,deleteOne:sT,deleteMany:iT,initialize:ZS});y(this,"selectors",{selectById:cT,selectByIds:dT})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class ub extends E{constructor(){super(...arguments);y(this,"name","Project Access");y(this,"url","/project-accesses");y(this,"actions",{addOne:fT,addMany:ST,setOne:TT,setMany:IT,updateOne:OT,updateMany:PT,deleteOne:FT,deleteMany:gT,initialize:AT});y(this,"selectors",{selectById:_T,selectByIds:MT})}add(e){var d;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=_({...e,created_by:((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[l.organization_access,l.project],blocks:[l.uuid]});return u.then(h=>{this.dispatch(c(h))}).catch(h=>{throw this.dispatch(r(l.uuid)),h}),[l,u]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,l=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,u=e.map(p=>_({...p,created_by:l}));this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{project_accesses:u.map(p=>z(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(A=>A.uuid))),p}),[u,d]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return u.then(d=>{this.dispatch(a(d))}).catch(d=>{throw this.dispatch(a(r)),d}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class lb extends Je{constructor(){super(...arguments);y(this,"name","Project Attachment");y(this,"url","/project-attachments");y(this,"actions",{addOne:ET,addMany:vT,setOne:VT,setMany:zT,updateOne:BT,updateMany:jT,deleteOne:qT,deleteMany:DT,initialize:wT});y(this,"selectors",{selectById:$T,selectByIds:UT})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,project:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,project:e.project}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.projectUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class ob extends E{constructor(){super(...arguments);y(this,"name","Project File");y(this,"url","/project-files");y(this,"actions",{addOne:WT,addMany:KT,setOne:GT,setMany:HT,updateOne:YT,updateMany:ZT,deleteOne:JT,deleteMany:XT,initialize:NT});y(this,"selectors",{selectById:iI,selectByIds:nI})}async saveExisting(e){const{setOne:n}=this.actions;if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const a={...e};delete a.file;const c=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:a,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(n(r))}),c}saveActive(){const{store:e}=this.client,{setOne:n}=this.actions,a=e.getState(),c=a.projectFileReducer.activeProjectFileId;if(!c)throw new Error("No active project file");const r=a.projectFileReducer.instances[c];if(!r)throw new Error("No active project file");if(!r.bounds&&!r.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let l;if(typeof r.file=="string"&&!r.file.startsWith("blob:")){const h={...r};delete h.file,l={method:m.PATCH,url:`${this.url}/${c}/`,payload:h,blockers:[c],blocks:[c]}}else l=new Promise((h,p)=>{this.client.files.uploadFileToS3(r.file_sha1).then(([A])=>{h({method:m.POST,url:`${this.url}/`,payload:{...r,...A},blockers:[c],blocks:[c]})}).catch(p)});const d=Promise.resolve(l).then(h=>this.enqueueRequest(h));return d.then(h=>{this.dispatch(n(h))}),this.dispatch(eI),this.dispatch(xT(null)),this.dispatch(QT(!1)),[r,d]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Expected project file with uuid ${e} to exist in the store.`);this.dispatch(c(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(a(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class hb extends nt{constructor(){super(...arguments);y(this,"name","Project");y(this,"url","/projects");y(this,"actions",{addOne:oI,addMany:lI,setOne:uI,setMany:rI,updateOne:mI,updateMany:hI,deleteOne:yI,deleteMany:pI,initialize:dI});y(this,"selectors",{selectById:SI,selectByIds:TI})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:m.POST,url:`${this.url}/`,payload:z(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:z(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class mb extends E{constructor(){super(...arguments);y(this,"name","Team Membership");y(this,"url","/team-memberships");y(this,"actions",{addOne:FI,addMany:gI,setOne:bI,setMany:_I,updateOne:MI,updateMany:RI,deleteOne:wI,deleteMany:EI,initialize:PI});y(this,"selectors",{selectById:zI,selectByIds:BI})}add(e){var d;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=_({...e,created_by:((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[e.team],blocks:[l.uuid]});return u.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,l=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,u=e.map(p=>_({...p,created_by:l}));this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{team_memberships:u.map(p=>z(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{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class yb extends E{constructor(){super(...arguments);y(this,"name","Team");y(this,"url","/teams");y(this,"actions",{addOne:DI,addMany:CI,setOne:$I,setMany:UI,updateOne:LI,updateMany:kI,deleteOne:NI,deleteMany:GI,initialize:qI});y(this,"selectors",{selectById:WI,selectByIds:KI})}add(e){var d;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=_({...e,submitted_at:new Date().toISOString(),created_by:((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[],blocks:[l.uuid]});return u.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:z(e),blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class pb extends nt{constructor(){super(...arguments);y(this,"name","User");y(this,"url","/user");y(this,"actions",{addOne:An,addMany:MS,setOne:_S,setMany:bS,updateOne:wS,updateMany:RS,deleteOne:fn,deleteMany:ES,initialize:gS});y(this,"selectors",{selectById:zt,selectByIds:zS})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:m.GET,url:r,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}async function Dn(t,s,e,n,a){const c=n instanceof Xe;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:l,payload:u,headers:d,method:h,queryParams:p,attachmentHash:A,isExternalUrl:f,isAuthNeeded:S,isResponseBlob:F}={...r,...s};let P=s.url;const g=A?await e.files.fetchCache(A):void 0;if(A&&!g)throw new Error(`Cannot upload file ${A} because it's not cached.`);!f&&!P.startsWith("http")&&(!P.startsWith("/")&&!P.startsWith("blob:")&&(P="/"+P),P=t+P);const w=q=>{if(A){if(!l)throw new Error(`No S3 URL for file ${A}`);if("warning"in l)throw new Error(`S3 URL warning for file ${A}`);if(!g)throw new Error(`No file for file ${A}`);const $=l.fields["x-amz-checksum-sha1"];if(!$)throw new Error(`No checksum for file ${A}`);return q.set("x-amz-checksum-sha1",$).field({...u,...l.fields}).attach("file",g)}return q.send(u)},v={[m.GET]:()=>F?et.get(P.toString()).responseType("blob"):et.get(P.toString()),[m.POST]:()=>{const q=et.post(P.toString());return w(q)},[m.PATCH]:()=>{const q=et.patch(P.toString());return w(q)},[m.PUT]:()=>{const q=et.put(P.toString());return w(q)},[m.DELETE]:()=>{const q=et.delete(P.toString());return w(q)}}[h];let B=v();if(a==null||a.addEventListener("abort",()=>{console.debug("aborting request:",s),B.abort()}),S&&c){const q=n.auth.getAuthHeader();B=B.set("Authorization",q)}d&&(B=B.set(d));try{return await B.query(p)}catch(q){const $=oO(q),FO=$==null?void 0:$.status;if(c&&FO===401)return await n.auth.handleUnauthorized(B,$),B.query(p);throw new U({response:$,innerError:q,discard:zn.includes(FO)})}}class Ab{constructor(s){y(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Ut,r={...e,uuid:e.uuid??tt.v4()};return Dn(s,r,this,n,a).then(l=>{c.resolve(l.body)}).catch(l=>{l instanceof Error?c.reject(l):c.reject(new Error((l??it).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof U)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof U)throw a;return a})}_enqueueRequest(s,e,n){const a=new Ut,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(oT(c)),l=d=>{if(d)a.resolve(d.body);else{const h=new U({message:"Could not get a response from the server.",response:d,discard:!0});a.reject(h)}},u=d=>{d instanceof U?d.options.discard=!0:(console.error("Received an unexpected error while processing a request:",d,`
|
|
15
|
+
Converting error to APIError and discarding.`),d=new U({message:"An error occurred while processing the request.",innerError:d,discard:!0})),a.reject(d)};return r.then(l,u),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:l}=r,u=[];let d=await this.performRequest(s,r,a,c);for(u.push(d.results);d.next;)d=await this.performRequest(s,{url:d.next,method:l},a,c),u.push(d.results);return u}}class at{constructor(){y(this,"graph");y(this,"requestAttemptCounter");this.graph=new vO.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new at;for(let n=0;n<s.length;n++){const a=s[n];if(!a){console.error("Outbox item was undefined");continue}e.sneakRequest(a);for(let c=0;c<n;c++){const r=s[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==a.payload.uuid&&r.payload.blocks.some(l=>a.payload.blockers.includes(l))&&at._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){at._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);s.payload.blockers.some(a=>n.payload.blocks.includes(a))&&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;this.graph.getNodeData(e).payload.blockers.some(a=>s.payload.blocks.includes(a))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let hO;function mO(t){hO=t}function ct(){return hO}let yO;function pO(t){yO=t}function AO(){return yO}let Cn=null;function xe(){const t=ct();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Cn)return Cn;const s=t.getState().offline.outbox,e=at._fromOutbox(s);return Cn=e,e}const fb=(t,s)=>{const e=new s(t);return pO(e),mO(t),e};class Sb{constructor(s){y(this,"_all");y(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 $n{constructor(){y(this,"next");this.next=null}then(s){return new Sb(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s),!ct())throw new Error("Client store not set");const n=AO();if(!n)throw new Error("Client SDK not set");return rO(s,n)}}}class fO extends $n{async run(s){return super.run(s)}}class SO extends $n{async run(s){return super.run(s)}}const TO=new fO().then(new SO).compile();function IO(t){var s;return(s=TO[0])==null?void 0:s.run(t)}var OO=(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))(OO||{});i.ALL_MIDDLEWARE=TO,i.APIError=U,i.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=xI,i.AgentService=sg,i.AssetAttachmentService=ig,i.AssetProcedureService=ug,i.AssetProcedureStepFieldValuesAttachmentService=mg,i.AssetProcedureStepFieldValuesService=yg,i.AssetProcedureStepFieldsAttachmentService=og,i.AssetProcedureStepFieldsService=hg,i.AssetProcedureStepService=pg,i.AssetProcedureTypeAttachmentService=ng,i.AssetProcedureTypeFieldValuesAttachmentService=dg,i.AssetProcedureTypeFieldValuesService=rg,i.AssetProcedureTypeFieldsAttachmentService=ag,i.AssetProcedureTypeFieldsService=cg,i.AssetProcedureTypeService=lg,i.AssetService=Ag,i.AssetStageCompletionService=fg,i.AssetStageService=Sg,i.AssetStatusType=Hn,i.AssetTypeAttachmentService=Tg,i.AssetTypeFieldValuesAttachmentService=Pg,i.AssetTypeFieldValuesService=Fg,i.AssetTypeFieldsAttachmentService=Ig,i.AssetTypeFieldsService=Og,i.AssetTypeIdentifierService=gg,i.AssetTypeIdentifierValueService=bg,i.AssetTypeService=_g,i.AssetTypeStatusService=Mg,i.AttachmentModel=Wn,i.BaseApiService=Xe,i.BaseModelApiService=nt,i.BaseOfflineAttachmentModelService=Je,i.BaseOfflineModelApiService=E,i.BaseSDK=Ab,i.COMMON_AUTO_FIELDS=xn,i.CategoryService=Rg,i.DEFAULT_ISSUE_PRIORITY=VO,i.DEFAULT_PAGE_SIZE=QI,i.DISCARD_HTTP_STATUSES=zn,i.DeferredPromise=Ut,i.DocumentAttachmentService=wg,i.DocumentService=Eg,i.EMPTY_ARRAY=kn,i.EMPTY_OBJECT=Nn,i.EmailDomainsService=vg,i.EmailVerificationService=Vg,i.FileService=Bg,i.FormIdentifierService=jg,i.FormIdentifierValueService=qg,i.FormRevisionAttachmentService=Dg,i.FormRevisionService=Cg,i.FormService=$g,i.FormSubmissionAttachmentService=Ug,i.FormSubmissionService=Lg,i.GeoImageService=kg,i.HttpMethod=m,i.IssueAssociationService=Ng,i.IssueAttachmentService=Gg,i.IssueCommentAttachmentService=Hg,i.IssueCommentService=Wg,i.IssuePriority=$t,i.IssueService=Kg,i.IssueStatusType=Kn,i.IssueTypeAttachmentService=Yg,i.IssueTypeFieldValuesAttachmentService=Xg,i.IssueTypeFieldValuesService=Qg,i.IssueTypeFieldsAttachmentService=Zg,i.IssueTypeFieldsService=Jg,i.IssueTypeIdentifierService=xg,i.IssueTypeIdentifierValueService=eb,i.IssueTypeService=tb,i.IssueTypeStatusService=sb,i.IssueUpdateChange=C,i.IssueUpdateService=ib,i.JWTService=cb,i.OUTBOX_RETRY_DELAY=Yn,i.OfflineAnalyticsMiddleware=fO,i.OfflineMiddleware=$n,i.OrganizationAccessLevel=Gn,i.OrganizationAccessService=db,i.OrganizationService=rb,i.OutboxCoordinator=at,i.ProjectAccessService=ub,i.ProjectAttachmentService=lb,i.ProjectFileService=ob,i.ProjectService=hb,i.RESET_ORGANIZATION_STATE=R,i.RESET_PROJECT_STATE=j,i.RESET_STATE=b,i.RateLimitingMiddleware=SO,i.SelectorBuilder=kF,i.TeamMembershipService=mb,i.TeamService=yb,i.UNKNOWN_ERROR_MESSAGE=it,i.UserService=pb,i.VERSION_REDUCER_KEY=dt,i.VerificationCodeType=OO,i._setLatestRetryTime=mT,i.addAsset=wr,i.addAssetAttachment=ya,i.addAssetAttachments=Yt,i.addAssetProcedure=kc,i.addAssetProcedureStep=fr,i.addAssetProcedureStepFieldValues=tr,i.addAssetProcedureStepFieldValuesAttachment=kd,i.addAssetProcedureStepFieldValuesAttachments=fs,i.addAssetProcedureStepFieldValuesMany=sr,i.addAssetProcedureStepFields=wd,i.addAssetProcedureStepFieldsAttachment=pd,i.addAssetProcedureStepFieldsAttachments=Ad,i.addAssetProcedureStepFieldsMany=Ed,i.addAssetProcedureSteps=Sr,i.addAssetProcedureType=td,i.addAssetProcedureTypeAttachment=Ma,i.addAssetProcedureTypeAttachments=Ra,i.addAssetProcedureTypeFieldValues=Rc,i.addAssetProcedureTypeFieldValuesAttachment=pc,i.addAssetProcedureTypeFieldValuesAttachments=is,i.addAssetProcedureTypeFieldValuesMany=wc,i.addAssetProcedureTypeFields=tc,i.addAssetProcedureTypeFieldsAttachment=La,i.addAssetProcedureTypeFieldsAttachments=ka,i.addAssetProcedureTypeFieldsMany=sc,i.addAssetProcedureTypes=sd,i.addAssetProcedures=rs,i.addAssetStage=nu,i.addAssetStageCompletion=Lr,i.addAssetStageCompletions=kr,i.addAssetStages=au,i.addAssetType=ao,i.addAssetTypeAttachment=pu,i.addAssetTypeAttachments=zs,i.addAssetTypeFieldValues=pl,i.addAssetTypeFieldValuesAttachment=sl,i.addAssetTypeFieldValuesAttachments=Us,i.addAssetTypeFieldValuesMany=Al,i.addAssetTypeFields=ku,i.addAssetTypeFieldsAttachment=Ru,i.addAssetTypeFieldsAttachments=wu,i.addAssetTypeFieldsMany=Nu,i.addAssetTypeIdentifier=wl,i.addAssetTypeIdentifierValue=Nl,i.addAssetTypeIdentifierValues=Gl,i.addAssetTypeIdentifiers=El,i.addAssetTypeStatus=So,i.addAssetTypeStatuses=To,i.addAssetTypes=co,i.addAssets=gs,i.addCategories=qo,i.addCategory=jo,i.addConversation=ra,i.addConversations=iP,i.addDocument=rh,i.addDocumentAttachment=Yo,i.addDocumentAttachments=Zo,i.addDocuments=uh,i.addEmailDomain=Ph,i.addEmailDomains=Fh,i.addForm=$m,i.addFormIdentifier=Lh,i.addFormIdentifierValue=tm,i.addFormIdentifierValues=sm,i.addFormIdentifiers=kh,i.addFormRevision=hi,i.addFormRevisionAttachment=pm,i.addFormRevisionAttachments=Am,i.addFormRevisions=mi,i.addFormSubmission=my,i.addFormSubmissionAttachment=xm,i.addFormSubmissionAttachments=Ii,i.addFormSubmissions=_i,i.addForms=Um,i.addGeoImage=_y,i.addGeoImages=My,i.addIssue=$p,i.addIssueAssociation=ky,i.addIssueAssociations=Mt,i.addIssueAttachment=xy,i.addIssueAttachments=zi,i.addIssueComment=_p,i.addIssueCommentAttachment=hp,i.addIssueCommentAttachments=mp,i.addIssueComments=Mp,i.addIssueType=kf,i.addIssueTypeAttachment=Qp,i.addIssueTypeAttachments=xp,i.addIssueTypeFieldValues=_A,i.addIssueTypeFieldValuesAttachment=ef,i.addIssueTypeFieldValuesAttachments=Ji,i.addIssueTypeFieldValuesMany=MA,i.addIssueTypeFields=UA,i.addIssueTypeFieldsAttachment=hA,i.addIssueTypeFieldsAttachments=mA,i.addIssueTypeFieldsMany=LA,i.addIssueTypeIdentifier=yf,i.addIssueTypeIdentifierValue=Rf,i.addIssueTypeIdentifierValues=wf,i.addIssueTypeIdentifiers=pf,i.addIssueTypeStatus=sS,i.addIssueTypeStatuses=iS,i.addIssueTypes=Nf,i.addIssueUpdate=un,i.addIssueUpdates=ln,i.addIssues=Li,i.addOrganization=xS,i.addOrganizationAccess=qS,i.addOrganizationAccesses=DS,i.addOrganizations=QS,i.addProject=oI,i.addProjectAccess=fT,i.addProjectAccesses=ST,i.addProjectAttachment=ET,i.addProjectAttachments=vT,i.addProjectFile=WT,i.addProjectFiles=KT,i.addProjects=lI,i.addTeam=DI,i.addTeamMembership=FI,i.addTeamMemberships=gI,i.addTeams=CI,i.addUser=An,i.addUsers=MS,i.agentsReducer=oa,i.agentsSlice=Ht,i.areArraysEqual=jO,i.assetAttachmentReducer=ga,i.assetAttachmentSlice=Kt,i.assetProcedureReducer=Yc,i.assetProcedureSlice=ds,i.assetProcedureStepFieldValuesAttachmentReducer=Qd,i.assetProcedureStepFieldValuesAttachmentSlice=As,i.assetProcedureStepFieldValuesReducer=hr,i.assetProcedureStepFieldValuesSlice=Is,i.assetProcedureStepFieldsAttachmentReducer=_d,i.assetProcedureStepFieldsAttachmentSlice=hs,i.assetProcedureStepFieldsReducer=$d,i.assetProcedureStepFieldsSlice=ys,i.assetProcedureStepReducer=Fr,i.assetProcedureStepSlice=Os,i.assetProcedureTypeAttachmentReducer=ja,i.assetProcedureTypeAttachmentSlice=Xt,i.assetProcedureTypeFieldValuesAttachmentReducer=Oc,i.assetProcedureTypeFieldValuesAttachmentSlice=ss,i.assetProcedureTypeFieldValuesReducer=qc,i.assetProcedureTypeFieldValuesSlice=cs,i.assetProcedureTypeFieldsAttachmentReducer=Za,i.assetProcedureTypeFieldsAttachmentSlice=xt,i.assetProcedureTypeFieldsReducer=uc,i.assetProcedureTypeFieldsSlice=ts,i.assetProcedureTypeReducer=ud,i.assetProcedureTypeSlice=ls,i.assetReducer=Cr,i.assetSlice=Fs,i.assetStageCompletionReducer=Zr,i.assetStageCompletionSlice=Rs,i.assetStageReducer=lu,i.assetStageSlice=ws,i.assetTypeAttachmentReducer=bu,i.assetTypeAttachmentSlice=Vs,i.assetTypeFieldValuesAttachmentReducer=hl,i.assetTypeFieldValuesAttachmentSlice=$s,i.assetTypeFieldValuesReducer=_l,i.assetTypeFieldValuesSlice=Ns,i.assetTypeFieldsAttachmentReducer=$u,i.assetTypeFieldsAttachmentSlice=qs,i.assetTypeFieldsReducer=xu,i.assetTypeFieldsSlice=Cs,i.assetTypeIdentifierReducer=Ul,i.assetTypeIdentifierSlice=Gs,i.assetTypeIdentifierValueReducer=eo,i.assetTypeIdentifierValueSlice=Ws,i.assetTypeReducer=po,i.assetTypeSlice=Ks,i.assetTypeStatusReducer=wo,i.assetTypeStatusSlice=Zs,i.assetTypeStatusSortFn=sa,i.authReducer=Vo,i.authSlice=Pt,i.baseReducer=$F,i.baseReducers=Vn,i.blobToBase64=GO,i.categoryReducer=Ho,i.categorySlice=Xs,i.clearTokens=LP,i.constructUploadedFilePayloads=NO,i.createModelAdapter=M,i.createOfflineAction=uT,i.createPayload=z,i.createSelectionAdapter=zO,i.deleteAsset=Vr,i.deleteAssetAttachment=Ta,i.deleteAssetAttachments=Zt,i.deleteAssetProcedure=Hc,i.deleteAssetProcedureStep=Or,i.deleteAssetProcedureStepFieldValues=dr,i.deleteAssetProcedureStepFieldValuesAttachment=Kd,i.deleteAssetProcedureStepFieldValuesAttachments=Ss,i.deleteAssetProcedureStepFieldValuesMany=rr,i.deleteAssetProcedureStepFields=jd,i.deleteAssetProcedureStepFieldsAttachment=Od,i.deleteAssetProcedureStepFieldsAttachments=Pd,i.deleteAssetProcedureStepFieldsMany=qd,i.deleteAssetProcedureSteps=Pr,i.deleteAssetProcedureType=ad,i.deleteAssetProcedureTypeAttachment=za,i.deleteAssetProcedureTypeAttachments=Ba,i.deleteAssetProcedureTypeFieldValues=Bc,i.deleteAssetProcedureTypeFieldValuesAttachment=Ic,i.deleteAssetProcedureTypeFieldValuesAttachments=ns,i.deleteAssetProcedureTypeFieldValuesMany=jc,i.deleteAssetProcedureTypeFields=dc,i.deleteAssetProcedureTypeFieldsAttachment=Ka,i.deleteAssetProcedureTypeFieldsAttachments=Ya,i.deleteAssetProcedureTypeFieldsMany=rc,i.deleteAssetProcedureTypes=cd,i.deleteAssetProcedures=us,i.deleteAssetStage=ru,i.deleteAssetStageCompletion=Kr,i.deleteAssetStageCompletions=Yr,i.deleteAssetStages=uu,i.deleteAssetType=lo,i.deleteAssetTypeAttachment=Iu,i.deleteAssetTypeAttachments=Bs,i.deleteAssetTypeFieldValues=Ol,i.deleteAssetTypeFieldValuesAttachment=dl,i.deleteAssetTypeFieldValuesAttachments=Ls,i.deleteAssetTypeFieldValuesMany=Pl,i.deleteAssetTypeFields=Yu,i.deleteAssetTypeFieldsAttachment=Bu,i.deleteAssetTypeFieldsAttachments=ju,i.deleteAssetTypeFieldsMany=Zu,i.deleteAssetTypeIdentifier=jl,i.deleteAssetTypeIdentifierValue=Zl,i.deleteAssetTypeIdentifierValues=Jl,i.deleteAssetTypeIdentifiers=ql,i.deleteAssetTypeStatus=go,i.deleteAssetTypeStatuses=bo,i.deleteAssetTypes=oo,i.deleteAssets=bs,i.deleteCategories=ko,i.deleteCategory=Lo,i.deleteConversation=cP,i.deleteConversations=dP,i.deleteDocument=yh,i.deleteDocumentAttachment=eh,i.deleteDocumentAttachments=th,i.deleteDocuments=ph,i.deleteEmailDomain=Rh,i.deleteEmailDomains=wh,i.deleteForm=Hm,i.deleteFormIdentifier=Kh,i.deleteFormIdentifierValue=dm,i.deleteFormIdentifierValues=rm,i.deleteFormIdentifiers=Yh,i.deleteFormRevision=yi,i.deleteFormRevisionAttachment=Om,i.deleteFormRevisionAttachments=Pm,i.deleteFormRevisions=pi,i.deleteFormSubmission=Ay,i.deleteFormSubmissionAttachment=ny,i.deleteFormSubmissionAttachments=Oi,i.deleteFormSubmissions=Mi,i.deleteForms=Wm,i.deleteGeoImage=Ey,i.deleteGeoImages=vy,i.deleteIssue=Gp,i.deleteIssueAssociation=Ny,i.deleteIssueAssociations=Rt,i.deleteIssueAttachment=np,i.deleteIssueAttachments=Bi,i.deleteIssueComment=Vp,i.deleteIssueCommentAttachment=Sp,i.deleteIssueCommentAttachments=Tp,i.deleteIssueComments=zp,i.deleteIssueType=Yf,i.deleteIssueTypeAttachment=nA,i.deleteIssueTypeAttachments=aA,i.deleteIssueTypeFieldValues=VA,i.deleteIssueTypeFieldValuesAttachment=cf,i.deleteIssueTypeFieldValuesAttachments=Xi,i.deleteIssueTypeFieldValuesMany=zA,i.deleteIssueTypeFields=WA,i.deleteIssueTypeFieldsAttachment=SA,i.deleteIssueTypeFieldsAttachments=TA,i.deleteIssueTypeFieldsMany=KA,i.deleteIssueTypeIdentifier=If,i.deleteIssueTypeIdentifierValue=Bf,i.deleteIssueTypeIdentifierValues=jf,i.deleteIssueTypeIdentifiers=Of,i.deleteIssueTypeStatus=rS,i.deleteIssueTypeStatuses=uS,i.deleteIssueTypes=Zf,i.deleteIssueUpdate=on,i.deleteIssueUpdates=hn,i.deleteIssues=ki,i.deleteOrganization=sT,i.deleteOrganizationAccess=kS,i.deleteOrganizationAccesses=NS,i.deleteOrganizations=iT,i.deleteProject=yI,i.deleteProjectAccess=FT,i.deleteProjectAccesses=gT,i.deleteProjectAttachment=qT,i.deleteProjectAttachments=DT,i.deleteProjectFile=JT,i.deleteProjectFiles=XT,i.deleteProjects=pI,i.deleteTeam=NI,i.deleteTeamMembership=wI,i.deleteTeamMemberships=EI,i.deleteTeams=GI,i.deleteUser=fn,i.deleteUsers=ES,i.dequeue=dO,i.discard=uO,i.documentAttachmentReducer=ah,i.documentAttachmentSlice=ei,i.documentSlice=si,i.documentsReducer=Ah,i.downloadFile=HO,i.downloadInMemoryFile=kO,i.emailDomainsReducer=zh,i.emailDomainsSlice=ni,i.emailRegex=eP,i.enqueue=cO,i.enqueueRequest=oT,i.extractResponseFromError=oO,i.fallbackToEmptyArray=I,i.fallbackToEmptyObject=yt,i.fileReducer=Ch,i.fileSlice=ci,i.fileToBlob=Xn,i.formIdentifierReducer=Qh,i.formIdentifierSlice=di,i.formIdentifierValueReducer=hm,i.formIdentifierValueSlice=ui,i.formReducer=Km,i.formRevisionAttachmentReducer=_m,i.formRevisionAttachmentSlice=li,i.formRevisionReducer=qm,i.formRevisionsSlice=oi,i.formSlice=fi,i.formSubmissionAttachmentReducer=ry,i.formSubmissionAttachmentSlice=Ti,i.formSubmissionReducer=Oy,i.formSubmissionSlice=bi,i.geoImageReducer=jy,i.geoImageSlice=wi,i.getAssetProcedureStepSubTree=ta,i.getAssetProcedureStepTrees=tP,i.getClientSDK=AO,i.getClientStore=ct,i.getDocumentSubTree=aa,i.getDocumentTrees=sP,i.getFileIdentifier=LO,i.getFileS3Key=Gt,i.getLocalDateString=Zn,i.getLocalRelativeDateString=$O,i.getOutboxCoordinator=xe,i.getRenamedFile=Jn,i.getRequestDescription=O,i.hashFile=st,i.initSDK=fb,i.initializeAssetAttachments=ma,i.initializeAssetProcedureStepFieldValues=er,i.initializeAssetProcedureStepFieldValuesAttachments=Ld,i.initializeAssetProcedureStepFields=Rd,i.initializeAssetProcedureStepFieldsAttachments=yd,i.initializeAssetProcedureSteps=yr,i.initializeAssetProcedureTypeAttachments=_a,i.initializeAssetProcedureTypeFieldValues=Mc,i.initializeAssetProcedureTypeFieldValuesAttachments=yc,i.initializeAssetProcedureTypeFields=ec,i.initializeAssetProcedureTypeFieldsAttachments=Ua,i.initializeAssetProcedureTypes=ed,i.initializeAssetProcedures=Lc,i.initializeAssetStageCompletions=Ur,i.initializeAssetStages=tu,i.initializeAssetTypeAttachments=yu,i.initializeAssetTypeFieldValues=yl,i.initializeAssetTypeFieldValuesAttachments=tl,i.initializeAssetTypeFields=Lu,i.initializeAssetTypeFieldsAttachments=Mu,i.initializeAssetTypeIdentifierValues=kl,i.initializeAssetTypeIdentifiers=Rl,i.initializeAssetTypeStatuses=fo,i.initializeAssetTypes=so,i.initializeAssets=Rr,i.initializeCategories=Bo,i.initializeConversations=da,i.initializeDocumentAttachments=Ko,i.initializeDocuments=dh,i.initializeEmailDomains=Oh,i.initializeFormIdentifierValues=em,i.initializeFormIdentifiers=Uh,i.initializeFormRevisionAttachments=ym,i.initializeFormRevisions=Rm,i.initializeFormSubmissionAttachments=Qm,i.initializeFormSubmissions=ly,i.initializeForms=Cm,i.initializeGeoImages=Fy,i.initializeIssueAssociations=Dy,i.initializeIssueAttachments=Qy,i.initializeIssueCommentAttachments=op,i.initializeIssueComments=bp,i.initializeIssueTypeAttachments=Xp,i.initializeIssueTypeFieldValues=bA,i.initializeIssueTypeFieldValuesAttachments=xA,i.initializeIssueTypeFields=$A,i.initializeIssueTypeFieldsAttachments=oA,i.initializeIssueTypeIdentifierValues=Mf,i.initializeIssueTypeIdentifiers=mf,i.initializeIssueTypeStatuses=tS,i.initializeIssueTypes=Lf,i.initializeIssueUpdates=yS,i.initializeIssues=Cp,i.initializeOrganizationAccesses=jS,i.initializeOrganizations=ZS,i.initializeProjectAccesses=AT,i.initializeProjectAttachments=wT,i.initializeProjectFiles=NT,i.initializeProjects=dI,i.initializeTeamMemberships=PI,i.initializeTeams=qI,i.initializeUsers=gS,i.isToday=CO,i.issueAssociationReducer=Jy,i.issueAssociationSlice=vi,i.issueAttachmentReducer=up,i.issueAttachmentSlice=Vi,i.issueCommentAttachmentReducer=Fp,i.issueCommentAttachmentSlice=qi,i.issueCommentReducer=qp,i.issueCommentSlice=Ci,i.issueReducer=Zp,i.issueSlice=Ui,i.issueTypeAttachmentReducer=uA,i.issueTypeAttachmentSlice=Ni,i.issueTypeFieldValuesAttachmentReducer=of,i.issueTypeFieldValuesAttachmentSlice=Zi,i.issueTypeFieldValuesReducer=DA,i.issueTypeFieldValuesSlice=Ki,i.issueTypeFieldsAttachmentReducer=FA,i.issueTypeFieldsAttachmentSlice=Hi,i.issueTypeFieldsReducer=XA,i.issueTypeFieldsSlice=Yi,i.issueTypeIdentifierReducer=bf,i.issueTypeIdentifierSlice=xi,i.issueTypeIdentifierValueReducer=$f,i.issueTypeIdentifierValueSlice=tn,i.issueTypeReducer=xf,i.issueTypeSlice=sn,i.issueTypeStatusReducer=hS,i.issueTypeStatusSlice=an,i.issueTypeStatusSortFn=ia,i.issueUpdateReducer=PS,i.issueUpdateSlice=rn,i.logOnlyOnce=WO,i.markAsDeleted=hT,i.markForDeletion=FF,i.memoize=kt,i.onlyUniqueHashes=xO,i.onlyUniqueOfflineIds=QO,i.organizationAccessReducer=GS,i.organizationAccessSlice=Tn,i.organizationReducer=rT,i.organizationSlice=In,i.outboxReducer=yT,i.outboxSlice=On,i.overmapEnhancer=JF,i.overmapReducer=UF,i.overmapReducers=XI,i.performRequest=Dn,i.performRequestFromAction=rO,i.projectAccessReducer=bT,i.projectAccessSlice=Pn,i.projectAttachmentReducer=LT,i.projectAttachmentSlice=gn,i.projectFileReducer=aI,i.projectFileSlice=_n,i.projectReducer=AI,i.projectSlice=Mn,i.rehydratedReducer=II,i.rehydratedSlice=Rn,i.restructureCreateSelectorWithArgs=T,i.runMiddleware=IO,i.saveActiveProjectFileBounds=eI,i.selectAccessToken=kP,i.selectAccessesByUserOfProject=bF,i.selectAccessibleProjects=EF,i.selectActiveOrganizationAccess=TF,i.selectActiveProjectFileId=RF,i.selectAllDocumentAttachments=ti,i.selectAllProjectAttachments=bn,i.selectAssetAttachmentById=Oa,i.selectAssetAttachmentMapping=Ia,i.selectAssetAttachments=Jt,i.selectAssetAttachmentsByIds=Pa,i.selectAssetById=qr,i.selectAssetProcedureById=Xc,i.selectAssetProcedureStepById=gr,i.selectAssetProcedureStepFieldValues=rt,i.selectAssetProcedureStepFieldValuesAttachmentById=Zd,i.selectAssetProcedureStepFieldValuesAttachments=Ts,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Jd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Yd,i.selectAssetProcedureStepFieldValuesById=lr,i.selectAssetProcedureStepFieldValuesByIds=or,i.selectAssetProcedureStepFieldValuesMapping=ur,i.selectAssetProcedureStepFieldValuesOfAsset=PP,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=FP,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=gP,i.selectAssetProcedureStepFields=St,i.selectAssetProcedureStepFieldsAttachmentById=gd,i.selectAssetProcedureStepFieldsAttachments=ms,i.selectAssetProcedureStepFieldsAttachmentsByIds=bd,i.selectAssetProcedureStepFieldsAttachmentsMapping=Fd,i.selectAssetProcedureStepFieldsById=Dd,i.selectAssetProcedureStepFieldsByIds=Cd,i.selectAssetProcedureStepFieldsMapping=ps,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=TP,i.selectAssetProcedureStepMapping=Tt,i.selectAssetProcedureSteps=Ps,i.selectAssetProcedureStepsByIds=br,i.selectAssetProcedureStepsMappingOfAssetProcedureType=bP,i.selectAssetProcedureStepsOfAssetProcedureType=_P,i.selectAssetProcedureTypeAttachmentById=Da,i.selectAssetProcedureTypeAttachmentMapping=qa,i.selectAssetProcedureTypeAttachments=Qt,i.selectAssetProcedureTypeAttachmentsByIds=Ca,i.selectAssetProcedureTypeById=od,i.selectAssetProcedureTypeFieldValues=At,i.selectAssetProcedureTypeFieldValuesAttachmentById=Fc,i.selectAssetProcedureTypeFieldValuesAttachments=as,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=gc,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Pc,i.selectAssetProcedureTypeFieldValuesById=Cc,i.selectAssetProcedureTypeFieldValuesByIds=$c,i.selectAssetProcedureTypeFieldValuesMapping=Dc,i.selectAssetProcedureTypeFieldValuesOfAsset=yP,i.selectAssetProcedureTypeFields=pt,i.selectAssetProcedureTypeFieldsAttachmentById=Xa,i.selectAssetProcedureTypeFieldsAttachments=es,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Qa,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Ja,i.selectAssetProcedureTypeFieldsById=oc,i.selectAssetProcedureTypeFieldsByIds=hc,i.selectAssetProcedureTypeFieldsMapping=lc,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=hP,i.selectAssetProcedureTypes=os,i.selectAssetProcedureTypesByIds=hd,i.selectAssetProcedureTypesMapping=ld,i.selectAssetProcedureTypesOfOrganization=fP,i.selectAssetProcedures=ft,i.selectAssetProceduresByIds=Qc,i.selectAssetProceduresMapping=Zc,i.selectAssetProceduresOfAssetProcedureType=Jc,i.selectAssetProceduresOfAssetType=AP,i.selectAssetStageById=ou,i.selectAssetStageCompletionById=Qr,i.selectAssetStageCompletionMapping=Jr,i.selectAssetStageCompletions=Xr,i.selectAssetStageCompletionsByIds=xr,i.selectAssetStages=vs,i.selectAssetStagesByIds=hu,i.selectAssetStagesMappingOfAssetProcedureType=RP,i.selectAssetStagesOfAssetProcedureType=wP,i.selectAssetTypeAttachmentById=Pu,i.selectAssetTypeAttachmentMapping=Ou,i.selectAssetTypeAttachments=js,i.selectAssetTypeAttachmentsByIds=Fu,i.selectAssetTypeById=mo,i.selectAssetTypeFieldValues=It,i.selectAssetTypeFieldValuesAttachmentById=ul,i.selectAssetTypeFieldValuesAttachments=ks,i.selectAssetTypeFieldValuesAttachmentsByIds=ll,i.selectAssetTypeFieldValuesAttachmentsMapping=rl,i.selectAssetTypeFieldValuesById=gl,i.selectAssetTypeFieldValuesByIds=bl,i.selectAssetTypeFieldValuesMapping=Fl,i.selectAssetTypeFieldValuesOfAsset=zP,i.selectAssetTypeFields=ut,i.selectAssetTypeFieldsAttachmentById=Du,i.selectAssetTypeFieldsAttachments=Ds,i.selectAssetTypeFieldsAttachmentsByIds=Cu,i.selectAssetTypeFieldsAttachmentsMapping=qu,i.selectAssetTypeFieldsById=Xu,i.selectAssetTypeFieldsByIds=Qu,i.selectAssetTypeFieldsMapping=Ju,i.selectAssetTypeFieldsOfAssetType=vP,i.selectAssetTypeIdentifierById=Cl,i.selectAssetTypeIdentifierMapping=Dl,i.selectAssetTypeIdentifierValueById=Ql,i.selectAssetTypeIdentifierValueMapping=Xl,i.selectAssetTypeIdentifierValues=Ot,i.selectAssetTypeIdentifierValuesByIds=xl,i.selectAssetTypeIdentifierValuesOfAsset=qP,i.selectAssetTypeIdentifierValuesOfIdentifier=DP,i.selectAssetTypeIdentifiers=Hs,i.selectAssetTypeIdentifiersByIds=$l,i.selectAssetTypeIdentifiersOfAssetType=jP,i.selectAssetTypeStatusById=Mo,i.selectAssetTypeStatusMapping=_o,i.selectAssetTypeStatuses=Js,i.selectAssetTypeStatusesByIds=Ro,i.selectAssetTypeStatusesOfAssetType=$P,i.selectAssetTypeValuesOfAssetType=BP,i.selectAssetTypes=Ys,i.selectAssetTypesByIds=yo,i.selectAssetTypesMapping=ho,i.selectAssetTypesOfOrganization=CP,i.selectAssets=_s,i.selectAssetsByIds=Dr,i.selectAssetsMapping=jr,i.selectAssetsOfAssetType=Ms,i.selectAttachmentsOfAsset=Fa,i.selectAttachmentsOfAssetProcedureStepFieldValues=Xd,i.selectAttachmentsOfAssetProcedureStepFields=SP,i.selectAttachmentsOfAssetProcedureType=lP,i.selectAttachmentsOfAssetProcedureTypeFieldValues=bc,i.selectAttachmentsOfAssetProcedureTypeFields=oP,i.selectAttachmentsOfAssetType=gu,i.selectAttachmentsOfAssetTypeFieldValues=ol,i.selectAttachmentsOfAssetTypeFields=EP,i.selectAttachmentsOfDocument=HP,i.selectAttachmentsOfFormRevision=xP,i.selectAttachmentsOfFormSubmission=dy,i.selectAttachmentsOfIssue=cp,i.selectAttachmentsOfIssueComment=iF,i.selectAttachmentsOfIssueType=cF,i.selectAttachmentsOfIssueTypeFieldValues=lf,i.selectAttachmentsOfIssueTypeFields=dF,i.selectAttachmentsOfProject=MF,i.selectCategories=Qs,i.selectCategoriesByIds=Go,i.selectCategoriesOfProject=GP,i.selectCategoryById=xs,i.selectCategoryMapping=No,i.selectCommentsOfIssue=nF,i.selectConversation=uP,i.selectConversationMapping=Wt,i.selectConversations=rP,i.selectCurrentUser=VS,i.selectDeletedRequests=OF,i.selectDescendantsOfAssetProcedureStep=_r,i.selectDescendantsOfDocument=Th,i.selectDocumentAttachmentById=ih,i.selectDocumentAttachmentMapping=sh,i.selectDocumentAttachmentsByIds=nh,i.selectDocumentById=fh,i.selectDocuments=Ft,i.selectDocumentsByIds=Sh,i.selectDocumentsMapping=ii,i.selectEmailDomainById=vh,i.selectEmailDomains=ai,i.selectEmailDomainsAsMapping=Eh,i.selectEmailDomainsByIds=Vh,i.selectEmailDomainsOfOrganization=YP,i.selectFieldValuesOfAssetProcedure=pP,i.selectFormById=Zm,i.selectFormIdentifierById=Jh,i.selectFormIdentifierMapping=Zh,i.selectFormIdentifierValueById=lm,i.selectFormIdentifierValueMapping=um,i.selectFormIdentifierValues=gt,i.selectFormIdentifierValuesByIds=om,i.selectFormIdentifierValuesOfFormSubmission=XP,i.selectFormIdentifierValuesOfIdentifier=QP,i.selectFormIdentifiers=ri,i.selectFormIdentifiersByIds=Xh,i.selectFormIdentifiersOfForm=JP,i.selectFormMapping=Ym,i.selectFormRevisionAttachmentById=gm,i.selectFormRevisionAttachments=Fm,i.selectFormRevisionAttachmentsByIds=bm,i.selectFormRevisionAttachmentsMapping=bt,i.selectFormRevisionById=zm,i.selectFormRevisionMapping=Ai,i.selectFormRevisions=_t,i.selectFormRevisionsByIds=Bm,i.selectFormRevisionsOfForm=jm,i.selectFormSubmissionAttachemntsByIds=gi,i.selectFormSubmissionAttachmentById=ay,i.selectFormSubmissionAttachments=Fi,i.selectFormSubmissionAttachmentsByIds=cy,i.selectFormSubmissionAttachmentsMapping=Pi,i.selectFormSubmissionById=Sy,i.selectFormSubmissions=fy,i.selectFormSubmissionsByIds=Ty,i.selectFormSubmissionsMapping=Ri,i.selectFormSubmissionsOfForm=Iy,i.selectForms=Si,i.selectFormsByIds=Jm,i.selectFormsOfOrganization=tF,i.selectGeoImageById=zy,i.selectGeoImageMapping=Vy,i.selectGeoImages=Ei,i.selectGeoImagesByIds=By,i.selectGeoImagesOfProject=sF,i.selectIsImportingProjectFile=wF,i.selectIsLoggedIn=NP,i.selectIssueAssociationById=Hy,i.selectIssueAssociationMapping=lt,i.selectIssueAssociations=Gy,i.selectIssueAssociationsByIds=Wy,i.selectIssueAssociationsOfAsset=Zy,i.selectIssueAssociationsOfIssue=Yy,i.selectIssueAssociationsToIssue=Ky,i.selectIssueAttachmentById=dp,i.selectIssueAttachmentMapping=ap,i.selectIssueAttachments=ji,i.selectIssueAttachmentsByIds=rp,i.selectIssueById=Wp,i.selectIssueCommentAttachmentById=Op,i.selectIssueCommentAttachmentMapping=Ip,i.selectIssueCommentAttachments=Di,i.selectIssueCommentAttachmentsByIds=Pp,i.selectIssueCommentById=Bp,i.selectIssueCommentMapping=$i,i.selectIssueCommentsByIds=jp,i.selectIssueMapping=Hp,i.selectIssueTypeAttachmentById=dA,i.selectIssueTypeAttachmentMapping=cA,i.selectIssueTypeAttachments=Gi,i.selectIssueTypeAttachmentsByIds=rA,i.selectIssueTypeById=Xf,i.selectIssueTypeFieldValues=Et,i.selectIssueTypeFieldValuesAttachmentById=rf,i.selectIssueTypeFieldValuesAttachments=Qi,i.selectIssueTypeFieldValuesAttachmentsByIds=uf,i.selectIssueTypeFieldValuesAttachmentsMapping=df,i.selectIssueTypeFieldValuesById=jA,i.selectIssueTypeFieldValuesByIds=qA,i.selectIssueTypeFieldValuesMapping=BA,i.selectIssueTypeFieldValuesOfIssue=rF,i.selectIssueTypeFields=ot,i.selectIssueTypeFieldsAttachmentById=OA,i.selectIssueTypeFieldsAttachments=Wi,i.selectIssueTypeFieldsAttachmentsByIds=PA,i.selectIssueTypeFieldsAttachmentsMapping=IA,i.selectIssueTypeFieldsById=ZA,i.selectIssueTypeFieldsByIds=JA,i.selectIssueTypeFieldsMapping=YA,i.selectIssueTypeFieldsOfIssueType=uF,i.selectIssueTypeIdentifierById=Ff,i.selectIssueTypeIdentifierMapping=Pf,i.selectIssueTypeIdentifierValueById=Df,i.selectIssueTypeIdentifierValueMapping=qf,i.selectIssueTypeIdentifierValues=vt,i.selectIssueTypeIdentifierValuesByIds=Cf,i.selectIssueTypeIdentifierValuesOfIdentifier=yF,i.selectIssueTypeIdentifierValuesOfIssue=mF,i.selectIssueTypeIdentifiers=en,i.selectIssueTypeIdentifiersByIds=gf,i.selectIssueTypeIdentifiersOfIssueType=hF,i.selectIssueTypeMapping=Jf,i.selectIssueTypeStatusById=dn,i.selectIssueTypeStatusMapping=lS,i.selectIssueTypeStatuses=cn,i.selectIssueTypeStatusesByIds=oS,i.selectIssueTypeStatusesOfIssueType=AF,i.selectIssueTypeValuesOfIssueType=oF,i.selectIssueTypes=nn,i.selectIssueTypesByIds=Qf,i.selectIssueTypesOfOrganization=pF,i.selectIssueUpdateById=TS,i.selectIssueUpdateMapping=mn,i.selectIssueUpdates=yn,i.selectIssueUpdatesByIds=IS,i.selectIssueUpdatesOfIssue=OS,i.selectIssues=wt,i.selectIssuesByIds=Kp,i.selectIssuesOfIssueType=Yp,i.selectIssuesOfProject=aF,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=IP,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=mP,i.selectLatestAssetTypeFieldsOfAssetType=VP,i.selectLatestFieldsByAssetProcedureStep=OP,i.selectLatestFormRevisionOfForm=eF,i.selectLatestIssueTypeFieldsOfIssueType=lF,i.selectLatestRetryTime=PF,i.selectMembershipsByUserOfTeam=jF,i.selectNumberOfAssetsOfAssetType=MP,i.selectOrganizationAccessById=HS,i.selectOrganizationAccessMapping=Bt,i.selectOrganizationAccessUserMapping=KS,i.selectOrganizationAccessesByIds=WS,i.selectOrganizationById=cT,i.selectOrganizationDocuments=KP,i.selectOrganizations=aT,i.selectOrganizationsByIds=dT,i.selectOrganizationsMapping=nT,i.selectProjectAccessById=_T,i.selectProjectAccessMapping=Fn,i.selectProjectAccesses=ht,i.selectProjectAccessesByIds=MT,i.selectProjectAccessesOfProject=gF,i.selectProjectAttachmentById=$T,i.selectProjectAttachmentMapping=CT,i.selectProjectAttachmentsByIds=UT,i.selectProjectById=SI,i.selectProjectDocuments=WP,i.selectProjectFileById=iI,i.selectProjectFileMapping=tI,i.selectProjectFiles=sI,i.selectProjectFilesByIds=nI,i.selectProjectMapping=fI,i.selectProjects=jt,i.selectProjectsByIds=TI,i.selectProjectsOfOrganization=vF,i.selectRehydrated=BF,i.selectStageMapping=Es,i.selectTeamById=WI,i.selectTeamMembershipById=zI,i.selectTeamMemberships=qt,i.selectTeamMembershipsByIds=BI,i.selectTeamMembershipsMapping=VI,i.selectTeams=vn,i.selectTeamsByIds=KI,i.selectTeamsMapping=HI,i.selectTeamsOfOrganization=DF,i.selectUploadUrl=Dh,i.selectUserById=zt,i.selectUsers=Vt,i.selectUsersByIds=zS,i.selectUsersMapping=Sn,i.selectUsersOfOrganization=IF,i.selectUsersOfProject=_F,i.selectUsersOfTeam=qF,i.setActiveProjectFileId=xT,i.setAsset=zr,i.setAssetAttachment=pa,i.setAssetAttachments=Aa,i.setAssetProcedure=Wc,i.setAssetProcedureStep=pr,i.setAssetProcedureStepFieldValues=ir,i.setAssetProcedureStepFieldValuesAttachment=Nd,i.setAssetProcedureStepFieldValuesAttachments=Gd,i.setAssetProcedureStepFieldValuesMany=nr,i.setAssetProcedureStepFields=vd,i.setAssetProcedureStepFieldsAttachment=fd,i.setAssetProcedureStepFieldsAttachments=Sd,i.setAssetProcedureStepFieldsMany=Vd,i.setAssetProcedureSteps=Ar,i.setAssetProcedureType=dd,i.setAssetProcedureTypeAttachment=wa,i.setAssetProcedureTypeAttachments=Ea,i.setAssetProcedureTypeFieldValues=Ec,i.setAssetProcedureTypeFieldValuesAttachment=Ac,i.setAssetProcedureTypeFieldValuesAttachments=fc,i.setAssetProcedureTypeFieldValuesMany=vc,i.setAssetProcedureTypeFields=ic,i.setAssetProcedureTypeFieldsAttachment=Na,i.setAssetProcedureTypeFieldsAttachments=Ga,i.setAssetProcedureTypeFieldsMany=nc,i.setAssetProcedureTypes=rd,i.setAssetProcedures=Kc,i.setAssetStage=su,i.setAssetStageCompletion=Nr,i.setAssetStageCompletions=Gr,i.setAssetStages=iu,i.setAssetType=io,i.setAssetTypeAttachment=Au,i.setAssetTypeAttachments=fu,i.setAssetTypeFieldValues=fl,i.setAssetTypeFieldValuesAttachment=il,i.setAssetTypeFieldValuesAttachments=nl,i.setAssetTypeFieldValuesMany=Sl,i.setAssetTypeFields=Gu,i.setAssetTypeFieldsAttachment=Eu,i.setAssetTypeFieldsAttachments=vu,i.setAssetTypeFieldsMany=Hu,i.setAssetTypeIdentifier=vl,i.setAssetTypeIdentifierValue=Hl,i.setAssetTypeIdentifierValues=Wl,i.setAssetTypeIdentifiers=Vl,i.setAssetTypeStatus=Io,i.setAssetTypeStatuses=Oo,i.setAssetTypes=no,i.setAssets=Br,i.setCategories=Co,i.setCategory=Do,i.setClientSDK=pO,i.setClientStore=mO,i.setConversation=ua,i.setConversations=nP,i.setCurrentUser=fF,i.setDocument=lh,i.setDocumentAttachment=Jo,i.setDocumentAttachments=Xo,i.setDocuments=oh,i.setEmailDomain=gh,i.setEmailDomains=bh,i.setForm=Lm,i.setFormIdentifier=Nh,i.setFormIdentifierValue=im,i.setFormIdentifierValues=nm,i.setFormIdentifiers=Gh,i.setFormRevision=wm,i.setFormRevisionAttachment=fm,i.setFormRevisionAttachments=Sm,i.setFormRevisions=Em,i.setFormSubmission=oy,i.setFormSubmissionAttachment=ey,i.setFormSubmissionAttachments=ty,i.setFormSubmissions=hy,i.setForms=km,i.setGeoImage=gy,i.setGeoImages=by,i.setIsImportingProjectFile=QT,i.setIssue=Up,i.setIssueAssociation=$y,i.setIssueAssociations=Cy,i.setIssueAttachment=ep,i.setIssueAttachments=tp,i.setIssueComment=Rp,i.setIssueCommentAttachment=yp,i.setIssueCommentAttachments=pp,i.setIssueComments=wp,i.setIssueType=Gf,i.setIssueTypeAttachment=eA,i.setIssueTypeAttachments=tA,i.setIssueTypeFieldValues=RA,i.setIssueTypeFieldValuesAttachment=tf,i.setIssueTypeFieldValuesAttachments=sf,i.setIssueTypeFieldValuesMany=wA,i.setIssueTypeFields=kA,i.setIssueTypeFieldsAttachment=yA,i.setIssueTypeFieldsAttachments=pA,i.setIssueTypeFieldsMany=NA,i.setIssueTypeIdentifier=Af,i.setIssueTypeIdentifierValue=Ef,i.setIssueTypeIdentifierValues=vf,i.setIssueTypeIdentifiers=ff,i.setIssueTypeStatus=nS,i.setIssueTypeStatuses=aS,i.setIssueTypes=Hf,i.setIssueUpdate=pS,i.setIssueUpdates=AS,i.setIssues=Lp,i.setLoggedIn=vo,i.setOrganization=XS,i.setOrganizationAccess=CS,i.setOrganizationAccesses=$S,i.setOrganizations=JS,i.setProfilePicture=SF,i.setProject=uI,i.setProjectAccess=TT,i.setProjectAccesses=IT,i.setProjectAttachment=VT,i.setProjectAttachments=zT,i.setProjectFile=GT,i.setProjectFiles=HT,i.setProjects=rI,i.setRehydrated=zF,i.setTeam=$I,i.setTeamMembership=bI,i.setTeamMemberships=_I,i.setTeams=UI,i.setTokens=UP,i.setUploadUrl=qh,i.setUser=_S,i.setUsers=bS,i.shallowEqual=BO,i.slugify=JO,i.spacesToDashesLower=ZO,i.teamMembershipReducer=vI,i.teamMembershipSlice=wn,i.teamReducer=YI,i.teamSlice=En,i.toFileNameSafeString=YO,i.toUuidArray=D,i.toUuidIdRecord=KO,i.truncate=XO,i.updateAsset=Er,i.updateAssetAttachment=fa,i.updateAssetAttachments=Sa,i.updateAssetProcedure=Nc,i.updateAssetProcedureStep=Tr,i.updateAssetProcedureStepFieldValues=ar,i.updateAssetProcedureStepFieldValuesAttachment=Hd,i.updateAssetProcedureStepFieldValuesAttachments=Wd,i.updateAssetProcedureStepFieldValuesMany=cr,i.updateAssetProcedureStepFields=zd,i.updateAssetProcedureStepFieldsAttachment=Td,i.updateAssetProcedureStepFieldsAttachments=Id,i.updateAssetProcedureStepFieldsMany=Bd,i.updateAssetProcedureSteps=Ir,i.updateAssetProcedureType=id,i.updateAssetProcedureTypeAttachment=va,i.updateAssetProcedureTypeAttachments=Va,i.updateAssetProcedureTypeFieldValues=Vc,i.updateAssetProcedureTypeFieldValuesAttachment=Sc,i.updateAssetProcedureTypeFieldValuesAttachments=Tc,i.updateAssetProcedureTypeFieldValuesMany=zc,i.updateAssetProcedureTypeFields=ac,i.updateAssetProcedureTypeFieldsAttachment=Ha,i.updateAssetProcedureTypeFieldsAttachments=Wa,i.updateAssetProcedureTypeFieldsMany=cc,i.updateAssetProcedureTypes=nd,i.updateAssetProcedures=Gc,i.updateAssetStage=cu,i.updateAssetStageCompletion=Hr,i.updateAssetStageCompletions=Wr,i.updateAssetStages=du,i.updateAssetType=ro,i.updateAssetTypeAttachment=Su,i.updateAssetTypeAttachments=Tu,i.updateAssetTypeFieldValues=Tl,i.updateAssetTypeFieldValuesAttachment=al,i.updateAssetTypeFieldValuesAttachments=cl,i.updateAssetTypeFieldValuesMany=Il,i.updateAssetTypeFields=Wu,i.updateAssetTypeFieldsAttachment=Vu,i.updateAssetTypeFieldsAttachments=zu,i.updateAssetTypeFieldsMany=Ku,i.updateAssetTypeIdentifier=zl,i.updateAssetTypeIdentifierValue=Kl,i.updateAssetTypeIdentifierValues=Yl,i.updateAssetTypeIdentifiers=Bl,i.updateAssetTypeStatus=Po,i.updateAssetTypeStatuses=Fo,i.updateAssetTypes=uo,i.updateAssets=vr,i.updateCategories=Uo,i.updateCategory=$o,i.updateConversation=la,i.updateConversations=aP,i.updateDocument=hh,i.updateDocumentAttachment=Qo,i.updateDocumentAttachments=xo,i.updateDocuments=mh,i.updateEmailDomain=_h,i.updateEmailDomains=Mh,i.updateForm=Nm,i.updateFormIdentifier=Hh,i.updateFormIdentifierValue=am,i.updateFormIdentifierValues=cm,i.updateFormIdentifiers=Wh,i.updateFormRevision=vm,i.updateFormRevisionAttachment=Tm,i.updateFormRevisionAttachments=Im,i.updateFormRevisions=Vm,i.updateFormSubmission=yy,i.updateFormSubmissionAttachment=sy,i.updateFormSubmissionAttachments=iy,i.updateFormSubmissions=py,i.updateForms=Gm,i.updateGeoImage=Ry,i.updateGeoImages=wy,i.updateIssue=kp,i.updateIssueAssociation=Uy,i.updateIssueAssociations=Ly,i.updateIssueAttachment=sp,i.updateIssueAttachments=ip,i.updateIssueComment=Ep,i.updateIssueCommentAttachment=Ap,i.updateIssueCommentAttachments=fp,i.updateIssueComments=vp,i.updateIssueType=Wf,i.updateIssueTypeAttachment=sA,i.updateIssueTypeAttachments=iA,i.updateIssueTypeFieldValues=EA,i.updateIssueTypeFieldValuesAttachment=nf,i.updateIssueTypeFieldValuesAttachments=af,i.updateIssueTypeFieldValuesMany=vA,i.updateIssueTypeFields=GA,i.updateIssueTypeFieldsAttachment=AA,i.updateIssueTypeFieldsAttachments=fA,i.updateIssueTypeFieldsMany=HA,i.updateIssueTypeIdentifier=Sf,i.updateIssueTypeIdentifierValue=Vf,i.updateIssueTypeIdentifierValues=zf,i.updateIssueTypeIdentifiers=Tf,i.updateIssueTypeStatus=cS,i.updateIssueTypeStatuses=dS,i.updateIssueTypes=Kf,i.updateIssueUpdate=fS,i.updateIssueUpdates=SS,i.updateIssues=Np,i.updateOrganization=tT,i.updateOrganizationAccess=US,i.updateOrganizationAccesses=LS,i.updateOrganizations=eT,i.updateProject=mI,i.updateProjectAccess=OT,i.updateProjectAccesses=PT,i.updateProjectAttachment=BT,i.updateProjectAttachments=jT,i.updateProjectFile=YT,i.updateProjectFiles=ZT,i.updateProjects=hI,i.updateTeam=LI,i.updateTeamMembership=MI,i.updateTeamMemberships=RI,i.updateTeams=kI,i.updateUser=wS,i.updateUsers=RS,i.useSelectorBuilder=LF,i.userReducer=vS,i.userSlice=pn,i.uuidObj=_,i.versioningReducer=JI,i.versioningSlice=ZI,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|