@overmap-ai/core 1.0.78-workflows-2.10 → 1.0.78-workflows-2.12

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.
Files changed (54) hide show
  1. package/dist/overmap-core.js +4739 -4585
  2. package/dist/overmap-core.umd.cjs +6 -6
  3. package/dist/sdk/services/IssueUpdateService.d.ts +2 -0
  4. package/dist/sdk/services/WorkflowIssueLinkService.d.ts +27 -0
  5. package/dist/sdk/services/index.d.ts +1 -0
  6. package/dist/store/reducers.d.ts +3 -0
  7. package/dist/store/slices/assetProcedureSlice.d.ts +1 -0
  8. package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +1 -0
  9. package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +1 -0
  10. package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +1 -0
  11. package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +2 -0
  12. package/dist/store/slices/assetProcedureStepSlice.d.ts +1 -0
  13. package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +1 -0
  14. package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +1 -0
  15. package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +1 -0
  16. package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +1 -0
  17. package/dist/store/slices/assetSlice.d.ts +1 -0
  18. package/dist/store/slices/assetStageCompletionSlice.d.ts +1 -0
  19. package/dist/store/slices/assetStageSlice.d.ts +1 -0
  20. package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +1 -0
  21. package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +1 -0
  22. package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +1 -0
  23. package/dist/store/slices/assetTypeFieldsSlice.d.ts +1 -0
  24. package/dist/store/slices/assetTypeStatusSlice.d.ts +1 -0
  25. package/dist/store/slices/emailDomainsSlice.d.ts +1 -0
  26. package/dist/store/slices/formRevisionAttachmentSlice.d.ts +1 -0
  27. package/dist/store/slices/formRevisionSlice.d.ts +1 -0
  28. package/dist/store/slices/formSlice.d.ts +1 -0
  29. package/dist/store/slices/geoImageSlice.d.ts +1 -0
  30. package/dist/store/slices/index.d.ts +1 -0
  31. package/dist/store/slices/issueAssociationSlice.d.ts +1 -0
  32. package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +1 -0
  33. package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +1 -0
  34. package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +1 -0
  35. package/dist/store/slices/issueTypeFieldsSlice.d.ts +1 -0
  36. package/dist/store/slices/issueTypeStatusSlice.d.ts +1 -0
  37. package/dist/store/slices/issueUpdateSlice.d.ts +3 -0
  38. package/dist/store/slices/organizationSlice.d.ts +1 -0
  39. package/dist/store/slices/projectFileSlice.d.ts +1 -0
  40. package/dist/store/slices/projectSlice.d.ts +1 -0
  41. package/dist/store/slices/userSlice.d.ts +1 -0
  42. package/dist/store/slices/workflowIssueLinkSlice.d.ts +129 -0
  43. package/dist/store/slices/workflowStepAssigneeSlice.d.ts +1 -0
  44. package/dist/store/slices/workflowStepCommentSlice.d.ts +1 -0
  45. package/dist/store/slices/workflowStepEventSlice.d.ts +1 -0
  46. package/dist/store/slices/workflowStepFieldValuesAttachmentSlice.d.ts +1 -0
  47. package/dist/store/slices/workflowStepFieldValuesReviewRequestSlice.d.ts +1 -0
  48. package/dist/store/slices/workflowStepFieldValuesReviewSlice.d.ts +1 -0
  49. package/dist/store/slices/workflowStepFieldValuesSlice.d.ts +1 -0
  50. package/dist/store/slices/workflowStepFieldsAttachmentSlice.d.ts +1 -0
  51. package/dist/store/slices/workflowStepFieldsSlice.d.ts +1 -0
  52. package/dist/store/slices/workflowStepReviewerSlice.d.ts +1 -0
  53. package/dist/typings/models/workflows.d.ts +5 -0
  54. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
- (function(i,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("react"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","react","file-saver","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],U):(i=typeof globalThis<"u"?globalThis:i||self,U(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.fileSaver,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,U,o,Tt,ot,Ig,Og,Va,jt,Fg,Ba,_g,gg,sk,ik,Pg,bg,Rg){"use strict";var ek=Object.defineProperty;var tk=(i,U,o)=>U in i?ek(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var m=(i,U,o)=>tk(i,typeof U!="symbol"?U+"":U,o);var wg;const Wa=Object.freeze([]),za=Object.freeze({});var qa=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(qa||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Da=(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))(Da||{}),ja=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(ja||{}),ps=(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))(ps||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),$a=(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))($a||{}),Ca=(t=>(t[t.ADD_ASSIGNEE=0]="ADD_ASSIGNEE",t[t.REMOVE_ASSIGNEE=2]="REMOVE_ASSIGNEE",t[t.ADD_REVIEWER=4]="ADD_REVIEWER",t[t.REMOVE_REVIEWER=6]="REMOVE_REVIEWER",t[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(Ca||{}),Pt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Pt||{}),bt=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(bt||{});const Mg=ps.MEDIUM,Ua=6e4,kg=[bt.APPROVED,bt.REJECTED,bt.CHANGES_REQUESTED],Eg=[Pt.ACTIVE,Pt.COMPLETED,Pt.CANCELLED];function F(t){return{addOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},addMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},setOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},setMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},updateOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},updateMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const f of y.payload)delete p.instances[f]},initialize:(p,y)=>{p.instances={};const f=new Set;for(const T of y.payload){const P=t(T);f.add(P),p.instances[P]=T}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function vg(){return{initializeSelection:(l,u)=>{l.selection=Array.from(new Set(u.payload))},selectOne:(l,u)=>{new Set(l.selection).has(u.payload)||l.selection.push(u.payload)},selectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)||p.add(y);l.selection=Array.from(p)},unselectOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)&&(p.delete(u.payload),l.selection=Array.from(p))},unselectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)&&p.delete(y);l.selection=Array.from(p)},toggleOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)?p.delete(u.payload):p.add(u.payload),l.selection=Array.from(p)},toggleMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)?p.delete(y):p.add(y);l.selection=Array.from(p)},getInitialState:l=>({...l,selection:[]})}}const Rt="versioning",I=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),_=o.createAction("RESET_ORGANIZATION_STATE");function Vg(t,s){return Ig.useMemo(t,s)}wg=Symbol.toStringTag;class ms{constructor(){m(this,wg,"Promise");m(this,"_promise");m(this,"_resolve");m(this,"_reject");m(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 ys=!1;["true","1"].includes("".toLowerCase())&&(ys=!0);function Bg(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 fs(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ys&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ys&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function Wg(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 A=t=>t.length===0?Wa:t,$t=t=>Object.keys(t).length===0?za:t,La=fs(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Ss.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),zg=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),qg=1e3*86400,Ss=new Date,Dg=t=>new Date(t).toDateString()===Ss.toDateString(),jg=fs((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Ss.getTime())/qg);return n<s||n>e?La(t):zg.format(n,"days")});function $g(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Ct(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=$g(c);s(r)})},n.readAsArrayBuffer(t)})}const Cg=(t,s)=>`${t}${s?`.${s}`:""}`;function Ug(t,s){return new File([t],s,{type:t.type})}function Na(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Ga=async t=>(await fetch(t)).blob(),Ha=async(t,s)=>{const e=await Ga(t);return new File([e],s,{type:e.type})};function Lg(t){const s=new Blob([t]);Og.saveAs(s,t.name)}function Ka(t){return typeof t=="string"&&t.startsWith("blob:")}function Ng(t){return t.type.startsWith("image/")}const Ya={};function Gg(t,s,e,...n){const a=Ya[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Ya[t]={[s]:!0},c=!0),c&&console[e](...n)}const Ja=["created_at","updated_at","index","revision"];function O(t){return{...t,uuid:ot.v4()}}function Hg(t){const s={};for(const e of t)s[e.uuid]=e;return s}function V(t){return t.map(({uuid:s})=>s)}function Ut(t,s){return t.localeCompare(s)}function As(t,s){return Ut(t.uuid,s.uuid)}function Kg(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 Yg(t){return t.toLowerCase().replace(" ","-")}function Jg(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function Zg(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const Qg=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[...Ja,"created_by"])e in s&&delete s[e];return s}const Za=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Va(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Xg=t=>{const{roots:s}=Za(t);return s.map(e=>new jt.Tree(e))},Qa=(t,s)=>{const{nodes:e}=Za(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new jt.Tree(n)},Xa=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,xa=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,ec=t=>Va(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),xg=t=>{const{roots:s}=ec(t);return s.map(e=>new jt.Tree(e))},tc=(t,s)=>{const{nodes:e}=ec(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new jt.Tree(n)};class eP{constructor(s){m(this,"operations",[]);m(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=>A(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),N=F(t=>t.uuid),sc={instances:{}},ws=o.createSlice({name:"agents",initialState:sc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,sc)),reducers:{initializeConversations:N.initialize,addConversation:N.addOne,addConversations:N.addMany,setConversation:N.setOne,setConversations:N.setMany,updateConversation:N.updateOne,updateConversations:N.updateMany,deleteConversation:N.deleteOne,deleteConversations:N.deleteMany}}),{initializeConversations:ic,addConversation:nc,addConversations:tP,setConversation:ac,setConversations:sP,updateConversation:cc,updateConversations:iP,deleteConversation:nP,deleteConversations:aP}=ws.actions,Ts=t=>t.agentsReducer.instances,cP=o.createSelector([Ts],t=>Object.values(t)),rP=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>t[s])),rc=ws.reducer,G=F(t=>t.uuid),dc={instances:{}},Is=o.createSlice({name:"assetAttachments",initialState:dc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,dc)),reducers:{initializeAssetAttachments:G.initialize,addAssetAttachment:G.addOne,addAssetAttachments:G.addMany,setAssetAttachment:G.setOne,setAssetAttachments:G.setMany,updateAssetAttachment:G.updateOne,updateAssetAttachments:G.updateMany,deleteAssetAttachment:G.deleteOne,deleteAssetAttachments:G.deleteMany}}),{initializeAssetAttachments:lc,addAssetAttachment:uc,addAssetAttachments:Os,setAssetAttachment:oc,setAssetAttachments:hc,updateAssetAttachment:pc,updateAssetAttachments:mc,deleteAssetAttachment:yc,deleteAssetAttachments:Fs}=Is.actions,fc=t=>t.assetAttachmentReducer.instances,_s=o.createSelector([fc],t=>Object.values(t)),Sc=t=>s=>s.assetAttachmentReducer.instances[t],Ac=S(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wc=S(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Tc=Is.reducer,H=F(({uuid:t})=>t),Ic={instances:{}},gs=o.createSlice({name:"assetProcedureTypeAttachments",initialState:Ic,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ic)),reducers:{initializeAssetProcedureTypeAttachments:H.initialize,addAssetProcedureTypeAttachment:H.addOne,addAssetProcedureTypeAttachments:H.addMany,setAssetProcedureTypeAttachment:H.setOne,setAssetProcedureTypeAttachments:H.setMany,updateAssetProcedureTypeAttachment:H.updateOne,updateAssetProcedureTypeAttachments:H.updateMany,deleteAssetProcedureTypeAttachment:H.deleteOne,deleteAssetProcedureTypeAttachments:H.deleteMany}}),{initializeAssetProcedureTypeAttachments:Oc,addAssetProcedureTypeAttachment:Fc,addAssetProcedureTypeAttachments:_c,setAssetProcedureTypeAttachment:gc,setAssetProcedureTypeAttachments:Pc,updateAssetProcedureTypeAttachment:bc,updateAssetProcedureTypeAttachments:Rc,deleteAssetProcedureTypeAttachment:Mc,deleteAssetProcedureTypeAttachments:kc}=gs.actions,Ec=gs.reducer,vc=t=>t.assetProcedureTypeAttachmentReducer.instances,Ps=o.createSelector([vc],t=>Object.values(t)),Vc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],Bc=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dP=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),K=F(({uuid:t})=>t),Wc={instances:{}},bs=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Wc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Wc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:K.initialize,addAssetProcedureTypeFieldsAttachment:K.addOne,addAssetProcedureTypeFieldsAttachments:K.addMany,setAssetProcedureTypeFieldsAttachment:K.setOne,setAssetProcedureTypeFieldsAttachments:K.setMany,updateAssetProcedureTypeFieldsAttachment:K.updateOne,updateAssetProcedureTypeFieldsAttachments:K.updateMany,deleteAssetProcedureTypeFieldsAttachment:K.deleteOne,deleteAssetProcedureTypeFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:zc,addAssetProcedureTypeFieldsAttachment:qc,addAssetProcedureTypeFieldsAttachments:Dc,setAssetProcedureTypeFieldsAttachment:jc,setAssetProcedureTypeFieldsAttachments:$c,updateAssetProcedureTypeFieldsAttachment:Cc,updateAssetProcedureTypeFieldsAttachments:Uc,deleteAssetProcedureTypeFieldsAttachment:Lc,deleteAssetProcedureTypeFieldsAttachments:Nc}=bs.actions,Gc=bs.reducer,Hc=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,Rs=o.createSelector([Hc],t=>Object.values(t)),lP=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Kc=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Yc=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Y=F(({uuid:t})=>t),Jc={instances:{}},Ms=o.createSlice({name:"assetProcedureTypeFields",initialState:Jc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jc)),reducers:{initializeAssetProcedureTypeFields:Y.initialize,addAssetProcedureTypeFields:Y.addOne,addAssetProcedureTypeFieldsMany:Y.addMany,setAssetProcedureTypeFields:Y.setOne,setAssetProcedureTypeFieldsMany:Y.setMany,updateAssetProcedureTypeFields:Y.updateOne,updateAssetProcedureTypeFieldsMany:Y.updateMany,deleteAssetProcedureTypeFields:Y.deleteOne,deleteAssetProcedureTypeFieldsMany:Y.deleteMany}}),{initializeAssetProcedureTypeFields:Zc,addAssetProcedureTypeFields:Qc,addAssetProcedureTypeFieldsMany:Xc,setAssetProcedureTypeFields:xc,setAssetProcedureTypeFieldsMany:er,updateAssetProcedureTypeFields:tr,updateAssetProcedureTypeFieldsMany:sr,deleteAssetProcedureTypeFields:ir,deleteAssetProcedureTypeFieldsMany:nr}=Ms.actions,ar=Ms.reducer,cr=t=>t.assetProcedureTypeFieldsReducer.instances,Lt=o.createSelector([cr],t=>Object.values(t)),uP=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),oP=S(o.createSelector([Lt,(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])),rr=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],dr=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=F(({uuid:t})=>t),lr={instances:{}},ks=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:lr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:J.initialize,addAssetProcedureTypeFieldValuesAttachment:J.addOne,addAssetProcedureTypeFieldValuesAttachments:J.addMany,setAssetProcedureTypeFieldValuesAttachment:J.setOne,setAssetProcedureTypeFieldValuesAttachments:J.setMany,updateAssetProcedureTypeFieldValuesAttachment:J.updateOne,updateAssetProcedureTypeFieldValuesAttachments:J.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:J.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:ur,addAssetProcedureTypeFieldValuesAttachment:or,addAssetProcedureTypeFieldValuesAttachments:Es,setAssetProcedureTypeFieldValuesAttachment:hr,setAssetProcedureTypeFieldValuesAttachments:pr,updateAssetProcedureTypeFieldValuesAttachment:mr,updateAssetProcedureTypeFieldValuesAttachments:yr,deleteAssetProcedureTypeFieldValuesAttachment:fr,deleteAssetProcedureTypeFieldValuesAttachments:vs}=ks.actions,Sr=ks.reducer,Ar=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Vs=o.createSelector([Ar],t=>Object.values(t)),wr=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Tr=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ir=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Z=F(({uuid:t})=>t),Or={instances:{}},Bs=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:Or,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Or)),reducers:{initializeAssetProcedureTypeFieldValues:Z.initialize,addAssetProcedureTypeFieldValues:Z.addOne,addAssetProcedureTypeFieldValuesMany:Z.addMany,setAssetProcedureTypeFieldValues:Z.setOne,setAssetProcedureTypeFieldValuesMany:Z.setMany,updateAssetProcedureTypeFieldValues:Z.updateOne,updateAssetProcedureTypeFieldValuesMany:Z.updateMany,deleteAssetProcedureTypeFieldValues:Z.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Fr,addAssetProcedureTypeFieldValues:_r,addAssetProcedureTypeFieldValuesMany:gr,setAssetProcedureTypeFieldValues:Pr,setAssetProcedureTypeFieldValuesMany:br,updateAssetProcedureTypeFieldValues:Rr,updateAssetProcedureTypeFieldValuesMany:Mr,deleteAssetProcedureTypeFieldValues:kr,deleteAssetProcedureTypeFieldValuesMany:Er}=Bs.actions,vr=Bs.reducer,Vr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Nt=o.createSelector([Vr],t=>Object.values(t)),hP=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),pP=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Br=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Wr=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Q=F(({uuid:t})=>t),zr={instances:{}},Ws=o.createSlice({name:"assetProcedures",initialState:zr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,zr)),reducers:{initializeAssetProcedures:Q.initialize,addAssetProcedure:Q.addOne,addAssetProcedures:Q.addMany,setAssetProcedure:Q.setOne,setAssetProcedures:Q.setMany,updateAssetProcedure:Q.updateOne,updateAssetProcedures:Q.updateMany,deleteAssetProcedure:Q.deleteOne,deleteAssetProcedures:Q.deleteMany}}),{initializeAssetProcedures:qr,addAssetProcedure:Dr,addAssetProcedures:zs,updateAssetProcedure:jr,updateAssetProcedures:$r,deleteAssetProcedure:Cr,deleteAssetProcedures:qs,setAssetProcedure:Ur,setAssetProcedures:Lr}=Ws.actions,Nr=Ws.reducer,Gr=t=>t.assetProcedureReducer.instances,Gt=o.createSelector([Gr],t=>Object.values(t)),Hr=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),mP=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Kr=t=>s=>s.assetProcedureReducer.instances[t],Yr=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),X=F(t=>t.uuid),Jr={instances:{}},Ds=o.createSlice({name:"assetProcedureTypes",initialState:Jr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jr)),reducers:{initializeAssetProcedureTypes:X.initialize,addAssetProcedureType:X.addOne,addAssetProcedureTypes:X.addMany,setAssetProcedureType:X.setOne,setAssetProcedureTypes:X.setMany,updateAssetProcedureType:X.updateOne,updateAssetProcedureTypes:X.updateMany,deleteAssetProcedureType:X.deleteOne,deleteAssetProcedureTypes:X.deleteMany}}),{initializeAssetProcedureTypes:Zr,addAssetProcedureType:Qr,addAssetProcedureTypes:Xr,updateAssetProcedureType:xr,updateAssetProcedureTypes:ed,deleteAssetProcedureType:td,deleteAssetProcedureTypes:sd,setAssetProcedureType:id,setAssetProcedureTypes:nd}=Ds.actions,ad=Ds.reducer,cd=t=>t.assetProcedureTypeReducer.instances,js=o.createSelector([cd],t=>Object.values(t)),rd=t=>s=>s.assetProcedureTypeReducer.instances[t],dd=S(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yP=S(o.createSelector([js,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),x=F(t=>t.uuid),ld={instances:{}},$s=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:ld,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ld)),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:ud,addAssetProcedureStepFieldsAttachment:od,addAssetProcedureStepFieldsAttachments:hd,setAssetProcedureStepFieldsAttachment:pd,setAssetProcedureStepFieldsAttachments:md,updateAssetProcedureStepFieldsAttachment:yd,updateAssetProcedureStepFieldsAttachments:fd,deleteAssetProcedureStepFieldsAttachment:Sd,deleteAssetProcedureStepFieldsAttachments:Ad}=$s.actions,wd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Cs=o.createSelector([wd],t=>Object.values(t)),fP=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Td=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Id=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Od=$s.reducer,ee=F(t=>t.uuid),Fd={instances:{}},Us=o.createSlice({name:"assetProcedureStepFields",initialState:Fd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Fd)),reducers:{initializeAssetProcedureStepFields:ee.initialize,addAssetProcedureStepFields:ee.addOne,addAssetProcedureStepFieldsMany:ee.addMany,setAssetProcedureStepFields:ee.setOne,setAssetProcedureStepFieldsMany:ee.setMany,updateAssetProcedureStepFields:ee.updateOne,updateAssetProcedureStepFieldsMany:ee.updateMany,deleteAssetProcedureStepFields:ee.deleteOne,deleteAssetProcedureStepFieldsMany:ee.deleteMany}}),{initializeAssetProcedureStepFields:_d,addAssetProcedureStepFields:gd,addAssetProcedureStepFieldsMany:Pd,setAssetProcedureStepFields:bd,setAssetProcedureStepFieldsMany:Rd,updateAssetProcedureStepFields:Md,updateAssetProcedureStepFieldsMany:kd,deleteAssetProcedureStepFields:Ed,deleteAssetProcedureStepFieldsMany:vd}=Us.actions,Ls=t=>t.assetProcedureStepFieldsReducer.instances,Ht=o.createSelector([Ls],t=>Object.values(t)),SP=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),AP=S(o.createSelector([Ht,(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])),wP=o.createSelector([Ls],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}),Vd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],Bd=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Wd=Us.reducer,te=F(t=>t.uuid),zd={instances:{}},Ns=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:zd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,zd)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:te.initialize,addAssetProcedureStepFieldValuesAttachment:te.addOne,addAssetProcedureStepFieldValuesAttachments:te.addMany,setAssetProcedureStepFieldValuesAttachment:te.setOne,setAssetProcedureStepFieldValuesAttachments:te.setMany,updateAssetProcedureStepFieldValuesAttachment:te.updateOne,updateAssetProcedureStepFieldValuesAttachments:te.updateMany,deleteAssetProcedureStepFieldValuesAttachment:te.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:qd,addAssetProcedureStepFieldValuesAttachment:Dd,addAssetProcedureStepFieldValuesAttachments:Gs,setAssetProcedureStepFieldValuesAttachment:jd,setAssetProcedureStepFieldValuesAttachments:$d,updateAssetProcedureStepFieldValuesAttachment:Cd,updateAssetProcedureStepFieldValuesAttachments:Ud,deleteAssetProcedureStepFieldValuesAttachment:Ld,deleteAssetProcedureStepFieldValuesAttachments:Hs}=Ns.actions,Nd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Ks=o.createSelector([Nd],t=>Object.values(t)),Gd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Hd=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Kd=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Yd=Ns.reducer,se=F(t=>t.uuid),Jd={instances:{}},Ys=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Jd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Jd)),reducers:{initializeAssetProcedureStepFieldValues:se.initialize,addAssetProcedureStepFieldValues:se.addOne,addAssetProcedureStepFieldValuesMany:se.addMany,setAssetProcedureStepFieldValues:se.setOne,setAssetProcedureStepFieldValuesMany:se.setMany,updateAssetProcedureStepFieldValues:se.updateOne,updateAssetProcedureStepFieldValuesMany:se.updateMany,deleteAssetProcedureStepFieldValues:se.deleteOne,deleteAssetProcedureStepFieldValuesMany:se.deleteMany}}),{initializeAssetProcedureStepFieldValues:Zd,addAssetProcedureStepFieldValues:Qd,addAssetProcedureStepFieldValuesMany:Xd,setAssetProcedureStepFieldValues:xd,setAssetProcedureStepFieldValuesMany:el,updateAssetProcedureStepFieldValues:tl,updateAssetProcedureStepFieldValuesMany:sl,deleteAssetProcedureStepFieldValues:il,deleteAssetProcedureStepFieldValuesMany:nl}=Ys.actions,al=t=>t.assetProcedureStepFieldValuesReducer.instances,Mt=o.createSelector([al],t=>Object.values(t)),TP=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),IP=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),OP=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),cl=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],rl=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dl=Ys.reducer,ie=F(t=>t.uuid),ll={instances:{}},Js=o.createSlice({name:"assetProcedureSteps",initialState:ll,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ll)),reducers:{initializeAssetProcedureSteps:ie.initialize,setAssetProcedureStep:ie.setOne,setAssetProcedureSteps:ie.setMany,addAssetProcedureStep:ie.addOne,addAssetProcedureSteps:ie.addMany,updateAssetProcedureStep:ie.updateOne,updateAssetProcedureSteps:ie.updateMany,deleteAssetProcedureStep:ie.deleteOne,deleteAssetProcedureSteps:ie.deleteMany}}),{initializeAssetProcedureSteps:ul,setAssetProcedureStep:ol,setAssetProcedureSteps:hl,addAssetProcedureStep:pl,addAssetProcedureSteps:ml,updateAssetProcedureStep:yl,updateAssetProcedureSteps:fl,deleteAssetProcedureStep:Sl,deleteAssetProcedureSteps:Al}=Js.actions,wl=Js.reducer,Kt=t=>t.assetProcedureStepReducer.instances,Tl=t=>s=>s.assetProcedureStepReducer.instances[t],Zs=o.createSelector([Kt],t=>Object.values(t)),FP=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return $t(e)})),_P=S(o.createSelector([Zs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Il=S(o.createSelector([Zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ol=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Qa(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ne=F(t=>t.uuid),Fl={instances:{}},Qs=o.createSlice({name:"assets",initialState:Fl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Fl)),reducers:{initializeAssets:ne.initialize,addAsset:ne.addOne,addAssets:ne.addMany,setAsset:ne.setOne,setAssets:ne.setMany,updateAsset:ne.updateOne,updateAssets:ne.updateMany,deleteAsset:ne.deleteOne,deleteAssets:ne.deleteMany}}),{initializeAssets:_l,addAsset:gl,addAssets:Xs,updateAsset:Pl,updateAssets:bl,deleteAsset:Rl,deleteAssets:xs,setAsset:Ml,setAssets:kl}=Qs.actions,El=t=>t.assetReducer.instances,Yt=o.createSelector([El],t=>A(Object.values(t))),gP=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),vl=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Vl=t=>s=>s.assetReducer.instances[t],Bl=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Wl=Qs.reducer,ae=F(t=>t.uuid),zl={instances:{}},ei=o.createSlice({name:"assetStageCompletions",initialState:zl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,zl)),reducers:{initializeAssetStageCompletions:ae.initialize,addAssetStageCompletion:ae.addOne,addAssetStageCompletions:ae.addMany,setAssetStageCompletion:ae.setOne,setAssetStageCompletions:ae.setMany,updateAssetStageCompletion:ae.updateOne,updateAssetStageCompletions:ae.updateMany,deleteAssetStageCompletion:ae.deleteOne,deleteAssetStageCompletions:ae.deleteMany}}),{initializeAssetStageCompletions:ql,addAssetStageCompletion:Dl,addAssetStageCompletions:jl,setAssetStageCompletion:$l,setAssetStageCompletions:Cl,updateAssetStageCompletion:Ul,updateAssetStageCompletions:Ll,deleteAssetStageCompletion:Nl,deleteAssetStageCompletions:Gl}=ei.actions,Hl=ei.reducer,Kl=t=>t.assetStageCompletionReducer.instances,Yl=o.createSelector([Kl],t=>Object.values(t)),Jl=t=>s=>s.assetStageCompletionReducer.instances[t],Zl=S(o.createSelector([Yl,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ce=F(t=>t.uuid),Ql={instances:{}},ti=o.createSlice({name:"assetStages",initialState:Ql,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ql)),reducers:{initializeAssetStages:ce.initialize,setAssetStage:ce.setOne,setAssetStages:ce.setMany,addAssetStage:ce.addOne,addAssetStages:ce.addMany,updateAssetStage:ce.updateOne,updateAssetStages:ce.updateMany,deleteAssetStage:ce.deleteOne,deleteAssetStages:ce.deleteMany}}),{initializeAssetStages:Xl,setAssetStage:xl,setAssetStages:eu,addAssetStage:tu,addAssetStages:su,updateAssetStage:iu,updateAssetStages:nu,deleteAssetStage:au,deleteAssetStages:cu}=ti.actions,ru=ti.reducer,si=t=>t.assetStageReducer.instances,du=t=>s=>s.assetStageReducer.instances[t],ii=o.createSelector([si],t=>Object.values(t)),PP=S(o.createSelector([si,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return $t(e)})),bP=S(o.createSelector([ii,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),lu=S(o.createSelector([ii,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),re=F(t=>t.uuid),uu={instances:{}},ni=o.createSlice({name:"assetTypeAttachments",initialState:uu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,uu)),reducers:{initializeAssetTypeAttachments:re.initialize,addAssetTypeAttachment:re.addOne,addAssetTypeAttachments:re.addMany,setAssetTypeAttachment:re.setOne,setAssetTypeAttachments:re.setMany,updateAssetTypeAttachment:re.updateOne,updateAssetTypeAttachments:re.updateMany,deleteAssetTypeAttachment:re.deleteOne,deleteAssetTypeAttachments:re.deleteMany}}),{initializeAssetTypeAttachments:ou,addAssetTypeAttachment:hu,addAssetTypeAttachments:ai,setAssetTypeAttachment:pu,setAssetTypeAttachments:mu,updateAssetTypeAttachment:yu,updateAssetTypeAttachments:fu,deleteAssetTypeAttachment:Su,deleteAssetTypeAttachments:ci}=ni.actions,Au=t=>t.assetTypeAttachmentReducer.instances,ri=o.createSelector([Au],t=>Object.values(t)),wu=t=>s=>s.assetTypeAttachmentReducer.instances[t],Tu=S(o.createSelector([ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Iu=S(o.createSelector([ri,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),Ou=ni.reducer,de=F(t=>t.uuid),Fu={instances:{}},di=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Fu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Fu)),reducers:{initializeAssetTypeFieldsAttachments:de.initialize,addAssetTypeFieldsAttachment:de.addOne,addAssetTypeFieldsAttachments:de.addMany,setAssetTypeFieldsAttachment:de.setOne,setAssetTypeFieldsAttachments:de.setMany,updateAssetTypeFieldsAttachment:de.updateOne,updateAssetTypeFieldsAttachments:de.updateMany,deleteAssetTypeFieldsAttachment:de.deleteOne,deleteAssetTypeFieldsAttachments:de.deleteMany}}),{initializeAssetTypeFieldsAttachments:_u,addAssetTypeFieldsAttachment:gu,addAssetTypeFieldsAttachments:Pu,setAssetTypeFieldsAttachment:bu,setAssetTypeFieldsAttachments:Ru,updateAssetTypeFieldsAttachment:Mu,updateAssetTypeFieldsAttachments:ku,deleteAssetTypeFieldsAttachment:Eu,deleteAssetTypeFieldsAttachments:vu}=di.actions,Vu=t=>t.assetTypeFieldsAttachmentReducer.instances,li=o.createSelector([Vu],t=>Object.values(t)),RP=S(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Bu=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Wu=S(o.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zu=di.reducer,le=F(t=>t.uuid),qu={instances:{}},ui=o.createSlice({name:"assetTypeFields",initialState:qu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,qu)),reducers:{initializeAssetTypeFields:le.initialize,addAssetTypeFields:le.addOne,addAssetTypeFieldsMany:le.addMany,setAssetTypeFields:le.setOne,setAssetTypeFieldsMany:le.setMany,updateAssetTypeFields:le.updateOne,updateAssetTypeFieldsMany:le.updateMany,deleteAssetTypeFields:le.deleteOne,deleteAssetTypeFieldsMany:le.deleteMany}}),{initializeAssetTypeFields:Du,addAssetTypeFields:ju,addAssetTypeFieldsMany:$u,setAssetTypeFields:Cu,setAssetTypeFieldsMany:Uu,updateAssetTypeFields:Lu,updateAssetTypeFieldsMany:Nu,deleteAssetTypeFields:Gu,deleteAssetTypeFieldsMany:Hu}=ui.actions,Ku=t=>t.assetTypeFieldsReducer.instances,kt=o.createSelector([Ku],t=>Object.values(t)),MP=S(o.createSelector([kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),kP=S(o.createSelector([kt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Yu=t=>s=>s.assetTypeFieldsReducer.instances[t],Ju=S(o.createSelector([kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zu=ui.reducer,ue=F(t=>t.uuid),Qu={instances:{}},oi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Qu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Qu)),reducers:{initializeAssetTypeFieldValuesAttachments:ue.initialize,addAssetTypeFieldValuesAttachment:ue.addOne,addAssetTypeFieldValuesAttachments:ue.addMany,setAssetTypeFieldValuesAttachment:ue.setOne,setAssetTypeFieldValuesAttachments:ue.setMany,updateAssetTypeFieldValuesAttachment:ue.updateOne,updateAssetTypeFieldValuesAttachments:ue.updateMany,deleteAssetTypeFieldValuesAttachment:ue.deleteOne,deleteAssetTypeFieldValuesAttachments:ue.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Xu,addAssetTypeFieldValuesAttachment:xu,addAssetTypeFieldValuesAttachments:hi,setAssetTypeFieldValuesAttachment:eo,setAssetTypeFieldValuesAttachments:to,updateAssetTypeFieldValuesAttachment:so,updateAssetTypeFieldValuesAttachments:io,deleteAssetTypeFieldValuesAttachment:no,deleteAssetTypeFieldValuesAttachments:pi}=oi.actions,ao=t=>t.assetTypeFieldValuesAttachmentReducer.instances,mi=o.createSelector([ao],t=>Object.values(t)),co=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],ro=S(o.createSelector([mi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lo=S(o.createSelector([mi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),uo=oi.reducer,oe=F(t=>t.uuid),oo={instances:{}},yi=o.createSlice({name:"assetTypeFieldValues",initialState:oo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,oo)),reducers:{initializeAssetTypeFieldValues:oe.initialize,addAssetTypeFieldValues:oe.addOne,addAssetTypeFieldValuesMany:oe.addMany,setAssetTypeFieldValues:oe.setOne,setAssetTypeFieldValuesMany:oe.setMany,updateAssetTypeFieldValues:oe.updateOne,updateAssetTypeFieldValuesMany:oe.updateMany,deleteAssetTypeFieldValues:oe.deleteOne,deleteAssetTypeFieldValuesMany:oe.deleteMany}}),{initializeAssetTypeFieldValues:ho,addAssetTypeFieldValues:po,addAssetTypeFieldValuesMany:mo,setAssetTypeFieldValues:yo,setAssetTypeFieldValuesMany:fo,updateAssetTypeFieldValues:So,updateAssetTypeFieldValuesMany:Ao,deleteAssetTypeFieldValues:wo,deleteAssetTypeFieldValuesMany:To}=yi.actions,Io=t=>t.assetTypeFieldValuesReducer.instances,Jt=o.createSelector([Io],t=>Object.values(t)),EP=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),vP=S(o.createSelector([kt,Jt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),Oo=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Fo=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_o=yi.reducer,he=F(t=>t.uuid),go={instances:{}},fi=o.createSlice({name:"assetTypeIdentifiers",initialState:go,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,go)),reducers:{initializeAssetTypeIdentifiers:he.initialize,addAssetTypeIdentifier:he.addOne,addAssetTypeIdentifiers:he.addMany,setAssetTypeIdentifier:he.setOne,setAssetTypeIdentifiers:he.setMany,updateAssetTypeIdentifier:he.updateOne,updateAssetTypeIdentifiers:he.updateMany,deleteAssetTypeIdentifier:he.deleteOne,deleteAssetTypeIdentifiers:he.deleteMany}}),{initializeAssetTypeIdentifiers:Po,addAssetTypeIdentifier:bo,addAssetTypeIdentifiers:Ro,setAssetTypeIdentifier:Mo,setAssetTypeIdentifiers:ko,updateAssetTypeIdentifier:Eo,updateAssetTypeIdentifiers:vo,deleteAssetTypeIdentifier:Vo,deleteAssetTypeIdentifiers:Bo}=fi.actions,Wo=t=>t.assetTypeIdentifierReducer.instances,Si=o.createSelector([Wo],t=>Object.values(t)),zo=t=>s=>s.assetTypeIdentifierReducer.instances[t],qo=S(o.createSelector([Si,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VP=S(o.createSelector([Si,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Do=fi.reducer,pe=F(t=>t.uuid),jo={instances:{}},Ai=o.createSlice({name:"assetTypeIdentifierValues",initialState:jo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,jo)),reducers:{initializeAssetTypeIdentifierValues:pe.initialize,addAssetTypeIdentifierValue:pe.addOne,addAssetTypeIdentifierValues:pe.addMany,setAssetTypeIdentifierValue:pe.setOne,setAssetTypeIdentifierValues:pe.setMany,updateAssetTypeIdentifierValue:pe.updateOne,updateAssetTypeIdentifierValues:pe.updateMany,deleteAssetTypeIdentifierValue:pe.deleteOne,deleteAssetTypeIdentifierValues:pe.deleteMany}}),{initializeAssetTypeIdentifierValues:$o,addAssetTypeIdentifierValue:Co,addAssetTypeIdentifierValues:Uo,setAssetTypeIdentifierValue:Lo,setAssetTypeIdentifierValues:No,updateAssetTypeIdentifierValue:Go,updateAssetTypeIdentifierValues:Ho,deleteAssetTypeIdentifierValue:Ko,deleteAssetTypeIdentifierValues:Yo}=Ai.actions,Jo=t=>t.assetTypeIdentifierValueReducer.instances,Zt=o.createSelector([Jo],t=>Object.values(t)),Zo=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],Qo=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),WP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),Xo=Ai.reducer,me=F(t=>t.uuid),xo={instances:{}},wi=o.createSlice({name:"assetTypes",initialState:xo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,xo)),reducers:{initializeAssetTypes:me.initialize,setAssetType:me.setOne,setAssetTypes:me.setMany,addAssetType:me.addOne,addAssetTypes:me.addMany,updateAssetType:me.updateOne,updateAssetTypes:me.updateMany,deleteAssetType:me.deleteOne,deleteAssetTypes:me.deleteMany}}),{initializeAssetTypes:eh,setAssetType:th,setAssetTypes:sh,addAssetType:ih,addAssetTypes:nh,updateAssetType:ah,updateAssetTypes:ch,deleteAssetType:rh,deleteAssetTypes:dh}=wi.actions,lh=t=>t.assetTypeReducer.instances,Ti=o.createSelector([lh],t=>Object.values(t)),uh=t=>s=>s.assetTypeReducer.instances[t],oh=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zP=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),hh=wi.reducer,ye=F(t=>t.uuid),ph={instances:{}},Ii=o.createSlice({name:"assetTypeStatuses",initialState:ph,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ph)),reducers:{initializeAssetTypeStatuses:ye.initialize,addAssetTypeStatus:ye.addOne,addAssetTypeStatuses:ye.addMany,setAssetTypeStatus:ye.setOne,setAssetTypeStatuses:ye.setMany,updateAssetTypeStatus:ye.updateOne,updateAssetTypeStatuses:ye.updateMany,deleteAssetTypeStatus:ye.deleteOne,deleteAssetTypeStatuses:ye.deleteMany}}),{initializeAssetTypeStatuses:mh,addAssetTypeStatus:yh,addAssetTypeStatuses:fh,setAssetTypeStatus:Sh,setAssetTypeStatuses:Ah,updateAssetTypeStatus:wh,updateAssetTypeStatuses:Th,deleteAssetTypeStatus:Ih,deleteAssetTypeStatuses:Oh}=Ii.actions,Fh=t=>t.assetTypeStatusReducer.instances,Oi=o.createSelector([Fh],t=>A(Object.values(t).toSorted(Xa))),_h=t=>s=>s.assetTypeStatusReducer.instances[t],gh=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qP=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Ph=Ii.reducer,bh={accessToken:"",refreshToken:"",isLoggedIn:!1},Qt=o.createSlice({name:"auth",initialState:bh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,bh)),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||Qt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:DP,clearTokens:jP,setLoggedIn:Rh}=Qt.actions,$P=t=>t.authReducer.accessToken,CP=t=>t.authReducer.isLoggedIn,Mh=Qt.reducer,fe=F(t=>t.uuid),kh={instances:{}},Fi=o.createSlice({name:"documentAttachments",initialState:kh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,kh)),reducers:{initializeDocumentAttachments:fe.initialize,addDocumentAttachment:fe.addOne,addDocumentAttachments:fe.addMany,setDocumentAttachment:fe.setOne,setDocumentAttachments:fe.setMany,updateDocumentAttachment:fe.updateOne,updateDocumentAttachments:fe.updateMany,deleteDocumentAttachment:fe.deleteOne,deleteDocumentAttachments:fe.deleteMany}}),{initializeDocumentAttachments:Eh,addDocumentAttachment:vh,addDocumentAttachments:Vh,setDocumentAttachment:Bh,setDocumentAttachments:Wh,updateDocumentAttachment:zh,updateDocumentAttachments:qh,deleteDocumentAttachment:Dh,deleteDocumentAttachments:jh}=Fi.actions,$h=t=>t.documentAttachmentReducer.instances,_i=o.createSelector([$h],t=>Object.values(t)),Ch=t=>s=>s.documentAttachmentReducer.instances[t],Uh=S(o.createSelector([_i,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UP=S(o.createSelector([_i,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),Lh=Fi.reducer,Se=F(({uuid:t})=>t),Nh={instances:{}},gi=o.createSlice({name:"documents",initialState:Nh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>{Object.assign(s,Nh)}),reducers:{initializeDocuments:Se.initialize,addDocument:Se.addOne,addDocuments:Se.addMany,setDocument:Se.setOne,setDocuments:Se.setMany,updateDocument:Se.updateOne,updateDocuments:Se.updateMany,deleteDocument:Se.deleteOne,deleteDocuments:Se.deleteMany}}),{initializeDocuments:Gh,addDocument:Hh,addDocuments:Kh,setDocument:Yh,setDocuments:Jh,updateDocument:Zh,updateDocuments:Qh,deleteDocument:Xh,deleteDocuments:xh}=gi.actions,ep=gi.reducer,Pi=t=>t.documentsReducer.instances,Xt=o.createSelector([Pi],t=>Object.values(t)),tp=t=>s=>s.documentsReducer.instances[t],sp=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),NP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),ip=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=tc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Ae=F(t=>t.uuid),np={instances:{}},bi=o.createSlice({name:"emailDomains",initialState:np,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,np)),reducers:{initializeEmailDomains:Ae.initialize,addEmailDomain:Ae.addOne,addEmailDomains:Ae.addMany,setEmailDomain:Ae.setOne,setEmailDomains:Ae.setMany,updateEmailDomain:Ae.updateOne,updateEmailDomains:Ae.updateMany,deleteEmailDomain:Ae.deleteOne,deleteEmailDomains:Ae.deleteMany}}),{initializeEmailDomains:ap,addEmailDomain:cp,addEmailDomains:rp,setEmailDomain:dp,setEmailDomains:lp,updateEmailDomain:up,updateEmailDomains:op,deleteEmailDomain:hp,deleteEmailDomains:pp}=bi.actions,mp=t=>t.emailDomainsReducer.instances,Ri=o.createSelector([mp],t=>Object.values(t)),yp=t=>s=>s.emailDomainsReducer.instances[t],fp=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GP=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Sp=bi.reducer,Ap={s3Urls:{}},wp=1e3*60*60,HP=wp*24*7,Mi=o.createSlice({name:"file",initialState:Ap,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Ap)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+HP);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:KP}=Mi.actions,YP=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<wp))return e},Tp=Mi.reducer,we=F(t=>t.uuid),Ip={instances:{}},ki=o.createSlice({name:"formIdentifiers",initialState:Ip,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ip)),reducers:{initializeFormIdentifiers:we.initialize,addFormIdentifier:we.addOne,addFormIdentifiers:we.addMany,setFormIdentifier:we.setOne,setFormIdentifiers:we.setMany,updateFormIdentifier:we.updateOne,updateFormIdentifiers:we.updateMany,deleteFormIdentifier:we.deleteOne,deleteFormIdentifiers:we.deleteMany}}),{initializeFormIdentifiers:Op,addFormIdentifier:Fp,addFormIdentifiers:_p,setFormIdentifier:gp,setFormIdentifiers:Pp,updateFormIdentifier:bp,updateFormIdentifiers:Rp,deleteFormIdentifier:Mp,deleteFormIdentifiers:kp}=ki.actions,Ep=t=>t.formIdentifierReducer.instances,Ei=o.createSelector([Ep],t=>Object.values(t)),vp=t=>s=>s.formIdentifierReducer.instances[t],Vp=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),JP=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Bp=ki.reducer,Te=F(t=>t.uuid),Wp={instances:{}},vi=o.createSlice({name:"formIdentifierValues",initialState:Wp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Wp)),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:zp,addFormIdentifierValue:qp,addFormIdentifierValues:Dp,setFormIdentifierValue:jp,setFormIdentifierValues:$p,updateFormIdentifierValue:Cp,updateFormIdentifierValues:Up,deleteFormIdentifierValue:Lp,deleteFormIdentifierValues:Np}=vi.actions,Gp=t=>t.formIdentifierValueReducer.instances,xt=o.createSelector([Gp],t=>Object.values(t)),Hp=t=>s=>s.formIdentifierValueReducer.instances[t],Kp=S(o.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ZP=S(o.createSelector([xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),QP=S(o.createSelector([xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),Yp=vi.reducer,Ie=F(t=>t.uuid),Jp={instances:{}},Vi=o.createSlice({name:"formRevisionAttachments",initialState:Jp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jp)),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:Zp,addFormRevisionAttachment:Qp,addFormRevisionAttachments:Xp,setFormRevisionAttachment:xp,setFormRevisionAttachments:em,updateFormRevisionAttachment:tm,updateFormRevisionAttachments:sm,deleteFormRevisionAttachment:im,deleteFormRevisionAttachments:nm}=Vi.actions,es=t=>t.formRevisionAttachmentReducer.instances,am=o.createSelector([es],t=>Object.values(t)),cm=S(o.createSelector([es,(t,s)=>s],(t,s)=>t[s])),rm=S(o.createSelector([am,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XP=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),dm=Vi.reducer,Oe=F(t=>t.uuid),lm={instances:{}},Bi=o.createSlice({name:"formRevisions",initialState:lm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,lm)),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:um,addFormRevision:Wi,addFormRevisions:zi,setFormRevision:om,setFormRevisions:hm,updateFormRevision:pm,updateFormRevisions:mm,deleteFormRevision:qi,deleteFormRevisions:Di}=Bi.actions,ji=t=>t.formRevisionReducer.instances,ts=o.createSelector([ji],t=>Object.values(t)),ym=t=>s=>s.formRevisionReducer.instances[t],fm=S(o.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xP=S(o.createSelector([ts,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Sm=S(o.createSelector([ts,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Am=Bi.reducer,Fe=F(t=>t.uuid),wm={instances:{}},$i=o.createSlice({name:"forms",initialState:wm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,wm)),reducers:{initializeForms:Fe.initialize,addForm:Fe.addOne,addForms:Fe.addMany,setForm:Fe.setOne,setForms:Fe.setMany,updateForm:Fe.updateOne,updateForms:Fe.updateMany,deleteForm:Fe.deleteOne,deleteForms:Fe.deleteMany}}),{initializeForms:Tm,addForm:Im,addForms:Om,setForm:Fm,setForms:_m,updateForm:gm,updateForms:Pm,deleteForm:bm,deleteForms:Rm}=$i.actions,Mm=$i.reducer,km=t=>t.formReducer.instances,Ci=o.createSelector([km],t=>Object.values(t)),Em=t=>s=>s.formReducer.instances[t],vm=S(o.createSelector([Ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eb=S(o.createSelector([Ci,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),_e=F(t=>t.uuid),Vm={instances:{}},Ui=o.createSlice({name:"formSubmissionAttachments",initialState:Vm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Vm)),reducers:{initializeFormSubmissionAttachments:_e.initialize,addFormSubmissionAttachment:_e.addOne,addFormSubmissionAttachments:_e.addMany,setFormSubmissionAttachment:_e.setOne,setFormSubmissionAttachments:_e.setMany,updateFormSubmissionAttachment:_e.updateOne,updateFormSubmissionAttachments:_e.updateMany,deleteFormSubmissionAttachment:_e.deleteOne,deleteFormSubmissionAttachments:_e.deleteMany}}),{initializeFormSubmissionAttachments:Bm,addFormSubmissionAttachment:Wm,addFormSubmissionAttachments:Li,setFormSubmissionAttachment:zm,setFormSubmissionAttachments:qm,updateFormSubmissionAttachment:Dm,updateFormSubmissionAttachments:jm,deleteFormSubmissionAttachment:$m,deleteFormSubmissionAttachments:Ni}=Ui.actions,Gi=t=>t.formSubmissionAttachmentReducer.instances,Hi=o.createSelector([Gi],t=>Object.values(t)),Cm=S(o.createSelector([Gi,(t,s)=>s],(t,s)=>t[s])),Ki=S(o.createSelector([Hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Um=Ki,Lm=S(o.createSelector([Hi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Nm=Ui.reducer,ge=F(t=>t.uuid),Gm={instances:{}},Yi=o.createSlice({name:"formSubmissions",initialState:Gm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Gm)),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:Hm,setFormSubmission:Km,setFormSubmissions:Ym,addFormSubmission:Jm,addFormSubmissions:Ji,updateFormSubmission:Zm,updateFormSubmissions:Qm,deleteFormSubmission:Xm,deleteFormSubmissions:Zi}=Yi.actions,Qi=t=>t.formSubmissionReducer.instances,xm=o.createSelector([Qi],t=>Object.values(t)),ey=t=>s=>s.formSubmissionReducer.instances[t],ty=S(o.createSelector([xm,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sy=S(o.createSelector([Qi,ji,(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))})),iy=Yi.reducer,Pe=F(t=>t.uuid),ny={instances:{}},Xi=o.createSlice({name:"geoImages",initialState:ny,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ny)),reducers:{initializeGeoImages:Pe.initialize,setGeoImage:Pe.setOne,setGeoImages:Pe.setMany,addGeoImage:Pe.addOne,addGeoImages:Pe.addMany,updateGeoImage:Pe.updateOne,updateGeoImages:Pe.updateMany,deleteGeoImage:Pe.deleteOne,deleteGeoImages:Pe.deleteMany}}),{initializeGeoImages:ay,setGeoImage:cy,setGeoImages:ry,addGeoImage:dy,addGeoImages:ly,updateGeoImage:uy,updateGeoImages:oy,deleteGeoImage:hy,deleteGeoImages:py}=Xi.actions,my=t=>t.geoImageReducer.instances,xi=o.createSelector([my],t=>Object.values(t)),yy=t=>s=>s.geoImageReducer.instances[t],fy=S(o.createSelector([xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tb=S(o.createSelector([xi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Sy=Xi.reducer,be=F(t=>t.uuid),Ay={instances:{}},en=o.createSlice({name:"issueAssociations",initialState:Ay,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Ay)),reducers:{initializeIssueAssociations:be.initialize,addIssueAssociation:be.addOne,addIssueAssociations:be.addMany,setIssueAssociation:be.setOne,setIssueAssociations:be.setMany,updateIssueAssociation:be.updateOne,updateIssueAssociations:be.updateMany,deleteIssueAssociation:be.deleteOne,deleteIssueAssociations:be.deleteMany}}),{initializeIssueAssociations:wy,setIssueAssociations:Ty,setIssueAssociation:Iy,updateIssueAssociation:Oy,updateIssueAssociations:Fy,addIssueAssociation:_y,addIssueAssociations:mt,deleteIssueAssociation:gy,deleteIssueAssociations:yt}=en.actions,Py=t=>t.issueAssociationReducer.instances,ft=o.createSelector([Py],t=>Object.values(t)),by=t=>s=>s.issueAssociationReducer.instances[t],Ry=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),My=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),ky=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),Ey=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),vy=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),Vy=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),By=en.reducer,Re=F(t=>t.uuid),Wy={instances:{}},tn=o.createSlice({name:"issueAttachments",initialState:Wy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Wy)),reducers:{initializeIssueAttachments:Re.initialize,addIssueAttachment:Re.addOne,addIssueAttachments:Re.addMany,setIssueAttachment:Re.setOne,setIssueAttachments:Re.setMany,updateIssueAttachment:Re.updateOne,updateIssueAttachments:Re.updateMany,deleteIssueAttachment:Re.deleteOne,deleteIssueAttachments:Re.deleteMany}}),{initializeIssueAttachments:zy,addIssueAttachment:qy,addIssueAttachments:sn,setIssueAttachment:Dy,setIssueAttachments:jy,updateIssueAttachment:$y,updateIssueAttachments:Cy,deleteIssueAttachment:Uy,deleteIssueAttachments:nn}=tn.actions,Ly=t=>t.issueAttachmentReducer.instances,an=o.createSelector([Ly],t=>Object.values(t)),Ny=S(o.createSelector([an,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Gy=t=>s=>s.issueAttachmentReducer.instances[t],Hy=S(o.createSelector([an,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ky=tn.reducer,Me=F(t=>t.uuid),Yy={instances:{}},cn=o.createSlice({name:"issueCommentAttachments",initialState:Yy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Yy)),reducers:{initializeIssueCommentAttachments:Me.initialize,addIssueCommentAttachment:Me.addOne,addIssueCommentAttachments:Me.addMany,setIssueCommentAttachment:Me.setOne,setIssueCommentAttachments:Me.setMany,updateIssueCommentAttachment:Me.updateOne,updateIssueCommentAttachments:Me.updateMany,deleteIssueCommentAttachment:Me.deleteOne,deleteIssueCommentAttachments:Me.deleteMany}}),{initializeIssueCommentAttachments:Jy,addIssueCommentAttachment:Zy,addIssueCommentAttachments:Qy,setIssueCommentAttachment:Xy,setIssueCommentAttachments:xy,updateIssueCommentAttachment:ef,updateIssueCommentAttachments:tf,deleteIssueCommentAttachment:sf,deleteIssueCommentAttachments:nf}=cn.actions,af=t=>t.issueCommentAttachmentReducer.instances,rn=o.createSelector([af],t=>Object.values(t)),cf=t=>s=>s.issueCommentAttachmentReducer.instances[t],rf=S(o.createSelector([rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sb=S(o.createSelector([rn,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),df=cn.reducer,ke=F(t=>t.uuid),lf={instances:{}},dn=o.createSlice({name:"issueComments",initialState:lf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lf)),reducers:{initializeIssueComments:ke.initialize,addIssueComment:ke.addOne,addIssueComments:ke.addMany,setIssueComment:ke.setOne,setIssueComments:ke.setMany,updateIssueComment:ke.updateOne,updateIssueComments:ke.updateMany,deleteIssueComment:ke.deleteOne,deleteIssueComments:ke.deleteMany}}),{initializeIssueComments:uf,addIssueComment:of,addIssueComments:hf,setIssueComment:pf,setIssueComments:mf,updateIssueComment:yf,updateIssueComments:ff,deleteIssueComment:Sf,deleteIssueComments:Af}=dn.actions,ln=t=>t.issueCommentReducer.instances,wf=t=>s=>s.issueCommentReducer.instances[t],Tf=S(o.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),ib=S(o.createSelector([ln,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),If=dn.reducer,Ee=F(t=>t.uuid),Of={instances:{}},un=o.createSlice({name:"issues",initialState:Of,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Of)),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:Ff,addIssue:_f,addIssues:on,setIssue:gf,setIssues:Pf,updateIssue:bf,updateIssues:Rf,deleteIssue:Mf,deleteIssues:hn}=un.actions,kf=t=>t.issueReducer.instances,ss=o.createSelector([kf],t=>Object.values(t)),Ef=t=>s=>s.issueReducer.instances[t],vf=S(o.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nb=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Vf=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),Bf=un.reducer,ve=F(t=>t.uuid),Wf={instances:{}},pn=o.createSlice({name:"issueTypeAttachments",initialState:Wf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Wf)),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:zf,addIssueTypeAttachment:qf,addIssueTypeAttachments:Df,setIssueTypeAttachment:jf,setIssueTypeAttachments:$f,updateIssueTypeAttachment:Cf,updateIssueTypeAttachments:Uf,deleteIssueTypeAttachment:Lf,deleteIssueTypeAttachments:Nf}=pn.actions,Gf=t=>t.issueTypeAttachmentReducer.instances,mn=o.createSelector([Gf],t=>Object.values(t)),Hf=t=>s=>s.issueTypeAttachmentReducer.instances[t],Kf=S(o.createSelector([mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ab=S(o.createSelector([mn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),Yf=pn.reducer,Ve=F(t=>t.uuid),Jf={instances:{}},yn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:Jf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jf)),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:Zf,addIssueTypeFieldsAttachment:Qf,addIssueTypeFieldsAttachments:Xf,setIssueTypeFieldsAttachment:xf,setIssueTypeFieldsAttachments:eS,updateIssueTypeFieldsAttachment:tS,updateIssueTypeFieldsAttachments:sS,deleteIssueTypeFieldsAttachment:iS,deleteIssueTypeFieldsAttachments:nS}=yn.actions,aS=t=>t.issueTypeFieldsAttachmentReducer.instances,fn=o.createSelector([aS],t=>Object.values(t)),cb=S(o.createSelector([fn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),cS=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],rS=S(o.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dS=yn.reducer,Be=F(t=>t.uuid),lS={instances:{}},Sn=o.createSlice({name:"issueTypeFieldValues",initialState:lS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lS)),reducers:{initializeIssueTypeFieldValues:Be.initialize,addIssueTypeFieldValues:Be.addOne,addIssueTypeFieldValuesMany:Be.addMany,setIssueTypeFieldValues:Be.setOne,setIssueTypeFieldValuesMany:Be.setMany,updateIssueTypeFieldValues:Be.updateOne,updateIssueTypeFieldValuesMany:Be.updateMany,deleteIssueTypeFieldValues:Be.deleteOne,deleteIssueTypeFieldValuesMany:Be.deleteMany}}),{initializeIssueTypeFieldValues:uS,addIssueTypeFieldValues:oS,addIssueTypeFieldValuesMany:hS,setIssueTypeFieldValues:pS,setIssueTypeFieldValuesMany:mS,updateIssueTypeFieldValues:yS,updateIssueTypeFieldValuesMany:fS,deleteIssueTypeFieldValues:SS,deleteIssueTypeFieldValuesMany:AS}=Sn.actions,wS=t=>t.issueTypeFieldValuesReducer.instances,is=o.createSelector([wS],t=>Object.values(t)),rb=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),TS=t=>s=>s.issueTypeFieldValuesReducer.instances[t],IS=S(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OS=Sn.reducer,We=F(t=>t.uuid),FS={instances:{}},An=o.createSlice({name:"issueTypeFields",initialState:FS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,FS)),reducers:{initializeIssueTypeFields:We.initialize,addIssueTypeFields:We.addOne,addIssueTypeFieldsMany:We.addMany,setIssueTypeFields:We.setOne,setIssueTypeFieldsMany:We.setMany,updateIssueTypeFields:We.updateOne,updateIssueTypeFieldsMany:We.updateMany,deleteIssueTypeFields:We.deleteOne,deleteIssueTypeFieldsMany:We.deleteMany}}),{initializeIssueTypeFields:_S,addIssueTypeFields:gS,addIssueTypeFieldsMany:PS,setIssueTypeFields:bS,setIssueTypeFieldsMany:RS,updateIssueTypeFields:MS,updateIssueTypeFieldsMany:kS,deleteIssueTypeFields:ES,deleteIssueTypeFieldsMany:vS}=An.actions,VS=t=>t.issueTypeFieldsReducer.instances,Et=o.createSelector([VS],t=>Object.values(t)),db=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),lb=S(o.createSelector([Et,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),ub=S(o.createSelector([Et,is,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),BS=t=>s=>s.issueTypeFieldsReducer.instances[t],WS=S(o.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zS=An.reducer,ze=F(t=>t.uuid),qS={instances:{}},wn=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:qS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,qS)),reducers:{initializeIssueTypeFieldValuesAttachments:ze.initialize,addIssueTypeFieldValuesAttachment:ze.addOne,addIssueTypeFieldValuesAttachments:ze.addMany,setIssueTypeFieldValuesAttachment:ze.setOne,setIssueTypeFieldValuesAttachments:ze.setMany,updateIssueTypeFieldValuesAttachment:ze.updateOne,updateIssueTypeFieldValuesAttachments:ze.updateMany,deleteIssueTypeFieldValuesAttachment:ze.deleteOne,deleteIssueTypeFieldValuesAttachments:ze.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:DS,addIssueTypeFieldValuesAttachment:jS,addIssueTypeFieldValuesAttachments:Tn,setIssueTypeFieldValuesAttachment:$S,setIssueTypeFieldValuesAttachments:CS,updateIssueTypeFieldValuesAttachment:US,updateIssueTypeFieldValuesAttachments:LS,deleteIssueTypeFieldValuesAttachment:NS,deleteIssueTypeFieldValuesAttachments:In}=wn.actions,GS=t=>t.issueTypeFieldValuesAttachmentReducer.instances,On=o.createSelector([GS],t=>Object.values(t)),HS=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],KS=S(o.createSelector([On,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YS=S(o.createSelector([On,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),JS=wn.reducer,qe=F(t=>t.uuid),ZS={instances:{}},Fn=o.createSlice({name:"issueTypeIdentifiers",initialState:ZS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ZS)),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:QS,addIssueTypeIdentifier:XS,addIssueTypeIdentifiers:xS,setIssueTypeIdentifier:eA,setIssueTypeIdentifiers:tA,updateIssueTypeIdentifier:sA,updateIssueTypeIdentifiers:iA,deleteIssueTypeIdentifier:nA,deleteIssueTypeIdentifiers:aA}=Fn.actions,cA=t=>t.issueTypeIdentifierReducer.instances,_n=o.createSelector([cA],t=>Object.values(t)),rA=t=>s=>s.issueTypeIdentifierReducer.instances[t],dA=S(o.createSelector([_n,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ob=S(o.createSelector([_n,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),lA=Fn.reducer,De=F(t=>t.uuid),uA={instances:{}},gn=o.createSlice({name:"issueTypeIdentifierValues",initialState:uA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,uA)),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:oA,addIssueTypeIdentifierValue:hA,addIssueTypeIdentifierValues:pA,setIssueTypeIdentifierValue:mA,setIssueTypeIdentifierValues:yA,updateIssueTypeIdentifierValue:fA,updateIssueTypeIdentifierValues:SA,deleteIssueTypeIdentifierValue:AA,deleteIssueTypeIdentifierValues:wA}=gn.actions,TA=t=>t.issueTypeIdentifierValueReducer.instances,ns=o.createSelector([TA],t=>Object.values(t)),IA=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],OA=S(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),pb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),FA=gn.reducer,je=F(t=>t.uuid),_A={instances:{}},Pn=o.createSlice({name:"issueTypes",initialState:_A,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,_A)),reducers:{initializeIssueTypes:je.initialize,addIssueType:je.addOne,addIssueTypes:je.addMany,setIssueType:je.setOne,setIssueTypes:je.setMany,updateIssueType:je.updateOne,updateIssueTypes:je.updateMany,deleteIssueType:je.deleteOne,deleteIssueTypes:je.deleteMany}}),{initializeIssueTypes:gA,addIssueType:PA,addIssueTypes:bA,setIssueType:RA,setIssueTypes:MA,updateIssueType:kA,updateIssueTypes:EA,deleteIssueType:vA,deleteIssueTypes:VA}=Pn.actions,BA=t=>t.issueTypeReducer.instances,bn=o.createSelector(BA,t=>Object.values(t)),WA=t=>s=>s.issueTypeReducer.instances[t],zA=S(o.createSelector([bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mb=S(o.createSelector([bn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),qA=Pn.reducer,$e=F(t=>t.uuid),DA={instances:{}},Rn=o.createSlice({name:"issueTypeStatuses",initialState:DA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,DA)),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:jA,addIssueTypeStatus:$A,addIssueTypeStatuses:CA,setIssueTypeStatus:UA,setIssueTypeStatuses:LA,updateIssueTypeStatus:NA,updateIssueTypeStatuses:GA,deleteIssueTypeStatus:HA,deleteIssueTypeStatuses:KA}=Rn.actions,YA=t=>t.issueTypeStatusReducer.instances,Mn=o.createSelector([YA],t=>A(Object.values(t).toSorted(xa))),kn=t=>s=>s.issueTypeStatusReducer.instances[t],JA=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yb=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),ZA=Rn.reducer,Ce=F(t=>t.uuid),QA={instances:{}},En=o.createSlice({name:"issueUpdates",initialState:QA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,QA)),reducers:{initializeIssueUpdates:Ce.initialize,addIssueUpdate:Ce.addOne,addIssueUpdates:Ce.addMany,setIssueUpdate:Ce.setOne,setIssueUpdates:Ce.setMany,updateIssueUpdate:Ce.updateOne,updateIssueUpdates:Ce.updateMany,deleteIssueUpdate:Ce.deleteOne,deleteIssueUpdates:Ce.deleteMany}}),{initializeIssueUpdates:XA,addIssueUpdate:vn,addIssueUpdates:Vn,setIssueUpdate:xA,setIssueUpdates:ew,updateIssueUpdate:tw,updateIssueUpdates:sw,deleteIssueUpdate:Bn,deleteIssueUpdates:Wn}=En.actions,zn=t=>t.issueUpdateReducer.instances,qn=o.createSelector([zn],t=>Object.values(t)),iw=S(o.createSelector([zn,(t,s)=>s],(t,s)=>t[s])),nw=S(o.createSelector([qn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aw=S(o.createSelector([qn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),cw=En.reducer,Ue=F(t=>t.id),rw={instances:{},currentUser:null},Dn=o.createSlice({name:"users",initialState:rw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,rw)).addCase(_,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ue.initialize,setUsers:Ue.setMany,setUser:Ue.setOne,addUsers:Ue.addMany,addUser:Ue.addOne,updateUsers:Ue.updateMany,updateUser:Ue.updateOne,deleteUser:Ue.deleteOne,deleteUsers:Ue.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setCurrentUserProfile:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile=s.payload;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile=s.payload}}}),{initializeUsers:dw,setUsers:lw,setUser:uw,addUsers:ow,addUser:jn,updateUsers:hw,updateUser:pw,deleteUser:$n,deleteUsers:mw,setCurrentUser:fb,setCurrentUserProfile:Sb}=Dn.actions,yw=Dn.reducer,fw=t=>t.userReducer.currentUser,Cn=t=>t.userReducer.instances,as=o.createSelector([Cn],t=>Object.values(t)),cs=t=>s=>s.userReducer.instances[t],Sw=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),Le=F(t=>t.uuid),Aw={instances:{}},Un=o.createSlice({name:"organizationAccess",initialState:Aw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Aw)),reducers:{initializeOrganizationAccesses:Le.initialize,addOrganizationAccess:Le.addOne,addOrganizationAccesses:Le.addMany,setOrganizationAccess:Le.setOne,setOrganizationAccesses:Le.setMany,updateOrganizationAccess:Le.updateOne,updateOrganizationAccesses:Le.updateMany,deleteOrganizationAccess:Le.deleteOne,deleteOrganizationAccesses:Le.deleteMany}}),{initializeOrganizationAccesses:ww,addOrganizationAccess:Tw,addOrganizationAccesses:Iw,setOrganizationAccess:Ow,setOrganizationAccesses:Fw,updateOrganizationAccess:_w,updateOrganizationAccesses:gw,deleteOrganizationAccess:Pw,deleteOrganizationAccesses:bw}=Un.actions,Rw=Un.reducer,rs=t=>t.organizationAccessReducer.instances,Mw=t=>s=>s.organizationAccessReducer.instances[t],kw=S(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),Ab=o.createSelector([fw,rs],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),Ew=o.createSelector([rs],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return $t(s)}),wb=S(o.createSelector([Cn,Ew,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ne=F(t=>t.uuid),vw={instances:{}},Ln=o.createSlice({name:"organizations",initialState:vw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,vw)),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:Vw,setOrganizations:Bw,setOrganization:Ww,addOrganizations:zw,addOrganization:qw,updateOrganizations:Dw,updateOrganization:jw,deleteOrganization:$w,deleteOrganizations:Cw}=Ln.actions,Uw=t=>t.organizationReducer.instances,Lw=o.createSelector([Uw],t=>Object.values(t)),Nw=t=>s=>s.organizationReducer.instances[t],Gw=S(o.createSelector([Lw,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hw=Ln.reducer,Kw=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:ot.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},Yw={deletedRequests:[],latestRetryTime:0},Nn=o.createSlice({name:"outbox",initialState:Yw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Yw)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t.url);const{BASE_URL:s,serviceName:e,...n}=t;return Kw(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}}}),Tb=t=>t.outboxReducer.deletedRequests,Ib=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Jw,markForDeletion:Ob,markAsDeleted:Zw,_setLatestRetryTime:Qw}=Nn.actions,Xw=Nn.reducer,Ge=F(t=>t.uuid),xw={instances:{}},Gn=o.createSlice({name:"projectAccess",initialState:xw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,xw)),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:eT,addProjectAccess:tT,addProjectAccesses:sT,setProjectAccess:iT,setProjectAccesses:nT,updateProjectAccess:aT,updateProjectAccesses:cT,deleteProjectAccess:rT,deleteProjectAccesses:dT}=Gn.actions,lT=Gn.reducer,Hn=t=>t.projectAccessReducer.instances,vt=o.createSelector(Hn,t=>Object.values(t)),uT=t=>s=>s.projectAccessReducer.instances[t],oT=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Fb=S(o.createSelector([Hn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),_b=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),gb=S(o.createSelector([as,vt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),He=F(t=>t.uuid),hT={instances:{}},Kn=o.createSlice({name:"projectAttachments",initialState:hT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,hT)),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:pT,addProjectAttachment:mT,addProjectAttachments:yT,setProjectAttachment:fT,setProjectAttachments:ST,updateProjectAttachment:AT,updateProjectAttachments:wT,deleteProjectAttachment:TT,deleteProjectAttachments:IT}=Kn.actions,OT=t=>t.projectAttachmentReducer.instances,Yn=o.createSelector([OT],t=>Object.values(t)),FT=t=>s=>s.projectAttachmentReducer.instances[t],_T=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Pb=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),gT=Kn.reducer,Ke=F(t=>t.uuid),PT={instances:{}},Jn=o.createSlice({name:"projectFiles",initialState:PT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,PT)),reducers:{initializeProjectFiles:Ke.initialize,setProjectFile:Ke.setOne,setProjectFiles:Ke.setMany,addProjectFile:Ke.addOne,addProjectFiles:Ke.addMany,updateProjectFile:Ke.updateOne,updateProjectFiles:Ke.updateMany,deleteProjectFile:Ke.deleteOne,deleteProjectFiles:Ke.deleteMany}}),{initializeProjectFiles:bT,setProjectFile:RT,setProjectFiles:MT,addProjectFile:kT,addProjectFiles:ET,updateProjectFile:vT,updateProjectFiles:VT,deleteProjectFile:BT,deleteProjectFiles:WT}=Jn.actions,zT=t=>t.projectFileReducer.instances,qT=o.createSelector([zT],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),DT=t=>s=>s.projectFileReducer.instances[t],jT=S(o.createSelector([qT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$T=Jn.reducer,Ye=F(t=>t.uuid),CT={instances:{}},Zn=o.createSlice({name:"projects",initialState:CT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,CT)),reducers:{initializeProjects:Ye.initialize,setProjects:Ye.setMany,setProject:Ye.setOne,addProjects:Ye.addMany,addProject:Ye.addOne,updateProjects:Ye.updateMany,updateProject:Ye.updateOne,deleteProject:Ye.deleteOne,deleteProjects:Ye.deleteMany}}),{initializeProjects:UT,setProjects:LT,setProject:NT,addProjects:GT,addProject:HT,updateProjects:KT,updateProject:YT,deleteProject:JT,deleteProjects:ZT}=Zn.actions,QT=Zn.reducer,XT=t=>t.projectReducer.instances,ds=o.createSelector([XT],t=>Object.values(t)),xT=t=>s=>s.projectReducer.instances[t],eI=S(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bb=S(o.createSelector([ds,vt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return A(t.filter(a=>n.has(a.uuid)))})),Rb=S(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Mb={isRehydrated:!1},Qn=o.createSlice({name:"rehydrated",initialState:Mb,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:kb}=Qn.actions,Eb=t=>t.rehydratedReducer.isRehydrated,tI=Qn.reducer,Je=F(t=>t.uuid),sI={instances:{}},Xn=o.createSlice({name:"teamMemberships",initialState:sI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,sI)),reducers:{initializeTeamMemberships:Je.initialize,addTeamMembership:Je.addOne,addTeamMemberships:Je.addMany,setTeamMembership:Je.setOne,setTeamMemberships:Je.setMany,updateTeamMembership:Je.updateOne,updateTeamMemberships:Je.updateMany,deleteTeamMembership:Je.deleteOne,deleteTeamMemberships:Je.deleteMany}}),{initializeTeamMemberships:iI,addTeamMembership:nI,addTeamMemberships:aI,setTeamMembership:cI,setTeamMemberships:rI,updateTeamMembership:dI,updateTeamMemberships:lI,deleteTeamMembership:uI,deleteTeamMemberships:oI}=Xn.actions,hI=Xn.reducer,pI=t=>t.teamMembershipReducer.instances,ls=o.createSelector([pI],t=>Object.values(t)),mI=t=>s=>s.teamMembershipReducer.instances[t],yI=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vb=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),Vb=S(o.createSelector([as,ls,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),Ze=F(t=>t.uuid),fI={instances:{}},xn=o.createSlice({name:"teams",initialState:fI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,fI)),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:SI,addTeam:AI,addTeams:wI,setTeam:TI,setTeams:II,updateTeam:OI,updateTeams:FI,deleteTeam:_I,deleteTeams:gI}=xn.actions,PI=t=>t.teamReducer.instances,ea=o.createSelector([PI],t=>Object.values(t)),bI=t=>s=>s.teamReducer.instances[t],RI=S(o.createSelector([ea,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Bb=S(o.createSelector([ea,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),MI=xn.reducer,Wb={version:0},kI=o.createSlice({name:"versioning",initialState:Wb,reducers:{}}),EI=kI.reducer,Qe=F(t=>t.uuid),vI={instances:{}},ta=o.createSlice({name:"workflows",initialState:vI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,vI)),reducers:{initializeWorkflows:Qe.initialize,addWorkflow:Qe.addOne,addWorkflows:Qe.addMany,setWorkflow:Qe.setOne,setWorkflows:Qe.setMany,updateWorkflow:Qe.updateOne,updateWorkflows:Qe.updateMany,deleteWorkflow:Qe.deleteOne,deleteWorkflows:Qe.deleteMany}}),{initializeWorkflows:VI,addWorkflow:BI,addWorkflows:WI,setWorkflow:zI,setWorkflows:qI,updateWorkflow:DI,updateWorkflows:jI,deleteWorkflow:$I,deleteWorkflows:CI}=ta.actions,UI=t=>t.workflowReducer.instances,us=o.createSelector([UI],t=>Object.values(t)),LI=t=>s=>s.workflowReducer.instances[t],NI=S(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zb=S(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),qb=S(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),GI=ta.reducer,Xe=F(t=>t.uuid),HI={instances:{}},sa=o.createSlice({name:"workflowStepAssignees",initialState:HI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,HI)),reducers:{initializeWorkflowStepAssignees:Xe.initialize,addWorkflowStepAssignee:Xe.addOne,addWorkflowStepAssignees:Xe.addMany,setWorkflowStepAssignee:Xe.setOne,setWorkflowStepAssignees:Xe.setMany,updateWorkflowStepAssignee:Xe.updateOne,updateWorkflowStepAssignees:Xe.updateMany,deleteWorkflowStepAssignee:Xe.deleteOne,deleteWorkflowStepAssignees:Xe.deleteMany}}),{initializeWorkflowStepAssignees:KI,addWorkflowStepAssignee:YI,addWorkflowStepAssignees:JI,setWorkflowStepAssignee:ZI,setWorkflowStepAssignees:QI,updateWorkflowStepAssignee:XI,updateWorkflowStepAssignees:xI,deleteWorkflowStepAssignee:eO,deleteWorkflowStepAssignees:tO}=sa.actions,sO=t=>t.workflowStepAssigneeReducer.instances,Vt=o.createSelector([sO],t=>Object.values(t)),iO=t=>s=>s.workflowStepAssigneeReducer.instances[t],nO=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Db=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),jb=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),$b=S(o.createSelector([Vt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),aO=sa.reducer,xe=F(t=>t.uuid),cO={instances:{}},ia=o.createSlice({name:"workflowStepComments",initialState:cO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,cO)),reducers:{initializeWorkflowStepComments:xe.initialize,addWorkflowStepComment:xe.addOne,addWorkflowStepComments:xe.addMany,setWorkflowStepComment:xe.setOne,setWorkflowStepComments:xe.setMany,updateWorkflowStepComment:xe.updateOne,updateWorkflowStepComments:xe.updateMany,deleteWorkflowStepComment:xe.deleteOne,deleteWorkflowStepComments:xe.deleteMany}}),{initializeWorkflowStepComments:rO,addWorkflowStepComment:dO,addWorkflowStepComments:lO,setWorkflowStepComment:uO,setWorkflowStepComments:oO,updateWorkflowStepComment:hO,updateWorkflowStepComments:pO,deleteWorkflowStepComment:mO,deleteWorkflowStepComments:yO}=ia.actions,fO=t=>t.workflowStepCommentReducer.instances,Bt=o.createSelector([fO],t=>Object.values(t)),SO=t=>s=>s.workflowStepCommentReducer.instances[t],AO=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Cb=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Ub=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Lb=S(o.createSelector([Bt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),wO=ia.reducer,et=F(t=>t.uuid),TO={instances:{}},na=o.createSlice({name:"workflowStepEvents",initialState:TO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,TO)),reducers:{initializeWorkflowStepEvents:et.initialize,addWorkflowStepEvent:et.addOne,addWorkflowStepEvents:et.addMany,setWorkflowStepEvent:et.setOne,setWorkflowStepEvents:et.setMany,updateWorkflowStepEvent:et.updateOne,updateWorkflowStepEvents:et.updateMany,deleteWorkflowStepEvent:et.deleteOne,deleteWorkflowStepEvents:et.deleteMany}}),{initializeWorkflowStepEvents:IO,addWorkflowStepEvent:OO,addWorkflowStepEvents:FO,setWorkflowStepEvent:_O,setWorkflowStepEvents:gO,updateWorkflowStepEvent:PO,updateWorkflowStepEvents:bO,deleteWorkflowStepEvent:RO,deleteWorkflowStepEvents:MO}=na.actions,kO=t=>t.workflowStepEventReducer.instances,Wt=o.createSelector([kO],t=>Object.values(t)),EO=t=>s=>s.workflowStepEventReducer.instances[t],vO=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nb=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Gb=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Hb=S(o.createSelector([Wt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),VO=na.reducer,tt=F(t=>t.uuid),BO={instances:{}},aa=o.createSlice({name:"workflowStepFieldsAttachments",initialState:BO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,BO)),reducers:{initializeWorkflowStepFieldsAttachments:tt.initialize,addWorkflowStepFieldsAttachment:tt.addOne,addWorkflowStepFieldsAttachments:tt.addMany,setWorkflowStepFieldsAttachment:tt.setOne,setWorkflowStepFieldsAttachments:tt.setMany,updateWorkflowStepFieldsAttachment:tt.updateOne,updateWorkflowStepFieldsAttachments:tt.updateMany,deleteWorkflowStepFieldsAttachment:tt.deleteOne,deleteWorkflowStepFieldsAttachments:tt.deleteMany}}),{initializeWorkflowStepFieldsAttachments:WO,addWorkflowStepFieldsAttachment:zO,addWorkflowStepFieldsAttachments:ca,setWorkflowStepFieldsAttachment:qO,setWorkflowStepFieldsAttachments:DO,updateWorkflowStepFieldsAttachment:jO,updateWorkflowStepFieldsAttachments:$O,deleteWorkflowStepFieldsAttachment:CO,deleteWorkflowStepFieldsAttachments:ra}=aa.actions,UO=t=>t.workflowStepFieldsAttachmentReducer.instances,da=o.createSelector([UO],t=>Object.values(t)),LO=S(o.createSelector([da,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),NO=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],GO=S(o.createSelector([da,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HO=aa.reducer,st=F(t=>t.uuid),KO={instances:{}},la=o.createSlice({name:"workflowStepFields",initialState:KO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,KO)),reducers:{initializeWorkflowStepFields:st.initialize,addWorkflowStepFields:st.addOne,addWorkflowStepFieldsMany:st.addMany,setWorkflowStepFields:st.setOne,setWorkflowStepFieldsMany:st.setMany,updateWorkflowStepFields:st.updateOne,updateWorkflowStepFieldsMany:st.updateMany,deleteWorkflowStepFields:st.deleteOne,deleteWorkflowStepFieldsMany:st.deleteMany}}),{initializeWorkflowStepFields:YO,addWorkflowStepFields:JO,addWorkflowStepFieldsMany:ZO,setWorkflowStepFields:QO,setWorkflowStepFieldsMany:XO,updateWorkflowStepFields:xO,updateWorkflowStepFieldsMany:eF,deleteWorkflowStepFields:tF,deleteWorkflowStepFieldsMany:sF}=la.actions,iF=t=>t.workflowStepFieldsReducer.instances,os=o.createSelector([iF],t=>Object.values(t)),Kb=S(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Yb=S(o.createSelector([os,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),nF=t=>s=>s.workflowStepFieldsReducer.instances[t],aF=S(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cF=la.reducer,it=F(t=>t.uuid),rF={instances:{}},ua=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:rF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,rF)),reducers:{initializeWorkflowStepFieldValuesAttachments:it.initialize,addWorkflowStepFieldValuesAttachment:it.addOne,addWorkflowStepFieldValuesAttachments:it.addMany,setWorkflowStepFieldValuesAttachment:it.setOne,setWorkflowStepFieldValuesAttachments:it.setMany,updateWorkflowStepFieldValuesAttachment:it.updateOne,updateWorkflowStepFieldValuesAttachments:it.updateMany,deleteWorkflowStepFieldValuesAttachment:it.deleteOne,deleteWorkflowStepFieldValuesAttachments:it.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:dF,addWorkflowStepFieldValuesAttachment:lF,addWorkflowStepFieldValuesAttachments:oa,setWorkflowStepFieldValuesAttachment:uF,setWorkflowStepFieldValuesAttachments:oF,updateWorkflowStepFieldValuesAttachment:hF,updateWorkflowStepFieldValuesAttachments:pF,deleteWorkflowStepFieldValuesAttachment:mF,deleteWorkflowStepFieldValuesAttachments:ha}=ua.actions,yF=t=>t.workflowStepFieldValuesAttachmentReducer.instances,pa=o.createSelector([yF],t=>Object.values(t)),fF=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],SF=S(o.createSelector([pa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AF=S(o.createSelector([pa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),wF=ua.reducer,nt=F(t=>t.uuid),TF={instances:{}},ma=o.createSlice({name:"workflowStepFieldValues",initialState:TF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,TF)),reducers:{initializeWorkflowStepFieldValues:nt.initialize,addWorkflowStepFieldValues:nt.addOne,addWorkflowStepFieldValuesMany:nt.addMany,setWorkflowStepFieldValues:nt.setOne,setWorkflowStepFieldValuesMany:nt.setMany,updateWorkflowStepFieldValues:nt.updateOne,updateWorkflowStepFieldValuesMany:nt.updateMany,deleteWorkflowStepFieldValues:nt.deleteOne,deleteWorkflowStepFieldValuesMany:nt.deleteMany}}),{initializeWorkflowStepFieldValues:IF,addWorkflowStepFieldValues:OF,addWorkflowStepFieldValuesMany:FF,setWorkflowStepFieldValues:_F,setWorkflowStepFieldValuesMany:gF,updateWorkflowStepFieldValues:PF,updateWorkflowStepFieldValuesMany:bF,deleteWorkflowStepFieldValues:RF,deleteWorkflowStepFieldValuesMany:MF}=ma.actions,kF=t=>t.workflowStepFieldValuesReducer.instances,ht=o.createSelector([kF],t=>Object.values(t)),Jb=S(o.createSelector([ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Zb=S(o.createSelector([ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),EF=t=>s=>s.workflowStepFieldValuesReducer.instances[t],vF=S(o.createSelector([ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Qb=S(o.createSelector([ht,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),Xb=S(o.createSelector([ht,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{workflow:a,workflow_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),VF=ma.reducer,at=F(t=>t.uuid),BF={instances:{}},ya=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:BF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,BF)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:at.initialize,addWorkflowStepFieldValuesReviewRequest:at.addOne,addWorkflowStepFieldValuesReviewRequests:at.addMany,setWorkflowStepFieldValuesReviewRequest:at.setOne,setWorkflowStepFieldValuesReviewRequests:at.setMany,updateWorkflowStepFieldValuesReviewRequest:at.updateOne,updateWorkflowStepFieldValuesReviewRequests:at.updateMany,deleteWorkflowStepFieldValuesReviewRequest:at.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:at.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:WF,addWorkflowStepFieldValuesReviewRequest:zF,addWorkflowStepFieldValuesReviewRequests:fa,setWorkflowStepFieldValuesReviewRequest:qF,setWorkflowStepFieldValuesReviewRequests:DF,updateWorkflowStepFieldValuesReviewRequest:jF,updateWorkflowStepFieldValuesReviewRequests:$F,deleteWorkflowStepFieldValuesReviewRequest:CF,deleteWorkflowStepFieldValuesReviewRequests:Sa}=ya.actions,UF=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,zt=o.createSelector([UF],t=>Object.values(t)),LF=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],NF=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GF=S(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),xb=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),eR=S(o.createSelector([ht,zt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),HF=ya.reducer,ct=F(t=>t.uuid),KF={instances:{}},Aa=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:KF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,KF)),reducers:{initializeWorkflowStepFieldValuesReviews:ct.initialize,addWorkflowStepFieldValuesReview:ct.addOne,addWorkflowStepFieldValuesReviews:ct.addMany,setWorkflowStepFieldValuesReview:ct.setOne,setWorkflowStepFieldValuesReviews:ct.setMany,updateWorkflowStepFieldValuesReview:ct.updateOne,updateWorkflowStepFieldValuesReviews:ct.updateMany,deleteWorkflowStepFieldValuesReview:ct.deleteOne,deleteWorkflowStepFieldValuesReviews:ct.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:YF,addWorkflowStepFieldValuesReview:JF,addWorkflowStepFieldValuesReviews:wa,setWorkflowStepFieldValuesReview:ZF,setWorkflowStepFieldValuesReviews:QF,updateWorkflowStepFieldValuesReview:XF,updateWorkflowStepFieldValuesReviews:xF,deleteWorkflowStepFieldValuesReview:e_,deleteWorkflowStepFieldValuesReviews:Ta}=Aa.actions,t_=t=>t.workflowStepFieldValuesReviewReducer.instances,It=o.createSelector([t_],t=>Object.values(t)),s_=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],i_=S(o.createSelector([It,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),n_=S(o.createSelector([It,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),tR=S(o.createSelector([It,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),sR=S(o.createSelector([ht,It,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),iR=o.createSelector([It],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),a_=Aa.reducer,rt=F(t=>t.uuid),c_={instances:{}},Ia=o.createSlice({name:"workflowStepReviewers",initialState:c_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,c_)),reducers:{initializeWorkflowStepReviewers:rt.initialize,addWorkflowStepReviewer:rt.addOne,addWorkflowStepReviewers:rt.addMany,setWorkflowStepReviewer:rt.setOne,setWorkflowStepReviewers:rt.setMany,updateWorkflowStepReviewer:rt.updateOne,updateWorkflowStepReviewers:rt.updateMany,deleteWorkflowStepReviewer:rt.deleteOne,deleteWorkflowStepReviewers:rt.deleteMany}}),{initializeWorkflowStepReviewers:r_,addWorkflowStepReviewer:d_,addWorkflowStepReviewers:l_,setWorkflowStepReviewer:u_,setWorkflowStepReviewers:o_,updateWorkflowStepReviewer:h_,updateWorkflowStepReviewers:p_,deleteWorkflowStepReviewer:m_,deleteWorkflowStepReviewers:y_}=Ia.actions,f_=t=>t.workflowStepReviewerReducer.instances,qt=o.createSelector([f_],t=>Object.values(t)),S_=t=>s=>s.workflowStepReviewerReducer.instances[t],A_=S(o.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),aR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),cR=S(o.createSelector([qt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),w_=Ia.reducer,dt=F(t=>t.uuid),T_={instances:{}},Oa=o.createSlice({name:"workflowSteps",initialState:T_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,T_)),reducers:{initializeWorkflowSteps:dt.initialize,addWorkflowStep:dt.addOne,addWorkflowSteps:dt.addMany,setWorkflowStep:dt.setOne,setWorkflowSteps:dt.setMany,updateWorkflowStep:dt.updateOne,updateWorkflowSteps:dt.updateMany,deleteWorkflowStep:dt.deleteOne,deleteWorkflowSteps:dt.deleteMany}}),{initializeWorkflowSteps:I_,addWorkflowStep:O_,addWorkflowSteps:F_,setWorkflowStep:__,setWorkflowSteps:g_,updateWorkflowStep:P_,updateWorkflowSteps:b_,deleteWorkflowStep:R_,deleteWorkflowSteps:M_}=Oa.actions,k_=t=>t.workflowStepReducer.instances,Fa=o.createSelector([k_],t=>Object.values(t)),E_=t=>s=>s.workflowStepReducer.instances[t],v_=S(o.createSelector([Fa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rR=S(o.createSelector([Fa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),V_=Oa.reducer,lt=F(t=>t.uuid),B_={instances:{}},_a=o.createSlice({name:"workflowTypes",initialState:B_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,B_)),reducers:{initializeWorkflowTypes:lt.initialize,addWorkflowType:lt.addOne,addWorkflowTypes:lt.addMany,setWorkflowType:lt.setOne,setWorkflowTypes:lt.setMany,updateWorkflowType:lt.updateOne,updateWorkflowTypes:lt.updateMany,deleteWorkflowType:lt.deleteOne,deleteWorkflowTypes:lt.deleteMany}}),{initializeWorkflowTypes:W_,addWorkflowType:z_,addWorkflowTypes:q_,setWorkflowType:D_,setWorkflowTypes:j_,updateWorkflowType:$_,updateWorkflowTypes:C_,deleteWorkflowType:U_,deleteWorkflowTypes:L_}=_a.actions,N_=t=>t.workflowTypeReducer.instances,ga=o.createSelector([N_],t=>Object.values(t)),G_=t=>s=>s.workflowTypeReducer.instances[t],H_=S(o.createSelector([ga,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dR=S(o.createSelector([ga,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),K_=_a.reducer,Pa={outboxReducer:Xw,fileReducer:Tp,authReducer:Mh},lR=o.combineReducers(Pa),Y_={...Pa,[Rt]:EI,assetReducer:Wl,assetAttachmentReducer:Tc,assetStageCompletionReducer:Hl,assetStageReducer:ru,assetTypeReducer:hh,assetTypeAttachmentReducer:Ou,issueReducer:Bf,issueAttachmentReducer:Ky,issueTypeReducer:qA,issueTypeAttachmentReducer:Yf,organizationReducer:Hw,projectReducer:QT,projectAttachmentReducer:gT,projectAccessReducer:lT,organizationAccessReducer:Rw,projectFileReducer:$T,rehydratedReducer:tI,formReducer:Mm,formRevisionReducer:Am,formRevisionAttachmentReducer:dm,formSubmissionAttachmentReducer:Nm,formSubmissionReducer:iy,formIdentifierReducer:Bp,formIdentifierValueReducer:Yp,userReducer:yw,emailDomainsReducer:Sp,documentsReducer:ep,documentAttachmentReducer:Lh,teamReducer:MI,agentsReducer:rc,issueCommentReducer:If,issueCommentAttachmentReducer:df,issueUpdateReducer:cw,geoImageReducer:Sy,issueAssociationReducer:By,issueTypeFieldsReducer:zS,issueTypeFieldValuesReducer:OS,issueTypeFieldsAttachmentReducer:dS,issueTypeFieldValuesAttachmentReducer:JS,issueTypeIdentifierReducer:lA,issueTypeIdentifierValueReducer:FA,issueTypeStatusReducer:ZA,assetTypeFieldsReducer:Zu,assetTypeFieldValuesReducer:_o,assetTypeFieldsAttachmentReducer:zu,assetTypeFieldValuesAttachmentReducer:uo,assetTypeIdentifierReducer:Do,assetTypeIdentifierValueReducer:Xo,assetTypeStatusReducer:Ph,assetProcedureTypeReducer:ad,assetProcedureReducer:Nr,assetProcedureTypeFieldsReducer:ar,assetProcedureTypeFieldValuesReducer:vr,assetProcedureTypeFieldsAttachmentReducer:Gc,assetProcedureTypeFieldValuesAttachmentReducer:Sr,assetProcedureTypeAttachmentReducer:Ec,assetProcedureStepFieldsAttachmentReducer:Od,assetProcedureStepFieldsReducer:Wd,assetProcedureStepFieldValuesAttachmentReducer:Yd,assetProcedureStepFieldValuesReducer:dl,assetProcedureStepReducer:wl,teamMembershipReducer:hI,workflowTypeReducer:K_,workflowStepReducer:V_,workflowStepFieldsReducer:cF,workflowStepFieldsAttachmentReducer:HO,workflowReducer:GI,workflowStepAssigneeReducer:aO,workflowStepCommentReducer:wO,workflowStepEventReducer:VO,workflowStepFieldValuesReducer:VF,workflowStepFieldValuesAttachmentReducer:wF,workflowStepFieldValuesReviewReducer:a_,workflowStepFieldValuesReviewRequestReducer:HF,workflowStepReviewerReducer:w_},uR=o.combineReducers(Y_),J_=1e4,Z_=200,ba=[400,409,403,404,405,500],ut=1e4,Q_={};class X_{constructor(s){m(this,"client");m(this,"pageSize",J_);Q_[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 x_=()=>sg.length-1,eg=t=>(t[Rt]={version:x_()},t),tg=()=>eg({}),oR=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),hR=t=>s=>{var e;return s===void 0&&(s={}),((e=s[Rt])==null?void 0:e.version)===x_()?s:t(s)},sg=[eg,tg,tg,oR],pR=Object.fromEntries(sg.map((t,s)=>[s,hR(t)])),mR=t=>{if(t)throw t;const s=_t();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},ig=(t,s,e)=>{const n=wt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},ng=(t,s,e)=>{const n=wt();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 yR(t,s){if(!s.payload)throw new Error("Received empty payload");return Sg(s)}const fR={...Ba,effect:yR,discard:cg,returnPromises:!0,persistCallback:mR,retry:TR,persistOptions:{storage:_g},queue:{...Ba.queue,enqueue:ig,dequeue:ng,peek:(...t)=>wR(...t)}},SR=gg(pR,Rt),AR=o.compose(Fg.offline(fR),SR);async function ag(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=Q_[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Ma(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function cg(t,s,e=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
1
+ (function(i,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("react"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","react","file-saver","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],U):(i=typeof globalThis<"u"?globalThis:i||self,U(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.fileSaver,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,U,o,Ot,ht,Dg,jg,za,Ct,$g,qa,Cg,Ug,gk,Pk,Lg,Ng,Gg){"use strict";var Fk=Object.defineProperty;var _k=(i,U,o)=>U in i?Fk(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var m=(i,U,o)=>_k(i,typeof U!="symbol"?U+"":U,o);var zg;const Da=Object.freeze([]),ja=Object.freeze({});var $a=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))($a||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Ca=(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))(Ca||{}),Ua=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Ua||{}),ys=(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))(ys||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),La=(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))(La||{}),Na=(t=>(t[t.ADD_ASSIGNEE=0]="ADD_ASSIGNEE",t[t.REMOVE_ASSIGNEE=2]="REMOVE_ASSIGNEE",t[t.ADD_REVIEWER=4]="ADD_REVIEWER",t[t.REMOVE_REVIEWER=6]="REMOVE_REVIEWER",t[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(Na||{}),Rt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Rt||{}),Mt=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(Mt||{});const Hg=ys.MEDIUM,Ga=6e4,Kg=[Mt.APPROVED,Mt.REJECTED,Mt.CHANGES_REQUESTED],Yg=[Rt.ACTIVE,Rt.COMPLETED,Rt.CANCELLED];function F(t){return{addOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},addMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},setOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},setMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},updateOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},updateMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const f of y.payload)delete p.instances[f]},initialize:(p,y)=>{p.instances={};const f=new Set;for(const T of y.payload){const P=t(T);f.add(P),p.instances[P]=T}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function Jg(){return{initializeSelection:(l,u)=>{l.selection=Array.from(new Set(u.payload))},selectOne:(l,u)=>{new Set(l.selection).has(u.payload)||l.selection.push(u.payload)},selectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)||p.add(y);l.selection=Array.from(p)},unselectOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)&&(p.delete(u.payload),l.selection=Array.from(p))},unselectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)&&p.delete(y);l.selection=Array.from(p)},toggleOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)?p.delete(u.payload):p.add(u.payload),l.selection=Array.from(p)},toggleMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)?p.delete(y):p.add(y);l.selection=Array.from(p)},getInitialState:l=>({...l,selection:[]})}}const kt="versioning",I=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),_=o.createAction("RESET_ORGANIZATION_STATE");function Zg(t,s){return Dg.useMemo(t,s)}zg=Symbol.toStringTag;class fs{constructor(){m(this,zg,"Promise");m(this,"_promise");m(this,"_resolve");m(this,"_reject");m(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 Ss=!1;["true","1"].includes("".toLowerCase())&&(Ss=!0);function Qg(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 As(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Ss&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Ss&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function Xg(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 A=t=>t.length===0?Da:t,Ut=t=>Object.keys(t).length===0?ja:t,Ha=As(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===ws.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),xg=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),eP=1e3*86400,ws=new Date,tP=t=>new Date(t).toDateString()===ws.toDateString(),sP=As((t,s,e)=>{const n=Math.round((new Date(t).getTime()-ws.getTime())/eP);return n<s||n>e?Ha(t):xg.format(n,"days")});function iP(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Lt(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=iP(c);s(r)})},n.readAsArrayBuffer(t)})}const nP=(t,s)=>`${t}${s?`.${s}`:""}`;function aP(t,s){return new File([t],s,{type:t.type})}function Ka(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Ya=async t=>(await fetch(t)).blob(),Ja=async(t,s)=>{const e=await Ya(t);return new File([e],s,{type:e.type})};function cP(t){const s=new Blob([t]);jg.saveAs(s,t.name)}function Za(t){return typeof t=="string"&&t.startsWith("blob:")}function rP(t){return t.type.startsWith("image/")}const Qa={};function dP(t,s,e,...n){const a=Qa[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Qa[t]={[s]:!0},c=!0),c&&console[e](...n)}const Xa=["created_at","updated_at","index","revision"];function O(t){return{...t,uuid:ht.v4()}}function lP(t){const s={};for(const e of t)s[e.uuid]=e;return s}function V(t){return t.map(({uuid:s})=>s)}function Nt(t,s){return t.localeCompare(s)}function Ts(t,s){return Nt(t.uuid,s.uuid)}function uP(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 oP(t){return t.toLowerCase().replace(" ","-")}function hP(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function pP(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const mP=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[...Xa,"created_by"])e in s&&delete s[e];return s}const xa=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return za(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},yP=t=>{const{roots:s}=xa(t);return s.map(e=>new Ct.Tree(e))},ec=(t,s)=>{const{nodes:e}=xa(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Ct.Tree(n)},tc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,sc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,ic=t=>za(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),fP=t=>{const{roots:s}=ic(t);return s.map(e=>new Ct.Tree(e))},nc=(t,s)=>{const{nodes:e}=ic(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Ct.Tree(n)};class SP{constructor(s){m(this,"operations",[]);m(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=>A(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),N=F(t=>t.uuid),ac={instances:{}},Is=o.createSlice({name:"agents",initialState:ac,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ac)),reducers:{initializeConversations:N.initialize,addConversation:N.addOne,addConversations:N.addMany,setConversation:N.setOne,setConversations:N.setMany,updateConversation:N.updateOne,updateConversations:N.updateMany,deleteConversation:N.deleteOne,deleteConversations:N.deleteMany}}),{initializeConversations:cc,addConversation:rc,addConversations:AP,setConversation:dc,setConversations:wP,updateConversation:lc,updateConversations:TP,deleteConversation:IP,deleteConversations:OP}=Is.actions,Os=t=>t.agentsReducer.instances,FP=o.createSelector([Os],t=>Object.values(t)),_P=S(o.createSelector([Os,(t,s)=>s],(t,s)=>t[s])),uc=Is.reducer,G=F(t=>t.uuid),oc={instances:{}},Fs=o.createSlice({name:"assetAttachments",initialState:oc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,oc)),reducers:{initializeAssetAttachments:G.initialize,addAssetAttachment:G.addOne,addAssetAttachments:G.addMany,setAssetAttachment:G.setOne,setAssetAttachments:G.setMany,updateAssetAttachment:G.updateOne,updateAssetAttachments:G.updateMany,deleteAssetAttachment:G.deleteOne,deleteAssetAttachments:G.deleteMany}}),{initializeAssetAttachments:hc,addAssetAttachment:pc,addAssetAttachments:_s,setAssetAttachment:mc,setAssetAttachments:yc,updateAssetAttachment:fc,updateAssetAttachments:Sc,deleteAssetAttachment:Ac,deleteAssetAttachments:gs}=Fs.actions,wc=t=>t.assetAttachmentReducer.instances,Ps=o.createSelector([wc],t=>Object.values(t)),Tc=t=>s=>s.assetAttachmentReducer.instances[t],Ic=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Oc=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Fc=Fs.reducer,H=F(({uuid:t})=>t),_c={instances:{}},bs=o.createSlice({name:"assetProcedureTypeAttachments",initialState:_c,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,_c)),reducers:{initializeAssetProcedureTypeAttachments:H.initialize,addAssetProcedureTypeAttachment:H.addOne,addAssetProcedureTypeAttachments:H.addMany,setAssetProcedureTypeAttachment:H.setOne,setAssetProcedureTypeAttachments:H.setMany,updateAssetProcedureTypeAttachment:H.updateOne,updateAssetProcedureTypeAttachments:H.updateMany,deleteAssetProcedureTypeAttachment:H.deleteOne,deleteAssetProcedureTypeAttachments:H.deleteMany}}),{initializeAssetProcedureTypeAttachments:gc,addAssetProcedureTypeAttachment:Pc,addAssetProcedureTypeAttachments:bc,setAssetProcedureTypeAttachment:Rc,setAssetProcedureTypeAttachments:Mc,updateAssetProcedureTypeAttachment:kc,updateAssetProcedureTypeAttachments:Ec,deleteAssetProcedureTypeAttachment:vc,deleteAssetProcedureTypeAttachments:Vc}=bs.actions,Bc=bs.reducer,Wc=t=>t.assetProcedureTypeAttachmentReducer.instances,Rs=o.createSelector([Wc],t=>Object.values(t)),zc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],qc=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gP=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),K=F(({uuid:t})=>t),Dc={instances:{}},Ms=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Dc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Dc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:K.initialize,addAssetProcedureTypeFieldsAttachment:K.addOne,addAssetProcedureTypeFieldsAttachments:K.addMany,setAssetProcedureTypeFieldsAttachment:K.setOne,setAssetProcedureTypeFieldsAttachments:K.setMany,updateAssetProcedureTypeFieldsAttachment:K.updateOne,updateAssetProcedureTypeFieldsAttachments:K.updateMany,deleteAssetProcedureTypeFieldsAttachment:K.deleteOne,deleteAssetProcedureTypeFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:jc,addAssetProcedureTypeFieldsAttachment:$c,addAssetProcedureTypeFieldsAttachments:Cc,setAssetProcedureTypeFieldsAttachment:Uc,setAssetProcedureTypeFieldsAttachments:Lc,updateAssetProcedureTypeFieldsAttachment:Nc,updateAssetProcedureTypeFieldsAttachments:Gc,deleteAssetProcedureTypeFieldsAttachment:Hc,deleteAssetProcedureTypeFieldsAttachments:Kc}=Ms.actions,Yc=Ms.reducer,Jc=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,ks=o.createSelector([Jc],t=>Object.values(t)),PP=S(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Zc=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Qc=S(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Y=F(({uuid:t})=>t),Xc={instances:{}},Es=o.createSlice({name:"assetProcedureTypeFields",initialState:Xc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Xc)),reducers:{initializeAssetProcedureTypeFields:Y.initialize,addAssetProcedureTypeFields:Y.addOne,addAssetProcedureTypeFieldsMany:Y.addMany,setAssetProcedureTypeFields:Y.setOne,setAssetProcedureTypeFieldsMany:Y.setMany,updateAssetProcedureTypeFields:Y.updateOne,updateAssetProcedureTypeFieldsMany:Y.updateMany,deleteAssetProcedureTypeFields:Y.deleteOne,deleteAssetProcedureTypeFieldsMany:Y.deleteMany}}),{initializeAssetProcedureTypeFields:xc,addAssetProcedureTypeFields:er,addAssetProcedureTypeFieldsMany:tr,setAssetProcedureTypeFields:sr,setAssetProcedureTypeFieldsMany:ir,updateAssetProcedureTypeFields:nr,updateAssetProcedureTypeFieldsMany:ar,deleteAssetProcedureTypeFields:cr,deleteAssetProcedureTypeFieldsMany:rr}=Es.actions,dr=Es.reducer,lr=t=>t.assetProcedureTypeFieldsReducer.instances,Gt=o.createSelector([lr],t=>Object.values(t)),bP=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),RP=S(o.createSelector([Gt,(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])),ur=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],or=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=F(({uuid:t})=>t),hr={instances:{}},vs=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:hr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,hr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:J.initialize,addAssetProcedureTypeFieldValuesAttachment:J.addOne,addAssetProcedureTypeFieldValuesAttachments:J.addMany,setAssetProcedureTypeFieldValuesAttachment:J.setOne,setAssetProcedureTypeFieldValuesAttachments:J.setMany,updateAssetProcedureTypeFieldValuesAttachment:J.updateOne,updateAssetProcedureTypeFieldValuesAttachments:J.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:J.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:pr,addAssetProcedureTypeFieldValuesAttachment:mr,addAssetProcedureTypeFieldValuesAttachments:Vs,setAssetProcedureTypeFieldValuesAttachment:yr,setAssetProcedureTypeFieldValuesAttachments:fr,updateAssetProcedureTypeFieldValuesAttachment:Sr,updateAssetProcedureTypeFieldValuesAttachments:Ar,deleteAssetProcedureTypeFieldValuesAttachment:wr,deleteAssetProcedureTypeFieldValuesAttachments:Bs}=vs.actions,Tr=vs.reducer,Ir=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Ws=o.createSelector([Ir],t=>Object.values(t)),Or=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Fr=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_r=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Z=F(({uuid:t})=>t),gr={instances:{}},zs=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:gr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,gr)),reducers:{initializeAssetProcedureTypeFieldValues:Z.initialize,addAssetProcedureTypeFieldValues:Z.addOne,addAssetProcedureTypeFieldValuesMany:Z.addMany,setAssetProcedureTypeFieldValues:Z.setOne,setAssetProcedureTypeFieldValuesMany:Z.setMany,updateAssetProcedureTypeFieldValues:Z.updateOne,updateAssetProcedureTypeFieldValuesMany:Z.updateMany,deleteAssetProcedureTypeFieldValues:Z.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Pr,addAssetProcedureTypeFieldValues:br,addAssetProcedureTypeFieldValuesMany:Rr,setAssetProcedureTypeFieldValues:Mr,setAssetProcedureTypeFieldValuesMany:kr,updateAssetProcedureTypeFieldValues:Er,updateAssetProcedureTypeFieldValuesMany:vr,deleteAssetProcedureTypeFieldValues:Vr,deleteAssetProcedureTypeFieldValuesMany:Br}=zs.actions,Wr=zs.reducer,zr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Ht=o.createSelector([zr],t=>Object.values(t)),MP=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),kP=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),qr=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Dr=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Q=F(({uuid:t})=>t),jr={instances:{}},qs=o.createSlice({name:"assetProcedures",initialState:jr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,jr)),reducers:{initializeAssetProcedures:Q.initialize,addAssetProcedure:Q.addOne,addAssetProcedures:Q.addMany,setAssetProcedure:Q.setOne,setAssetProcedures:Q.setMany,updateAssetProcedure:Q.updateOne,updateAssetProcedures:Q.updateMany,deleteAssetProcedure:Q.deleteOne,deleteAssetProcedures:Q.deleteMany}}),{initializeAssetProcedures:$r,addAssetProcedure:Cr,addAssetProcedures:Ds,updateAssetProcedure:Ur,updateAssetProcedures:Lr,deleteAssetProcedure:Nr,deleteAssetProcedures:js,setAssetProcedure:Gr,setAssetProcedures:Hr}=qs.actions,Kr=qs.reducer,Yr=t=>t.assetProcedureReducer.instances,Kt=o.createSelector([Yr],t=>Object.values(t)),Jr=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),EP=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Zr=t=>s=>s.assetProcedureReducer.instances[t],Qr=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),X=F(t=>t.uuid),Xr={instances:{}},$s=o.createSlice({name:"assetProcedureTypes",initialState:Xr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Xr)),reducers:{initializeAssetProcedureTypes:X.initialize,addAssetProcedureType:X.addOne,addAssetProcedureTypes:X.addMany,setAssetProcedureType:X.setOne,setAssetProcedureTypes:X.setMany,updateAssetProcedureType:X.updateOne,updateAssetProcedureTypes:X.updateMany,deleteAssetProcedureType:X.deleteOne,deleteAssetProcedureTypes:X.deleteMany}}),{initializeAssetProcedureTypes:xr,addAssetProcedureType:ed,addAssetProcedureTypes:td,updateAssetProcedureType:sd,updateAssetProcedureTypes:id,deleteAssetProcedureType:nd,deleteAssetProcedureTypes:ad,setAssetProcedureType:cd,setAssetProcedureTypes:rd}=$s.actions,dd=$s.reducer,ld=t=>t.assetProcedureTypeReducer.instances,Cs=o.createSelector([ld],t=>Object.values(t)),ud=t=>s=>s.assetProcedureTypeReducer.instances[t],od=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vP=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),x=F(t=>t.uuid),hd={instances:{}},Us=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:hd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,hd)),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:pd,addAssetProcedureStepFieldsAttachment:md,addAssetProcedureStepFieldsAttachments:yd,setAssetProcedureStepFieldsAttachment:fd,setAssetProcedureStepFieldsAttachments:Sd,updateAssetProcedureStepFieldsAttachment:Ad,updateAssetProcedureStepFieldsAttachments:wd,deleteAssetProcedureStepFieldsAttachment:Td,deleteAssetProcedureStepFieldsAttachments:Id}=Us.actions,Od=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Ls=o.createSelector([Od],t=>Object.values(t)),VP=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Fd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],_d=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gd=Us.reducer,ee=F(t=>t.uuid),Pd={instances:{}},Ns=o.createSlice({name:"assetProcedureStepFields",initialState:Pd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Pd)),reducers:{initializeAssetProcedureStepFields:ee.initialize,addAssetProcedureStepFields:ee.addOne,addAssetProcedureStepFieldsMany:ee.addMany,setAssetProcedureStepFields:ee.setOne,setAssetProcedureStepFieldsMany:ee.setMany,updateAssetProcedureStepFields:ee.updateOne,updateAssetProcedureStepFieldsMany:ee.updateMany,deleteAssetProcedureStepFields:ee.deleteOne,deleteAssetProcedureStepFieldsMany:ee.deleteMany}}),{initializeAssetProcedureStepFields:bd,addAssetProcedureStepFields:Rd,addAssetProcedureStepFieldsMany:Md,setAssetProcedureStepFields:kd,setAssetProcedureStepFieldsMany:Ed,updateAssetProcedureStepFields:vd,updateAssetProcedureStepFieldsMany:Vd,deleteAssetProcedureStepFields:Bd,deleteAssetProcedureStepFieldsMany:Wd}=Ns.actions,Gs=t=>t.assetProcedureStepFieldsReducer.instances,Yt=o.createSelector([Gs],t=>Object.values(t)),BP=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),WP=S(o.createSelector([Yt,(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])),zP=o.createSelector([Gs],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),zd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],qd=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Dd=Ns.reducer,te=F(t=>t.uuid),jd={instances:{}},Hs=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:jd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,jd)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:te.initialize,addAssetProcedureStepFieldValuesAttachment:te.addOne,addAssetProcedureStepFieldValuesAttachments:te.addMany,setAssetProcedureStepFieldValuesAttachment:te.setOne,setAssetProcedureStepFieldValuesAttachments:te.setMany,updateAssetProcedureStepFieldValuesAttachment:te.updateOne,updateAssetProcedureStepFieldValuesAttachments:te.updateMany,deleteAssetProcedureStepFieldValuesAttachment:te.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:$d,addAssetProcedureStepFieldValuesAttachment:Cd,addAssetProcedureStepFieldValuesAttachments:Ks,setAssetProcedureStepFieldValuesAttachment:Ud,setAssetProcedureStepFieldValuesAttachments:Ld,updateAssetProcedureStepFieldValuesAttachment:Nd,updateAssetProcedureStepFieldValuesAttachments:Gd,deleteAssetProcedureStepFieldValuesAttachment:Hd,deleteAssetProcedureStepFieldValuesAttachments:Ys}=Hs.actions,Kd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Js=o.createSelector([Kd],t=>Object.values(t)),Yd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Jd=S(o.createSelector([Js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zd=S(o.createSelector([Js,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Qd=Hs.reducer,se=F(t=>t.uuid),Xd={instances:{}},Zs=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Xd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Xd)),reducers:{initializeAssetProcedureStepFieldValues:se.initialize,addAssetProcedureStepFieldValues:se.addOne,addAssetProcedureStepFieldValuesMany:se.addMany,setAssetProcedureStepFieldValues:se.setOne,setAssetProcedureStepFieldValuesMany:se.setMany,updateAssetProcedureStepFieldValues:se.updateOne,updateAssetProcedureStepFieldValuesMany:se.updateMany,deleteAssetProcedureStepFieldValues:se.deleteOne,deleteAssetProcedureStepFieldValuesMany:se.deleteMany}}),{initializeAssetProcedureStepFieldValues:xd,addAssetProcedureStepFieldValues:el,addAssetProcedureStepFieldValuesMany:tl,setAssetProcedureStepFieldValues:sl,setAssetProcedureStepFieldValuesMany:il,updateAssetProcedureStepFieldValues:nl,updateAssetProcedureStepFieldValuesMany:al,deleteAssetProcedureStepFieldValues:cl,deleteAssetProcedureStepFieldValuesMany:rl}=Zs.actions,dl=t=>t.assetProcedureStepFieldValuesReducer.instances,Et=o.createSelector([dl],t=>Object.values(t)),qP=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),DP=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),jP=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),ll=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],ul=S(o.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ol=Zs.reducer,ie=F(t=>t.uuid),hl={instances:{}},Qs=o.createSlice({name:"assetProcedureSteps",initialState:hl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,hl)),reducers:{initializeAssetProcedureSteps:ie.initialize,setAssetProcedureStep:ie.setOne,setAssetProcedureSteps:ie.setMany,addAssetProcedureStep:ie.addOne,addAssetProcedureSteps:ie.addMany,updateAssetProcedureStep:ie.updateOne,updateAssetProcedureSteps:ie.updateMany,deleteAssetProcedureStep:ie.deleteOne,deleteAssetProcedureSteps:ie.deleteMany}}),{initializeAssetProcedureSteps:pl,setAssetProcedureStep:ml,setAssetProcedureSteps:yl,addAssetProcedureStep:fl,addAssetProcedureSteps:Sl,updateAssetProcedureStep:Al,updateAssetProcedureSteps:wl,deleteAssetProcedureStep:Tl,deleteAssetProcedureSteps:Il}=Qs.actions,Ol=Qs.reducer,Jt=t=>t.assetProcedureStepReducer.instances,Fl=t=>s=>s.assetProcedureStepReducer.instances[t],Xs=o.createSelector([Jt],t=>Object.values(t)),$P=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return Ut(e)})),CP=S(o.createSelector([Xs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),_l=S(o.createSelector([Xs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gl=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=ec(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ne=F(t=>t.uuid),Pl={instances:{}},xs=o.createSlice({name:"assets",initialState:Pl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Pl)),reducers:{initializeAssets:ne.initialize,addAsset:ne.addOne,addAssets:ne.addMany,setAsset:ne.setOne,setAssets:ne.setMany,updateAsset:ne.updateOne,updateAssets:ne.updateMany,deleteAsset:ne.deleteOne,deleteAssets:ne.deleteMany}}),{initializeAssets:bl,addAsset:Rl,addAssets:ei,updateAsset:Ml,updateAssets:kl,deleteAsset:El,deleteAssets:ti,setAsset:vl,setAssets:Vl}=xs.actions,Bl=t=>t.assetReducer.instances,Zt=o.createSelector([Bl],t=>A(Object.values(t))),UP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),Wl=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),zl=t=>s=>s.assetReducer.instances[t],ql=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Dl=xs.reducer,ae=F(t=>t.uuid),jl={instances:{}},si=o.createSlice({name:"assetStageCompletions",initialState:jl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,jl)),reducers:{initializeAssetStageCompletions:ae.initialize,addAssetStageCompletion:ae.addOne,addAssetStageCompletions:ae.addMany,setAssetStageCompletion:ae.setOne,setAssetStageCompletions:ae.setMany,updateAssetStageCompletion:ae.updateOne,updateAssetStageCompletions:ae.updateMany,deleteAssetStageCompletion:ae.deleteOne,deleteAssetStageCompletions:ae.deleteMany}}),{initializeAssetStageCompletions:$l,addAssetStageCompletion:Cl,addAssetStageCompletions:Ul,setAssetStageCompletion:Ll,setAssetStageCompletions:Nl,updateAssetStageCompletion:Gl,updateAssetStageCompletions:Hl,deleteAssetStageCompletion:Kl,deleteAssetStageCompletions:Yl}=si.actions,Jl=si.reducer,Zl=t=>t.assetStageCompletionReducer.instances,Ql=o.createSelector([Zl],t=>Object.values(t)),Xl=t=>s=>s.assetStageCompletionReducer.instances[t],xl=S(o.createSelector([Ql,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ce=F(t=>t.uuid),eu={instances:{}},ii=o.createSlice({name:"assetStages",initialState:eu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,eu)),reducers:{initializeAssetStages:ce.initialize,setAssetStage:ce.setOne,setAssetStages:ce.setMany,addAssetStage:ce.addOne,addAssetStages:ce.addMany,updateAssetStage:ce.updateOne,updateAssetStages:ce.updateMany,deleteAssetStage:ce.deleteOne,deleteAssetStages:ce.deleteMany}}),{initializeAssetStages:tu,setAssetStage:su,setAssetStages:iu,addAssetStage:nu,addAssetStages:au,updateAssetStage:cu,updateAssetStages:ru,deleteAssetStage:du,deleteAssetStages:lu}=ii.actions,uu=ii.reducer,ni=t=>t.assetStageReducer.instances,ou=t=>s=>s.assetStageReducer.instances[t],ai=o.createSelector([ni],t=>Object.values(t)),LP=S(o.createSelector([ni,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return Ut(e)})),NP=S(o.createSelector([ai,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),hu=S(o.createSelector([ai,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),re=F(t=>t.uuid),pu={instances:{}},ci=o.createSlice({name:"assetTypeAttachments",initialState:pu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,pu)),reducers:{initializeAssetTypeAttachments:re.initialize,addAssetTypeAttachment:re.addOne,addAssetTypeAttachments:re.addMany,setAssetTypeAttachment:re.setOne,setAssetTypeAttachments:re.setMany,updateAssetTypeAttachment:re.updateOne,updateAssetTypeAttachments:re.updateMany,deleteAssetTypeAttachment:re.deleteOne,deleteAssetTypeAttachments:re.deleteMany}}),{initializeAssetTypeAttachments:mu,addAssetTypeAttachment:yu,addAssetTypeAttachments:ri,setAssetTypeAttachment:fu,setAssetTypeAttachments:Su,updateAssetTypeAttachment:Au,updateAssetTypeAttachments:wu,deleteAssetTypeAttachment:Tu,deleteAssetTypeAttachments:di}=ci.actions,Iu=t=>t.assetTypeAttachmentReducer.instances,li=o.createSelector([Iu],t=>Object.values(t)),Ou=t=>s=>s.assetTypeAttachmentReducer.instances[t],Fu=S(o.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_u=S(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),gu=ci.reducer,de=F(t=>t.uuid),Pu={instances:{}},ui=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Pu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Pu)),reducers:{initializeAssetTypeFieldsAttachments:de.initialize,addAssetTypeFieldsAttachment:de.addOne,addAssetTypeFieldsAttachments:de.addMany,setAssetTypeFieldsAttachment:de.setOne,setAssetTypeFieldsAttachments:de.setMany,updateAssetTypeFieldsAttachment:de.updateOne,updateAssetTypeFieldsAttachments:de.updateMany,deleteAssetTypeFieldsAttachment:de.deleteOne,deleteAssetTypeFieldsAttachments:de.deleteMany}}),{initializeAssetTypeFieldsAttachments:bu,addAssetTypeFieldsAttachment:Ru,addAssetTypeFieldsAttachments:Mu,setAssetTypeFieldsAttachment:ku,setAssetTypeFieldsAttachments:Eu,updateAssetTypeFieldsAttachment:vu,updateAssetTypeFieldsAttachments:Vu,deleteAssetTypeFieldsAttachment:Bu,deleteAssetTypeFieldsAttachments:Wu}=ui.actions,zu=t=>t.assetTypeFieldsAttachmentReducer.instances,oi=o.createSelector([zu],t=>Object.values(t)),GP=S(o.createSelector([oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),qu=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Du=S(o.createSelector([oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ju=ui.reducer,le=F(t=>t.uuid),$u={instances:{}},hi=o.createSlice({name:"assetTypeFields",initialState:$u,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,$u)),reducers:{initializeAssetTypeFields:le.initialize,addAssetTypeFields:le.addOne,addAssetTypeFieldsMany:le.addMany,setAssetTypeFields:le.setOne,setAssetTypeFieldsMany:le.setMany,updateAssetTypeFields:le.updateOne,updateAssetTypeFieldsMany:le.updateMany,deleteAssetTypeFields:le.deleteOne,deleteAssetTypeFieldsMany:le.deleteMany}}),{initializeAssetTypeFields:Cu,addAssetTypeFields:Uu,addAssetTypeFieldsMany:Lu,setAssetTypeFields:Nu,setAssetTypeFieldsMany:Gu,updateAssetTypeFields:Hu,updateAssetTypeFieldsMany:Ku,deleteAssetTypeFields:Yu,deleteAssetTypeFieldsMany:Ju}=hi.actions,Zu=t=>t.assetTypeFieldsReducer.instances,vt=o.createSelector([Zu],t=>Object.values(t)),HP=S(o.createSelector([vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),KP=S(o.createSelector([vt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Qu=t=>s=>s.assetTypeFieldsReducer.instances[t],Xu=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xu=hi.reducer,ue=F(t=>t.uuid),eo={instances:{}},pi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:eo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,eo)),reducers:{initializeAssetTypeFieldValuesAttachments:ue.initialize,addAssetTypeFieldValuesAttachment:ue.addOne,addAssetTypeFieldValuesAttachments:ue.addMany,setAssetTypeFieldValuesAttachment:ue.setOne,setAssetTypeFieldValuesAttachments:ue.setMany,updateAssetTypeFieldValuesAttachment:ue.updateOne,updateAssetTypeFieldValuesAttachments:ue.updateMany,deleteAssetTypeFieldValuesAttachment:ue.deleteOne,deleteAssetTypeFieldValuesAttachments:ue.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:to,addAssetTypeFieldValuesAttachment:so,addAssetTypeFieldValuesAttachments:mi,setAssetTypeFieldValuesAttachment:io,setAssetTypeFieldValuesAttachments:no,updateAssetTypeFieldValuesAttachment:ao,updateAssetTypeFieldValuesAttachments:co,deleteAssetTypeFieldValuesAttachment:ro,deleteAssetTypeFieldValuesAttachments:yi}=pi.actions,lo=t=>t.assetTypeFieldValuesAttachmentReducer.instances,fi=o.createSelector([lo],t=>Object.values(t)),uo=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],oo=S(o.createSelector([fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ho=S(o.createSelector([fi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),po=pi.reducer,oe=F(t=>t.uuid),mo={instances:{}},Si=o.createSlice({name:"assetTypeFieldValues",initialState:mo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,mo)),reducers:{initializeAssetTypeFieldValues:oe.initialize,addAssetTypeFieldValues:oe.addOne,addAssetTypeFieldValuesMany:oe.addMany,setAssetTypeFieldValues:oe.setOne,setAssetTypeFieldValuesMany:oe.setMany,updateAssetTypeFieldValues:oe.updateOne,updateAssetTypeFieldValuesMany:oe.updateMany,deleteAssetTypeFieldValues:oe.deleteOne,deleteAssetTypeFieldValuesMany:oe.deleteMany}}),{initializeAssetTypeFieldValues:yo,addAssetTypeFieldValues:fo,addAssetTypeFieldValuesMany:So,setAssetTypeFieldValues:Ao,setAssetTypeFieldValuesMany:wo,updateAssetTypeFieldValues:To,updateAssetTypeFieldValuesMany:Io,deleteAssetTypeFieldValues:Oo,deleteAssetTypeFieldValuesMany:Fo}=Si.actions,_o=t=>t.assetTypeFieldValuesReducer.instances,Qt=o.createSelector([_o],t=>Object.values(t)),YP=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),JP=S(o.createSelector([vt,Qt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),go=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Po=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bo=Si.reducer,he=F(t=>t.uuid),Ro={instances:{}},Ai=o.createSlice({name:"assetTypeIdentifiers",initialState:Ro,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ro)),reducers:{initializeAssetTypeIdentifiers:he.initialize,addAssetTypeIdentifier:he.addOne,addAssetTypeIdentifiers:he.addMany,setAssetTypeIdentifier:he.setOne,setAssetTypeIdentifiers:he.setMany,updateAssetTypeIdentifier:he.updateOne,updateAssetTypeIdentifiers:he.updateMany,deleteAssetTypeIdentifier:he.deleteOne,deleteAssetTypeIdentifiers:he.deleteMany}}),{initializeAssetTypeIdentifiers:Mo,addAssetTypeIdentifier:ko,addAssetTypeIdentifiers:Eo,setAssetTypeIdentifier:vo,setAssetTypeIdentifiers:Vo,updateAssetTypeIdentifier:Bo,updateAssetTypeIdentifiers:Wo,deleteAssetTypeIdentifier:zo,deleteAssetTypeIdentifiers:qo}=Ai.actions,Do=t=>t.assetTypeIdentifierReducer.instances,wi=o.createSelector([Do],t=>Object.values(t)),jo=t=>s=>s.assetTypeIdentifierReducer.instances[t],$o=S(o.createSelector([wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ZP=S(o.createSelector([wi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Co=Ai.reducer,pe=F(t=>t.uuid),Uo={instances:{}},Ti=o.createSlice({name:"assetTypeIdentifierValues",initialState:Uo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Uo)),reducers:{initializeAssetTypeIdentifierValues:pe.initialize,addAssetTypeIdentifierValue:pe.addOne,addAssetTypeIdentifierValues:pe.addMany,setAssetTypeIdentifierValue:pe.setOne,setAssetTypeIdentifierValues:pe.setMany,updateAssetTypeIdentifierValue:pe.updateOne,updateAssetTypeIdentifierValues:pe.updateMany,deleteAssetTypeIdentifierValue:pe.deleteOne,deleteAssetTypeIdentifierValues:pe.deleteMany}}),{initializeAssetTypeIdentifierValues:Lo,addAssetTypeIdentifierValue:No,addAssetTypeIdentifierValues:Go,setAssetTypeIdentifierValue:Ho,setAssetTypeIdentifierValues:Ko,updateAssetTypeIdentifierValue:Yo,updateAssetTypeIdentifierValues:Jo,deleteAssetTypeIdentifierValue:Zo,deleteAssetTypeIdentifierValues:Qo}=Ti.actions,Xo=t=>t.assetTypeIdentifierValueReducer.instances,Xt=o.createSelector([Xo],t=>Object.values(t)),xo=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],eh=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),XP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),th=Ti.reducer,me=F(t=>t.uuid),sh={instances:{}},Ii=o.createSlice({name:"assetTypes",initialState:sh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,sh)),reducers:{initializeAssetTypes:me.initialize,setAssetType:me.setOne,setAssetTypes:me.setMany,addAssetType:me.addOne,addAssetTypes:me.addMany,updateAssetType:me.updateOne,updateAssetTypes:me.updateMany,deleteAssetType:me.deleteOne,deleteAssetTypes:me.deleteMany}}),{initializeAssetTypes:ih,setAssetType:nh,setAssetTypes:ah,addAssetType:ch,addAssetTypes:rh,updateAssetType:dh,updateAssetTypes:lh,deleteAssetType:uh,deleteAssetTypes:oh}=Ii.actions,hh=t=>t.assetTypeReducer.instances,Oi=o.createSelector([hh],t=>Object.values(t)),ph=t=>s=>s.assetTypeReducer.instances[t],mh=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xP=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),yh=Ii.reducer,ye=F(t=>t.uuid),fh={instances:{}},Fi=o.createSlice({name:"assetTypeStatuses",initialState:fh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,fh)),reducers:{initializeAssetTypeStatuses:ye.initialize,addAssetTypeStatus:ye.addOne,addAssetTypeStatuses:ye.addMany,setAssetTypeStatus:ye.setOne,setAssetTypeStatuses:ye.setMany,updateAssetTypeStatus:ye.updateOne,updateAssetTypeStatuses:ye.updateMany,deleteAssetTypeStatus:ye.deleteOne,deleteAssetTypeStatuses:ye.deleteMany}}),{initializeAssetTypeStatuses:Sh,addAssetTypeStatus:Ah,addAssetTypeStatuses:wh,setAssetTypeStatus:Th,setAssetTypeStatuses:Ih,updateAssetTypeStatus:Oh,updateAssetTypeStatuses:Fh,deleteAssetTypeStatus:_h,deleteAssetTypeStatuses:gh}=Fi.actions,Ph=t=>t.assetTypeStatusReducer.instances,_i=o.createSelector([Ph],t=>A(Object.values(t).toSorted(tc))),bh=t=>s=>s.assetTypeStatusReducer.instances[t],Rh=S(o.createSelector([_i,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eb=S(o.createSelector([_i,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Mh=Fi.reducer,kh={accessToken:"",refreshToken:"",isLoggedIn:!1},xt=o.createSlice({name:"auth",initialState:kh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,kh)),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||xt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:tb,clearTokens:sb,setLoggedIn:Eh}=xt.actions,ib=t=>t.authReducer.accessToken,nb=t=>t.authReducer.isLoggedIn,vh=xt.reducer,fe=F(t=>t.uuid),Vh={instances:{}},gi=o.createSlice({name:"documentAttachments",initialState:Vh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Vh)),reducers:{initializeDocumentAttachments:fe.initialize,addDocumentAttachment:fe.addOne,addDocumentAttachments:fe.addMany,setDocumentAttachment:fe.setOne,setDocumentAttachments:fe.setMany,updateDocumentAttachment:fe.updateOne,updateDocumentAttachments:fe.updateMany,deleteDocumentAttachment:fe.deleteOne,deleteDocumentAttachments:fe.deleteMany}}),{initializeDocumentAttachments:Bh,addDocumentAttachment:Wh,addDocumentAttachments:zh,setDocumentAttachment:qh,setDocumentAttachments:Dh,updateDocumentAttachment:jh,updateDocumentAttachments:$h,deleteDocumentAttachment:Ch,deleteDocumentAttachments:Uh}=gi.actions,Lh=t=>t.documentAttachmentReducer.instances,Pi=o.createSelector([Lh],t=>Object.values(t)),Nh=t=>s=>s.documentAttachmentReducer.instances[t],Gh=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ab=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),Hh=gi.reducer,Se=F(({uuid:t})=>t),Kh={instances:{}},bi=o.createSlice({name:"documents",initialState:Kh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>{Object.assign(s,Kh)}),reducers:{initializeDocuments:Se.initialize,addDocument:Se.addOne,addDocuments:Se.addMany,setDocument:Se.setOne,setDocuments:Se.setMany,updateDocument:Se.updateOne,updateDocuments:Se.updateMany,deleteDocument:Se.deleteOne,deleteDocuments:Se.deleteMany}}),{initializeDocuments:Yh,addDocument:Jh,addDocuments:Zh,setDocument:Qh,setDocuments:Xh,updateDocument:xh,updateDocuments:ep,deleteDocument:tp,deleteDocuments:sp}=bi.actions,ip=bi.reducer,Ri=t=>t.documentsReducer.instances,es=o.createSelector([Ri],t=>Object.values(t)),np=t=>s=>s.documentsReducer.instances[t],ap=S(o.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cb=S(o.createSelector([es,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),rb=S(o.createSelector([es,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),cp=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=nc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Ae=F(t=>t.uuid),rp={instances:{}},Mi=o.createSlice({name:"emailDomains",initialState:rp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,rp)),reducers:{initializeEmailDomains:Ae.initialize,addEmailDomain:Ae.addOne,addEmailDomains:Ae.addMany,setEmailDomain:Ae.setOne,setEmailDomains:Ae.setMany,updateEmailDomain:Ae.updateOne,updateEmailDomains:Ae.updateMany,deleteEmailDomain:Ae.deleteOne,deleteEmailDomains:Ae.deleteMany}}),{initializeEmailDomains:dp,addEmailDomain:lp,addEmailDomains:up,setEmailDomain:op,setEmailDomains:hp,updateEmailDomain:pp,updateEmailDomains:mp,deleteEmailDomain:yp,deleteEmailDomains:fp}=Mi.actions,Sp=t=>t.emailDomainsReducer.instances,ki=o.createSelector([Sp],t=>Object.values(t)),Ap=t=>s=>s.emailDomainsReducer.instances[t],wp=S(o.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),db=S(o.createSelector([ki,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Tp=Mi.reducer,Ip={s3Urls:{}},Op=1e3*60*60,lb=Op*24*7,Ei=o.createSlice({name:"file",initialState:Ip,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Ip)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+lb);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:ub}=Ei.actions,ob=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Op))return e},Fp=Ei.reducer,we=F(t=>t.uuid),_p={instances:{}},vi=o.createSlice({name:"formIdentifiers",initialState:_p,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,_p)),reducers:{initializeFormIdentifiers:we.initialize,addFormIdentifier:we.addOne,addFormIdentifiers:we.addMany,setFormIdentifier:we.setOne,setFormIdentifiers:we.setMany,updateFormIdentifier:we.updateOne,updateFormIdentifiers:we.updateMany,deleteFormIdentifier:we.deleteOne,deleteFormIdentifiers:we.deleteMany}}),{initializeFormIdentifiers:gp,addFormIdentifier:Pp,addFormIdentifiers:bp,setFormIdentifier:Rp,setFormIdentifiers:Mp,updateFormIdentifier:kp,updateFormIdentifiers:Ep,deleteFormIdentifier:vp,deleteFormIdentifiers:Vp}=vi.actions,Bp=t=>t.formIdentifierReducer.instances,Vi=o.createSelector([Bp],t=>Object.values(t)),Wp=t=>s=>s.formIdentifierReducer.instances[t],zp=S(o.createSelector([Vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hb=S(o.createSelector([Vi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),qp=vi.reducer,Te=F(t=>t.uuid),Dp={instances:{}},Bi=o.createSlice({name:"formIdentifierValues",initialState:Dp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Dp)),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:jp,addFormIdentifierValue:$p,addFormIdentifierValues:Cp,setFormIdentifierValue:Up,setFormIdentifierValues:Lp,updateFormIdentifierValue:Np,updateFormIdentifierValues:Gp,deleteFormIdentifierValue:Hp,deleteFormIdentifierValues:Kp}=Bi.actions,Yp=t=>t.formIdentifierValueReducer.instances,ts=o.createSelector([Yp],t=>Object.values(t)),Jp=t=>s=>s.formIdentifierValueReducer.instances[t],Zp=S(o.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pb=S(o.createSelector([ts,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),mb=S(o.createSelector([ts,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),Qp=Bi.reducer,Ie=F(t=>t.uuid),Xp={instances:{}},Wi=o.createSlice({name:"formRevisionAttachments",initialState:Xp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Xp)),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:xp,addFormRevisionAttachment:em,addFormRevisionAttachments:tm,setFormRevisionAttachment:sm,setFormRevisionAttachments:im,updateFormRevisionAttachment:nm,updateFormRevisionAttachments:am,deleteFormRevisionAttachment:cm,deleteFormRevisionAttachments:rm}=Wi.actions,ss=t=>t.formRevisionAttachmentReducer.instances,dm=o.createSelector([ss],t=>Object.values(t)),lm=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t[s])),um=S(o.createSelector([dm,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yb=S(o.createSelector([ss,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),om=Wi.reducer,Oe=F(t=>t.uuid),hm={instances:{}},zi=o.createSlice({name:"formRevisions",initialState:hm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,hm)),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:pm,addFormRevision:qi,addFormRevisions:Di,setFormRevision:mm,setFormRevisions:ym,updateFormRevision:fm,updateFormRevisions:Sm,deleteFormRevision:ji,deleteFormRevisions:$i}=zi.actions,Ci=t=>t.formRevisionReducer.instances,is=o.createSelector([Ci],t=>Object.values(t)),Am=t=>s=>s.formRevisionReducer.instances[t],wm=S(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fb=S(o.createSelector([is,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Tm=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Im=zi.reducer,Fe=F(t=>t.uuid),Om={instances:{}},Ui=o.createSlice({name:"forms",initialState:Om,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Om)),reducers:{initializeForms:Fe.initialize,addForm:Fe.addOne,addForms:Fe.addMany,setForm:Fe.setOne,setForms:Fe.setMany,updateForm:Fe.updateOne,updateForms:Fe.updateMany,deleteForm:Fe.deleteOne,deleteForms:Fe.deleteMany}}),{initializeForms:Fm,addForm:_m,addForms:gm,setForm:Pm,setForms:bm,updateForm:Rm,updateForms:Mm,deleteForm:km,deleteForms:Em}=Ui.actions,vm=Ui.reducer,Vm=t=>t.formReducer.instances,Li=o.createSelector([Vm],t=>Object.values(t)),Bm=t=>s=>s.formReducer.instances[t],Wm=S(o.createSelector([Li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Sb=S(o.createSelector([Li,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),_e=F(t=>t.uuid),zm={instances:{}},Ni=o.createSlice({name:"formSubmissionAttachments",initialState:zm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,zm)),reducers:{initializeFormSubmissionAttachments:_e.initialize,addFormSubmissionAttachment:_e.addOne,addFormSubmissionAttachments:_e.addMany,setFormSubmissionAttachment:_e.setOne,setFormSubmissionAttachments:_e.setMany,updateFormSubmissionAttachment:_e.updateOne,updateFormSubmissionAttachments:_e.updateMany,deleteFormSubmissionAttachment:_e.deleteOne,deleteFormSubmissionAttachments:_e.deleteMany}}),{initializeFormSubmissionAttachments:qm,addFormSubmissionAttachment:Dm,addFormSubmissionAttachments:Gi,setFormSubmissionAttachment:jm,setFormSubmissionAttachments:$m,updateFormSubmissionAttachment:Cm,updateFormSubmissionAttachments:Um,deleteFormSubmissionAttachment:Lm,deleteFormSubmissionAttachments:Hi}=Ni.actions,Ki=t=>t.formSubmissionAttachmentReducer.instances,Yi=o.createSelector([Ki],t=>Object.values(t)),Nm=S(o.createSelector([Ki,(t,s)=>s],(t,s)=>t[s])),Ji=S(o.createSelector([Yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Gm=Ji,Hm=S(o.createSelector([Yi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Km=Ni.reducer,ge=F(t=>t.uuid),Ym={instances:{}},Zi=o.createSlice({name:"formSubmissions",initialState:Ym,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ym)),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:Jm,setFormSubmission:Zm,setFormSubmissions:Qm,addFormSubmission:Xm,addFormSubmissions:Qi,updateFormSubmission:xm,updateFormSubmissions:ey,deleteFormSubmission:ty,deleteFormSubmissions:Xi}=Zi.actions,xi=t=>t.formSubmissionReducer.instances,sy=o.createSelector([xi],t=>Object.values(t)),iy=t=>s=>s.formSubmissionReducer.instances[t],ny=S(o.createSelector([sy,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ay=S(o.createSelector([xi,Ci,(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))})),cy=Zi.reducer,Pe=F(t=>t.uuid),ry={instances:{}},en=o.createSlice({name:"geoImages",initialState:ry,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ry)),reducers:{initializeGeoImages:Pe.initialize,setGeoImage:Pe.setOne,setGeoImages:Pe.setMany,addGeoImage:Pe.addOne,addGeoImages:Pe.addMany,updateGeoImage:Pe.updateOne,updateGeoImages:Pe.updateMany,deleteGeoImage:Pe.deleteOne,deleteGeoImages:Pe.deleteMany}}),{initializeGeoImages:dy,setGeoImage:ly,setGeoImages:uy,addGeoImage:oy,addGeoImages:hy,updateGeoImage:py,updateGeoImages:my,deleteGeoImage:yy,deleteGeoImages:fy}=en.actions,Sy=t=>t.geoImageReducer.instances,tn=o.createSelector([Sy],t=>Object.values(t)),Ay=t=>s=>s.geoImageReducer.instances[t],wy=S(o.createSelector([tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ab=S(o.createSelector([tn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Ty=en.reducer,be=F(t=>t.uuid),Iy={instances:{}},sn=o.createSlice({name:"issueAssociations",initialState:Iy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Iy)),reducers:{initializeIssueAssociations:be.initialize,addIssueAssociation:be.addOne,addIssueAssociations:be.addMany,setIssueAssociation:be.setOne,setIssueAssociations:be.setMany,updateIssueAssociation:be.updateOne,updateIssueAssociations:be.updateMany,deleteIssueAssociation:be.deleteOne,deleteIssueAssociations:be.deleteMany}}),{initializeIssueAssociations:Oy,setIssueAssociations:Fy,setIssueAssociation:_y,updateIssueAssociation:gy,updateIssueAssociations:Py,addIssueAssociation:by,addIssueAssociations:yt,deleteIssueAssociation:Ry,deleteIssueAssociations:ft}=sn.actions,My=t=>t.issueAssociationReducer.instances,St=o.createSelector([My],t=>Object.values(t)),ky=t=>s=>s.issueAssociationReducer.instances[t],Ey=S(o.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vy=S(o.createSelector([St,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),Vy=S(o.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),By=S(o.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),Wy=S(o.createSelector([St,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),zy=S(o.createSelector([St,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),qy=sn.reducer,Re=F(t=>t.uuid),Dy={instances:{}},nn=o.createSlice({name:"issueAttachments",initialState:Dy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Dy)),reducers:{initializeIssueAttachments:Re.initialize,addIssueAttachment:Re.addOne,addIssueAttachments:Re.addMany,setIssueAttachment:Re.setOne,setIssueAttachments:Re.setMany,updateIssueAttachment:Re.updateOne,updateIssueAttachments:Re.updateMany,deleteIssueAttachment:Re.deleteOne,deleteIssueAttachments:Re.deleteMany}}),{initializeIssueAttachments:jy,addIssueAttachment:$y,addIssueAttachments:an,setIssueAttachment:Cy,setIssueAttachments:Uy,updateIssueAttachment:Ly,updateIssueAttachments:Ny,deleteIssueAttachment:Gy,deleteIssueAttachments:cn}=nn.actions,Hy=t=>t.issueAttachmentReducer.instances,rn=o.createSelector([Hy],t=>Object.values(t)),Ky=S(o.createSelector([rn,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Yy=t=>s=>s.issueAttachmentReducer.instances[t],Jy=S(o.createSelector([rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zy=nn.reducer,Me=F(t=>t.uuid),Qy={instances:{}},dn=o.createSlice({name:"issueCommentAttachments",initialState:Qy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Qy)),reducers:{initializeIssueCommentAttachments:Me.initialize,addIssueCommentAttachment:Me.addOne,addIssueCommentAttachments:Me.addMany,setIssueCommentAttachment:Me.setOne,setIssueCommentAttachments:Me.setMany,updateIssueCommentAttachment:Me.updateOne,updateIssueCommentAttachments:Me.updateMany,deleteIssueCommentAttachment:Me.deleteOne,deleteIssueCommentAttachments:Me.deleteMany}}),{initializeIssueCommentAttachments:Xy,addIssueCommentAttachment:xy,addIssueCommentAttachments:ef,setIssueCommentAttachment:tf,setIssueCommentAttachments:sf,updateIssueCommentAttachment:nf,updateIssueCommentAttachments:af,deleteIssueCommentAttachment:cf,deleteIssueCommentAttachments:rf}=dn.actions,df=t=>t.issueCommentAttachmentReducer.instances,ln=o.createSelector([df],t=>Object.values(t)),lf=t=>s=>s.issueCommentAttachmentReducer.instances[t],uf=S(o.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wb=S(o.createSelector([ln,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),of=dn.reducer,ke=F(t=>t.uuid),hf={instances:{}},un=o.createSlice({name:"issueComments",initialState:hf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,hf)),reducers:{initializeIssueComments:ke.initialize,addIssueComment:ke.addOne,addIssueComments:ke.addMany,setIssueComment:ke.setOne,setIssueComments:ke.setMany,updateIssueComment:ke.updateOne,updateIssueComments:ke.updateMany,deleteIssueComment:ke.deleteOne,deleteIssueComments:ke.deleteMany}}),{initializeIssueComments:pf,addIssueComment:mf,addIssueComments:yf,setIssueComment:ff,setIssueComments:Sf,updateIssueComment:Af,updateIssueComments:wf,deleteIssueComment:Tf,deleteIssueComments:If}=un.actions,on=t=>t.issueCommentReducer.instances,Of=t=>s=>s.issueCommentReducer.instances[t],Ff=S(o.createSelector([on,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),Tb=S(o.createSelector([on,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),_f=un.reducer,Ee=F(t=>t.uuid),gf={instances:{}},hn=o.createSlice({name:"issues",initialState:gf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,gf)),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:Pf,addIssue:bf,addIssues:pn,setIssue:Rf,setIssues:Mf,updateIssue:kf,updateIssues:Ef,deleteIssue:vf,deleteIssues:mn}=hn.actions,Vf=t=>t.issueReducer.instances,ns=o.createSelector([Vf],t=>Object.values(t)),Bf=t=>s=>s.issueReducer.instances[t],Wf=S(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ib=S(o.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),zf=S(o.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),qf=hn.reducer,ve=F(t=>t.uuid),Df={instances:{}},yn=o.createSlice({name:"issueTypeAttachments",initialState:Df,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Df)),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:jf,addIssueTypeAttachment:$f,addIssueTypeAttachments:Cf,setIssueTypeAttachment:Uf,setIssueTypeAttachments:Lf,updateIssueTypeAttachment:Nf,updateIssueTypeAttachments:Gf,deleteIssueTypeAttachment:Hf,deleteIssueTypeAttachments:Kf}=yn.actions,Yf=t=>t.issueTypeAttachmentReducer.instances,fn=o.createSelector([Yf],t=>Object.values(t)),Jf=t=>s=>s.issueTypeAttachmentReducer.instances[t],Zf=S(o.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ob=S(o.createSelector([fn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),Qf=yn.reducer,Ve=F(t=>t.uuid),Xf={instances:{}},Sn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:Xf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Xf)),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:xf,addIssueTypeFieldsAttachment:eS,addIssueTypeFieldsAttachments:tS,setIssueTypeFieldsAttachment:sS,setIssueTypeFieldsAttachments:iS,updateIssueTypeFieldsAttachment:nS,updateIssueTypeFieldsAttachments:aS,deleteIssueTypeFieldsAttachment:cS,deleteIssueTypeFieldsAttachments:rS}=Sn.actions,dS=t=>t.issueTypeFieldsAttachmentReducer.instances,An=o.createSelector([dS],t=>Object.values(t)),Fb=S(o.createSelector([An,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),lS=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],uS=S(o.createSelector([An,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),oS=Sn.reducer,Be=F(t=>t.uuid),hS={instances:{}},wn=o.createSlice({name:"issueTypeFieldValues",initialState:hS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,hS)),reducers:{initializeIssueTypeFieldValues:Be.initialize,addIssueTypeFieldValues:Be.addOne,addIssueTypeFieldValuesMany:Be.addMany,setIssueTypeFieldValues:Be.setOne,setIssueTypeFieldValuesMany:Be.setMany,updateIssueTypeFieldValues:Be.updateOne,updateIssueTypeFieldValuesMany:Be.updateMany,deleteIssueTypeFieldValues:Be.deleteOne,deleteIssueTypeFieldValuesMany:Be.deleteMany}}),{initializeIssueTypeFieldValues:pS,addIssueTypeFieldValues:mS,addIssueTypeFieldValuesMany:yS,setIssueTypeFieldValues:fS,setIssueTypeFieldValuesMany:SS,updateIssueTypeFieldValues:AS,updateIssueTypeFieldValuesMany:wS,deleteIssueTypeFieldValues:TS,deleteIssueTypeFieldValuesMany:IS}=wn.actions,OS=t=>t.issueTypeFieldValuesReducer.instances,as=o.createSelector([OS],t=>Object.values(t)),_b=S(o.createSelector([as,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),FS=t=>s=>s.issueTypeFieldValuesReducer.instances[t],_S=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gS=wn.reducer,We=F(t=>t.uuid),PS={instances:{}},Tn=o.createSlice({name:"issueTypeFields",initialState:PS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,PS)),reducers:{initializeIssueTypeFields:We.initialize,addIssueTypeFields:We.addOne,addIssueTypeFieldsMany:We.addMany,setIssueTypeFields:We.setOne,setIssueTypeFieldsMany:We.setMany,updateIssueTypeFields:We.updateOne,updateIssueTypeFieldsMany:We.updateMany,deleteIssueTypeFields:We.deleteOne,deleteIssueTypeFieldsMany:We.deleteMany}}),{initializeIssueTypeFields:bS,addIssueTypeFields:RS,addIssueTypeFieldsMany:MS,setIssueTypeFields:kS,setIssueTypeFieldsMany:ES,updateIssueTypeFields:vS,updateIssueTypeFieldsMany:VS,deleteIssueTypeFields:BS,deleteIssueTypeFieldsMany:WS}=Tn.actions,zS=t=>t.issueTypeFieldsReducer.instances,Vt=o.createSelector([zS],t=>Object.values(t)),gb=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),Pb=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),bb=S(o.createSelector([Vt,as,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),qS=t=>s=>s.issueTypeFieldsReducer.instances[t],DS=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),jS=Tn.reducer,ze=F(t=>t.uuid),$S={instances:{}},In=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:$S,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,$S)),reducers:{initializeIssueTypeFieldValuesAttachments:ze.initialize,addIssueTypeFieldValuesAttachment:ze.addOne,addIssueTypeFieldValuesAttachments:ze.addMany,setIssueTypeFieldValuesAttachment:ze.setOne,setIssueTypeFieldValuesAttachments:ze.setMany,updateIssueTypeFieldValuesAttachment:ze.updateOne,updateIssueTypeFieldValuesAttachments:ze.updateMany,deleteIssueTypeFieldValuesAttachment:ze.deleteOne,deleteIssueTypeFieldValuesAttachments:ze.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:CS,addIssueTypeFieldValuesAttachment:US,addIssueTypeFieldValuesAttachments:On,setIssueTypeFieldValuesAttachment:LS,setIssueTypeFieldValuesAttachments:NS,updateIssueTypeFieldValuesAttachment:GS,updateIssueTypeFieldValuesAttachments:HS,deleteIssueTypeFieldValuesAttachment:KS,deleteIssueTypeFieldValuesAttachments:Fn}=In.actions,YS=t=>t.issueTypeFieldValuesAttachmentReducer.instances,_n=o.createSelector([YS],t=>Object.values(t)),JS=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],ZS=S(o.createSelector([_n,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QS=S(o.createSelector([_n,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),XS=In.reducer,qe=F(t=>t.uuid),xS={instances:{}},gn=o.createSlice({name:"issueTypeIdentifiers",initialState:xS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,xS)),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:eA,addIssueTypeIdentifier:tA,addIssueTypeIdentifiers:sA,setIssueTypeIdentifier:iA,setIssueTypeIdentifiers:nA,updateIssueTypeIdentifier:aA,updateIssueTypeIdentifiers:cA,deleteIssueTypeIdentifier:rA,deleteIssueTypeIdentifiers:dA}=gn.actions,lA=t=>t.issueTypeIdentifierReducer.instances,Pn=o.createSelector([lA],t=>Object.values(t)),uA=t=>s=>s.issueTypeIdentifierReducer.instances[t],oA=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Rb=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),hA=gn.reducer,De=F(t=>t.uuid),pA={instances:{}},bn=o.createSlice({name:"issueTypeIdentifierValues",initialState:pA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,pA)),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:mA,addIssueTypeIdentifierValue:yA,addIssueTypeIdentifierValues:fA,setIssueTypeIdentifierValue:SA,setIssueTypeIdentifierValues:AA,updateIssueTypeIdentifierValue:wA,updateIssueTypeIdentifierValues:TA,deleteIssueTypeIdentifierValue:IA,deleteIssueTypeIdentifierValues:OA}=bn.actions,FA=t=>t.issueTypeIdentifierValueReducer.instances,cs=o.createSelector([FA],t=>Object.values(t)),_A=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],gA=S(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mb=S(o.createSelector([cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),kb=S(o.createSelector([cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),PA=bn.reducer,je=F(t=>t.uuid),bA={instances:{}},Rn=o.createSlice({name:"issueTypes",initialState:bA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,bA)),reducers:{initializeIssueTypes:je.initialize,addIssueType:je.addOne,addIssueTypes:je.addMany,setIssueType:je.setOne,setIssueTypes:je.setMany,updateIssueType:je.updateOne,updateIssueTypes:je.updateMany,deleteIssueType:je.deleteOne,deleteIssueTypes:je.deleteMany}}),{initializeIssueTypes:RA,addIssueType:MA,addIssueTypes:kA,setIssueType:EA,setIssueTypes:vA,updateIssueType:VA,updateIssueTypes:BA,deleteIssueType:WA,deleteIssueTypes:zA}=Rn.actions,qA=t=>t.issueTypeReducer.instances,Mn=o.createSelector(qA,t=>Object.values(t)),DA=t=>s=>s.issueTypeReducer.instances[t],jA=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Eb=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),$A=Rn.reducer,$e=F(t=>t.uuid),CA={instances:{}},kn=o.createSlice({name:"issueTypeStatuses",initialState:CA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,CA)),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:UA,addIssueTypeStatus:LA,addIssueTypeStatuses:NA,setIssueTypeStatus:GA,setIssueTypeStatuses:HA,updateIssueTypeStatus:KA,updateIssueTypeStatuses:YA,deleteIssueTypeStatus:JA,deleteIssueTypeStatuses:ZA}=kn.actions,QA=t=>t.issueTypeStatusReducer.instances,En=o.createSelector([QA],t=>A(Object.values(t).toSorted(sc))),vn=t=>s=>s.issueTypeStatusReducer.instances[t],XA=S(o.createSelector([En,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vb=S(o.createSelector([En,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),xA=kn.reducer,Ce=F(t=>t.uuid),ew={instances:{}},Vn=o.createSlice({name:"issueUpdates",initialState:ew,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ew)),reducers:{initializeIssueUpdates:Ce.initialize,addIssueUpdate:Ce.addOne,addIssueUpdates:Ce.addMany,setIssueUpdate:Ce.setOne,setIssueUpdates:Ce.setMany,updateIssueUpdate:Ce.updateOne,updateIssueUpdates:Ce.updateMany,deleteIssueUpdate:Ce.deleteOne,deleteIssueUpdates:Ce.deleteMany}}),{initializeIssueUpdates:tw,addIssueUpdate:Bn,addIssueUpdates:Wn,setIssueUpdate:sw,setIssueUpdates:iw,updateIssueUpdate:nw,updateIssueUpdates:aw,deleteIssueUpdate:zn,deleteIssueUpdates:qn}=Vn.actions,Dn=t=>t.issueUpdateReducer.instances,jn=o.createSelector([Dn],t=>Object.values(t)),cw=S(o.createSelector([Dn,(t,s)=>s],(t,s)=>t[s])),rw=S(o.createSelector([jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dw=S(o.createSelector([jn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),lw=Vn.reducer,Ue=F(t=>t.id),uw={instances:{},currentUser:null},$n=o.createSlice({name:"users",initialState:uw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,uw)).addCase(_,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ue.initialize,setUsers:Ue.setMany,setUser:Ue.setOne,addUsers:Ue.addMany,addUser:Ue.addOne,updateUsers:Ue.updateMany,updateUser:Ue.updateOne,deleteUser:Ue.deleteOne,deleteUsers:Ue.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setCurrentUserProfile:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile=s.payload;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile=s.payload}}}),{initializeUsers:ow,setUsers:hw,setUser:pw,addUsers:mw,addUser:Cn,updateUsers:yw,updateUser:fw,deleteUser:Un,deleteUsers:Sw,setCurrentUser:Vb,setCurrentUserProfile:Bb}=$n.actions,Aw=$n.reducer,ww=t=>t.userReducer.currentUser,Ln=t=>t.userReducer.instances,rs=o.createSelector([Ln],t=>Object.values(t)),ds=t=>s=>s.userReducer.instances[t],Tw=S(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),Le=F(t=>t.uuid),Iw={instances:{}},Nn=o.createSlice({name:"organizationAccess",initialState:Iw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Iw)),reducers:{initializeOrganizationAccesses:Le.initialize,addOrganizationAccess:Le.addOne,addOrganizationAccesses:Le.addMany,setOrganizationAccess:Le.setOne,setOrganizationAccesses:Le.setMany,updateOrganizationAccess:Le.updateOne,updateOrganizationAccesses:Le.updateMany,deleteOrganizationAccess:Le.deleteOne,deleteOrganizationAccesses:Le.deleteMany}}),{initializeOrganizationAccesses:Ow,addOrganizationAccess:Fw,addOrganizationAccesses:_w,setOrganizationAccess:gw,setOrganizationAccesses:Pw,updateOrganizationAccess:bw,updateOrganizationAccesses:Rw,deleteOrganizationAccess:Mw,deleteOrganizationAccesses:kw}=Nn.actions,Ew=Nn.reducer,ls=t=>t.organizationAccessReducer.instances,vw=t=>s=>s.organizationAccessReducer.instances[t],Vw=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),Wb=o.createSelector([ww,ls],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),Bw=o.createSelector([ls],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return Ut(s)}),zb=S(o.createSelector([Ln,Bw,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ne=F(t=>t.uuid),Ww={instances:{}},Gn=o.createSlice({name:"organizations",initialState:Ww,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ww)),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:zw,setOrganizations:qw,setOrganization:Dw,addOrganizations:jw,addOrganization:$w,updateOrganizations:Cw,updateOrganization:Uw,deleteOrganization:Lw,deleteOrganizations:Nw}=Gn.actions,Gw=t=>t.organizationReducer.instances,Hw=o.createSelector([Gw],t=>Object.values(t)),Kw=t=>s=>s.organizationReducer.instances[t],Yw=S(o.createSelector([Hw,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Jw=Gn.reducer,Zw=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:ht.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},Qw={deletedRequests:[],latestRetryTime:0},Hn=o.createSlice({name:"outbox",initialState:Qw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Qw)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t.url);const{BASE_URL:s,serviceName:e,...n}=t;return Zw(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}}}),qb=t=>t.outboxReducer.deletedRequests,Db=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Xw,markForDeletion:jb,markAsDeleted:xw,_setLatestRetryTime:eT}=Hn.actions,tT=Hn.reducer,Ge=F(t=>t.uuid),sT={instances:{}},Kn=o.createSlice({name:"projectAccess",initialState:sT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,sT)),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:iT,addProjectAccess:nT,addProjectAccesses:aT,setProjectAccess:cT,setProjectAccesses:rT,updateProjectAccess:dT,updateProjectAccesses:lT,deleteProjectAccess:uT,deleteProjectAccesses:oT}=Kn.actions,hT=Kn.reducer,Yn=t=>t.projectAccessReducer.instances,Bt=o.createSelector(Yn,t=>Object.values(t)),pT=t=>s=>s.projectAccessReducer.instances[t],mT=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$b=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),Cb=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),Ub=S(o.createSelector([rs,Bt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),He=F(t=>t.uuid),yT={instances:{}},Jn=o.createSlice({name:"projectAttachments",initialState:yT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,yT)),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:fT,addProjectAttachment:ST,addProjectAttachments:AT,setProjectAttachment:wT,setProjectAttachments:TT,updateProjectAttachment:IT,updateProjectAttachments:OT,deleteProjectAttachment:FT,deleteProjectAttachments:_T}=Jn.actions,gT=t=>t.projectAttachmentReducer.instances,Zn=o.createSelector([gT],t=>Object.values(t)),PT=t=>s=>s.projectAttachmentReducer.instances[t],bT=S(o.createSelector([Zn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Lb=S(o.createSelector([Zn,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),RT=Jn.reducer,Ke=F(t=>t.uuid),MT={instances:{}},Qn=o.createSlice({name:"projectFiles",initialState:MT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,MT)),reducers:{initializeProjectFiles:Ke.initialize,setProjectFile:Ke.setOne,setProjectFiles:Ke.setMany,addProjectFile:Ke.addOne,addProjectFiles:Ke.addMany,updateProjectFile:Ke.updateOne,updateProjectFiles:Ke.updateMany,deleteProjectFile:Ke.deleteOne,deleteProjectFiles:Ke.deleteMany}}),{initializeProjectFiles:kT,setProjectFile:ET,setProjectFiles:vT,addProjectFile:VT,addProjectFiles:BT,updateProjectFile:WT,updateProjectFiles:zT,deleteProjectFile:qT,deleteProjectFiles:DT}=Qn.actions,jT=t=>t.projectFileReducer.instances,$T=o.createSelector([jT],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),CT=t=>s=>s.projectFileReducer.instances[t],UT=S(o.createSelector([$T,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LT=Qn.reducer,Ye=F(t=>t.uuid),NT={instances:{}},Xn=o.createSlice({name:"projects",initialState:NT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,NT)),reducers:{initializeProjects:Ye.initialize,setProjects:Ye.setMany,setProject:Ye.setOne,addProjects:Ye.addMany,addProject:Ye.addOne,updateProjects:Ye.updateMany,updateProject:Ye.updateOne,deleteProject:Ye.deleteOne,deleteProjects:Ye.deleteMany}}),{initializeProjects:GT,setProjects:HT,setProject:KT,addProjects:YT,addProject:JT,updateProjects:ZT,updateProject:QT,deleteProject:XT,deleteProjects:xT}=Xn.actions,eI=Xn.reducer,tI=t=>t.projectReducer.instances,us=o.createSelector([tI],t=>Object.values(t)),sI=t=>s=>s.projectReducer.instances[t],iI=S(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nb=S(o.createSelector([us,Bt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return A(t.filter(a=>n.has(a.uuid)))})),Gb=S(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Hb={isRehydrated:!1},xn=o.createSlice({name:"rehydrated",initialState:Hb,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:Kb}=xn.actions,Yb=t=>t.rehydratedReducer.isRehydrated,nI=xn.reducer,Je=F(t=>t.uuid),aI={instances:{}},ea=o.createSlice({name:"teamMemberships",initialState:aI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,aI)),reducers:{initializeTeamMemberships:Je.initialize,addTeamMembership:Je.addOne,addTeamMemberships:Je.addMany,setTeamMembership:Je.setOne,setTeamMemberships:Je.setMany,updateTeamMembership:Je.updateOne,updateTeamMemberships:Je.updateMany,deleteTeamMembership:Je.deleteOne,deleteTeamMemberships:Je.deleteMany}}),{initializeTeamMemberships:cI,addTeamMembership:rI,addTeamMemberships:dI,setTeamMembership:lI,setTeamMemberships:uI,updateTeamMembership:oI,updateTeamMemberships:hI,deleteTeamMembership:pI,deleteTeamMemberships:mI}=ea.actions,yI=ea.reducer,fI=t=>t.teamMembershipReducer.instances,os=o.createSelector([fI],t=>Object.values(t)),SI=t=>s=>s.teamMembershipReducer.instances[t],AI=S(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Jb=S(o.createSelector([os,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),Zb=S(o.createSelector([rs,os,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),Ze=F(t=>t.uuid),wI={instances:{}},ta=o.createSlice({name:"teams",initialState:wI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,wI)),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:TI,addTeam:II,addTeams:OI,setTeam:FI,setTeams:_I,updateTeam:gI,updateTeams:PI,deleteTeam:bI,deleteTeams:RI}=ta.actions,MI=t=>t.teamReducer.instances,sa=o.createSelector([MI],t=>Object.values(t)),kI=t=>s=>s.teamReducer.instances[t],EI=S(o.createSelector([sa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Qb=S(o.createSelector([sa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),vI=ta.reducer,Xb={version:0},VI=o.createSlice({name:"versioning",initialState:Xb,reducers:{}}),BI=VI.reducer,Qe=F(t=>t.uuid),WI={instances:{}},ia=o.createSlice({name:"workflows",initialState:WI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,WI)),reducers:{initializeWorkflows:Qe.initialize,addWorkflow:Qe.addOne,addWorkflows:Qe.addMany,setWorkflow:Qe.setOne,setWorkflows:Qe.setMany,updateWorkflow:Qe.updateOne,updateWorkflows:Qe.updateMany,deleteWorkflow:Qe.deleteOne,deleteWorkflows:Qe.deleteMany}}),{initializeWorkflows:zI,addWorkflow:qI,addWorkflows:DI,setWorkflow:jI,setWorkflows:$I,updateWorkflow:CI,updateWorkflows:UI,deleteWorkflow:LI,deleteWorkflows:NI}=ia.actions,GI=t=>t.workflowReducer.instances,hs=o.createSelector([GI],t=>Object.values(t)),HI=t=>s=>s.workflowReducer.instances[t],KI=S(o.createSelector([hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xb=S(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),eR=S(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),YI=ia.reducer,Xe=F(t=>t.uuid),JI={instances:{}},na=o.createSlice({name:"workflowIssueLinks",initialState:JI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,JI)),reducers:{initializeWorkflowIssueLinks:Xe.initialize,addWorkflowIssueLink:Xe.addOne,addWorkflowIssueLinks:Xe.addMany,setWorkflowIssueLink:Xe.setOne,setWorkflowIssueLinks:Xe.setMany,updateWorkflowIssueLink:Xe.updateOne,updateWorkflowIssueLinks:Xe.updateMany,deleteWorkflowIssueLink:Xe.deleteOne,deleteWorkflowIssueLinks:Xe.deleteMany}}),{initializeWorkflowIssueLinks:ZI,addWorkflowIssueLink:QI,addWorkflowIssueLinks:XI,setWorkflowIssueLink:xI,setWorkflowIssueLinks:eO,updateWorkflowIssueLink:tO,updateWorkflowIssueLinks:sO,deleteWorkflowIssueLink:iO,deleteWorkflowIssueLinks:nO}=na.actions,aO=t=>t.workflowIssueLinkReducer.instances,At=o.createSelector([aO],t=>Object.values(t)),cO=t=>s=>s.workflowIssueLinkReducer.instances[t],rO=S(o.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tR=S(o.createSelector([At,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),sR=S(o.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),iR=S(o.createSelector([At,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),nR=S(o.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),aR=S(o.createSelector([At,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,issue:a})=>n===s&&a===e)))),dO=na.reducer,xe=F(t=>t.uuid),lO={instances:{}},aa=o.createSlice({name:"workflowStepAssignees",initialState:lO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lO)),reducers:{initializeWorkflowStepAssignees:xe.initialize,addWorkflowStepAssignee:xe.addOne,addWorkflowStepAssignees:xe.addMany,setWorkflowStepAssignee:xe.setOne,setWorkflowStepAssignees:xe.setMany,updateWorkflowStepAssignee:xe.updateOne,updateWorkflowStepAssignees:xe.updateMany,deleteWorkflowStepAssignee:xe.deleteOne,deleteWorkflowStepAssignees:xe.deleteMany}}),{initializeWorkflowStepAssignees:uO,addWorkflowStepAssignee:oO,addWorkflowStepAssignees:hO,setWorkflowStepAssignee:pO,setWorkflowStepAssignees:mO,updateWorkflowStepAssignee:yO,updateWorkflowStepAssignees:fO,deleteWorkflowStepAssignee:SO,deleteWorkflowStepAssignees:AO}=aa.actions,wO=t=>t.workflowStepAssigneeReducer.instances,Wt=o.createSelector([wO],t=>Object.values(t)),TO=t=>s=>s.workflowStepAssigneeReducer.instances[t],IO=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cR=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),rR=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),dR=S(o.createSelector([Wt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),OO=aa.reducer,et=F(t=>t.uuid),FO={instances:{}},ca=o.createSlice({name:"workflowStepComments",initialState:FO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,FO)),reducers:{initializeWorkflowStepComments:et.initialize,addWorkflowStepComment:et.addOne,addWorkflowStepComments:et.addMany,setWorkflowStepComment:et.setOne,setWorkflowStepComments:et.setMany,updateWorkflowStepComment:et.updateOne,updateWorkflowStepComments:et.updateMany,deleteWorkflowStepComment:et.deleteOne,deleteWorkflowStepComments:et.deleteMany}}),{initializeWorkflowStepComments:_O,addWorkflowStepComment:gO,addWorkflowStepComments:PO,setWorkflowStepComment:bO,setWorkflowStepComments:RO,updateWorkflowStepComment:MO,updateWorkflowStepComments:kO,deleteWorkflowStepComment:EO,deleteWorkflowStepComments:vO}=ca.actions,VO=t=>t.workflowStepCommentReducer.instances,zt=o.createSelector([VO],t=>Object.values(t)),BO=t=>s=>s.workflowStepCommentReducer.instances[t],WO=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lR=S(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),uR=S(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),oR=S(o.createSelector([zt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),zO=ca.reducer,tt=F(t=>t.uuid),qO={instances:{}},ra=o.createSlice({name:"workflowStepEvents",initialState:qO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,qO)),reducers:{initializeWorkflowStepEvents:tt.initialize,addWorkflowStepEvent:tt.addOne,addWorkflowStepEvents:tt.addMany,setWorkflowStepEvent:tt.setOne,setWorkflowStepEvents:tt.setMany,updateWorkflowStepEvent:tt.updateOne,updateWorkflowStepEvents:tt.updateMany,deleteWorkflowStepEvent:tt.deleteOne,deleteWorkflowStepEvents:tt.deleteMany}}),{initializeWorkflowStepEvents:DO,addWorkflowStepEvent:jO,addWorkflowStepEvents:$O,setWorkflowStepEvent:CO,setWorkflowStepEvents:UO,updateWorkflowStepEvent:LO,updateWorkflowStepEvents:NO,deleteWorkflowStepEvent:GO,deleteWorkflowStepEvents:HO}=ra.actions,KO=t=>t.workflowStepEventReducer.instances,qt=o.createSelector([KO],t=>Object.values(t)),YO=t=>s=>s.workflowStepEventReducer.instances[t],JO=S(o.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),pR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),mR=S(o.createSelector([qt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),ZO=ra.reducer,st=F(t=>t.uuid),QO={instances:{}},da=o.createSlice({name:"workflowStepFieldsAttachments",initialState:QO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,QO)),reducers:{initializeWorkflowStepFieldsAttachments:st.initialize,addWorkflowStepFieldsAttachment:st.addOne,addWorkflowStepFieldsAttachments:st.addMany,setWorkflowStepFieldsAttachment:st.setOne,setWorkflowStepFieldsAttachments:st.setMany,updateWorkflowStepFieldsAttachment:st.updateOne,updateWorkflowStepFieldsAttachments:st.updateMany,deleteWorkflowStepFieldsAttachment:st.deleteOne,deleteWorkflowStepFieldsAttachments:st.deleteMany}}),{initializeWorkflowStepFieldsAttachments:XO,addWorkflowStepFieldsAttachment:xO,addWorkflowStepFieldsAttachments:la,setWorkflowStepFieldsAttachment:eF,setWorkflowStepFieldsAttachments:tF,updateWorkflowStepFieldsAttachment:sF,updateWorkflowStepFieldsAttachments:iF,deleteWorkflowStepFieldsAttachment:nF,deleteWorkflowStepFieldsAttachments:ua}=da.actions,aF=t=>t.workflowStepFieldsAttachmentReducer.instances,oa=o.createSelector([aF],t=>Object.values(t)),cF=S(o.createSelector([oa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),rF=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],dF=S(o.createSelector([oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lF=da.reducer,it=F(t=>t.uuid),uF={instances:{}},ha=o.createSlice({name:"workflowStepFields",initialState:uF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,uF)),reducers:{initializeWorkflowStepFields:it.initialize,addWorkflowStepFields:it.addOne,addWorkflowStepFieldsMany:it.addMany,setWorkflowStepFields:it.setOne,setWorkflowStepFieldsMany:it.setMany,updateWorkflowStepFields:it.updateOne,updateWorkflowStepFieldsMany:it.updateMany,deleteWorkflowStepFields:it.deleteOne,deleteWorkflowStepFieldsMany:it.deleteMany}}),{initializeWorkflowStepFields:oF,addWorkflowStepFields:hF,addWorkflowStepFieldsMany:pF,setWorkflowStepFields:mF,setWorkflowStepFieldsMany:yF,updateWorkflowStepFields:fF,updateWorkflowStepFieldsMany:SF,deleteWorkflowStepFields:AF,deleteWorkflowStepFieldsMany:wF}=ha.actions,TF=t=>t.workflowStepFieldsReducer.instances,ps=o.createSelector([TF],t=>Object.values(t)),yR=S(o.createSelector([ps,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),fR=S(o.createSelector([ps,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),IF=t=>s=>s.workflowStepFieldsReducer.instances[t],OF=S(o.createSelector([ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FF=ha.reducer,nt=F(t=>t.uuid),_F={instances:{}},pa=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:_F,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,_F)),reducers:{initializeWorkflowStepFieldValuesAttachments:nt.initialize,addWorkflowStepFieldValuesAttachment:nt.addOne,addWorkflowStepFieldValuesAttachments:nt.addMany,setWorkflowStepFieldValuesAttachment:nt.setOne,setWorkflowStepFieldValuesAttachments:nt.setMany,updateWorkflowStepFieldValuesAttachment:nt.updateOne,updateWorkflowStepFieldValuesAttachments:nt.updateMany,deleteWorkflowStepFieldValuesAttachment:nt.deleteOne,deleteWorkflowStepFieldValuesAttachments:nt.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:gF,addWorkflowStepFieldValuesAttachment:PF,addWorkflowStepFieldValuesAttachments:ma,setWorkflowStepFieldValuesAttachment:bF,setWorkflowStepFieldValuesAttachments:RF,updateWorkflowStepFieldValuesAttachment:MF,updateWorkflowStepFieldValuesAttachments:kF,deleteWorkflowStepFieldValuesAttachment:EF,deleteWorkflowStepFieldValuesAttachments:ya}=pa.actions,vF=t=>t.workflowStepFieldValuesAttachmentReducer.instances,fa=o.createSelector([vF],t=>Object.values(t)),VF=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],BF=S(o.createSelector([fa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WF=S(o.createSelector([fa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),zF=pa.reducer,at=F(t=>t.uuid),qF={instances:{}},Sa=o.createSlice({name:"workflowStepFieldValues",initialState:qF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,qF)),reducers:{initializeWorkflowStepFieldValues:at.initialize,addWorkflowStepFieldValues:at.addOne,addWorkflowStepFieldValuesMany:at.addMany,setWorkflowStepFieldValues:at.setOne,setWorkflowStepFieldValuesMany:at.setMany,updateWorkflowStepFieldValues:at.updateOne,updateWorkflowStepFieldValuesMany:at.updateMany,deleteWorkflowStepFieldValues:at.deleteOne,deleteWorkflowStepFieldValuesMany:at.deleteMany}}),{initializeWorkflowStepFieldValues:DF,addWorkflowStepFieldValues:jF,addWorkflowStepFieldValuesMany:$F,setWorkflowStepFieldValues:CF,setWorkflowStepFieldValuesMany:UF,updateWorkflowStepFieldValues:LF,updateWorkflowStepFieldValuesMany:NF,deleteWorkflowStepFieldValues:GF,deleteWorkflowStepFieldValuesMany:HF}=Sa.actions,KF=t=>t.workflowStepFieldValuesReducer.instances,pt=o.createSelector([KF],t=>Object.values(t)),SR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),AR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),YF=t=>s=>s.workflowStepFieldValuesReducer.instances[t],JF=S(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wR=S(o.createSelector([pt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),TR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{workflow:a,workflow_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),ZF=Sa.reducer,ct=F(t=>t.uuid),QF={instances:{}},Aa=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:QF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,QF)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:ct.initialize,addWorkflowStepFieldValuesReviewRequest:ct.addOne,addWorkflowStepFieldValuesReviewRequests:ct.addMany,setWorkflowStepFieldValuesReviewRequest:ct.setOne,setWorkflowStepFieldValuesReviewRequests:ct.setMany,updateWorkflowStepFieldValuesReviewRequest:ct.updateOne,updateWorkflowStepFieldValuesReviewRequests:ct.updateMany,deleteWorkflowStepFieldValuesReviewRequest:ct.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:ct.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:XF,addWorkflowStepFieldValuesReviewRequest:xF,addWorkflowStepFieldValuesReviewRequests:wa,setWorkflowStepFieldValuesReviewRequest:e_,setWorkflowStepFieldValuesReviewRequests:t_,updateWorkflowStepFieldValuesReviewRequest:s_,updateWorkflowStepFieldValuesReviewRequests:i_,deleteWorkflowStepFieldValuesReviewRequest:n_,deleteWorkflowStepFieldValuesReviewRequests:Ta}=Aa.actions,a_=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,Dt=o.createSelector([a_],t=>Object.values(t)),c_=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],r_=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),d_=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),IR=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),OR=S(o.createSelector([pt,Dt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),l_=Aa.reducer,rt=F(t=>t.uuid),u_={instances:{}},Ia=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:u_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,u_)),reducers:{initializeWorkflowStepFieldValuesReviews:rt.initialize,addWorkflowStepFieldValuesReview:rt.addOne,addWorkflowStepFieldValuesReviews:rt.addMany,setWorkflowStepFieldValuesReview:rt.setOne,setWorkflowStepFieldValuesReviews:rt.setMany,updateWorkflowStepFieldValuesReview:rt.updateOne,updateWorkflowStepFieldValuesReviews:rt.updateMany,deleteWorkflowStepFieldValuesReview:rt.deleteOne,deleteWorkflowStepFieldValuesReviews:rt.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:o_,addWorkflowStepFieldValuesReview:h_,addWorkflowStepFieldValuesReviews:Oa,setWorkflowStepFieldValuesReview:p_,setWorkflowStepFieldValuesReviews:m_,updateWorkflowStepFieldValuesReview:y_,updateWorkflowStepFieldValuesReviews:f_,deleteWorkflowStepFieldValuesReview:S_,deleteWorkflowStepFieldValuesReviews:Fa}=Ia.actions,A_=t=>t.workflowStepFieldValuesReviewReducer.instances,Ft=o.createSelector([A_],t=>Object.values(t)),w_=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],T_=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),I_=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),FR=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),_R=S(o.createSelector([pt,Ft,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),gR=o.createSelector([Ft],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),O_=Ia.reducer,dt=F(t=>t.uuid),F_={instances:{}},_a=o.createSlice({name:"workflowStepReviewers",initialState:F_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,F_)),reducers:{initializeWorkflowStepReviewers:dt.initialize,addWorkflowStepReviewer:dt.addOne,addWorkflowStepReviewers:dt.addMany,setWorkflowStepReviewer:dt.setOne,setWorkflowStepReviewers:dt.setMany,updateWorkflowStepReviewer:dt.updateOne,updateWorkflowStepReviewers:dt.updateMany,deleteWorkflowStepReviewer:dt.deleteOne,deleteWorkflowStepReviewers:dt.deleteMany}}),{initializeWorkflowStepReviewers:__,addWorkflowStepReviewer:g_,addWorkflowStepReviewers:P_,setWorkflowStepReviewer:b_,setWorkflowStepReviewers:R_,updateWorkflowStepReviewer:M_,updateWorkflowStepReviewers:k_,deleteWorkflowStepReviewer:E_,deleteWorkflowStepReviewers:v_}=_a.actions,V_=t=>t.workflowStepReviewerReducer.instances,jt=o.createSelector([V_],t=>Object.values(t)),B_=t=>s=>s.workflowStepReviewerReducer.instances[t],W_=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),PR=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),bR=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),RR=S(o.createSelector([jt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),z_=_a.reducer,lt=F(t=>t.uuid),q_={instances:{}},ga=o.createSlice({name:"workflowSteps",initialState:q_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,q_)),reducers:{initializeWorkflowSteps:lt.initialize,addWorkflowStep:lt.addOne,addWorkflowSteps:lt.addMany,setWorkflowStep:lt.setOne,setWorkflowSteps:lt.setMany,updateWorkflowStep:lt.updateOne,updateWorkflowSteps:lt.updateMany,deleteWorkflowStep:lt.deleteOne,deleteWorkflowSteps:lt.deleteMany}}),{initializeWorkflowSteps:D_,addWorkflowStep:j_,addWorkflowSteps:$_,setWorkflowStep:C_,setWorkflowSteps:U_,updateWorkflowStep:L_,updateWorkflowSteps:N_,deleteWorkflowStep:G_,deleteWorkflowSteps:H_}=ga.actions,K_=t=>t.workflowStepReducer.instances,Pa=o.createSelector([K_],t=>Object.values(t)),Y_=t=>s=>s.workflowStepReducer.instances[t],J_=S(o.createSelector([Pa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),MR=S(o.createSelector([Pa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),Z_=ga.reducer,ut=F(t=>t.uuid),Q_={instances:{}},ba=o.createSlice({name:"workflowTypes",initialState:Q_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Q_)),reducers:{initializeWorkflowTypes:ut.initialize,addWorkflowType:ut.addOne,addWorkflowTypes:ut.addMany,setWorkflowType:ut.setOne,setWorkflowTypes:ut.setMany,updateWorkflowType:ut.updateOne,updateWorkflowTypes:ut.updateMany,deleteWorkflowType:ut.deleteOne,deleteWorkflowTypes:ut.deleteMany}}),{initializeWorkflowTypes:X_,addWorkflowType:x_,addWorkflowTypes:eg,setWorkflowType:tg,setWorkflowTypes:sg,updateWorkflowType:ig,updateWorkflowTypes:ng,deleteWorkflowType:ag,deleteWorkflowTypes:cg}=ba.actions,rg=t=>t.workflowTypeReducer.instances,Ra=o.createSelector([rg],t=>Object.values(t)),dg=t=>s=>s.workflowTypeReducer.instances[t],lg=S(o.createSelector([Ra,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kR=S(o.createSelector([Ra,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ug=ba.reducer,Ma={outboxReducer:tT,fileReducer:Fp,authReducer:vh},ER=o.combineReducers(Ma),og={...Ma,[kt]:BI,assetReducer:Dl,assetAttachmentReducer:Fc,assetStageCompletionReducer:Jl,assetStageReducer:uu,assetTypeReducer:yh,assetTypeAttachmentReducer:gu,issueReducer:qf,issueAttachmentReducer:Zy,issueTypeReducer:$A,issueTypeAttachmentReducer:Qf,organizationReducer:Jw,projectReducer:eI,projectAttachmentReducer:RT,projectAccessReducer:hT,organizationAccessReducer:Ew,projectFileReducer:LT,rehydratedReducer:nI,formReducer:vm,formRevisionReducer:Im,formRevisionAttachmentReducer:om,formSubmissionAttachmentReducer:Km,formSubmissionReducer:cy,formIdentifierReducer:qp,formIdentifierValueReducer:Qp,userReducer:Aw,emailDomainsReducer:Tp,documentsReducer:ip,documentAttachmentReducer:Hh,teamReducer:vI,agentsReducer:uc,issueCommentReducer:_f,issueCommentAttachmentReducer:of,issueUpdateReducer:lw,geoImageReducer:Ty,issueAssociationReducer:qy,issueTypeFieldsReducer:jS,issueTypeFieldValuesReducer:gS,issueTypeFieldsAttachmentReducer:oS,issueTypeFieldValuesAttachmentReducer:XS,issueTypeIdentifierReducer:hA,issueTypeIdentifierValueReducer:PA,issueTypeStatusReducer:xA,assetTypeFieldsReducer:xu,assetTypeFieldValuesReducer:bo,assetTypeFieldsAttachmentReducer:ju,assetTypeFieldValuesAttachmentReducer:po,assetTypeIdentifierReducer:Co,assetTypeIdentifierValueReducer:th,assetTypeStatusReducer:Mh,assetProcedureTypeReducer:dd,assetProcedureReducer:Kr,assetProcedureTypeFieldsReducer:dr,assetProcedureTypeFieldValuesReducer:Wr,assetProcedureTypeFieldsAttachmentReducer:Yc,assetProcedureTypeFieldValuesAttachmentReducer:Tr,assetProcedureTypeAttachmentReducer:Bc,assetProcedureStepFieldsAttachmentReducer:gd,assetProcedureStepFieldsReducer:Dd,assetProcedureStepFieldValuesAttachmentReducer:Qd,assetProcedureStepFieldValuesReducer:ol,assetProcedureStepReducer:Ol,teamMembershipReducer:yI,workflowTypeReducer:ug,workflowStepReducer:Z_,workflowStepFieldsReducer:FF,workflowStepFieldsAttachmentReducer:lF,workflowReducer:YI,workflowIssueLinkReducer:dO,workflowStepAssigneeReducer:OO,workflowStepCommentReducer:zO,workflowStepEventReducer:ZO,workflowStepFieldValuesReducer:ZF,workflowStepFieldValuesAttachmentReducer:zF,workflowStepFieldValuesReviewReducer:O_,workflowStepFieldValuesReviewRequestReducer:l_,workflowStepReviewerReducer:z_},vR=o.combineReducers(og),hg=1e4,pg=200,ka=[400,409,403,404,405,500],ot=1e4,mg={};class yg{constructor(s){m(this,"client");m(this,"pageSize",hg);mg[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 fg=()=>wg.length-1,Sg=t=>(t[kt]={version:fg()},t),Ag=()=>Sg({}),VR=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),BR=t=>s=>{var e;return s===void 0&&(s={}),((e=s[kt])==null?void 0:e.version)===fg()?s:t(s)},wg=[Sg,Ag,Ag,VR],WR=Object.fromEntries(wg.map((t,s)=>[s,BR(t)])),zR=t=>{if(t)throw t;const s=Pt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},Tg=(t,s,e)=>{const n=It();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},Ig=(t,s,e)=>{const n=It();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 qR(t,s){if(!s.payload)throw new Error("Received empty payload");return Bg(s)}const DR={...qa,effect:qR,discard:Fg,returnPromises:!0,persistCallback:zR,retry:UR,persistOptions:{storage:Cg},queue:{...qa.queue,enqueue:Tg,dequeue:Ig,peek:(...t)=>CR(...t)}},jR=Ug(WR,kt),$R=o.compose($g.offline(DR),jR);async function Og(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=mg[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return va(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function Fg(t,s,e=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
2
2
  Url:`,s.payload.url,`
3
- Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=_t(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(Zw(r));const p=wt();if(!p)throw new Error("Outbox coordinator not set");p.remove(s.payload.uuid);const y=s.meta.offline.rollback;throw y&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(y)),t}if(t instanceof C&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),d()),c.includes(r)&&(console.debug("Discarding request due to deletion:",s.payload.url),d()),t instanceof C){const p=t.status||((u=t.response)==null?void 0:u.status);if(p||console.warn("Error has no status code:",t),p!==void 0&&ba.includes(p)){console.warn("Discarding request due to error:",t,`
4
- Action:`,s);const y=wt();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=wt();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function wR(t,s,e){var n;return(n=wt())==null?void 0:n.peek()}function TR(t,s){return _t().dispatch(Qw(new Date().getTime())),Ua}const Ot="An unknown error occurred",IR=500,rg=["non_field_errors","detail"];function OR(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"?rg.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?rg.includes(a)?c.join(`
3
+ Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=Pt(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(xw(r));const p=It();if(!p)throw new Error("Outbox coordinator not set");p.remove(s.payload.uuid);const y=s.meta.offline.rollback;throw y&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(y)),t}if(t instanceof C&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),d()),c.includes(r)&&(console.debug("Discarding request due to deletion:",s.payload.url),d()),t instanceof C){const p=t.status||((u=t.response)==null?void 0:u.status);if(p||console.warn("Error has no status code:",t),p!==void 0&&ka.includes(p)){console.warn("Discarding request due to error:",t,`
4
+ Action:`,s);const y=It();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=It();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function CR(t,s,e){var n;return(n=It())==null?void 0:n.peek()}function UR(t,s){return Pt().dispatch(eT(new Date().getTime())),Ga}const _t="An unknown error occurred",LR=500,_g=["non_field_errors","detail"];function NR(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"?_g.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?_g.includes(a)?c.join(`
5
5
  `):c.map(r=>`${a}: ${r}`).join(`
6
6
  `):`${a}: ${JSON.stringify(c)}`).join(`
7
- `)}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>IR?Ot:e}class C extends Error{constructor(e){super(Ot);m(this,"status");m(this,"response");m(this,"message");m(this,"options");const{response:n,innerError:a}=e;this.message=e.message??OR(n,a)??Ot,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function dg(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 FR extends X_{constructor(s){super(s)}}class St extends X_{constructor(e,n){super(e);m(this,"auth");this.auth=n}}class _R extends St{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(nc(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(cc(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(ac(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:h.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(ic(n)),n}}function pt(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case h.GET:return`Get ${n}`;case h.POST:return`Create ${n}`;case h.PATCH:return`Update ${n}`;case h.PUT:return`Update ${n}`;case h.DELETE:return`Delete ${n}`}}class k extends St{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class q extends k{constructor(){super(...arguments);m(this,"pageSize",Z_)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:P,...E}=e;d=await this.client.files.getFilePayload(P),l=URL.createObjectURL(P),r={...E,file_sha1:d.sha1,file_type:d.file_type,file_name:P.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),p=this.buildPayload(u);this.dispatch(n(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...p,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});y.then(({instance:P})=>{this.dispatch(a(P))}).catch(P=>{throw this.dispatch(c(this.getId(u))),P}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=y.then(({instance:P})=>P),T=y.then(async({instance:P,presigned_url:E})=>{try{return E&&await this.client.files.processPresignedUrl(P.file_sha1,E),P.file_sha1}catch(g){throw console.error("Upload to s3 using presigned url failed.",g),g}});return[u,f,T]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,p=pt(e,Math.min(n??e.length,ut)),y=[];for(const E of p){const g=[],M={},b=[],z=[];for(const W of E){let D;if("file"in W){const{file:va,...xM}=W,gt=await this.client.files.getFilePayload(va);gt.sha1 in M||(M[gt.sha1]=gt);const Tg=URL.createObjectURL(va);u.add(Tg),D={...xM,file_sha1:gt.sha1,file_type:gt.file_type,file_name:va.name,file_extension:gt.extension,file_url:Tg}}else D=W;const v=this.buildModel(D);l.push(v);const L=this.buildBulkPayload(v);g.push(L);const hs=this.getBlockers(v);b.push(...hs);const XM=this.getBlocks(v);z.push(...XM)}const j={payloads:g,submittedAt:d,files:Object.values(M),blockers:b,blocks:z};y.push(j)}this.dispatch(a(l));const f=y.map(E=>{const{submittedAt:g,files:M,payloads:b,blocks:z,blockers:j}=E;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:g,files:M,payloads:b},blockers:j,blocks:z})});Promise.all(f).then(E=>{const g=E.flatMap(M=>M.instances);this.dispatch(c(g))}).catch(E=>{throw this.dispatch(r(l.map(g=>this.getId(g)))),console.error(E),E}).finally(()=>{for(const E of u)URL.revokeObjectURL(E)});const T=Promise.all(f).then(E=>E.flatMap(({instances:g})=>g)),P=Promise.all(f).then(async E=>{const g=[];for(const{presigned_urls:M}of E){const b=this.client.files.processPresignedUrls(M);for(const[z,j]of Object.entries(b))try{await j,g.push(z)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return g});return[l,T,P]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(d)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(d)),l}}}class gR extends q{constructor(){super(...arguments);m(this,"name","Asset attachment");m(this,"url","/asset-attachments");m(this,"actions",{addOne:uc,addMany:Os,setOne:oc,setMany:hc,updateOne:pc,updateMany:mc,deleteOne:yc,deleteMany:Fs,initialize:lc});m(this,"selectors",{selectById:Sc,selectByIds:Ac})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class PR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Attachment");m(this,"url","/asset-procedure-type-attachments");m(this,"actions",{addOne:Fc,addMany:_c,setOne:gc,setMany:Pc,updateOne:bc,updateMany:Rc,deleteOne:Mc,deleteMany:kc,initialize:Oc});m(this,"selectors",{selectById:Vc,selectByIds:Bc})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,p=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,y=new Date().toISOString();return O({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:p,submitted_at:y,asset_procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}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 bR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields Attachment");m(this,"url","/asset-procedure-type-fields-attachments");m(this,"actions",{addOne:qc,addMany:Dc,setOne:jc,setMany:$c,updateOne:Cc,updateMany:Uc,deleteOne:Lc,deleteMany:Nc,initialize:zc});m(this,"selectors",{selectById:Kc,selectByIds:Yc})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}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 RR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields");m(this,"url","/asset-procedure-type-fields");m(this,"actions",{addOne:Qc,addMany:Xc,setOne:xc,setMany:er,updateOne:tr,updateMany:sr,deleteOne:ir,deleteMany:nr,initialize:Zc});m(this,"selectors",{selectById:rr,selectByIds:dr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}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 MR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values Attachment");m(this,"url","/asset-procedure-type-field-values-attachments");m(this,"actions",{addOne:or,addMany:Es,setOne:hr,setMany:pr,updateOne:mr,updateMany:yr,deleteOne:fr,deleteMany:vs,initialize:ur});m(this,"selectors",{selectById:wr,selectByIds:Tr})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.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:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class kR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values");m(this,"url","/asset-procedure-type-field-values");m(this,"actions",{addOne:_r,addMany:gr,setOne:Pr,setMany:br,updateOne:Rr,updateMany:Mr,deleteOne:kr,deleteMany:Er,initialize:Fr});m(this,"selectors",{selectById:Br,selectByIds:Wr})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=pt(c,Math.min(n??c.length,ut)),T=[];for(const g of f){const M=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),M.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:a,field_values:M})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:M}=g,b=M.map(({asset:v})=>v),z=M.map(({fields_revision:v})=>v),j=M.map(({asset_procedure:v})=>v),W=M.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Ir(e)(d);this.dispatch(a(e)),this.dispatch(vs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Es(u)),p}}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 ER extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure");m(this,"url","/asset-procedures");m(this,"actions",{addOne:Dr,addMany:zs,setOne:Ur,setMany:Lr,updateOne:jr,updateMany:$r,deleteOne:Cr,deleteMany:qs,initialize:qr});m(this,"selectors",{selectById:Kr,selectByIds:Yr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class vR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type");m(this,"url","/asset-procedure-types");m(this,"actions",{addOne:Qr,addMany:Xr,setOne:id,setMany:nd,updateOne:xr,updateMany:ed,deleteOne:td,deleteMany:sd,initialize:Zr});m(this,"selectors",{selectById:rd,selectByIds:dd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=Hr(e)(d);this.dispatch(a(e)),this.dispatch(qs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(zs(u)),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 VR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields Attachment");m(this,"url","/asset-procedure-step-fields-attachments");m(this,"actions",{addOne:od,addMany:hd,setOne:pd,setMany:md,updateOne:yd,updateMany:fd,deleteOne:Sd,deleteMany:Ad,initialize:ud});m(this,"selectors",{selectById:Td,selectByIds:Id})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}buildBulkPayload(e){return{uuid:e.uuid,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}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 BR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields");m(this,"url","/asset-procedure-step-fields");m(this,"actions",{addOne:gd,addMany:Pd,setOne:bd,setMany:Rd,updateOne:Md,updateMany:kd,deleteOne:Ed,deleteMany:vd,initialize:_d});m(this,"selectors",{selectById:Vd,selectByIds:Bd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}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 d=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[r,d]}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:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(r)),d}}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 WR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values Attachment");m(this,"url","/asset-procedure-step-field-values-attachments");m(this,"actions",{addOne:Dd,addMany:Gs,setOne:jd,setMany:$d,updateOne:Cd,updateMany:Ud,deleteOne:Ld,deleteMany:Hs,initialize:qd});m(this,"selectors",{selectById:Gd,selectByIds:Hd})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.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:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class zR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values");m(this,"url","/asset-procedure-step-field-values");m(this,"actions",{addOne:Qd,addMany:Xd,setOne:xd,setMany:el,updateOne:tl,updateMany:sl,deleteOne:il,deleteMany:nl,initialize:Zd});m(this,"selectors",{selectById:cl,selectByIds:rl})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=pt(a,Math.min(n??a.length,ut)),T=[];for(const g of f){const M=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),M.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,asset_procedure_step:b.asset_procedure_step,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:c,field_values:M})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:M}=g,b=M.map(({asset:v})=>v),z=M.map(({fields_revision:v})=>v),j=M.map(({asset_procedure:v})=>v),W=M.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Kd(e)(d);this.dispatch(a(e)),this.dispatch(Hs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Gs(u)),p}}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 qR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step");m(this,"url","/asset-procedure-steps");m(this,"actions",{addOne:pl,addMany:ml,setOne:ol,setMany:hl,updateOne:yl,updateMany:fl,deleteOne:Sl,deleteMany:Al,initialize:ul});m(this,"selectors",{selectById:Tl,selectByIds:Il})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.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 l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const y=Ol(e)(u);this.dispatch(d(e)),this.dispatch(a(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(p)),this.dispatch(c(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class DR extends k{constructor(){super(...arguments);m(this,"url","/assets");m(this,"name","Asset");m(this,"actions",{addOne:gl,addMany:Xs,setOne:Ml,setMany:kl,updateOne:Pl,updateMany:bl,deleteOne:Rl,deleteMany:xs,initialize:_l});m(this,"selectors",{selectById:Vl,selectByIds:Bl})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const u=wc(e)(d),p=Vy(e)(d);this.dispatch(c(e)),this.dispatch(Fs(V(u))),this.dispatch(yt(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(Os(u)),this.dispatch(mt(p)),y}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=ot.v4(),d=pt(e,Math.min(n??e.length,ut)).map(p=>{const y=p.map(f=>O(f));return{batchId:ot.v4(),payload:{transaction_id:r,submitted_at:c,assets:y}}}),l=[];let u=null;for(const p of d){const{batchId:y,payload:f}=p,T=f.assets.map(({uuid:b})=>b),P=f.assets.map(({asset_type:b})=>b),E=f.assets.map(({project:b})=>b),g=f.assets.map(({status:b})=>b),M=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(P).concat(E).concat(g),blocks:[y].concat(T)});u=p.batchId,l.push(M)}return Promise.all(l).then(p=>{const y=p.flat();this.dispatch(a(y))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Ut);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(As);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} assets that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=pt(e,Math.min(n??e.length,ut)),y=[];let f=null;for(const T of p){const P=ot.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),M=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(M),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids: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 jR extends k{constructor(){super(...arguments);m(this,"name","Asset Stage Completion");m(this,"url","/asset-stage-completions");m(this,"actions",{addOne:Dl,addMany:jl,setOne:$l,setMany:Cl,updateOne:Ul,updateMany:Ll,deleteOne:Nl,deleteMany:Gl,initialize:ql});m(this,"selectors",{selectById:Jl,selectByIds:Zl})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}bulkAdd(e){var T;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((T=n.getState().userReducer.currentUser)==null?void 0:T.id)??null,u=e.map(P=>O(P)),p=u.map(P=>({...P,created_by:l,submitted_at:d})),y=p.map(({uuid:P})=>P);this.dispatch(a(p));const f=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:u},blockers:[...e.map(P=>P.asset_procedure),...e.map(P=>P.asset_stage),...e.map(P=>P.asset)],blocks:y});return f.then(P=>{this.dispatch(c(P))}).catch(()=>{this.dispatch(r(y))}),[p,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 $R extends k{constructor(){super(...arguments);m(this,"name","Asset Stage");m(this,"url","/asset-stages");m(this,"actions",{addOne:tu,addMany:su,setOne:xl,setMany:eu,updateOne:iu,updateMany:nu,deleteOne:au,deleteMany:cu,initialize:Xl});m(this,"selectors",{selectById:du,selectByIds:lu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class CR extends q{constructor(){super(...arguments);m(this,"name","Asset Type Attachment");m(this,"url","/asset-type-attachments");m(this,"actions",{addOne:hu,addMany:ai,setOne:pu,setMany:mu,updateOne:yu,updateMany:fu,deleteOne:Su,deleteMany:ci,initialize:ou});m(this,"selectors",{selectById:wu,selectByIds:Tu})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class UR extends q{constructor(){super(...arguments);m(this,"name","Asset Type Fields Attachment");m(this,"url","/asset-type-fields-attachments");m(this,"actions",{addOne:gu,addMany:Pu,setOne:bu,setMany:Ru,updateOne:Mu,updateMany:ku,deleteOne:Eu,deleteMany:vu,initialize:_u});m(this,"selectors",{selectById:Bu,selectByIds:Wu})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}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 LR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Fields");m(this,"url","/asset-type-fields");m(this,"actions",{addOne:ju,addMany:$u,setOne:Cu,setMany:Uu,updateOne:Lu,updateMany:Nu,deleteOne:Gu,deleteMany:Hu,initialize:Du});m(this,"selectors",{selectById:Yu,selectByIds:Ju})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}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 NR extends q{constructor(){super(...arguments);m(this,"name","Asset Type Field Values Attachment");m(this,"url","/asset-type-field-values-attachments");m(this,"actions",{addOne:xu,addMany:hi,setOne:eo,setMany:to,updateOne:so,updateMany:io,deleteOne:no,deleteMany:pi,initialize:Xu});m(this,"selectors",{selectById:co,selectByIds:ro})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.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:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class GR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Field Values");m(this,"url","/asset-type-field-values");m(this,"actions",{addOne:po,addMany:mo,setOne:yo,setMany:fo,updateOne:So,updateMany:Ao,deleteOne:wo,deleteMany:To,initialize:ho});m(this,"selectors",{selectById:Oo,selectByIds:Fo})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=[],y=pt(a,Math.min(n??a.length,ut)),f=[];for(const E of y){const g=[];for(const M of E){const b=O({...M,values:M.values,created_by:((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,submitted_at:u});p.push(b),g.push({uuid:b.uuid,asset:M.asset,fields_revision:M.fields_revision,published_at:M.published_at,values:b.values})}f.push({submitted_at:u,values:c,field_values:g})}this.dispatch(r(p));const T=[];for(const E of f){const{field_values:g}=E,M=g.map(({asset:W})=>W),b=g.map(({fields_revision:W})=>W),z=g.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:E,blockers:M.concat(b),blocks:z});T.push(j)}return Promise.all(T).then(E=>{this.dispatch(d(E.flat()))}).catch(()=>{this.dispatch(l(V(p)))}),[p,T]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=lo(e)(d);this.dispatch(a(e)),this.dispatch(pi(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(hi(u)),p}}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 HR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Identifier");m(this,"url","/asset-type-identifiers");m(this,"actions",{addOne:bo,addMany:Ro,setOne:Mo,setMany:ko,updateOne:Eo,updateMany:vo,deleteOne:Vo,deleteMany:Bo,initialize:Po});m(this,"selectors",{selectById:zo,selectByIds:qo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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 KR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Identifier Value");m(this,"url","/asset-type-identifier-values");m(this,"actions",{addOne:Co,addMany:Uo,setOne:Lo,setMany:No,updateOne:Go,updateMany:Ho,deleteOne:Ko,deleteMany:Yo,initialize:$o});m(this,"selectors",{selectById:Zo,selectByIds:Qo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}bulkAdd(e,n){var E;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((E=a.getState().userReducer.currentUser)==null?void 0:E.id)??null,p=pt(e,Math.min(n??e.length,ut)),y=[],f=[];for(const g of p){const M=[],b=[],z=[];for(const W of g){const D=O({...W,submitted_at:l,created_by:u});f.push(D);const v={uuid:D.uuid,asset:D.asset,asset_type_identifier:D.asset_type_identifier,value:D.value};M.push(v),b.push(D.asset),b.push(D.asset_type_identifier),z.push(D.uuid)}const j={payloads:M,submitted_at:l,blockers:b,blocks:z};y.push(j)}this.dispatch(c(f));const T=y.map(g=>{const{payloads:M,submitted_at:b,blockers:z,blocks:j}=g;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:M},blockers:z,blocks:j})});Promise.all(T).then(g=>{this.dispatch(r(g.flat()))}).catch(g=>{throw this.dispatch(d(V(f))),g});const P=Promise.all(T).then(g=>g.flat());return[f,P]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class YR extends k{constructor(){super(...arguments);m(this,"name","Asset Type");m(this,"url","/asset-types");m(this,"actions",{addOne:ih,addMany:nh,setOne:th,setMany:sh,updateOne:ah,updateMany:ch,deleteOne:rh,deleteMany:dh,initialize:eh});m(this,"selectors",{selectById:uh,selectByIds:oh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=vl(e)(d),p=Iu(e)(d);this.dispatch(a(e)),this.dispatch(xs(V(u))),this.dispatch(ci(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Xs(u)),this.dispatch(ai(p)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class JR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Status");m(this,"url","/asset-type-statuses");m(this,"actions",{addOne:yh,addMany:fh,setOne:Sh,setMany:Ah,updateOne:wh,updateMany:Th,deleteOne:Ih,deleteMany:Oh,initialize:mh});m(this,"selectors",{selectById:_h,selectByIds:gh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class ZR extends q{constructor(){super(...arguments);m(this,"name","Document Attachment");m(this,"url","/document-attachments");m(this,"actions",{addOne:vh,addMany:Vh,setOne:Bh,setMany:Wh,updateOne:zh,updateMany:qh,deleteOne:Dh,deleteMany:jh,initialize:Eh});m(this,"selectors",{selectById:Ch,selectByIds:Uh})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}async bulkAdd(e,n){const[a,c,r]=await super.bulkAdd(e,n),d={};for(const{file_sha1:l,uuid:u}of a)l in d||(d[l]=[]),d[l].push(u);return r.then(l=>{const u=l.flatMap(p=>d[p]??[]);for(const p of u)this.makeReadable(p)}),[a,c,r]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.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),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class QR extends k{constructor(){super(...arguments);m(this,"name","Document");m(this,"url","/documents");m(this,"actions",{addOne:Hh,addMany:Kh,setOne:Yh,setMany:Jh,updateOne:Zh,updateMany:Qh,deleteOne:Xh,deleteMany:xh,initialize:Gh});m(this,"selectors",{selectById:tp,selectByIds:sp})}add(e){var y;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const y=ip(e)(u);this.dispatch(a(e)),this.dispatch(d(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(p)),this.dispatch(r(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class At extends St{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class XR extends At{constructor(){super(...arguments);m(this,"name","Email Domains");m(this,"url","/organization-email-domains");m(this,"actions",{addOne:cp,addMany:rp,setOne:dp,setMany:lp,updateOne:up,updateMany:op,deleteOne:hp,deleteMany:pp,initialize:ap});m(this,"selectors",{selectById:yp,selectByIds:fp})}async add(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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 xR extends St{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const Dt={},Ra=new Set;class eM extends St{constructor(){super(...arguments);m(this,"host");m(this,"dbPromise",Pg.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async getDB(){return await this.dbPromise}async addCache(e){if(!e.name)throw new Error(`Cant add a file without a name to cache: ${e.name}`);if(!e.type)throw new Error(`Cant add a file without a type to cache: ${e.name}`);if(!e.size)throw new Error(`Cant add an empty file to cache: ${e.name}`);const n=await Ct(e);if(Ra.has(n))return;const a=await this.getDB();!!await a.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await a.put("files",e,n),Ra.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),Ra.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,a=n){const c=e.split("?")[0]??e,r=await this.fetchCache(n);if(r)return r;let d;c in Dt?d=Dt[c]:Ka(e)?(d=Ha(e,a),Dt[c]=d):(d=new Promise(p=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(y=>{const f=new File([y],a,{type:y.type});p(f)})}),Dt[c]=d);let l;try{l=await d}catch(p){throw p instanceof C&&delete Dt[c],p}const u=await Ct(l);if(u!==n){const p=`The hash of the file returned from the server (${u}) does not match the
7
+ `)}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>LR?_t:e}class C extends Error{constructor(e){super(_t);m(this,"status");m(this,"response");m(this,"message");m(this,"options");const{response:n,innerError:a}=e;this.message=e.message??NR(n,a)??_t,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function gg(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 GR extends yg{constructor(s){super(s)}}class wt extends yg{constructor(e,n){super(e);m(this,"auth");this.auth=n}}class HR extends wt{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(rc(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(lc(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(dc(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:h.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(cc(n)),n}}function mt(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case h.GET:return`Get ${n}`;case h.POST:return`Create ${n}`;case h.PATCH:return`Update ${n}`;case h.PUT:return`Update ${n}`;case h.DELETE:return`Delete ${n}`}}class M extends wt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class q extends M{constructor(){super(...arguments);m(this,"pageSize",pg)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:P,...E}=e;d=await this.client.files.getFilePayload(P),l=URL.createObjectURL(P),r={...E,file_sha1:d.sha1,file_type:d.file_type,file_name:P.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),p=this.buildPayload(u);this.dispatch(n(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...p,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});y.then(({instance:P})=>{this.dispatch(a(P))}).catch(P=>{throw this.dispatch(c(this.getId(u))),P}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=y.then(({instance:P})=>P),T=y.then(async({instance:P,presigned_url:E})=>{try{return E&&await this.client.files.processPresignedUrl(P.file_sha1,E),P.file_sha1}catch(g){throw console.error("Upload to s3 using presigned url failed.",g),g}});return[u,f,T]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,p=mt(e,Math.min(n??e.length,ot)),y=[];for(const E of p){const g=[],k={},b=[],z=[];for(const W of E){let D;if("file"in W){const{file:Wa,...Ok}=W,bt=await this.client.files.getFilePayload(Wa);bt.sha1 in k||(k[bt.sha1]=bt);const qg=URL.createObjectURL(Wa);u.add(qg),D={...Ok,file_sha1:bt.sha1,file_type:bt.file_type,file_name:Wa.name,file_extension:bt.extension,file_url:qg}}else D=W;const v=this.buildModel(D);l.push(v);const L=this.buildBulkPayload(v);g.push(L);const ms=this.getBlockers(v);b.push(...ms);const Ik=this.getBlocks(v);z.push(...Ik)}const j={payloads:g,submittedAt:d,files:Object.values(k),blockers:b,blocks:z};y.push(j)}this.dispatch(a(l));const f=y.map(E=>{const{submittedAt:g,files:k,payloads:b,blocks:z,blockers:j}=E;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:g,files:k,payloads:b},blockers:j,blocks:z})});Promise.all(f).then(E=>{const g=E.flatMap(k=>k.instances);this.dispatch(c(g))}).catch(E=>{throw this.dispatch(r(l.map(g=>this.getId(g)))),console.error(E),E}).finally(()=>{for(const E of u)URL.revokeObjectURL(E)});const T=Promise.all(f).then(E=>E.flatMap(({instances:g})=>g)),P=Promise.all(f).then(async E=>{const g=[];for(const{presigned_urls:k}of E){const b=this.client.files.processPresignedUrls(k);for(const[z,j]of Object.entries(b))try{await j,g.push(z)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return g});return[l,T,P]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(d)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(d)),l}}}class KR extends q{constructor(){super(...arguments);m(this,"name","Asset attachment");m(this,"url","/asset-attachments");m(this,"actions",{addOne:pc,addMany:_s,setOne:mc,setMany:yc,updateOne:fc,updateMany:Sc,deleteOne:Ac,deleteMany:gs,initialize:hc});m(this,"selectors",{selectById:Tc,selectByIds:Ic})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class YR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Attachment");m(this,"url","/asset-procedure-type-attachments");m(this,"actions",{addOne:Pc,addMany:bc,setOne:Rc,setMany:Mc,updateOne:kc,updateMany:Ec,deleteOne:vc,deleteMany:Vc,initialize:gc});m(this,"selectors",{selectById:zc,selectByIds:qc})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,p=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,y=new Date().toISOString();return O({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:p,submitted_at:y,asset_procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}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 JR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields Attachment");m(this,"url","/asset-procedure-type-fields-attachments");m(this,"actions",{addOne:$c,addMany:Cc,setOne:Uc,setMany:Lc,updateOne:Nc,updateMany:Gc,deleteOne:Hc,deleteMany:Kc,initialize:jc});m(this,"selectors",{selectById:Zc,selectByIds:Qc})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}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 ZR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields");m(this,"url","/asset-procedure-type-fields");m(this,"actions",{addOne:er,addMany:tr,setOne:sr,setMany:ir,updateOne:nr,updateMany:ar,deleteOne:cr,deleteMany:rr,initialize:xc});m(this,"selectors",{selectById:ur,selectByIds:or})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}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 QR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values Attachment");m(this,"url","/asset-procedure-type-field-values-attachments");m(this,"actions",{addOne:mr,addMany:Vs,setOne:yr,setMany:fr,updateOne:Sr,updateMany:Ar,deleteOne:wr,deleteMany:Bs,initialize:pr});m(this,"selectors",{selectById:Or,selectByIds:Fr})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.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:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class XR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values");m(this,"url","/asset-procedure-type-field-values");m(this,"actions",{addOne:br,addMany:Rr,setOne:Mr,setMany:kr,updateOne:Er,updateMany:vr,deleteOne:Vr,deleteMany:Br,initialize:Pr});m(this,"selectors",{selectById:qr,selectByIds:Dr})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=mt(c,Math.min(n??c.length,ot)),T=[];for(const g of f){const k=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),k.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:a,field_values:k})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:k}=g,b=k.map(({asset:v})=>v),z=k.map(({fields_revision:v})=>v),j=k.map(({asset_procedure:v})=>v),W=k.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=_r(e)(d);this.dispatch(a(e)),this.dispatch(Bs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Vs(u)),p}}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 xR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure");m(this,"url","/asset-procedures");m(this,"actions",{addOne:Cr,addMany:Ds,setOne:Gr,setMany:Hr,updateOne:Ur,updateMany:Lr,deleteOne:Nr,deleteMany:js,initialize:$r});m(this,"selectors",{selectById:Zr,selectByIds:Qr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class eM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type");m(this,"url","/asset-procedure-types");m(this,"actions",{addOne:ed,addMany:td,setOne:cd,setMany:rd,updateOne:sd,updateMany:id,deleteOne:nd,deleteMany:ad,initialize:xr});m(this,"selectors",{selectById:ud,selectByIds:od})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=Jr(e)(d);this.dispatch(a(e)),this.dispatch(js(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ds(u)),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 tM extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields Attachment");m(this,"url","/asset-procedure-step-fields-attachments");m(this,"actions",{addOne:md,addMany:yd,setOne:fd,setMany:Sd,updateOne:Ad,updateMany:wd,deleteOne:Td,deleteMany:Id,initialize:pd});m(this,"selectors",{selectById:Fd,selectByIds:_d})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}buildBulkPayload(e){return{uuid:e.uuid,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}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 sM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields");m(this,"url","/asset-procedure-step-fields");m(this,"actions",{addOne:Rd,addMany:Md,setOne:kd,setMany:Ed,updateOne:vd,updateMany:Vd,deleteOne:Bd,deleteMany:Wd,initialize:bd});m(this,"selectors",{selectById:zd,selectByIds:qd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}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 d=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[r,d]}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:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(r)),d}}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 iM extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values Attachment");m(this,"url","/asset-procedure-step-field-values-attachments");m(this,"actions",{addOne:Cd,addMany:Ks,setOne:Ud,setMany:Ld,updateOne:Nd,updateMany:Gd,deleteOne:Hd,deleteMany:Ys,initialize:$d});m(this,"selectors",{selectById:Yd,selectByIds:Jd})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.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:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class nM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values");m(this,"url","/asset-procedure-step-field-values");m(this,"actions",{addOne:el,addMany:tl,setOne:sl,setMany:il,updateOne:nl,updateMany:al,deleteOne:cl,deleteMany:rl,initialize:xd});m(this,"selectors",{selectById:ll,selectByIds:ul})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=mt(a,Math.min(n??a.length,ot)),T=[];for(const g of f){const k=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),k.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,asset_procedure_step:b.asset_procedure_step,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:c,field_values:k})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:k}=g,b=k.map(({asset:v})=>v),z=k.map(({fields_revision:v})=>v),j=k.map(({asset_procedure:v})=>v),W=k.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Zd(e)(d);this.dispatch(a(e)),this.dispatch(Ys(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ks(u)),p}}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 aM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step");m(this,"url","/asset-procedure-steps");m(this,"actions",{addOne:fl,addMany:Sl,setOne:ml,setMany:yl,updateOne:Al,updateMany:wl,deleteOne:Tl,deleteMany:Il,initialize:pl});m(this,"selectors",{selectById:Fl,selectByIds:_l})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.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 l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const y=gl(e)(u);this.dispatch(d(e)),this.dispatch(a(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(p)),this.dispatch(c(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class cM extends M{constructor(){super(...arguments);m(this,"url","/assets");m(this,"name","Asset");m(this,"actions",{addOne:Rl,addMany:ei,setOne:vl,setMany:Vl,updateOne:Ml,updateMany:kl,deleteOne:El,deleteMany:ti,initialize:bl});m(this,"selectors",{selectById:zl,selectByIds:ql})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const u=Oc(e)(d),p=zy(e)(d);this.dispatch(c(e)),this.dispatch(gs(V(u))),this.dispatch(ft(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(_s(u)),this.dispatch(yt(p)),y}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=ht.v4(),d=mt(e,Math.min(n??e.length,ot)).map(p=>{const y=p.map(f=>O(f));return{batchId:ht.v4(),payload:{transaction_id:r,submitted_at:c,assets:y}}}),l=[];let u=null;for(const p of d){const{batchId:y,payload:f}=p,T=f.assets.map(({uuid:b})=>b),P=f.assets.map(({asset_type:b})=>b),E=f.assets.map(({project:b})=>b),g=f.assets.map(({status:b})=>b),k=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(P).concat(E).concat(g),blocks:[y].concat(T)});u=p.batchId,l.push(k)}return Promise.all(l).then(p=>{const y=p.flat();this.dispatch(a(y))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Nt);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(Ts);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} assets that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=mt(e,Math.min(n??e.length,ot)),y=[];let f=null;for(const T of p){const P=ht.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(k),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids: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 rM extends M{constructor(){super(...arguments);m(this,"name","Asset Stage Completion");m(this,"url","/asset-stage-completions");m(this,"actions",{addOne:Cl,addMany:Ul,setOne:Ll,setMany:Nl,updateOne:Gl,updateMany:Hl,deleteOne:Kl,deleteMany:Yl,initialize:$l});m(this,"selectors",{selectById:Xl,selectByIds:xl})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}bulkAdd(e){var T;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((T=n.getState().userReducer.currentUser)==null?void 0:T.id)??null,u=e.map(P=>O(P)),p=u.map(P=>({...P,created_by:l,submitted_at:d})),y=p.map(({uuid:P})=>P);this.dispatch(a(p));const f=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:u},blockers:[...e.map(P=>P.asset_procedure),...e.map(P=>P.asset_stage),...e.map(P=>P.asset)],blocks:y});return f.then(P=>{this.dispatch(c(P))}).catch(()=>{this.dispatch(r(y))}),[p,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 dM extends M{constructor(){super(...arguments);m(this,"name","Asset Stage");m(this,"url","/asset-stages");m(this,"actions",{addOne:nu,addMany:au,setOne:su,setMany:iu,updateOne:cu,updateMany:ru,deleteOne:du,deleteMany:lu,initialize:tu});m(this,"selectors",{selectById:ou,selectByIds:hu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class lM extends q{constructor(){super(...arguments);m(this,"name","Asset Type Attachment");m(this,"url","/asset-type-attachments");m(this,"actions",{addOne:yu,addMany:ri,setOne:fu,setMany:Su,updateOne:Au,updateMany:wu,deleteOne:Tu,deleteMany:di,initialize:mu});m(this,"selectors",{selectById:Ou,selectByIds:Fu})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class uM extends q{constructor(){super(...arguments);m(this,"name","Asset Type Fields Attachment");m(this,"url","/asset-type-fields-attachments");m(this,"actions",{addOne:Ru,addMany:Mu,setOne:ku,setMany:Eu,updateOne:vu,updateMany:Vu,deleteOne:Bu,deleteMany:Wu,initialize:bu});m(this,"selectors",{selectById:qu,selectByIds:Du})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}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 oM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Fields");m(this,"url","/asset-type-fields");m(this,"actions",{addOne:Uu,addMany:Lu,setOne:Nu,setMany:Gu,updateOne:Hu,updateMany:Ku,deleteOne:Yu,deleteMany:Ju,initialize:Cu});m(this,"selectors",{selectById:Qu,selectByIds:Xu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}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 hM extends q{constructor(){super(...arguments);m(this,"name","Asset Type Field Values Attachment");m(this,"url","/asset-type-field-values-attachments");m(this,"actions",{addOne:so,addMany:mi,setOne:io,setMany:no,updateOne:ao,updateMany:co,deleteOne:ro,deleteMany:yi,initialize:to});m(this,"selectors",{selectById:uo,selectByIds:oo})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.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:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class pM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Field Values");m(this,"url","/asset-type-field-values");m(this,"actions",{addOne:fo,addMany:So,setOne:Ao,setMany:wo,updateOne:To,updateMany:Io,deleteOne:Oo,deleteMany:Fo,initialize:yo});m(this,"selectors",{selectById:go,selectByIds:Po})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=[],y=mt(a,Math.min(n??a.length,ot)),f=[];for(const E of y){const g=[];for(const k of E){const b=O({...k,values:k.values,created_by:((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,submitted_at:u});p.push(b),g.push({uuid:b.uuid,asset:k.asset,fields_revision:k.fields_revision,published_at:k.published_at,values:b.values})}f.push({submitted_at:u,values:c,field_values:g})}this.dispatch(r(p));const T=[];for(const E of f){const{field_values:g}=E,k=g.map(({asset:W})=>W),b=g.map(({fields_revision:W})=>W),z=g.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:E,blockers:k.concat(b),blocks:z});T.push(j)}return Promise.all(T).then(E=>{this.dispatch(d(E.flat()))}).catch(()=>{this.dispatch(l(V(p)))}),[p,T]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=ho(e)(d);this.dispatch(a(e)),this.dispatch(yi(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(mi(u)),p}}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 mM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier");m(this,"url","/asset-type-identifiers");m(this,"actions",{addOne:ko,addMany:Eo,setOne:vo,setMany:Vo,updateOne:Bo,updateMany:Wo,deleteOne:zo,deleteMany:qo,initialize:Mo});m(this,"selectors",{selectById:jo,selectByIds:$o})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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 yM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier Value");m(this,"url","/asset-type-identifier-values");m(this,"actions",{addOne:No,addMany:Go,setOne:Ho,setMany:Ko,updateOne:Yo,updateMany:Jo,deleteOne:Zo,deleteMany:Qo,initialize:Lo});m(this,"selectors",{selectById:xo,selectByIds:eh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}bulkAdd(e,n){var E;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((E=a.getState().userReducer.currentUser)==null?void 0:E.id)??null,p=mt(e,Math.min(n??e.length,ot)),y=[],f=[];for(const g of p){const k=[],b=[],z=[];for(const W of g){const D=O({...W,submitted_at:l,created_by:u});f.push(D);const v={uuid:D.uuid,asset:D.asset,asset_type_identifier:D.asset_type_identifier,value:D.value};k.push(v),b.push(D.asset),b.push(D.asset_type_identifier),z.push(D.uuid)}const j={payloads:k,submitted_at:l,blockers:b,blocks:z};y.push(j)}this.dispatch(c(f));const T=y.map(g=>{const{payloads:k,submitted_at:b,blockers:z,blocks:j}=g;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:k},blockers:z,blocks:j})});Promise.all(T).then(g=>{this.dispatch(r(g.flat()))}).catch(g=>{throw this.dispatch(d(V(f))),g});const P=Promise.all(T).then(g=>g.flat());return[f,P]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class fM extends M{constructor(){super(...arguments);m(this,"name","Asset Type");m(this,"url","/asset-types");m(this,"actions",{addOne:ch,addMany:rh,setOne:nh,setMany:ah,updateOne:dh,updateMany:lh,deleteOne:uh,deleteMany:oh,initialize:ih});m(this,"selectors",{selectById:ph,selectByIds:mh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=Wl(e)(d),p=_u(e)(d);this.dispatch(a(e)),this.dispatch(ti(V(u))),this.dispatch(di(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(ei(u)),this.dispatch(ri(p)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class SM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Status");m(this,"url","/asset-type-statuses");m(this,"actions",{addOne:Ah,addMany:wh,setOne:Th,setMany:Ih,updateOne:Oh,updateMany:Fh,deleteOne:_h,deleteMany:gh,initialize:Sh});m(this,"selectors",{selectById:bh,selectByIds:Rh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class AM extends q{constructor(){super(...arguments);m(this,"name","Document Attachment");m(this,"url","/document-attachments");m(this,"actions",{addOne:Wh,addMany:zh,setOne:qh,setMany:Dh,updateOne:jh,updateMany:$h,deleteOne:Ch,deleteMany:Uh,initialize:Bh});m(this,"selectors",{selectById:Nh,selectByIds:Gh})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}async bulkAdd(e,n){const[a,c,r]=await super.bulkAdd(e,n),d={};for(const{file_sha1:l,uuid:u}of a)l in d||(d[l]=[]),d[l].push(u);return r.then(l=>{const u=l.flatMap(p=>d[p]??[]);for(const p of u)this.makeReadable(p)}),[a,c,r]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.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),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class wM extends M{constructor(){super(...arguments);m(this,"name","Document");m(this,"url","/documents");m(this,"actions",{addOne:Jh,addMany:Zh,setOne:Qh,setMany:Xh,updateOne:xh,updateMany:ep,deleteOne:tp,deleteMany:sp,initialize:Yh});m(this,"selectors",{selectById:np,selectByIds:ap})}add(e){var y;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const y=cp(e)(u);this.dispatch(a(e)),this.dispatch(d(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(p)),this.dispatch(r(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class Tt extends wt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class TM extends Tt{constructor(){super(...arguments);m(this,"name","Email Domains");m(this,"url","/organization-email-domains");m(this,"actions",{addOne:lp,addMany:up,setOne:op,setMany:hp,updateOne:pp,updateMany:mp,deleteOne:yp,deleteMany:fp,initialize:dp});m(this,"selectors",{selectById:Ap,selectByIds:wp})}async add(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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 IM extends wt{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const $t={},Ea=new Set;class OM extends wt{constructor(){super(...arguments);m(this,"host");m(this,"dbPromise",Lg.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async getDB(){return await this.dbPromise}async addCache(e){if(!e.name)throw new Error(`Cant add a file without a name to cache: ${e.name}`);if(!e.type)throw new Error(`Cant add a file without a type to cache: ${e.name}`);if(!e.size)throw new Error(`Cant add an empty file to cache: ${e.name}`);const n=await Lt(e);if(Ea.has(n))return;const a=await this.getDB();!!await a.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await a.put("files",e,n),Ea.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),Ea.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,a=n){const c=e.split("?")[0]??e,r=await this.fetchCache(n);if(r)return r;let d;c in $t?d=$t[c]:Za(e)?(d=Ja(e,a),$t[c]=d):(d=new Promise(p=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(y=>{const f=new File([y],a,{type:y.type});p(f)})}),$t[c]=d);let l;try{l=await d}catch(p){throw p instanceof C&&delete $t[c],p}const u=await Lt(l);if(u!==n){const p=`The hash of the file returned from the server (${u}) does not match the
8
8
  expected hash (${n}). This can happen if you're using a local development server and the
9
9
  isExternalUrl flag in the request details is set to true, because instead of requesting the local
10
10
  REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
11
11
  (with an uuid attached) being returned. Alternatively, you may be running with
12
12
  import.meta.env.PROD, which will result in some file requests being treated as
13
- external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(p)}return await this.addCache(l),l}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.processPresignedUrl(a,c);return n}async getFilePayload(e){const a={sha1:await Ct(e),file_type:e.type,extension:Na(e),size:e.size};return await this.client.files.addCache(e),a}}class tM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:Fp,addMany:_p,setOne:gp,setMany:Pp,updateOne:bp,updateMany:Rp,deleteOne:Mp,deleteMany:kp,initialize:Op});m(this,"selectors",{selectById:vp,selectByIds:Vp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.form],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{form__organization:e}},n);return this.dispatch(a(c)),c}}class sM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:qp,addMany:Dp,setOne:jp,setMany:$p,updateOne:Cp,updateMany:Up,deleteOne:Lp,deleteMany:Np,initialize:zp});m(this,"selectors",{selectById:Hp,selectByIds:Kp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class iM extends q{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:Qp,addMany:Xp,setOne:xp,setMany:em,updateOne:tm,updateMany:sm,deleteOne:im,deleteMany:nm,initialize:Zp});m(this,"selectors",{selectById:cm,selectByIds:rm})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}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 nM extends k{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:Wi,addMany:zi,setOne:om,setMany:hm,updateOne:pm,updateMany:mm,deleteOne:qi,deleteMany:Di,initialize:um});m(this,"selectors",{selectById:ym,selectByIds:fm})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class aM extends k{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:Im,addMany:Om,setOne:Fm,setMany:_m,updateOne:gm,updateMany:Pm,deleteOne:bm,deleteMany:Rm,initialize:Tm});m(this,"selectors",{selectById:Em,selectByIds:vm})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=O({...e,submitted_at:d,created_by:l}),p=O({...n,form:u.uuid,submitted_at:d,created_by:l});this.dispatch(c(u)),this.dispatch(Wi(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...R(u),initial_revision:{uuid:p.uuid,submitted_at:p.submitted_at,title:p.title,description:p.description,fields:p.fields}},blockers:[],blocks:[u.uuid,p.uuid]});return y.catch(T=>{throw this.dispatch(r(u.uuid)),this.dispatch(qi(p.uuid)),T}),[u,p,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error("Expected form to exist");const u=sy(e)(d),p=Sm(e)(d);this.dispatch(a(e)),this.dispatch(Zi(V(u))),this.dispatch(Di(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(zi(p)),this.dispatch(Ji(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class cM extends q{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:Wm,addMany:Li,setOne:zm,setMany:qm,updateOne:Dm,updateMany:jm,deleteOne:$m,deleteMany:Ni,initialize:Bm});m(this,"selectors",{selectById:Cm,selectByIds:Um})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=Ki(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 rM extends k{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:Jm,addMany:Ji,setOne:Km,setMany:Ym,updateOne:Zm,updateMany:Qm,deleteOne:Xm,deleteMany:Zi,initialize:Hm});m(this,"selectors",{selectById:ey,selectByIds:ty})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Lm(e)(d);this.dispatch(a(e)),this.dispatch(Ni(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Li(u)),p}}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 dM extends q{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:dy,addMany:ly,setOne:cy,setMany:ry,updateOne:uy,updateMany:oy,deleteOne:hy,deleteMany:py,initialize:ay});m(this,"selectors",{selectById:yy,selectByIds:fy})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class lM extends k{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:_y,addMany:mt,setOne:Iy,setMany:Ty,updateOne:Oy,updateMany:Fy,deleteOne:gy,deleteMany:yt,initialize:wy});m(this,"selectors",{selectById:by,selectByIds:Ry})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 uM extends q{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:qy,addMany:sn,setOne:Dy,setMany:jy,updateOne:$y,updateMany:Cy,deleteOne:Uy,deleteMany:nn,initialize:zy});m(this,"selectors",{selectById:Gy,selectByIds:Hy})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class oM extends q{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:Zy,addMany:Qy,setOne:Xy,setMany:xy,updateOne:ef,updateMany:tf,deleteOne:sf,deleteMany:nf,initialize:Jy});m(this,"selectors",{selectById:cf,selectByIds:rf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class hM extends k{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:of,addMany:hf,setOne:pf,setMany:mf,updateOne:yf,updateMany:ff,deleteOne:Sf,deleteMany:Af,initialize:uf});m(this,"selectors",{selectById:wf,selectByIds:Tf})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue],blocks:[d.uuid]});return l.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 pM extends k{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:_f,addMany:on,setOne:gf,setMany:Pf,updateOne:bf,updateMany:Rf,deleteOne:Mf,deleteMany:hn,initialize:Ff});m(this,"selectors",{selectById:Ef,selectByIds:vf})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=new Date().toISOString(),u=((f=d.userReducer.currentUser)==null?void 0:f.id)??null,p=O({...e,submitted_at:l,created_by:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[p.project,p.issue_type,p.status],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(T=>{throw this.dispatch(r(p.uuid)),T}),[p,y]}update(e){var y;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 d={...r,...e};this.dispatch(n(d));const l={};for(const f of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(f in e&&e[f]!==r[f])switch(f){case $.PRIORITY:l[f]=e[f];break;case $.DUE_DATE:l[f]=e[f];break;case $.DESCRIPTION:l[f]=e[f];break;case $.TITLE:l[f]=e[f];break;case $.STATUS:{const T=e[f],P=kn(T)(c);if(!P)throw new Error(`Trying to update issue type status with ${T} which does not exist in store`);l[f]={name:P.name,color:P.color,uuid:P.uuid};break}case $.ASSIGNED_TO:{const T=e[f];if(T===null)l[f]=null;else{const P=cs(T)(c);if(!P)throw new Error(`Trying to update assigned to with ${T} which does not exist in store.`);l[f]={full_name:P.username,id:P.id}}break}}const u=O({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(vn(u));const p=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(Bn(u.uuid))}),[d,p]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Ut);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(As);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} issues that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=pt(e,Math.min(n??e.length,ut)),y=[];let f=null;for(const T of p){const P=ot.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),M=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(M),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const u=My(e)(d),p=vy(e)(d),y=Ny(e)(d),f=aw(e)(d);this.dispatch(a(e)),this.dispatch(nn(V(y))),this.dispatch(Wn(V(f))),this.dispatch(yt(V(u))),this.dispatch(yt(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(T){throw this.dispatch(c(l)),this.dispatch(sn(y)),this.dispatch(Vn(f)),this.dispatch(mt(u)),this.dispatch(mt(p)),T}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d),u=ky(e)(d),p=Ey(e)(d);this.dispatch(c(e)),this.dispatch(yt(V(u))),this.dispatch(yt(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(mt(u)),this.dispatch(mt(p)),y}}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 mM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:qf,addMany:Df,setOne:jf,setMany:$f,updateOne:Cf,updateMany:Uf,deleteOne:Lf,deleteMany:Nf,initialize:zf});m(this,"selectors",{selectById:Hf,selectByIds:Kf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class yM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:Qf,addMany:Xf,setOne:xf,setMany:eS,updateOne:tS,updateMany:sS,deleteOne:iS,deleteMany:nS,initialize:Zf});m(this,"selectors",{selectById:cS,selectByIds:rS})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}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 fM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:gS,addMany:PS,setOne:bS,setMany:RS,updateOne:MS,updateMany:kS,deleteOne:ES,deleteMany:vS,initialize:_S});m(this,"selectors",{selectById:BS,selectByIds:WS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}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 SM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:jS,addMany:Tn,setOne:$S,setMany:CS,updateOne:US,updateMany:LS,deleteOne:NS,deleteMany:In,initialize:DS});m(this,"selectors",{selectById:HS,selectByIds:KS})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.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:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class AM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:oS,addMany:hS,setOne:pS,setMany:mS,updateOne:yS,updateMany:fS,deleteOne:SS,deleteMany:AS,initialize:uS});m(this,"selectors",{selectById:TS,selectByIds:IS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.issue,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=YS(e)(d);this.dispatch(a(e)),this.dispatch(In(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Tn(u)),p}}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 wM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:XS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:aA,initialize:QS});m(this,"selectors",{selectById:rA,selectByIds:dA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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 TM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:hA,addMany:pA,setOne:mA,setMany:yA,updateOne:fA,updateMany:SA,deleteOne:AA,deleteMany:wA,initialize:oA});m(this,"selectors",{selectById:IA,selectByIds:OA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class IM extends k{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:PA,addMany:bA,setOne:RA,setMany:MA,updateOne:kA,updateMany:EA,deleteOne:vA,deleteMany:VA,initialize:gA});m(this,"selectors",{selectById:WA,selectByIds:zA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,submitted_at:u,created_by:l});this.dispatch(a(p));const y=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=Vf(e)(d);this.dispatch(a(e)),this.dispatch(hn(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(on(u)),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 OM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:$A,addMany:CA,setOne:UA,setMany:LA,updateOne:NA,updateMany:GA,deleteOne:HA,deleteMany:KA,initialize:jA});m(this,"selectors",{selectById:kn,selectByIds:JA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class FM extends k{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:vn,addMany:Vn,setOne:xA,setMany:ew,updateOne:tw,updateMany:sw,deleteOne:Bn,deleteMany:Wn,initialize:XA});m(this,"selectors",{selectById:iw,selectByIds:nw})}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 _M=1800;function gM(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 PM extends FR{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:h.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(Rh(!1)),this.clearTokens(),this.dispatch(I()),this.dispatch(I())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=bg(e).exp??n}catch{a=n}return a-n<_M}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 C&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??Ot).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 C({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 C({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=ot.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:h.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(gM(a))})}}class bM extends At{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:Tw,addMany:Iw,setOne:Ow,setMany:Fw,updateOne:_w,updateMany:gw,deleteOne:Pw,deleteMany:bw,initialize:ww});m(this,"selectors",{selectById:Mw,selectByIds:kw})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d),u=cs(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch($n(l.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(jn(u)),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 RM extends At{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:qw,addMany:zw,setOne:Ww,setMany:Bw,updateOne:jw,updateMany:Dw,deleteOne:$w,deleteMany:Cw,initialize:Vw});m(this,"selectors",{selectById:Nw,selectByIds:Gw})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.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 MM extends k{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:tT,addMany:sT,setOne:iT,setMany:nT,updateOne:aT,updateMany:cT,deleteOne:rT,deleteMany:dT,initialize:eT});m(this,"selectors",{selectById:uT,selectByIds:oT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.organization_access,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(p=>{throw this.dispatch(r(d.uuid)),p}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>R(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(r(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class kM extends q{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:mT,addMany:yT,setOne:fT,setMany:ST,updateOne:AT,updateMany:wT,deleteOne:TT,deleteMany:IT,initialize:pT});m(this,"selectors",{selectById:FT,selectByIds:_T})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class EM extends q{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:kT,addMany:ET,setOne:RT,setMany:MT,updateOne:vT,updateMany:VT,deleteOne:BT,deleteMany:WT,initialize:bT});m(this,"selectors",{selectById:DT,selectByIds:jT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[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 vM extends At{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:HT,addMany:GT,setOne:NT,setMany:LT,updateOne:YT,updateMany:KT,deleteOne:JT,deleteMany:ZT,initialize:UT});m(this,"selectors",{selectById:xT,selectByIds:eI})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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 VM extends k{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:nI,addMany:aI,setOne:cI,setMany:rI,updateOne:dI,updateMany:lI,deleteOne:uI,deleteMany:oI,initialize:iI});m(this,"selectors",{selectById:mI,selectByIds:yI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.team],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>R(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.map(y=>y.uuid)))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}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 BM extends k{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:AI,addMany:wI,setOne:TI,setMany:II,updateOne:OI,updateMany:FI,deleteOne:_I,deleteMany:gI,initialize:SI});m(this,"selectors",{selectById:bI,selectByIds:RI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class WM extends At{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:jn,addMany:ow,setOne:uw,setMany:lw,updateOne:pw,updateMany:hw,deleteOne:$n,deleteMany:mw,initialize:dw});m(this,"selectors",{selectById:cs,selectByIds:Sw})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:h.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}}class zM extends k{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:BI,addMany:WI,setOne:zI,setMany:qI,updateOne:DI,updateMany:jI,deleteOne:$I,deleteMany:CI,initialize:VI});m(this,"selectors",{selectById:LI,selectByIds:NI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type,d.project],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 qM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:YI,addMany:JI,setOne:ZI,setMany:QI,updateOne:XI,updateMany:xI,deleteOne:eO,deleteMany:tO,initialize:KI});m(this,"selectors",{selectById:iO,selectByIds:nO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(V(u)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class DM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:dO,addMany:lO,setOne:uO,setMany:oO,updateOne:hO,updateMany:pO,deleteOne:mO,deleteMany:yO,initialize:rO});m(this,"selectors",{selectById:SO,selectByIds:AO})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class jM extends At{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:OO,addMany:FO,setOne:_O,setMany:gO,updateOne:PO,updateMany:bO,deleteOne:RO,deleteMany:MO,initialize:IO});m(this,"selectors",{selectById:EO,selectByIds:vO})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class $M extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:zO,addMany:ca,setOne:qO,setMany:DO,updateOne:jO,updateMany:$O,deleteOne:CO,deleteMany:ra,initialize:WO});m(this,"selectors",{selectById:NO,selectByIds:GO})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class CM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:JO,addMany:ZO,setOne:QO,setMany:XO,updateOne:xO,updateMany:eF,deleteOne:tF,deleteMany:sF,initialize:YO});m(this,"selectors",{selectById:nF,selectByIds:aF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const u=LO(e)(d);this.dispatch(a(e)),this.dispatch(ra(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(ca(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class UM extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:lF,addMany:oa,setOne:uF,setMany:oF,updateOne:hF,updateMany:pF,deleteOne:mF,deleteMany:ha,initialize:dF});m(this,"selectors",{selectById:fF,selectByIds:SF})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class LM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review Request");m(this,"url","/workflow-step-field-values-review-requests");m(this,"actions",{addOne:zF,addMany:fa,setOne:qF,setMany:DF,updateOne:jF,updateMany:$F,deleteOne:CF,deleteMany:Sa,initialize:WF});m(this,"selectors",{selectById:LF,selectByIds:NF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class NM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review");m(this,"url","/workflow-step-field-values-reviews");m(this,"actions",{addOne:JF,addMany:wa,setOne:ZF,setMany:QF,updateOne:XF,updateMany:xF,deleteOne:e_,deleteMany:Ta,initialize:YF});m(this,"selectors",{selectById:s_,selectByIds:i_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class GM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:OF,addMany:FF,setOne:_F,setMany:gF,updateOne:PF,updateMany:bF,deleteOne:RF,deleteMany:MF,initialize:IF});m(this,"selectors",{selectById:EF,selectByIds:vF})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()}),u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.workflow,l.workflow_step,l.fields_revision],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const u=AF(e)(d),p=n_(e)(d),y=GF(e)(d);this.dispatch(a(e)),this.dispatch(ha(V(u))),this.dispatch(Ta(V(p))),this.dispatch(Sa(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(oa(u)),this.dispatch(wa(p)),this.dispatch(fa(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class HM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:d_,addMany:l_,setOne:u_,setMany:o_,updateOne:h_,updateMany:p_,deleteOne:m_,deleteMany:y_,initialize:r_});m(this,"selectors",{selectById:S_,selectByIds:A_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class KM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:O_,addMany:F_,setOne:__,setMany:g_,updateOne:P_,updateMany:b_,deleteOne:R_,deleteMany:M_,initialize:I_});m(this,"selectors",{selectById:E_,selectByIds:v_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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 workflow step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class YM extends k{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:z_,addMany:q_,setOne:D_,setMany:j_,updateOne:$_,updateMany:C_,deleteOne:U_,deleteMany:L_,initialize:W_});m(this,"selectors",{selectById:G_,selectByIds:H_})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(y=>{this.dispatch(c(y))}).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 workflow type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function Ma(t,s,e,n,a){const c=n instanceof St;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:p,queryParams:y,attachmentHash:f,isExternalUrl:T,isAuthNeeded:P,isResponseBlob:E}={...r,...s};let g=s.url;const M=f?await e.files.fetchCache(f):void 0;if(f&&!M)throw new Error(`Cannot upload file ${f} because it's not cached.`);!T&&!g.startsWith("http")&&(!g.startsWith("/")&&!g.startsWith("blob:")&&(g="/"+g),g=t+g);const b=v=>{if(f){if(!d)throw new Error(`No S3 URL for file ${f}`);if("warning"in d)throw new Error(`S3 URL warning for file ${f}`);if(!M)throw new Error(`No file for file ${f}`);const L=d.fields["x-amz-checksum-sha1"];if(!L)throw new Error(`No checksum for file ${f}`);return v.set("x-amz-checksum-sha1",L).field({...l,...d.fields}).attach("file",M)}return v.send(l)},j={[h.GET]:()=>E?Tt.get(g.toString()).responseType("blob"):Tt.get(g.toString()),[h.POST]:()=>{const v=Tt.post(g.toString());return b(v)},[h.PATCH]:()=>{const v=Tt.patch(g.toString());return b(v)},[h.PUT]:()=>{const v=Tt.put(g.toString());return b(v)},[h.DELETE]:()=>{const v=Tt.delete(g.toString());return b(v)}}[p];let W=j();const D=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",D),P&&c){const v=n.auth.getAuthHeader();W=W.set("Authorization",v)}u&&(W=W.set(u));try{return await W.query(y)}catch(v){const L=dg(v),hs=L==null?void 0:L.status;if(c&&hs===401)return await n.auth.handleUnauthorized(W,L),W.query(y);throw new C({response:L,innerError:v,discard:ba.includes(hs)})}finally{a==null||a.removeEventListener("abort",D)}}class JM{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new ms,r={...e,uuid:e.uuid??ot.v4()};return Ma(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??Ot).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof C)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof C)throw a;return a})}_enqueueRequest(s,e,n){const a=new ms,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(Jw(c)),d=u=>{if(u)a.resolve(u.body);else{const p=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(p)}},l=u=>{u instanceof C?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
14
- Converting error to APIError and discarding.`),u=new C({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return r.then(d,l),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,l=[];let u=await this.performRequest(s,r,a,c);for(l.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:d},a,c),l.push(u.results);return l}}class Ft{constructor(){m(this,"graph");m(this,"requestAttemptCounter");this.graph=new Rg.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Ft;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(d=>a.payload.blockers.includes(d))&&Ft._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Ft._addDependency(s,e,this.graph)}static _addDependency(s,e,n){if(s===e)throw new Error(`Tried to add dependency from node to itself: ${s}`);if(!n.hasNode(s))throw new Error(`Tried to add dependency from non-existent node: ${s} (to node: ${e})`);if(!n.hasNode(e))throw new Error(`Tried to add dependency to non-existent node: ${e} (from node: ${s})`);n.addDependency(s,e)}addRequest(s){if(this.graph.addNode(s.payload.uuid,s),!(s.payload.blockers.length===0||this.graph.size()===1))for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&this._addDependency(s.payload.uuid,e)}}insertRequest(s){this.graph.addNode(s.payload.uuid,s);for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let lg;function ug(t){lg=t}function _t(){return lg}let og;function hg(t){og=t}function pg(){return og}let ka=null;function wt(){const t=_t();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(ka)return ka;const s=t.getState().offline.outbox,e=Ft._fromOutbox(s);return ka=e,e}const ZM=(t,s)=>{const e=new s(t);return hg(e),ug(t),e};class QM{constructor(s){m(this,"_all");m(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 Ea{constructor(){m(this,"next");this.next=null}then(s){return new QM(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!_t())throw new Error("Client store not set");const n=pg();if(!n)throw new Error("Client SDK not set");return ag(s,n)}}}class mg extends Ea{async run(s){return super.run(s)}}class yg extends Ea{async run(s){return super.run(s)}}const fg=new mg().then(new yg).compile();function Sg(t){var s;return(s=fg[0])==null?void 0:s.run(t)}var Ag=(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))(Ag||{});i.ALL_MIDDLEWARE=fg,i.APIError=C,i.AgentService=_R,i.AssetAttachmentService=gR,i.AssetProcedureService=ER,i.AssetProcedureStepFieldValuesAttachmentService=WR,i.AssetProcedureStepFieldValuesService=zR,i.AssetProcedureStepFieldsAttachmentService=VR,i.AssetProcedureStepFieldsService=BR,i.AssetProcedureStepService=qR,i.AssetProcedureTypeAttachmentService=PR,i.AssetProcedureTypeFieldValuesAttachmentService=MR,i.AssetProcedureTypeFieldValuesService=kR,i.AssetProcedureTypeFieldsAttachmentService=bR,i.AssetProcedureTypeFieldsService=RR,i.AssetProcedureTypeService=vR,i.AssetService=DR,i.AssetStageCompletionService=jR,i.AssetStageService=$R,i.AssetStatusType=Da,i.AssetTypeAttachmentService=CR,i.AssetTypeFieldValuesAttachmentService=NR,i.AssetTypeFieldValuesService=GR,i.AssetTypeFieldsAttachmentService=UR,i.AssetTypeFieldsService=LR,i.AssetTypeIdentifierService=HR,i.AssetTypeIdentifierValueService=KR,i.AssetTypeService=YR,i.AssetTypeStatusService=JR,i.AttachmentModel=ja,i.BaseApiService=St,i.BaseModelApiService=At,i.BaseOfflineFileModelApiService=q,i.BaseOfflineModelApiService=k,i.BaseSDK=JM,i.COMMON_AUTO_FIELDS=Ja,i.DEFAULT_ISSUE_PRIORITY=Mg,i.DEFAULT_PAGE_SIZE=J_,i.DISCARD_HTTP_STATUSES=ba,i.DeferredPromise=ms,i.DocumentAttachmentService=ZR,i.DocumentService=QR,i.EMPTY_ARRAY=Wa,i.EMPTY_OBJECT=za,i.EmailDomainsService=XR,i.EmailVerificationService=xR,i.FILE_MODEL_DEFAULT_PAGE_SIZE=Z_,i.FileService=eM,i.FormIdentifierService=tM,i.FormIdentifierValueService=sM,i.FormRevisionAttachmentService=iM,i.FormRevisionService=nM,i.FormService=aM,i.FormSubmissionAttachmentService=cM,i.FormSubmissionService=rM,i.GeoImageService=dM,i.HttpMethod=h,i.IssueAssociationService=lM,i.IssueAttachmentService=uM,i.IssueCommentAttachmentService=oM,i.IssueCommentService=hM,i.IssuePriority=ps,i.IssueService=pM,i.IssueStatusType=$a,i.IssueTypeAttachmentService=mM,i.IssueTypeFieldValuesAttachmentService=SM,i.IssueTypeFieldValuesService=AM,i.IssueTypeFieldsAttachmentService=yM,i.IssueTypeFieldsService=fM,i.IssueTypeIdentifierService=wM,i.IssueTypeIdentifierValueService=TM,i.IssueTypeService=IM,i.IssueTypeStatusService=OM,i.IssueUpdateChange=$,i.IssueUpdateService=FM,i.JWTService=PM,i.MAX_SERVICE_BATCH_SIZE=ut,i.OUTBOX_RETRY_DELAY=Ua,i.OfflineAnalyticsMiddleware=mg,i.OfflineMiddleware=Ea,i.OrganizationAccessLevel=qa,i.OrganizationAccessService=bM,i.OrganizationService=RM,i.OutboxCoordinator=Ft,i.ProjectAccessService=MM,i.ProjectAttachmentService=kM,i.ProjectFileService=EM,i.ProjectService=vM,i.RESET_ORGANIZATION_STATE=_,i.RESET_PROJECT_STATE=B,i.RESET_STATE=I,i.RateLimitingMiddleware=yg,i.SelectorBuilder=eP,i.TeamMembershipService=VM,i.TeamService=BM,i.UNKNOWN_ERROR_MESSAGE=Ot,i.UserService=WM,i.VERSION_REDUCER_KEY=Rt,i.VerificationCodeType=Ag,i.WORKFLOW_STATUSES=Eg,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=kg,i.WorkflowService=zM,i.WorkflowStatus=Pt,i.WorkflowStepAssigneeService=qM,i.WorkflowStepCommentService=DM,i.WorkflowStepEventService=jM,i.WorkflowStepEventType=Ca,i.WorkflowStepFieldValuesAttachmentService=UM,i.WorkflowStepFieldValuesReviewRequestService=LM,i.WorkflowStepFieldValuesReviewService=NM,i.WorkflowStepFieldValuesReviewType=bt,i.WorkflowStepFieldValuesService=GM,i.WorkflowStepFieldsAttachmentService=$M,i.WorkflowStepFieldsService=CM,i.WorkflowStepReviewerService=HM,i.WorkflowStepService=KM,i.WorkflowTypeService=YM,i._setLatestRetryTime=Qw,i.addAsset=gl,i.addAssetAttachment=uc,i.addAssetAttachments=Os,i.addAssetProcedure=Dr,i.addAssetProcedureStep=pl,i.addAssetProcedureStepFieldValues=Qd,i.addAssetProcedureStepFieldValuesAttachment=Dd,i.addAssetProcedureStepFieldValuesAttachments=Gs,i.addAssetProcedureStepFieldValuesMany=Xd,i.addAssetProcedureStepFields=gd,i.addAssetProcedureStepFieldsAttachment=od,i.addAssetProcedureStepFieldsAttachments=hd,i.addAssetProcedureStepFieldsMany=Pd,i.addAssetProcedureSteps=ml,i.addAssetProcedureType=Qr,i.addAssetProcedureTypeAttachment=Fc,i.addAssetProcedureTypeAttachments=_c,i.addAssetProcedureTypeFieldValues=_r,i.addAssetProcedureTypeFieldValuesAttachment=or,i.addAssetProcedureTypeFieldValuesAttachments=Es,i.addAssetProcedureTypeFieldValuesMany=gr,i.addAssetProcedureTypeFields=Qc,i.addAssetProcedureTypeFieldsAttachment=qc,i.addAssetProcedureTypeFieldsAttachments=Dc,i.addAssetProcedureTypeFieldsMany=Xc,i.addAssetProcedureTypes=Xr,i.addAssetProcedures=zs,i.addAssetStage=tu,i.addAssetStageCompletion=Dl,i.addAssetStageCompletions=jl,i.addAssetStages=su,i.addAssetType=ih,i.addAssetTypeAttachment=hu,i.addAssetTypeAttachments=ai,i.addAssetTypeFieldValues=po,i.addAssetTypeFieldValuesAttachment=xu,i.addAssetTypeFieldValuesAttachments=hi,i.addAssetTypeFieldValuesMany=mo,i.addAssetTypeFields=ju,i.addAssetTypeFieldsAttachment=gu,i.addAssetTypeFieldsAttachments=Pu,i.addAssetTypeFieldsMany=$u,i.addAssetTypeIdentifier=bo,i.addAssetTypeIdentifierValue=Co,i.addAssetTypeIdentifierValues=Uo,i.addAssetTypeIdentifiers=Ro,i.addAssetTypeStatus=yh,i.addAssetTypeStatuses=fh,i.addAssetTypes=nh,i.addAssets=Xs,i.addConversation=nc,i.addConversations=tP,i.addDocument=Hh,i.addDocumentAttachment=vh,i.addDocumentAttachments=Vh,i.addDocuments=Kh,i.addEmailDomain=cp,i.addEmailDomains=rp,i.addForm=Im,i.addFormIdentifier=Fp,i.addFormIdentifierValue=qp,i.addFormIdentifierValues=Dp,i.addFormIdentifiers=_p,i.addFormRevision=Wi,i.addFormRevisionAttachment=Qp,i.addFormRevisionAttachments=Xp,i.addFormRevisions=zi,i.addFormSubmission=Jm,i.addFormSubmissionAttachment=Wm,i.addFormSubmissionAttachments=Li,i.addFormSubmissions=Ji,i.addForms=Om,i.addGeoImage=dy,i.addGeoImages=ly,i.addIssue=_f,i.addIssueAssociation=_y,i.addIssueAssociations=mt,i.addIssueAttachment=qy,i.addIssueAttachments=sn,i.addIssueComment=of,i.addIssueCommentAttachment=Zy,i.addIssueCommentAttachments=Qy,i.addIssueComments=hf,i.addIssueType=PA,i.addIssueTypeAttachment=qf,i.addIssueTypeAttachments=Df,i.addIssueTypeFieldValues=oS,i.addIssueTypeFieldValuesAttachment=jS,i.addIssueTypeFieldValuesAttachments=Tn,i.addIssueTypeFieldValuesMany=hS,i.addIssueTypeFields=gS,i.addIssueTypeFieldsAttachment=Qf,i.addIssueTypeFieldsAttachments=Xf,i.addIssueTypeFieldsMany=PS,i.addIssueTypeIdentifier=XS,i.addIssueTypeIdentifierValue=hA,i.addIssueTypeIdentifierValues=pA,i.addIssueTypeIdentifiers=xS,i.addIssueTypeStatus=$A,i.addIssueTypeStatuses=CA,i.addIssueTypes=bA,i.addIssueUpdate=vn,i.addIssueUpdates=Vn,i.addIssues=on,i.addOrganization=qw,i.addOrganizationAccess=Tw,i.addOrganizationAccesses=Iw,i.addOrganizations=zw,i.addProject=HT,i.addProjectAccess=tT,i.addProjectAccesses=sT,i.addProjectAttachment=mT,i.addProjectAttachments=yT,i.addProjectFile=kT,i.addProjectFiles=ET,i.addProjects=GT,i.addTeam=AI,i.addTeamMembership=nI,i.addTeamMemberships=aI,i.addTeams=wI,i.addUser=jn,i.addUsers=ow,i.addWorkflow=BI,i.addWorkflowStep=O_,i.addWorkflowStepAssignee=YI,i.addWorkflowStepAssignees=JI,i.addWorkflowStepComment=dO,i.addWorkflowStepComments=lO,i.addWorkflowStepEvent=OO,i.addWorkflowStepEvents=FO,i.addWorkflowStepFieldValues=OF,i.addWorkflowStepFieldValuesAttachment=lF,i.addWorkflowStepFieldValuesAttachments=oa,i.addWorkflowStepFieldValuesMany=FF,i.addWorkflowStepFieldValuesReview=JF,i.addWorkflowStepFieldValuesReviewRequest=zF,i.addWorkflowStepFieldValuesReviewRequests=fa,i.addWorkflowStepFieldValuesReviews=wa,i.addWorkflowStepFields=JO,i.addWorkflowStepFieldsAttachment=zO,i.addWorkflowStepFieldsAttachments=ca,i.addWorkflowStepFieldsMany=ZO,i.addWorkflowStepReviewer=d_,i.addWorkflowStepReviewers=l_,i.addWorkflowSteps=F_,i.addWorkflowType=z_,i.addWorkflowTypes=q_,i.addWorkflows=WI,i.agentsReducer=rc,i.agentsSlice=ws,i.areArraysEqual=Wg,i.assetAttachmentReducer=Tc,i.assetAttachmentSlice=Is,i.assetProcedureReducer=Nr,i.assetProcedureSlice=Ws,i.assetProcedureStepFieldValuesAttachmentReducer=Yd,i.assetProcedureStepFieldValuesAttachmentSlice=Ns,i.assetProcedureStepFieldValuesReducer=dl,i.assetProcedureStepFieldValuesSlice=Ys,i.assetProcedureStepFieldsAttachmentReducer=Od,i.assetProcedureStepFieldsAttachmentSlice=$s,i.assetProcedureStepFieldsReducer=Wd,i.assetProcedureStepFieldsSlice=Us,i.assetProcedureStepReducer=wl,i.assetProcedureStepSlice=Js,i.assetProcedureTypeAttachmentReducer=Ec,i.assetProcedureTypeAttachmentSlice=gs,i.assetProcedureTypeFieldValuesAttachmentReducer=Sr,i.assetProcedureTypeFieldValuesAttachmentSlice=ks,i.assetProcedureTypeFieldValuesReducer=vr,i.assetProcedureTypeFieldValuesSlice=Bs,i.assetProcedureTypeFieldsAttachmentReducer=Gc,i.assetProcedureTypeFieldsAttachmentSlice=bs,i.assetProcedureTypeFieldsReducer=ar,i.assetProcedureTypeFieldsSlice=Ms,i.assetProcedureTypeReducer=ad,i.assetProcedureTypeSlice=Ds,i.assetReducer=Wl,i.assetSlice=Qs,i.assetStageCompletionReducer=Hl,i.assetStageCompletionSlice=ei,i.assetStageReducer=ru,i.assetStageSlice=ti,i.assetTypeAttachmentReducer=Ou,i.assetTypeAttachmentSlice=ni,i.assetTypeFieldValuesAttachmentReducer=uo,i.assetTypeFieldValuesAttachmentSlice=oi,i.assetTypeFieldValuesReducer=_o,i.assetTypeFieldValuesSlice=yi,i.assetTypeFieldsAttachmentReducer=zu,i.assetTypeFieldsAttachmentSlice=di,i.assetTypeFieldsReducer=Zu,i.assetTypeFieldsSlice=ui,i.assetTypeIdentifierReducer=Do,i.assetTypeIdentifierSlice=fi,i.assetTypeIdentifierValueReducer=Xo,i.assetTypeIdentifierValueSlice=Ai,i.assetTypeReducer=hh,i.assetTypeSlice=wi,i.assetTypeStatusReducer=Ph,i.assetTypeStatusSlice=Ii,i.assetTypeStatusSortFn=Xa,i.authReducer=Mh,i.authSlice=Qt,i.baseReducer=lR,i.baseReducers=Pa,i.clearTokens=jP,i.createModelAdapter=F,i.createOfflineAction=Kw,i.createPayload=R,i.createSelectionAdapter=vg,i.deleteAsset=Rl,i.deleteAssetAttachment=yc,i.deleteAssetAttachments=Fs,i.deleteAssetProcedure=Cr,i.deleteAssetProcedureStep=Sl,i.deleteAssetProcedureStepFieldValues=il,i.deleteAssetProcedureStepFieldValuesAttachment=Ld,i.deleteAssetProcedureStepFieldValuesAttachments=Hs,i.deleteAssetProcedureStepFieldValuesMany=nl,i.deleteAssetProcedureStepFields=Ed,i.deleteAssetProcedureStepFieldsAttachment=Sd,i.deleteAssetProcedureStepFieldsAttachments=Ad,i.deleteAssetProcedureStepFieldsMany=vd,i.deleteAssetProcedureSteps=Al,i.deleteAssetProcedureType=td,i.deleteAssetProcedureTypeAttachment=Mc,i.deleteAssetProcedureTypeAttachments=kc,i.deleteAssetProcedureTypeFieldValues=kr,i.deleteAssetProcedureTypeFieldValuesAttachment=fr,i.deleteAssetProcedureTypeFieldValuesAttachments=vs,i.deleteAssetProcedureTypeFieldValuesMany=Er,i.deleteAssetProcedureTypeFields=ir,i.deleteAssetProcedureTypeFieldsAttachment=Lc,i.deleteAssetProcedureTypeFieldsAttachments=Nc,i.deleteAssetProcedureTypeFieldsMany=nr,i.deleteAssetProcedureTypes=sd,i.deleteAssetProcedures=qs,i.deleteAssetStage=au,i.deleteAssetStageCompletion=Nl,i.deleteAssetStageCompletions=Gl,i.deleteAssetStages=cu,i.deleteAssetType=rh,i.deleteAssetTypeAttachment=Su,i.deleteAssetTypeAttachments=ci,i.deleteAssetTypeFieldValues=wo,i.deleteAssetTypeFieldValuesAttachment=no,i.deleteAssetTypeFieldValuesAttachments=pi,i.deleteAssetTypeFieldValuesMany=To,i.deleteAssetTypeFields=Gu,i.deleteAssetTypeFieldsAttachment=Eu,i.deleteAssetTypeFieldsAttachments=vu,i.deleteAssetTypeFieldsMany=Hu,i.deleteAssetTypeIdentifier=Vo,i.deleteAssetTypeIdentifierValue=Ko,i.deleteAssetTypeIdentifierValues=Yo,i.deleteAssetTypeIdentifiers=Bo,i.deleteAssetTypeStatus=Ih,i.deleteAssetTypeStatuses=Oh,i.deleteAssetTypes=dh,i.deleteAssets=xs,i.deleteConversation=nP,i.deleteConversations=aP,i.deleteDocument=Xh,i.deleteDocumentAttachment=Dh,i.deleteDocumentAttachments=jh,i.deleteDocuments=xh,i.deleteEmailDomain=hp,i.deleteEmailDomains=pp,i.deleteForm=bm,i.deleteFormIdentifier=Mp,i.deleteFormIdentifierValue=Lp,i.deleteFormIdentifierValues=Np,i.deleteFormIdentifiers=kp,i.deleteFormRevision=qi,i.deleteFormRevisionAttachment=im,i.deleteFormRevisionAttachments=nm,i.deleteFormRevisions=Di,i.deleteFormSubmission=Xm,i.deleteFormSubmissionAttachment=$m,i.deleteFormSubmissionAttachments=Ni,i.deleteFormSubmissions=Zi,i.deleteForms=Rm,i.deleteGeoImage=hy,i.deleteGeoImages=py,i.deleteIssue=Mf,i.deleteIssueAssociation=gy,i.deleteIssueAssociations=yt,i.deleteIssueAttachment=Uy,i.deleteIssueAttachments=nn,i.deleteIssueComment=Sf,i.deleteIssueCommentAttachment=sf,i.deleteIssueCommentAttachments=nf,i.deleteIssueComments=Af,i.deleteIssueType=vA,i.deleteIssueTypeAttachment=Lf,i.deleteIssueTypeAttachments=Nf,i.deleteIssueTypeFieldValues=SS,i.deleteIssueTypeFieldValuesAttachment=NS,i.deleteIssueTypeFieldValuesAttachments=In,i.deleteIssueTypeFieldValuesMany=AS,i.deleteIssueTypeFields=ES,i.deleteIssueTypeFieldsAttachment=iS,i.deleteIssueTypeFieldsAttachments=nS,i.deleteIssueTypeFieldsMany=vS,i.deleteIssueTypeIdentifier=nA,i.deleteIssueTypeIdentifierValue=AA,i.deleteIssueTypeIdentifierValues=wA,i.deleteIssueTypeIdentifiers=aA,i.deleteIssueTypeStatus=HA,i.deleteIssueTypeStatuses=KA,i.deleteIssueTypes=VA,i.deleteIssueUpdate=Bn,i.deleteIssueUpdates=Wn,i.deleteIssues=hn,i.deleteOrganization=$w,i.deleteOrganizationAccess=Pw,i.deleteOrganizationAccesses=bw,i.deleteOrganizations=Cw,i.deleteProject=JT,i.deleteProjectAccess=rT,i.deleteProjectAccesses=dT,i.deleteProjectAttachment=TT,i.deleteProjectAttachments=IT,i.deleteProjectFile=BT,i.deleteProjectFiles=WT,i.deleteProjects=ZT,i.deleteTeam=_I,i.deleteTeamMembership=uI,i.deleteTeamMemberships=oI,i.deleteTeams=gI,i.deleteUser=$n,i.deleteUsers=mw,i.deleteWorkflow=$I,i.deleteWorkflowStep=R_,i.deleteWorkflowStepAssignee=eO,i.deleteWorkflowStepAssignees=tO,i.deleteWorkflowStepComment=mO,i.deleteWorkflowStepComments=yO,i.deleteWorkflowStepEvent=RO,i.deleteWorkflowStepEvents=MO,i.deleteWorkflowStepFieldValues=RF,i.deleteWorkflowStepFieldValuesAttachment=mF,i.deleteWorkflowStepFieldValuesAttachments=ha,i.deleteWorkflowStepFieldValuesMany=MF,i.deleteWorkflowStepFieldValuesReview=e_,i.deleteWorkflowStepFieldValuesReviewRequest=CF,i.deleteWorkflowStepFieldValuesReviewRequests=Sa,i.deleteWorkflowStepFieldValuesReviews=Ta,i.deleteWorkflowStepFields=tF,i.deleteWorkflowStepFieldsAttachment=CO,i.deleteWorkflowStepFieldsAttachments=ra,i.deleteWorkflowStepFieldsMany=sF,i.deleteWorkflowStepReviewer=m_,i.deleteWorkflowStepReviewers=y_,i.deleteWorkflowSteps=M_,i.deleteWorkflowType=U_,i.deleteWorkflowTypes=L_,i.deleteWorkflows=CI,i.dequeue=ng,i.discard=cg,i.documentAttachmentReducer=Lh,i.documentAttachmentSlice=Fi,i.documentSlice=gi,i.documentsReducer=ep,i.downloadFile=Lg,i.emailDomainsReducer=Sp,i.emailDomainsSlice=bi,i.emailRegex=Qg,i.enqueue=ig,i.enqueueRequest=Jw,i.extractResponseFromError=dg,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=$t,i.fetchBlobFromObjectUrl=Ga,i.fetchFileFromObjectUrl=Ha,i.fileReducer=Tp,i.fileSlice=Mi,i.formIdentifierReducer=Bp,i.formIdentifierSlice=ki,i.formIdentifierValueReducer=Yp,i.formIdentifierValueSlice=vi,i.formReducer=Mm,i.formRevisionAttachmentReducer=dm,i.formRevisionAttachmentSlice=Vi,i.formRevisionReducer=Am,i.formRevisionsSlice=Bi,i.formSlice=$i,i.formSubmissionAttachmentReducer=Nm,i.formSubmissionAttachmentSlice=Ui,i.formSubmissionReducer=iy,i.formSubmissionSlice=Yi,i.geoImageReducer=Sy,i.geoImageSlice=Xi,i.getAssetProcedureStepSubTree=Qa,i.getAssetProcedureStepTrees=Xg,i.getClientSDK=pg,i.getClientStore=_t,i.getDocumentSubTree=tc,i.getDocumentTrees=xg,i.getFileExtension=Na,i.getLocalDateString=La,i.getLocalRelativeDateString=jg,i.getOutboxCoordinator=wt,i.getRenamedFile=Ug,i.getRequestDescription=w,i.getS3FileKey=Cg,i.hashFile=Ct,i.initSDK=ZM,i.initializeAssetAttachments=lc,i.initializeAssetProcedureStepFieldValues=Zd,i.initializeAssetProcedureStepFieldValuesAttachments=qd,i.initializeAssetProcedureStepFields=_d,i.initializeAssetProcedureStepFieldsAttachments=ud,i.initializeAssetProcedureSteps=ul,i.initializeAssetProcedureTypeAttachments=Oc,i.initializeAssetProcedureTypeFieldValues=Fr,i.initializeAssetProcedureTypeFieldValuesAttachments=ur,i.initializeAssetProcedureTypeFields=Zc,i.initializeAssetProcedureTypeFieldsAttachments=zc,i.initializeAssetProcedureTypes=Zr,i.initializeAssetProcedures=qr,i.initializeAssetStageCompletions=ql,i.initializeAssetStages=Xl,i.initializeAssetTypeAttachments=ou,i.initializeAssetTypeFieldValues=ho,i.initializeAssetTypeFieldValuesAttachments=Xu,i.initializeAssetTypeFields=Du,i.initializeAssetTypeFieldsAttachments=_u,i.initializeAssetTypeIdentifierValues=$o,i.initializeAssetTypeIdentifiers=Po,i.initializeAssetTypeStatuses=mh,i.initializeAssetTypes=eh,i.initializeAssets=_l,i.initializeConversations=ic,i.initializeDocumentAttachments=Eh,i.initializeDocuments=Gh,i.initializeEmailDomains=ap,i.initializeFormIdentifierValues=zp,i.initializeFormIdentifiers=Op,i.initializeFormRevisionAttachments=Zp,i.initializeFormRevisions=um,i.initializeFormSubmissionAttachments=Bm,i.initializeFormSubmissions=Hm,i.initializeForms=Tm,i.initializeGeoImages=ay,i.initializeIssueAssociations=wy,i.initializeIssueAttachments=zy,i.initializeIssueCommentAttachments=Jy,i.initializeIssueComments=uf,i.initializeIssueTypeAttachments=zf,i.initializeIssueTypeFieldValues=uS,i.initializeIssueTypeFieldValuesAttachments=DS,i.initializeIssueTypeFields=_S,i.initializeIssueTypeFieldsAttachments=Zf,i.initializeIssueTypeIdentifierValues=oA,i.initializeIssueTypeIdentifiers=QS,i.initializeIssueTypeStatuses=jA,i.initializeIssueTypes=gA,i.initializeIssueUpdates=XA,i.initializeIssues=Ff,i.initializeOrganizationAccesses=ww,i.initializeOrganizations=Vw,i.initializeProjectAccesses=eT,i.initializeProjectAttachments=pT,i.initializeProjectFiles=bT,i.initializeProjects=UT,i.initializeTeamMemberships=iI,i.initializeTeams=SI,i.initializeUsers=dw,i.initializeWorkflowStepAssignees=KI,i.initializeWorkflowStepComments=rO,i.initializeWorkflowStepEvents=IO,i.initializeWorkflowStepFieldValues=IF,i.initializeWorkflowStepFieldValuesAttachments=dF,i.initializeWorkflowStepFieldValuesReviewRequests=WF,i.initializeWorkflowStepFieldValuesReviews=YF,i.initializeWorkflowStepFields=YO,i.initializeWorkflowStepFieldsAttachments=WO,i.initializeWorkflowStepReviewers=r_,i.initializeWorkflowSteps=I_,i.initializeWorkflowTypes=W_,i.initializeWorkflows=VI,i.isImageFile=Ng,i.isObjectUrl=Ka,i.isToday=Dg,i.issueAssociationReducer=By,i.issueAssociationSlice=en,i.issueAttachmentReducer=Ky,i.issueAttachmentSlice=tn,i.issueCommentAttachmentReducer=df,i.issueCommentAttachmentSlice=cn,i.issueCommentReducer=If,i.issueCommentSlice=dn,i.issueReducer=Bf,i.issueSlice=un,i.issueTypeAttachmentReducer=Yf,i.issueTypeAttachmentSlice=pn,i.issueTypeFieldValuesAttachmentReducer=JS,i.issueTypeFieldValuesAttachmentSlice=wn,i.issueTypeFieldValuesReducer=OS,i.issueTypeFieldValuesSlice=Sn,i.issueTypeFieldsAttachmentReducer=dS,i.issueTypeFieldsAttachmentSlice=yn,i.issueTypeFieldsReducer=zS,i.issueTypeFieldsSlice=An,i.issueTypeIdentifierReducer=lA,i.issueTypeIdentifierSlice=Fn,i.issueTypeIdentifierValueReducer=FA,i.issueTypeIdentifierValueSlice=gn,i.issueTypeReducer=qA,i.issueTypeSlice=Pn,i.issueTypeStatusReducer=ZA,i.issueTypeStatusSlice=Rn,i.issueTypeStatusSortFn=xa,i.issueUpdateReducer=cw,i.issueUpdateSlice=En,i.logOnlyOnce=Gg,i.markAsDeleted=Zw,i.markForDeletion=Ob,i.memoize=fs,i.organizationAccessReducer=Rw,i.organizationAccessSlice=Un,i.organizationReducer=Hw,i.organizationSlice=Ln,i.outboxReducer=Xw,i.outboxSlice=Nn,i.overmapEnhancer=AR,i.overmapReducer=uR,i.overmapReducers=Y_,i.performRequest=Ma,i.performRequestFromAction=ag,i.projectAccessReducer=lT,i.projectAccessSlice=Gn,i.projectAttachmentReducer=gT,i.projectAttachmentSlice=Kn,i.projectFileReducer=$T,i.projectFileSlice=Jn,i.projectReducer=QT,i.projectSlice=Zn,i.rehydratedReducer=tI,i.rehydratedSlice=Qn,i.restructureSelectorWithArgs=S,i.runMiddleware=Sg,i.selectAccessToken=$P,i.selectAccessesByUserOfProject=_b,i.selectAccessibleProjects=bb,i.selectActiveOrganizationAccess=Ab,i.selectAllDocumentAttachments=_i,i.selectAssetAttachmentById=Sc,i.selectAssetAttachmentMapping=fc,i.selectAssetAttachments=_s,i.selectAssetAttachmentsByIds=Ac,i.selectAssetById=Vl,i.selectAssetProcedureById=Kr,i.selectAssetProcedureStepById=Tl,i.selectAssetProcedureStepFieldValues=Mt,i.selectAssetProcedureStepFieldValuesAttachmentById=Gd,i.selectAssetProcedureStepFieldValuesAttachments=Ks,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Hd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Nd,i.selectAssetProcedureStepFieldValuesById=cl,i.selectAssetProcedureStepFieldValuesByIds=rl,i.selectAssetProcedureStepFieldValuesMapping=al,i.selectAssetProcedureStepFieldValuesOfAsset=TP,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=IP,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=OP,i.selectAssetProcedureStepFields=Ht,i.selectAssetProcedureStepFieldsAttachmentById=Td,i.selectAssetProcedureStepFieldsAttachments=Cs,i.selectAssetProcedureStepFieldsAttachmentsByIds=Id,i.selectAssetProcedureStepFieldsAttachmentsMapping=wd,i.selectAssetProcedureStepFieldsById=Vd,i.selectAssetProcedureStepFieldsByIds=Bd,i.selectAssetProcedureStepFieldsMapping=Ls,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=SP,i.selectAssetProcedureStepMapping=Kt,i.selectAssetProcedureSteps=Zs,i.selectAssetProcedureStepsByIds=Il,i.selectAssetProcedureStepsMappingOfAssetProcedureType=FP,i.selectAssetProcedureStepsOfAssetProcedureType=_P,i.selectAssetProcedureTypeAttachmentById=Vc,i.selectAssetProcedureTypeAttachmentMapping=vc,i.selectAssetProcedureTypeAttachments=Ps,i.selectAssetProcedureTypeAttachmentsByIds=Bc,i.selectAssetProcedureTypeById=rd,i.selectAssetProcedureTypeFieldValues=Nt,i.selectAssetProcedureTypeFieldValuesAttachmentById=wr,i.selectAssetProcedureTypeFieldValuesAttachments=Vs,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Tr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Ar,i.selectAssetProcedureTypeFieldValuesById=Br,i.selectAssetProcedureTypeFieldValuesByIds=Wr,i.selectAssetProcedureTypeFieldValuesMapping=Vr,i.selectAssetProcedureTypeFieldValuesOfAsset=hP,i.selectAssetProcedureTypeFields=Lt,i.selectAssetProcedureTypeFieldsAttachmentById=Kc,i.selectAssetProcedureTypeFieldsAttachments=Rs,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Yc,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Hc,i.selectAssetProcedureTypeFieldsById=rr,i.selectAssetProcedureTypeFieldsByIds=dr,i.selectAssetProcedureTypeFieldsMapping=cr,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=uP,i.selectAssetProcedureTypes=js,i.selectAssetProcedureTypesByIds=dd,i.selectAssetProcedureTypesMapping=cd,i.selectAssetProcedureTypesOfOrganization=yP,i.selectAssetProcedures=Gt,i.selectAssetProceduresByIds=Yr,i.selectAssetProceduresMapping=Gr,i.selectAssetProceduresOfAssetProcedureType=Hr,i.selectAssetProceduresOfAssetType=mP,i.selectAssetStageById=du,i.selectAssetStageCompletionById=Jl,i.selectAssetStageCompletionMapping=Kl,i.selectAssetStageCompletions=Yl,i.selectAssetStageCompletionsByIds=Zl,i.selectAssetStages=ii,i.selectAssetStagesByIds=lu,i.selectAssetStagesMappingOfAssetProcedureType=PP,i.selectAssetStagesOfAssetProcedureType=bP,i.selectAssetTypeAttachmentById=wu,i.selectAssetTypeAttachmentMapping=Au,i.selectAssetTypeAttachments=ri,i.selectAssetTypeAttachmentsByIds=Tu,i.selectAssetTypeById=uh,i.selectAssetTypeFieldValues=Jt,i.selectAssetTypeFieldValuesAttachmentById=co,i.selectAssetTypeFieldValuesAttachments=mi,i.selectAssetTypeFieldValuesAttachmentsByIds=ro,i.selectAssetTypeFieldValuesAttachmentsMapping=ao,i.selectAssetTypeFieldValuesById=Oo,i.selectAssetTypeFieldValuesByIds=Fo,i.selectAssetTypeFieldValuesMapping=Io,i.selectAssetTypeFieldValuesOfAsset=EP,i.selectAssetTypeFields=kt,i.selectAssetTypeFieldsAttachmentById=Bu,i.selectAssetTypeFieldsAttachments=li,i.selectAssetTypeFieldsAttachmentsByIds=Wu,i.selectAssetTypeFieldsAttachmentsMapping=Vu,i.selectAssetTypeFieldsById=Yu,i.selectAssetTypeFieldsByIds=Ju,i.selectAssetTypeFieldsMapping=Ku,i.selectAssetTypeFieldsOfAssetType=MP,i.selectAssetTypeIdentifierById=zo,i.selectAssetTypeIdentifierMapping=Wo,i.selectAssetTypeIdentifierValueById=Zo,i.selectAssetTypeIdentifierValueMapping=Jo,i.selectAssetTypeIdentifierValues=Zt,i.selectAssetTypeIdentifierValuesByIds=Qo,i.selectAssetTypeIdentifierValuesOfAsset=BP,i.selectAssetTypeIdentifierValuesOfIdentifier=WP,i.selectAssetTypeIdentifiers=Si,i.selectAssetTypeIdentifiersByIds=qo,i.selectAssetTypeIdentifiersOfAssetType=VP,i.selectAssetTypeStatusById=_h,i.selectAssetTypeStatusMapping=Fh,i.selectAssetTypeStatuses=Oi,i.selectAssetTypeStatusesByIds=gh,i.selectAssetTypeStatusesOfAssetType=qP,i.selectAssetTypeValuesOfAssetType=vP,i.selectAssetTypes=Ti,i.selectAssetTypesByIds=oh,i.selectAssetTypesMapping=lh,i.selectAssetTypesOfOrganization=zP,i.selectAssets=Yt,i.selectAssetsByIds=Bl,i.selectAssetsMapping=El,i.selectAssetsOfAssetType=vl,i.selectAssetsOfProject=gP,i.selectAttachmentsOfAsset=wc,i.selectAttachmentsOfAssetProcedureStepFieldValues=Kd,i.selectAttachmentsOfAssetProcedureStepFields=fP,i.selectAttachmentsOfAssetProcedureType=dP,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Ir,i.selectAttachmentsOfAssetProcedureTypeFields=lP,i.selectAttachmentsOfAssetType=Iu,i.selectAttachmentsOfAssetTypeFieldValues=lo,i.selectAttachmentsOfAssetTypeFields=RP,i.selectAttachmentsOfDocument=UP,i.selectAttachmentsOfFormRevision=XP,i.selectAttachmentsOfFormSubmission=Lm,i.selectAttachmentsOfIssue=Ny,i.selectAttachmentsOfIssueComment=sb,i.selectAttachmentsOfIssueType=ab,i.selectAttachmentsOfIssueTypeFieldValues=YS,i.selectAttachmentsOfIssueTypeFields=cb,i.selectAttachmentsOfProject=Pb,i.selectAttachmentsOfWorkflowStepFieldValues=AF,i.selectAttachmentsOfWorkflowStepFields=LO,i.selectCommentsOfIssue=ib,i.selectConversation=rP,i.selectConversationMapping=Ts,i.selectConversations=cP,i.selectCurrentUser=fw,i.selectDeletedRequests=Tb,i.selectDescendantsOfAssetProcedureStep=Ol,i.selectDescendantsOfDocument=ip,i.selectDocumentAttachmentById=Ch,i.selectDocumentAttachmentMapping=$h,i.selectDocumentAttachmentsByIds=Uh,i.selectDocumentById=tp,i.selectDocuments=Xt,i.selectDocumentsByIds=sp,i.selectDocumentsMapping=Pi,i.selectEmailDomainById=yp,i.selectEmailDomains=Ri,i.selectEmailDomainsAsMapping=mp,i.selectEmailDomainsByIds=fp,i.selectEmailDomainsOfOrganization=GP,i.selectFieldValuesOfAssetProcedure=pP,i.selectFormById=Em,i.selectFormIdentifierById=vp,i.selectFormIdentifierMapping=Ep,i.selectFormIdentifierValueById=Hp,i.selectFormIdentifierValueMapping=Gp,i.selectFormIdentifierValues=xt,i.selectFormIdentifierValuesByIds=Kp,i.selectFormIdentifierValuesOfFormSubmission=ZP,i.selectFormIdentifierValuesOfIdentifier=QP,i.selectFormIdentifiers=Ei,i.selectFormIdentifiersByIds=Vp,i.selectFormIdentifiersOfForm=JP,i.selectFormMapping=km,i.selectFormRevisionAttachmentById=cm,i.selectFormRevisionAttachments=am,i.selectFormRevisionAttachmentsByIds=rm,i.selectFormRevisionAttachmentsMapping=es,i.selectFormRevisionById=ym,i.selectFormRevisionMapping=ji,i.selectFormRevisions=ts,i.selectFormRevisionsByIds=fm,i.selectFormRevisionsOfForm=Sm,i.selectFormSubmissionAttachemntsByIds=Ki,i.selectFormSubmissionAttachmentById=Cm,i.selectFormSubmissionAttachments=Hi,i.selectFormSubmissionAttachmentsByIds=Um,i.selectFormSubmissionAttachmentsMapping=Gi,i.selectFormSubmissionById=ey,i.selectFormSubmissions=xm,i.selectFormSubmissionsByIds=ty,i.selectFormSubmissionsMapping=Qi,i.selectFormSubmissionsOfForm=sy,i.selectForms=Ci,i.selectFormsByIds=vm,i.selectFormsOfOrganization=eb,i.selectGeoImageById=yy,i.selectGeoImageMapping=my,i.selectGeoImages=xi,i.selectGeoImagesByIds=fy,i.selectGeoImagesOfProject=tb,i.selectIsLoggedIn=CP,i.selectIssueAssociationById=by,i.selectIssueAssociationMapping=Py,i.selectIssueAssociations=ft,i.selectIssueAssociationsByIds=Ry,i.selectIssueAssociationsOfAsset=Vy,i.selectIssueAssociationsOfIssue=vy,i.selectIssueAssociationsOfIssues=Ey,i.selectIssueAssociationsToIssue=My,i.selectIssueAssociationsToIssues=ky,i.selectIssueAttachmentById=Gy,i.selectIssueAttachmentMapping=Ly,i.selectIssueAttachments=an,i.selectIssueAttachmentsByIds=Hy,i.selectIssueById=Ef,i.selectIssueCommentAttachmentById=cf,i.selectIssueCommentAttachmentMapping=af,i.selectIssueCommentAttachments=rn,i.selectIssueCommentAttachmentsByIds=rf,i.selectIssueCommentById=wf,i.selectIssueCommentMapping=ln,i.selectIssueCommentsByIds=Tf,i.selectIssueMapping=kf,i.selectIssueTypeAttachmentById=Hf,i.selectIssueTypeAttachmentMapping=Gf,i.selectIssueTypeAttachments=mn,i.selectIssueTypeAttachmentsByIds=Kf,i.selectIssueTypeById=WA,i.selectIssueTypeFieldValues=is,i.selectIssueTypeFieldValuesAttachmentById=HS,i.selectIssueTypeFieldValuesAttachments=On,i.selectIssueTypeFieldValuesAttachmentsByIds=KS,i.selectIssueTypeFieldValuesAttachmentsMapping=GS,i.selectIssueTypeFieldValuesById=TS,i.selectIssueTypeFieldValuesByIds=IS,i.selectIssueTypeFieldValuesMapping=wS,i.selectIssueTypeFieldValuesOfIssue=rb,i.selectIssueTypeFields=Et,i.selectIssueTypeFieldsAttachmentById=cS,i.selectIssueTypeFieldsAttachments=fn,i.selectIssueTypeFieldsAttachmentsByIds=rS,i.selectIssueTypeFieldsAttachmentsMapping=aS,i.selectIssueTypeFieldsById=BS,i.selectIssueTypeFieldsByIds=WS,i.selectIssueTypeFieldsMapping=VS,i.selectIssueTypeFieldsOfIssueType=db,i.selectIssueTypeIdentifierById=rA,i.selectIssueTypeIdentifierMapping=cA,i.selectIssueTypeIdentifierValueById=IA,i.selectIssueTypeIdentifierValueMapping=TA,i.selectIssueTypeIdentifierValues=ns,i.selectIssueTypeIdentifierValuesByIds=OA,i.selectIssueTypeIdentifierValuesOfIdentifier=pb,i.selectIssueTypeIdentifierValuesOfIssue=hb,i.selectIssueTypeIdentifiers=_n,i.selectIssueTypeIdentifiersByIds=dA,i.selectIssueTypeIdentifiersOfIssueType=ob,i.selectIssueTypeMapping=BA,i.selectIssueTypeStatusById=kn,i.selectIssueTypeStatusMapping=YA,i.selectIssueTypeStatuses=Mn,i.selectIssueTypeStatusesByIds=JA,i.selectIssueTypeStatusesOfIssueType=yb,i.selectIssueTypeValuesOfIssueType=ub,i.selectIssueTypes=bn,i.selectIssueTypesByIds=zA,i.selectIssueTypesOfOrganization=mb,i.selectIssueUpdateById=iw,i.selectIssueUpdateMapping=zn,i.selectIssueUpdates=qn,i.selectIssueUpdatesByIds=nw,i.selectIssueUpdatesOfIssue=aw,i.selectIssues=ss,i.selectIssuesByIds=vf,i.selectIssuesOfIssueType=Vf,i.selectIssuesOfProject=nb,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=AP,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=oP,i.selectLatestAssetTypeFieldsOfAssetType=kP,i.selectLatestFieldsByAssetProcedureStep=wP,i.selectLatestFormRevisionOfForm=xP,i.selectLatestIssueTypeFieldsOfIssueType=lb,i.selectLatestRetryTime=Ib,i.selectLatestReviewOfWorkflowStepFieldValues=tR,i.selectLatestReviewRequestOfWorkflowStepFieldValues=xb,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=Xb,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=iR,i.selectLatestWorkflowStepFieldsOfWorkflowStep=Yb,i.selectMembershipsByUserOfTeam=vb,i.selectOrganizationAccessById=Mw,i.selectOrganizationAccessMapping=rs,i.selectOrganizationAccessUserMapping=Ew,i.selectOrganizationAccessesByIds=kw,i.selectOrganizationById=Nw,i.selectOrganizationDocuments=NP,i.selectOrganizations=Lw,i.selectOrganizationsByIds=Gw,i.selectOrganizationsMapping=Uw,i.selectProjectAccessById=uT,i.selectProjectAccessMapping=Hn,i.selectProjectAccesses=vt,i.selectProjectAccessesByIds=oT,i.selectProjectAccessesOfProject=Fb,i.selectProjectAttachmentById=FT,i.selectProjectAttachmentMapping=OT,i.selectProjectAttachments=Yn,i.selectProjectAttachmentsByIds=_T,i.selectProjectById=xT,i.selectProjectDocuments=LP,i.selectProjectFileById=DT,i.selectProjectFileMapping=zT,i.selectProjectFiles=qT,i.selectProjectFilesByIds=jT,i.selectProjectMapping=XT,i.selectProjects=ds,i.selectProjectsByIds=eI,i.selectProjectsOfOrganization=Rb,i.selectRehydrated=Eb,i.selectReviewRequestsOfWorkflowStepFieldValues=GF,i.selectReviewsOfWorkflowStepFieldValues=n_,i.selectStageMapping=si,i.selectTeamById=bI,i.selectTeamMembershipById=mI,i.selectTeamMemberships=ls,i.selectTeamMembershipsByIds=yI,i.selectTeamMembershipsMapping=pI,i.selectTeams=ea,i.selectTeamsByIds=RI,i.selectTeamsMapping=PI,i.selectTeamsOfOrganization=Bb,i.selectUploadUrl=YP,i.selectUserById=cs,i.selectUsers=as,i.selectUsersByIds=Sw,i.selectUsersMapping=Cn,i.selectUsersOfOrganization=wb,i.selectUsersOfProject=gb,i.selectUsersOfTeam=Vb,i.selectWorkflowById=LI,i.selectWorkflowMapping=UI,i.selectWorkflowStepAssigneeById=iO,i.selectWorkflowStepAssignees=Vt,i.selectWorkflowStepAssigneesByIds=nO,i.selectWorkflowStepAssigneesMapping=sO,i.selectWorkflowStepAssigneesOfWorkflow=Db,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=$b,i.selectWorkflowStepAssigneesOfWorkflowStep=jb,i.selectWorkflowStepById=E_,i.selectWorkflowStepCommentById=SO,i.selectWorkflowStepComments=Bt,i.selectWorkflowStepCommentsByIds=AO,i.selectWorkflowStepCommentsMapping=fO,i.selectWorkflowStepCommentsOfWorkflow=Cb,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=Lb,i.selectWorkflowStepCommentsOfWorkflowStep=Ub,i.selectWorkflowStepEventById=EO,i.selectWorkflowStepEvents=Wt,i.selectWorkflowStepEventsByIds=vO,i.selectWorkflowStepEventsMapping=kO,i.selectWorkflowStepEventsOfWorkflow=Nb,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=Hb,i.selectWorkflowStepEventsOfWorkflowStep=Gb,i.selectWorkflowStepFieldValues=ht,i.selectWorkflowStepFieldValuesAttachmentById=fF,i.selectWorkflowStepFieldValuesAttachments=pa,i.selectWorkflowStepFieldValuesAttachmentsByIds=SF,i.selectWorkflowStepFieldValuesAttachmentsMapping=yF,i.selectWorkflowStepFieldValuesById=EF,i.selectWorkflowStepFieldValuesByIds=vF,i.selectWorkflowStepFieldValuesMapping=kF,i.selectWorkflowStepFieldValuesOfWorkflow=Jb,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=Qb,i.selectWorkflowStepFieldValuesOfWorkflowStep=Zb,i.selectWorkflowStepFieldValuesReviewById=s_,i.selectWorkflowStepFieldValuesReviewRequestById=LF,i.selectWorkflowStepFieldValuesReviewRequests=zt,i.selectWorkflowStepFieldValuesReviewRequestsByIds=NF,i.selectWorkflowStepFieldValuesReviewRequestsMapping=UF,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=eR,i.selectWorkflowStepFieldValuesReviews=It,i.selectWorkflowStepFieldValuesReviewsByIds=i_,i.selectWorkflowStepFieldValuesReviewsMapping=t_,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=sR,i.selectWorkflowStepFields=os,i.selectWorkflowStepFieldsAttachmentById=NO,i.selectWorkflowStepFieldsAttachments=da,i.selectWorkflowStepFieldsAttachmentsByIds=GO,i.selectWorkflowStepFieldsAttachmentsMapping=UO,i.selectWorkflowStepFieldsById=nF,i.selectWorkflowStepFieldsByIds=aF,i.selectWorkflowStepFieldsMapping=iF,i.selectWorkflowStepFieldsOfWorkflowStep=Kb,i.selectWorkflowStepReviewerById=S_,i.selectWorkflowStepReviewers=qt,i.selectWorkflowStepReviewersByIds=A_,i.selectWorkflowStepReviewersMapping=f_,i.selectWorkflowStepReviewersOfWorkflow=nR,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=cR,i.selectWorkflowStepReviewersOfWorkflowStep=aR,i.selectWorkflowSteps=Fa,i.selectWorkflowStepsByIds=v_,i.selectWorkflowStepsMapping=k_,i.selectWorkflowStepsOfWorkflowType=rR,i.selectWorkflowTypeById=G_,i.selectWorkflowTypeMapping=N_,i.selectWorkflowTypes=ga,i.selectWorkflowTypesByIds=H_,i.selectWorkflowTypesOfOrganization=dR,i.selectWorkflows=us,i.selectWorkflowsByIds=NI,i.selectWorkflowsOfProject=zb,i.selectWorkflowsOfWorkflowType=qb,i.setAsset=Ml,i.setAssetAttachment=oc,i.setAssetAttachments=hc,i.setAssetProcedure=Ur,i.setAssetProcedureStep=ol,i.setAssetProcedureStepFieldValues=xd,i.setAssetProcedureStepFieldValuesAttachment=jd,i.setAssetProcedureStepFieldValuesAttachments=$d,i.setAssetProcedureStepFieldValuesMany=el,i.setAssetProcedureStepFields=bd,i.setAssetProcedureStepFieldsAttachment=pd,i.setAssetProcedureStepFieldsAttachments=md,i.setAssetProcedureStepFieldsMany=Rd,i.setAssetProcedureSteps=hl,i.setAssetProcedureType=id,i.setAssetProcedureTypeAttachment=gc,i.setAssetProcedureTypeAttachments=Pc,i.setAssetProcedureTypeFieldValues=Pr,i.setAssetProcedureTypeFieldValuesAttachment=hr,i.setAssetProcedureTypeFieldValuesAttachments=pr,i.setAssetProcedureTypeFieldValuesMany=br,i.setAssetProcedureTypeFields=xc,i.setAssetProcedureTypeFieldsAttachment=jc,i.setAssetProcedureTypeFieldsAttachments=$c,i.setAssetProcedureTypeFieldsMany=er,i.setAssetProcedureTypes=nd,i.setAssetProcedures=Lr,i.setAssetStage=xl,i.setAssetStageCompletion=$l,i.setAssetStageCompletions=Cl,i.setAssetStages=eu,i.setAssetType=th,i.setAssetTypeAttachment=pu,i.setAssetTypeAttachments=mu,i.setAssetTypeFieldValues=yo,i.setAssetTypeFieldValuesAttachment=eo,i.setAssetTypeFieldValuesAttachments=to,i.setAssetTypeFieldValuesMany=fo,i.setAssetTypeFields=Cu,i.setAssetTypeFieldsAttachment=bu,i.setAssetTypeFieldsAttachments=Ru,i.setAssetTypeFieldsMany=Uu,i.setAssetTypeIdentifier=Mo,i.setAssetTypeIdentifierValue=Lo,i.setAssetTypeIdentifierValues=No,i.setAssetTypeIdentifiers=ko,i.setAssetTypeStatus=Sh,i.setAssetTypeStatuses=Ah,i.setAssetTypes=sh,i.setAssets=kl,i.setClientSDK=hg,i.setClientStore=ug,i.setConversation=ac,i.setConversations=sP,i.setCurrentUser=fb,i.setCurrentUserProfile=Sb,i.setDocument=Yh,i.setDocumentAttachment=Bh,i.setDocumentAttachments=Wh,i.setDocuments=Jh,i.setEmailDomain=dp,i.setEmailDomains=lp,i.setForm=Fm,i.setFormIdentifier=gp,i.setFormIdentifierValue=jp,i.setFormIdentifierValues=$p,i.setFormIdentifiers=Pp,i.setFormRevision=om,i.setFormRevisionAttachment=xp,i.setFormRevisionAttachments=em,i.setFormRevisions=hm,i.setFormSubmission=Km,i.setFormSubmissionAttachment=zm,i.setFormSubmissionAttachments=qm,i.setFormSubmissions=Ym,i.setForms=_m,i.setGeoImage=cy,i.setGeoImages=ry,i.setIssue=gf,i.setIssueAssociation=Iy,i.setIssueAssociations=Ty,i.setIssueAttachment=Dy,i.setIssueAttachments=jy,i.setIssueComment=pf,i.setIssueCommentAttachment=Xy,i.setIssueCommentAttachments=xy,i.setIssueComments=mf,i.setIssueType=RA,i.setIssueTypeAttachment=jf,i.setIssueTypeAttachments=$f,i.setIssueTypeFieldValues=pS,i.setIssueTypeFieldValuesAttachment=$S,i.setIssueTypeFieldValuesAttachments=CS,i.setIssueTypeFieldValuesMany=mS,i.setIssueTypeFields=bS,i.setIssueTypeFieldsAttachment=xf,i.setIssueTypeFieldsAttachments=eS,i.setIssueTypeFieldsMany=RS,i.setIssueTypeIdentifier=eA,i.setIssueTypeIdentifierValue=mA,i.setIssueTypeIdentifierValues=yA,i.setIssueTypeIdentifiers=tA,i.setIssueTypeStatus=UA,i.setIssueTypeStatuses=LA,i.setIssueTypes=MA,i.setIssueUpdate=xA,i.setIssueUpdates=ew,i.setIssues=Pf,i.setLoggedIn=Rh,i.setOrganization=Ww,i.setOrganizationAccess=Ow,i.setOrganizationAccesses=Fw,i.setOrganizations=Bw,i.setProject=NT,i.setProjectAccess=iT,i.setProjectAccesses=nT,i.setProjectAttachment=fT,i.setProjectAttachments=ST,i.setProjectFile=RT,i.setProjectFiles=MT,i.setProjects=LT,i.setRehydrated=kb,i.setTeam=TI,i.setTeamMembership=cI,i.setTeamMemberships=rI,i.setTeams=II,i.setTokens=DP,i.setUploadUrl=KP,i.setUser=uw,i.setUsers=lw,i.setWorkflow=zI,i.setWorkflowStep=__,i.setWorkflowStepAssignee=ZI,i.setWorkflowStepAssignees=QI,i.setWorkflowStepComment=uO,i.setWorkflowStepComments=oO,i.setWorkflowStepEvent=_O,i.setWorkflowStepEvents=gO,i.setWorkflowStepFieldValues=_F,i.setWorkflowStepFieldValuesAttachment=uF,i.setWorkflowStepFieldValuesAttachments=oF,i.setWorkflowStepFieldValuesMany=gF,i.setWorkflowStepFieldValuesReview=ZF,i.setWorkflowStepFieldValuesReviewRequest=qF,i.setWorkflowStepFieldValuesReviewRequests=DF,i.setWorkflowStepFieldValuesReviews=QF,i.setWorkflowStepFields=QO,i.setWorkflowStepFieldsAttachment=qO,i.setWorkflowStepFieldsAttachments=DO,i.setWorkflowStepFieldsMany=XO,i.setWorkflowStepReviewer=u_,i.setWorkflowStepReviewers=o_,i.setWorkflowSteps=g_,i.setWorkflowType=D_,i.setWorkflowTypes=j_,i.setWorkflows=qI,i.shallowEqual=Bg,i.slugify=Jg,i.spacesToDashesLower=Yg,i.teamMembershipReducer=hI,i.teamMembershipSlice=Xn,i.teamReducer=MI,i.teamSlice=xn,i.toFileNameSafeString=Kg,i.toUuidArray=V,i.toUuidIdRecord=Hg,i.truncate=Zg,i.updateAsset=Pl,i.updateAssetAttachment=pc,i.updateAssetAttachments=mc,i.updateAssetProcedure=jr,i.updateAssetProcedureStep=yl,i.updateAssetProcedureStepFieldValues=tl,i.updateAssetProcedureStepFieldValuesAttachment=Cd,i.updateAssetProcedureStepFieldValuesAttachments=Ud,i.updateAssetProcedureStepFieldValuesMany=sl,i.updateAssetProcedureStepFields=Md,i.updateAssetProcedureStepFieldsAttachment=yd,i.updateAssetProcedureStepFieldsAttachments=fd,i.updateAssetProcedureStepFieldsMany=kd,i.updateAssetProcedureSteps=fl,i.updateAssetProcedureType=xr,i.updateAssetProcedureTypeAttachment=bc,i.updateAssetProcedureTypeAttachments=Rc,i.updateAssetProcedureTypeFieldValues=Rr,i.updateAssetProcedureTypeFieldValuesAttachment=mr,i.updateAssetProcedureTypeFieldValuesAttachments=yr,i.updateAssetProcedureTypeFieldValuesMany=Mr,i.updateAssetProcedureTypeFields=tr,i.updateAssetProcedureTypeFieldsAttachment=Cc,i.updateAssetProcedureTypeFieldsAttachments=Uc,i.updateAssetProcedureTypeFieldsMany=sr,i.updateAssetProcedureTypes=ed,i.updateAssetProcedures=$r,i.updateAssetStage=iu,i.updateAssetStageCompletion=Ul,i.updateAssetStageCompletions=Ll,i.updateAssetStages=nu,i.updateAssetType=ah,i.updateAssetTypeAttachment=yu,i.updateAssetTypeAttachments=fu,i.updateAssetTypeFieldValues=So,i.updateAssetTypeFieldValuesAttachment=so,i.updateAssetTypeFieldValuesAttachments=io,i.updateAssetTypeFieldValuesMany=Ao,i.updateAssetTypeFields=Lu,i.updateAssetTypeFieldsAttachment=Mu,i.updateAssetTypeFieldsAttachments=ku,i.updateAssetTypeFieldsMany=Nu,i.updateAssetTypeIdentifier=Eo,i.updateAssetTypeIdentifierValue=Go,i.updateAssetTypeIdentifierValues=Ho,i.updateAssetTypeIdentifiers=vo,i.updateAssetTypeStatus=wh,i.updateAssetTypeStatuses=Th,i.updateAssetTypes=ch,i.updateAssets=bl,i.updateConversation=cc,i.updateConversations=iP,i.updateDocument=Zh,i.updateDocumentAttachment=zh,i.updateDocumentAttachments=qh,i.updateDocuments=Qh,i.updateEmailDomain=up,i.updateEmailDomains=op,i.updateForm=gm,i.updateFormIdentifier=bp,i.updateFormIdentifierValue=Cp,i.updateFormIdentifierValues=Up,i.updateFormIdentifiers=Rp,i.updateFormRevision=pm,i.updateFormRevisionAttachment=tm,i.updateFormRevisionAttachments=sm,i.updateFormRevisions=mm,i.updateFormSubmission=Zm,i.updateFormSubmissionAttachment=Dm,i.updateFormSubmissionAttachments=jm,i.updateFormSubmissions=Qm,i.updateForms=Pm,i.updateGeoImage=uy,i.updateGeoImages=oy,i.updateIssue=bf,i.updateIssueAssociation=Oy,i.updateIssueAssociations=Fy,i.updateIssueAttachment=$y,i.updateIssueAttachments=Cy,i.updateIssueComment=yf,i.updateIssueCommentAttachment=ef,i.updateIssueCommentAttachments=tf,i.updateIssueComments=ff,i.updateIssueType=kA,i.updateIssueTypeAttachment=Cf,i.updateIssueTypeAttachments=Uf,i.updateIssueTypeFieldValues=yS,i.updateIssueTypeFieldValuesAttachment=US,i.updateIssueTypeFieldValuesAttachments=LS,i.updateIssueTypeFieldValuesMany=fS,i.updateIssueTypeFields=MS,i.updateIssueTypeFieldsAttachment=tS,i.updateIssueTypeFieldsAttachments=sS,i.updateIssueTypeFieldsMany=kS,i.updateIssueTypeIdentifier=sA,i.updateIssueTypeIdentifierValue=fA,i.updateIssueTypeIdentifierValues=SA,i.updateIssueTypeIdentifiers=iA,i.updateIssueTypeStatus=NA,i.updateIssueTypeStatuses=GA,i.updateIssueTypes=EA,i.updateIssueUpdate=tw,i.updateIssueUpdates=sw,i.updateIssues=Rf,i.updateOrganization=jw,i.updateOrganizationAccess=_w,i.updateOrganizationAccesses=gw,i.updateOrganizations=Dw,i.updateProject=YT,i.updateProjectAccess=aT,i.updateProjectAccesses=cT,i.updateProjectAttachment=AT,i.updateProjectAttachments=wT,i.updateProjectFile=vT,i.updateProjectFiles=VT,i.updateProjects=KT,i.updateTeam=OI,i.updateTeamMembership=dI,i.updateTeamMemberships=lI,i.updateTeams=FI,i.updateUser=pw,i.updateUsers=hw,i.updateWorkflow=DI,i.updateWorkflowStep=P_,i.updateWorkflowStepAssignee=XI,i.updateWorkflowStepAssignees=xI,i.updateWorkflowStepComment=hO,i.updateWorkflowStepComments=pO,i.updateWorkflowStepEvent=PO,i.updateWorkflowStepEvents=bO,i.updateWorkflowStepFieldValues=PF,i.updateWorkflowStepFieldValuesAttachment=hF,i.updateWorkflowStepFieldValuesAttachments=pF,i.updateWorkflowStepFieldValuesMany=bF,i.updateWorkflowStepFieldValuesReview=XF,i.updateWorkflowStepFieldValuesReviewRequest=jF,i.updateWorkflowStepFieldValuesReviewRequests=$F,i.updateWorkflowStepFieldValuesReviews=xF,i.updateWorkflowStepFields=xO,i.updateWorkflowStepFieldsAttachment=jO,i.updateWorkflowStepFieldsAttachments=$O,i.updateWorkflowStepFieldsMany=eF,i.updateWorkflowStepReviewer=h_,i.updateWorkflowStepReviewers=p_,i.updateWorkflowSteps=b_,i.updateWorkflowType=$_,i.updateWorkflowTypes=C_,i.updateWorkflows=jI,i.useSelectorBuilder=Vg,i.userReducer=yw,i.userSlice=Dn,i.uuidObj=O,i.uuidObjSortFn=As,i.uuidSortFn=Ut,i.versioningReducer=EI,i.versioningSlice=kI,i.workflowReducer=GI,i.workflowSlice=ta,i.workflowStepAssigneeReducer=aO,i.workflowStepAssigneeSlice=sa,i.workflowStepCommentReducer=wO,i.workflowStepCommentSlice=ia,i.workflowStepEventReducer=VO,i.workflowStepEventSlice=na,i.workflowStepFieldValuesAttachmentReducer=wF,i.workflowStepFieldValuesAttachmentSlice=ua,i.workflowStepFieldValuesReducer=VF,i.workflowStepFieldValuesReviewReducer=a_,i.workflowStepFieldValuesReviewRequestReducer=HF,i.workflowStepFieldValuesReviewRequestSlice=ya,i.workflowStepFieldValuesReviewSlice=Aa,i.workflowStepFieldValuesSlice=ma,i.workflowStepFieldsAttachmentReducer=HO,i.workflowStepFieldsAttachmentSlice=aa,i.workflowStepFieldsReducer=cF,i.workflowStepFieldsSlice=la,i.workflowStepReducer=V_,i.workflowStepReviewerReducer=w_,i.workflowStepReviewerSlice=Ia,i.workflowStepSlice=Oa,i.workflowTypeReducer=K_,i.workflowTypeSlice=_a,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
13
+ external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(p)}return await this.addCache(l),l}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.processPresignedUrl(a,c);return n}async getFilePayload(e){const a={sha1:await Lt(e),file_type:e.type,extension:Ka(e),size:e.size};return await this.client.files.addCache(e),a}}class FM extends M{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:Pp,addMany:bp,setOne:Rp,setMany:Mp,updateOne:kp,updateMany:Ep,deleteOne:vp,deleteMany:Vp,initialize:gp});m(this,"selectors",{selectById:Wp,selectByIds:zp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.form],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{form__organization:e}},n);return this.dispatch(a(c)),c}}class _M extends M{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:$p,addMany:Cp,setOne:Up,setMany:Lp,updateOne:Np,updateMany:Gp,deleteOne:Hp,deleteMany:Kp,initialize:jp});m(this,"selectors",{selectById:Jp,selectByIds:Zp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class gM extends q{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:em,addMany:tm,setOne:sm,setMany:im,updateOne:nm,updateMany:am,deleteOne:cm,deleteMany:rm,initialize:xp});m(this,"selectors",{selectById:lm,selectByIds:um})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}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 PM extends M{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:qi,addMany:Di,setOne:mm,setMany:ym,updateOne:fm,updateMany:Sm,deleteOne:ji,deleteMany:$i,initialize:pm});m(this,"selectors",{selectById:Am,selectByIds:wm})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class bM extends M{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:_m,addMany:gm,setOne:Pm,setMany:bm,updateOne:Rm,updateMany:Mm,deleteOne:km,deleteMany:Em,initialize:Fm});m(this,"selectors",{selectById:Bm,selectByIds:Wm})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=O({...e,submitted_at:d,created_by:l}),p=O({...n,form:u.uuid,submitted_at:d,created_by:l});this.dispatch(c(u)),this.dispatch(qi(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...R(u),initial_revision:{uuid:p.uuid,submitted_at:p.submitted_at,title:p.title,description:p.description,fields:p.fields}},blockers:[],blocks:[u.uuid,p.uuid]});return y.catch(T=>{throw this.dispatch(r(u.uuid)),this.dispatch(ji(p.uuid)),T}),[u,p,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error("Expected form to exist");const u=ay(e)(d),p=Tm(e)(d);this.dispatch(a(e)),this.dispatch(Xi(V(u))),this.dispatch($i(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Di(p)),this.dispatch(Qi(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class RM extends q{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:Dm,addMany:Gi,setOne:jm,setMany:$m,updateOne:Cm,updateMany:Um,deleteOne:Lm,deleteMany:Hi,initialize:qm});m(this,"selectors",{selectById:Nm,selectByIds:Gm})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=Ji(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 MM extends M{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:Xm,addMany:Qi,setOne:Zm,setMany:Qm,updateOne:xm,updateMany:ey,deleteOne:ty,deleteMany:Xi,initialize:Jm});m(this,"selectors",{selectById:iy,selectByIds:ny})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Hm(e)(d);this.dispatch(a(e)),this.dispatch(Hi(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Gi(u)),p}}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 kM extends q{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:oy,addMany:hy,setOne:ly,setMany:uy,updateOne:py,updateMany:my,deleteOne:yy,deleteMany:fy,initialize:dy});m(this,"selectors",{selectById:Ay,selectByIds:wy})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class EM extends M{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:by,addMany:yt,setOne:_y,setMany:Fy,updateOne:gy,updateMany:Py,deleteOne:Ry,deleteMany:ft,initialize:Oy});m(this,"selectors",{selectById:ky,selectByIds:Ey})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 vM extends q{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:$y,addMany:an,setOne:Cy,setMany:Uy,updateOne:Ly,updateMany:Ny,deleteOne:Gy,deleteMany:cn,initialize:jy});m(this,"selectors",{selectById:Yy,selectByIds:Jy})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class VM extends q{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:xy,addMany:ef,setOne:tf,setMany:sf,updateOne:nf,updateMany:af,deleteOne:cf,deleteMany:rf,initialize:Xy});m(this,"selectors",{selectById:lf,selectByIds:uf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class BM extends M{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:mf,addMany:yf,setOne:ff,setMany:Sf,updateOne:Af,updateMany:wf,deleteOne:Tf,deleteMany:If,initialize:pf});m(this,"selectors",{selectById:Of,selectByIds:Ff})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue],blocks:[d.uuid]});return l.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 WM extends M{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:bf,addMany:pn,setOne:Rf,setMany:Mf,updateOne:kf,updateMany:Ef,deleteOne:vf,deleteMany:mn,initialize:Pf});m(this,"selectors",{selectById:Bf,selectByIds:Wf})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=new Date().toISOString(),u=((f=d.userReducer.currentUser)==null?void 0:f.id)??null,p=O({...e,submitted_at:l,created_by:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[p.project,p.issue_type,p.status],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(T=>{throw this.dispatch(r(p.uuid)),T}),[p,y]}update(e){var y;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 d={...r,...e};this.dispatch(n(d));const l={};for(const f of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(f in e&&e[f]!==r[f])switch(f){case $.PRIORITY:l[f]=e[f];break;case $.DUE_DATE:l[f]=e[f];break;case $.DESCRIPTION:l[f]=e[f];break;case $.TITLE:l[f]=e[f];break;case $.STATUS:{const T=e[f],P=vn(T)(c);if(!P)throw new Error(`Trying to update issue type status with ${T} which does not exist in store`);l[f]={name:P.name,color:P.color,uuid:P.uuid};break}case $.ASSIGNED_TO:{const T=e[f];if(T===null)l[f]=null;else{const P=ds(T)(c);if(!P)throw new Error(`Trying to update assigned to with ${T} which does not exist in store.`);l[f]={full_name:P.username,id:P.id}}break}}const u=O({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(Bn(u));const p=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(zn(u.uuid))}),[d,p]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Nt);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(Ts);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} issues that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=mt(e,Math.min(n??e.length,ot)),y=[];let f=null;for(const T of p){const P=ht.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(k),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const u=vy(e)(d),p=Wy(e)(d),y=Ky(e)(d),f=dw(e)(d);this.dispatch(a(e)),this.dispatch(cn(V(y))),this.dispatch(qn(V(f))),this.dispatch(ft(V(u))),this.dispatch(ft(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(T){throw this.dispatch(c(l)),this.dispatch(an(y)),this.dispatch(Wn(f)),this.dispatch(yt(u)),this.dispatch(yt(p)),T}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d),u=Vy(e)(d),p=By(e)(d);this.dispatch(c(e)),this.dispatch(ft(V(u))),this.dispatch(ft(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(yt(u)),this.dispatch(yt(p)),y}}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 zM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:$f,addMany:Cf,setOne:Uf,setMany:Lf,updateOne:Nf,updateMany:Gf,deleteOne:Hf,deleteMany:Kf,initialize:jf});m(this,"selectors",{selectById:Jf,selectByIds:Zf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class qM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:eS,addMany:tS,setOne:sS,setMany:iS,updateOne:nS,updateMany:aS,deleteOne:cS,deleteMany:rS,initialize:xf});m(this,"selectors",{selectById:lS,selectByIds:uS})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}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 DM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:RS,addMany:MS,setOne:kS,setMany:ES,updateOne:vS,updateMany:VS,deleteOne:BS,deleteMany:WS,initialize:bS});m(this,"selectors",{selectById:qS,selectByIds:DS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}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 jM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:US,addMany:On,setOne:LS,setMany:NS,updateOne:GS,updateMany:HS,deleteOne:KS,deleteMany:Fn,initialize:CS});m(this,"selectors",{selectById:JS,selectByIds:ZS})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.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:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class $M extends M{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:mS,addMany:yS,setOne:fS,setMany:SS,updateOne:AS,updateMany:wS,deleteOne:TS,deleteMany:IS,initialize:pS});m(this,"selectors",{selectById:FS,selectByIds:_S})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.issue,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=QS(e)(d);this.dispatch(a(e)),this.dispatch(Fn(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(On(u)),p}}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 CM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:tA,addMany:sA,setOne:iA,setMany:nA,updateOne:aA,updateMany:cA,deleteOne:rA,deleteMany:dA,initialize:eA});m(this,"selectors",{selectById:uA,selectByIds:oA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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 UM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:yA,addMany:fA,setOne:SA,setMany:AA,updateOne:wA,updateMany:TA,deleteOne:IA,deleteMany:OA,initialize:mA});m(this,"selectors",{selectById:_A,selectByIds:gA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class LM extends M{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:MA,addMany:kA,setOne:EA,setMany:vA,updateOne:VA,updateMany:BA,deleteOne:WA,deleteMany:zA,initialize:RA});m(this,"selectors",{selectById:DA,selectByIds:jA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,submitted_at:u,created_by:l});this.dispatch(a(p));const y=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=zf(e)(d);this.dispatch(a(e)),this.dispatch(mn(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(pn(u)),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 NM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:LA,addMany:NA,setOne:GA,setMany:HA,updateOne:KA,updateMany:YA,deleteOne:JA,deleteMany:ZA,initialize:UA});m(this,"selectors",{selectById:vn,selectByIds:XA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}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 d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class GM extends M{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:Bn,addMany:Wn,setOne:sw,setMany:iw,updateOne:nw,updateMany:aw,deleteOne:zn,deleteMany:qn,initialize:tw});m(this,"selectors",{selectById:cw,selectByIds:rw})}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 HM=1800;function KM(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 YM extends GR{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:h.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(Eh(!1)),this.clearTokens(),this.dispatch(I()),this.dispatch(I())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=Ng(e).exp??n}catch{a=n}return a-n<HM}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 C&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??_t).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 C({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 C({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=ht.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:h.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(KM(a))})}}class JM extends Tt{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:Fw,addMany:_w,setOne:gw,setMany:Pw,updateOne:bw,updateMany:Rw,deleteOne:Mw,deleteMany:kw,initialize:Ow});m(this,"selectors",{selectById:vw,selectByIds:Vw})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d),u=ds(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch(Un(l.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Cn(u)),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 ZM extends Tt{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:$w,addMany:jw,setOne:Dw,setMany:qw,updateOne:Uw,updateMany:Cw,deleteOne:Lw,deleteMany:Nw,initialize:zw});m(this,"selectors",{selectById:Kw,selectByIds:Yw})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.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 QM extends M{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:nT,addMany:aT,setOne:cT,setMany:rT,updateOne:dT,updateMany:lT,deleteOne:uT,deleteMany:oT,initialize:iT});m(this,"selectors",{selectById:pT,selectByIds:mT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.organization_access,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(p=>{throw this.dispatch(r(d.uuid)),p}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>R(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(r(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class XM extends q{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:ST,addMany:AT,setOne:wT,setMany:TT,updateOne:IT,updateMany:OT,deleteOne:FT,deleteMany:_T,initialize:fT});m(this,"selectors",{selectById:PT,selectByIds:bT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class xM extends q{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:VT,addMany:BT,setOne:ET,setMany:vT,updateOne:WT,updateMany:zT,deleteOne:qT,deleteMany:DT,initialize:kT});m(this,"selectors",{selectById:CT,selectByIds:UT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[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 ek extends Tt{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:JT,addMany:YT,setOne:KT,setMany:HT,updateOne:QT,updateMany:ZT,deleteOne:XT,deleteMany:xT,initialize:GT});m(this,"selectors",{selectById:sI,selectByIds:iI})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.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 tk extends M{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:rI,addMany:dI,setOne:lI,setMany:uI,updateOne:oI,updateMany:hI,deleteOne:pI,deleteMany:mI,initialize:cI});m(this,"selectors",{selectById:SI,selectByIds:AI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.team],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>R(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.map(y=>y.uuid)))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}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 sk extends M{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:II,addMany:OI,setOne:FI,setMany:_I,updateOne:gI,updateMany:PI,deleteOne:bI,deleteMany:RI,initialize:TI});m(this,"selectors",{selectById:kI,selectByIds:EI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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 d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class ik extends Tt{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:Cn,addMany:mw,setOne:pw,setMany:hw,updateOne:fw,updateMany:yw,deleteOne:Un,deleteMany:Sw,initialize:ow});m(this,"selectors",{selectById:ds,selectByIds:Tw})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:h.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}}class nk extends M{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:qI,addMany:DI,setOne:jI,setMany:$I,updateOne:CI,updateMany:UI,deleteOne:LI,deleteMany:NI,initialize:zI});m(this,"selectors",{selectById:HI,selectByIds:KI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type,d.project],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}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 ak extends M{constructor(){super(...arguments);m(this,"name","Workflow Issue Link");m(this,"url","/workflow-issue-links");m(this,"actions",{addOne:QI,addMany:XI,setOne:xI,setMany:eO,updateOne:tO,updateMany:sO,deleteOne:iO,deleteMany:nO,initialize:ZI});m(this,"selectors",{selectById:cO,selectByIds:rO})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.workflow,e.issue],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow issue link with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class ck extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:oO,addMany:hO,setOne:pO,setMany:mO,updateOne:yO,updateMany:fO,deleteOne:SO,deleteMany:AO,initialize:uO});m(this,"selectors",{selectById:TO,selectByIds:IO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(V(u)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class rk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:gO,addMany:PO,setOne:bO,setMany:RO,updateOne:MO,updateMany:kO,deleteOne:EO,deleteMany:vO,initialize:_O});m(this,"selectors",{selectById:BO,selectByIds:WO})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class dk extends Tt{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:jO,addMany:$O,setOne:CO,setMany:UO,updateOne:LO,updateMany:NO,deleteOne:GO,deleteMany:HO,initialize:DO});m(this,"selectors",{selectById:YO,selectByIds:JO})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class lk extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:xO,addMany:la,setOne:eF,setMany:tF,updateOne:sF,updateMany:iF,deleteOne:nF,deleteMany:ua,initialize:XO});m(this,"selectors",{selectById:rF,selectByIds:dF})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class uk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:hF,addMany:pF,setOne:mF,setMany:yF,updateOne:fF,updateMany:SF,deleteOne:AF,deleteMany:wF,initialize:oF});m(this,"selectors",{selectById:IF,selectByIds:OF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const u=cF(e)(d);this.dispatch(a(e)),this.dispatch(ua(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(la(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class ok extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:PF,addMany:ma,setOne:bF,setMany:RF,updateOne:MF,updateMany:kF,deleteOne:EF,deleteMany:ya,initialize:gF});m(this,"selectors",{selectById:VF,selectByIds:BF})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class hk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review Request");m(this,"url","/workflow-step-field-values-review-requests");m(this,"actions",{addOne:xF,addMany:wa,setOne:e_,setMany:t_,updateOne:s_,updateMany:i_,deleteOne:n_,deleteMany:Ta,initialize:XF});m(this,"selectors",{selectById:c_,selectByIds:r_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class pk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review");m(this,"url","/workflow-step-field-values-reviews");m(this,"actions",{addOne:h_,addMany:Oa,setOne:p_,setMany:m_,updateOne:y_,updateMany:f_,deleteOne:S_,deleteMany:Fa,initialize:o_});m(this,"selectors",{selectById:w_,selectByIds:T_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class mk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:jF,addMany:$F,setOne:CF,setMany:UF,updateOne:LF,updateMany:NF,deleteOne:GF,deleteMany:HF,initialize:DF});m(this,"selectors",{selectById:YF,selectByIds:JF})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()}),u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.workflow,l.workflow_step,l.fields_revision],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const u=WF(e)(d),p=I_(e)(d),y=d_(e)(d);this.dispatch(a(e)),this.dispatch(ya(V(u))),this.dispatch(Fa(V(p))),this.dispatch(Ta(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(ma(u)),this.dispatch(Oa(p)),this.dispatch(wa(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class yk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:g_,addMany:P_,setOne:b_,setMany:R_,updateOne:M_,updateMany:k_,deleteOne:E_,deleteMany:v_,initialize:__});m(this,"selectors",{selectById:B_,selectByIds:W_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class fk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:j_,addMany:$_,setOne:C_,setMany:U_,updateOne:L_,updateMany:N_,deleteOne:G_,deleteMany:H_,initialize:D_});m(this,"selectors",{selectById:Y_,selectByIds:J_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}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 workflow step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Sk extends M{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:x_,addMany:eg,setOne:tg,setMany:sg,updateOne:ig,updateMany:ng,deleteOne:ag,deleteMany:cg,initialize:X_});m(this,"selectors",{selectById:dg,selectByIds:lg})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(y=>{this.dispatch(c(y))}).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 workflow type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function va(t,s,e,n,a){const c=n instanceof wt;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:p,queryParams:y,attachmentHash:f,isExternalUrl:T,isAuthNeeded:P,isResponseBlob:E}={...r,...s};let g=s.url;const k=f?await e.files.fetchCache(f):void 0;if(f&&!k)throw new Error(`Cannot upload file ${f} because it's not cached.`);!T&&!g.startsWith("http")&&(!g.startsWith("/")&&!g.startsWith("blob:")&&(g="/"+g),g=t+g);const b=v=>{if(f){if(!d)throw new Error(`No S3 URL for file ${f}`);if("warning"in d)throw new Error(`S3 URL warning for file ${f}`);if(!k)throw new Error(`No file for file ${f}`);const L=d.fields["x-amz-checksum-sha1"];if(!L)throw new Error(`No checksum for file ${f}`);return v.set("x-amz-checksum-sha1",L).field({...l,...d.fields}).attach("file",k)}return v.send(l)},j={[h.GET]:()=>E?Ot.get(g.toString()).responseType("blob"):Ot.get(g.toString()),[h.POST]:()=>{const v=Ot.post(g.toString());return b(v)},[h.PATCH]:()=>{const v=Ot.patch(g.toString());return b(v)},[h.PUT]:()=>{const v=Ot.put(g.toString());return b(v)},[h.DELETE]:()=>{const v=Ot.delete(g.toString());return b(v)}}[p];let W=j();const D=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",D),P&&c){const v=n.auth.getAuthHeader();W=W.set("Authorization",v)}u&&(W=W.set(u));try{return await W.query(y)}catch(v){const L=gg(v),ms=L==null?void 0:L.status;if(c&&ms===401)return await n.auth.handleUnauthorized(W,L),W.query(y);throw new C({response:L,innerError:v,discard:ka.includes(ms)})}finally{a==null||a.removeEventListener("abort",D)}}class Ak{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new fs,r={...e,uuid:e.uuid??ht.v4()};return va(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??_t).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof C)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof C)throw a;return a})}_enqueueRequest(s,e,n){const a=new fs,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(Xw(c)),d=u=>{if(u)a.resolve(u.body);else{const p=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(p)}},l=u=>{u instanceof C?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
14
+ Converting error to APIError and discarding.`),u=new C({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return r.then(d,l),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,l=[];let u=await this.performRequest(s,r,a,c);for(l.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:d},a,c),l.push(u.results);return l}}class gt{constructor(){m(this,"graph");m(this,"requestAttemptCounter");this.graph=new Gg.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new gt;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(d=>a.payload.blockers.includes(d))&&gt._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){gt._addDependency(s,e,this.graph)}static _addDependency(s,e,n){if(s===e)throw new Error(`Tried to add dependency from node to itself: ${s}`);if(!n.hasNode(s))throw new Error(`Tried to add dependency from non-existent node: ${s} (to node: ${e})`);if(!n.hasNode(e))throw new Error(`Tried to add dependency to non-existent node: ${e} (from node: ${s})`);n.addDependency(s,e)}addRequest(s){if(this.graph.addNode(s.payload.uuid,s),!(s.payload.blockers.length===0||this.graph.size()===1))for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&this._addDependency(s.payload.uuid,e)}}insertRequest(s){this.graph.addNode(s.payload.uuid,s);for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let Pg;function bg(t){Pg=t}function Pt(){return Pg}let Rg;function Mg(t){Rg=t}function kg(){return Rg}let Va=null;function It(){const t=Pt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Va)return Va;const s=t.getState().offline.outbox,e=gt._fromOutbox(s);return Va=e,e}const wk=(t,s)=>{const e=new s(t);return Mg(e),bg(t),e};class Tk{constructor(s){m(this,"_all");m(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 Ba{constructor(){m(this,"next");this.next=null}then(s){return new Tk(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Pt())throw new Error("Client store not set");const n=kg();if(!n)throw new Error("Client SDK not set");return Og(s,n)}}}class Eg extends Ba{async run(s){return super.run(s)}}class vg extends Ba{async run(s){return super.run(s)}}const Vg=new Eg().then(new vg).compile();function Bg(t){var s;return(s=Vg[0])==null?void 0:s.run(t)}var Wg=(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))(Wg||{});i.ALL_MIDDLEWARE=Vg,i.APIError=C,i.AgentService=HR,i.AssetAttachmentService=KR,i.AssetProcedureService=xR,i.AssetProcedureStepFieldValuesAttachmentService=iM,i.AssetProcedureStepFieldValuesService=nM,i.AssetProcedureStepFieldsAttachmentService=tM,i.AssetProcedureStepFieldsService=sM,i.AssetProcedureStepService=aM,i.AssetProcedureTypeAttachmentService=YR,i.AssetProcedureTypeFieldValuesAttachmentService=QR,i.AssetProcedureTypeFieldValuesService=XR,i.AssetProcedureTypeFieldsAttachmentService=JR,i.AssetProcedureTypeFieldsService=ZR,i.AssetProcedureTypeService=eM,i.AssetService=cM,i.AssetStageCompletionService=rM,i.AssetStageService=dM,i.AssetStatusType=Ca,i.AssetTypeAttachmentService=lM,i.AssetTypeFieldValuesAttachmentService=hM,i.AssetTypeFieldValuesService=pM,i.AssetTypeFieldsAttachmentService=uM,i.AssetTypeFieldsService=oM,i.AssetTypeIdentifierService=mM,i.AssetTypeIdentifierValueService=yM,i.AssetTypeService=fM,i.AssetTypeStatusService=SM,i.AttachmentModel=Ua,i.BaseApiService=wt,i.BaseModelApiService=Tt,i.BaseOfflineFileModelApiService=q,i.BaseOfflineModelApiService=M,i.BaseSDK=Ak,i.COMMON_AUTO_FIELDS=Xa,i.DEFAULT_ISSUE_PRIORITY=Hg,i.DEFAULT_PAGE_SIZE=hg,i.DISCARD_HTTP_STATUSES=ka,i.DeferredPromise=fs,i.DocumentAttachmentService=AM,i.DocumentService=wM,i.EMPTY_ARRAY=Da,i.EMPTY_OBJECT=ja,i.EmailDomainsService=TM,i.EmailVerificationService=IM,i.FILE_MODEL_DEFAULT_PAGE_SIZE=pg,i.FileService=OM,i.FormIdentifierService=FM,i.FormIdentifierValueService=_M,i.FormRevisionAttachmentService=gM,i.FormRevisionService=PM,i.FormService=bM,i.FormSubmissionAttachmentService=RM,i.FormSubmissionService=MM,i.GeoImageService=kM,i.HttpMethod=h,i.IssueAssociationService=EM,i.IssueAttachmentService=vM,i.IssueCommentAttachmentService=VM,i.IssueCommentService=BM,i.IssuePriority=ys,i.IssueService=WM,i.IssueStatusType=La,i.IssueTypeAttachmentService=zM,i.IssueTypeFieldValuesAttachmentService=jM,i.IssueTypeFieldValuesService=$M,i.IssueTypeFieldsAttachmentService=qM,i.IssueTypeFieldsService=DM,i.IssueTypeIdentifierService=CM,i.IssueTypeIdentifierValueService=UM,i.IssueTypeService=LM,i.IssueTypeStatusService=NM,i.IssueUpdateChange=$,i.IssueUpdateService=GM,i.JWTService=YM,i.MAX_SERVICE_BATCH_SIZE=ot,i.OUTBOX_RETRY_DELAY=Ga,i.OfflineAnalyticsMiddleware=Eg,i.OfflineMiddleware=Ba,i.OrganizationAccessLevel=$a,i.OrganizationAccessService=JM,i.OrganizationService=ZM,i.OutboxCoordinator=gt,i.ProjectAccessService=QM,i.ProjectAttachmentService=XM,i.ProjectFileService=xM,i.ProjectService=ek,i.RESET_ORGANIZATION_STATE=_,i.RESET_PROJECT_STATE=B,i.RESET_STATE=I,i.RateLimitingMiddleware=vg,i.SelectorBuilder=SP,i.TeamMembershipService=tk,i.TeamService=sk,i.UNKNOWN_ERROR_MESSAGE=_t,i.UserService=ik,i.VERSION_REDUCER_KEY=kt,i.VerificationCodeType=Wg,i.WORKFLOW_STATUSES=Yg,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=Kg,i.WorkflowIssueLinkService=ak,i.WorkflowService=nk,i.WorkflowStatus=Rt,i.WorkflowStepAssigneeService=ck,i.WorkflowStepCommentService=rk,i.WorkflowStepEventService=dk,i.WorkflowStepEventType=Na,i.WorkflowStepFieldValuesAttachmentService=ok,i.WorkflowStepFieldValuesReviewRequestService=hk,i.WorkflowStepFieldValuesReviewService=pk,i.WorkflowStepFieldValuesReviewType=Mt,i.WorkflowStepFieldValuesService=mk,i.WorkflowStepFieldsAttachmentService=lk,i.WorkflowStepFieldsService=uk,i.WorkflowStepReviewerService=yk,i.WorkflowStepService=fk,i.WorkflowTypeService=Sk,i._setLatestRetryTime=eT,i.addAsset=Rl,i.addAssetAttachment=pc,i.addAssetAttachments=_s,i.addAssetProcedure=Cr,i.addAssetProcedureStep=fl,i.addAssetProcedureStepFieldValues=el,i.addAssetProcedureStepFieldValuesAttachment=Cd,i.addAssetProcedureStepFieldValuesAttachments=Ks,i.addAssetProcedureStepFieldValuesMany=tl,i.addAssetProcedureStepFields=Rd,i.addAssetProcedureStepFieldsAttachment=md,i.addAssetProcedureStepFieldsAttachments=yd,i.addAssetProcedureStepFieldsMany=Md,i.addAssetProcedureSteps=Sl,i.addAssetProcedureType=ed,i.addAssetProcedureTypeAttachment=Pc,i.addAssetProcedureTypeAttachments=bc,i.addAssetProcedureTypeFieldValues=br,i.addAssetProcedureTypeFieldValuesAttachment=mr,i.addAssetProcedureTypeFieldValuesAttachments=Vs,i.addAssetProcedureTypeFieldValuesMany=Rr,i.addAssetProcedureTypeFields=er,i.addAssetProcedureTypeFieldsAttachment=$c,i.addAssetProcedureTypeFieldsAttachments=Cc,i.addAssetProcedureTypeFieldsMany=tr,i.addAssetProcedureTypes=td,i.addAssetProcedures=Ds,i.addAssetStage=nu,i.addAssetStageCompletion=Cl,i.addAssetStageCompletions=Ul,i.addAssetStages=au,i.addAssetType=ch,i.addAssetTypeAttachment=yu,i.addAssetTypeAttachments=ri,i.addAssetTypeFieldValues=fo,i.addAssetTypeFieldValuesAttachment=so,i.addAssetTypeFieldValuesAttachments=mi,i.addAssetTypeFieldValuesMany=So,i.addAssetTypeFields=Uu,i.addAssetTypeFieldsAttachment=Ru,i.addAssetTypeFieldsAttachments=Mu,i.addAssetTypeFieldsMany=Lu,i.addAssetTypeIdentifier=ko,i.addAssetTypeIdentifierValue=No,i.addAssetTypeIdentifierValues=Go,i.addAssetTypeIdentifiers=Eo,i.addAssetTypeStatus=Ah,i.addAssetTypeStatuses=wh,i.addAssetTypes=rh,i.addAssets=ei,i.addConversation=rc,i.addConversations=AP,i.addDocument=Jh,i.addDocumentAttachment=Wh,i.addDocumentAttachments=zh,i.addDocuments=Zh,i.addEmailDomain=lp,i.addEmailDomains=up,i.addForm=_m,i.addFormIdentifier=Pp,i.addFormIdentifierValue=$p,i.addFormIdentifierValues=Cp,i.addFormIdentifiers=bp,i.addFormRevision=qi,i.addFormRevisionAttachment=em,i.addFormRevisionAttachments=tm,i.addFormRevisions=Di,i.addFormSubmission=Xm,i.addFormSubmissionAttachment=Dm,i.addFormSubmissionAttachments=Gi,i.addFormSubmissions=Qi,i.addForms=gm,i.addGeoImage=oy,i.addGeoImages=hy,i.addIssue=bf,i.addIssueAssociation=by,i.addIssueAssociations=yt,i.addIssueAttachment=$y,i.addIssueAttachments=an,i.addIssueComment=mf,i.addIssueCommentAttachment=xy,i.addIssueCommentAttachments=ef,i.addIssueComments=yf,i.addIssueType=MA,i.addIssueTypeAttachment=$f,i.addIssueTypeAttachments=Cf,i.addIssueTypeFieldValues=mS,i.addIssueTypeFieldValuesAttachment=US,i.addIssueTypeFieldValuesAttachments=On,i.addIssueTypeFieldValuesMany=yS,i.addIssueTypeFields=RS,i.addIssueTypeFieldsAttachment=eS,i.addIssueTypeFieldsAttachments=tS,i.addIssueTypeFieldsMany=MS,i.addIssueTypeIdentifier=tA,i.addIssueTypeIdentifierValue=yA,i.addIssueTypeIdentifierValues=fA,i.addIssueTypeIdentifiers=sA,i.addIssueTypeStatus=LA,i.addIssueTypeStatuses=NA,i.addIssueTypes=kA,i.addIssueUpdate=Bn,i.addIssueUpdates=Wn,i.addIssues=pn,i.addOrganization=$w,i.addOrganizationAccess=Fw,i.addOrganizationAccesses=_w,i.addOrganizations=jw,i.addProject=JT,i.addProjectAccess=nT,i.addProjectAccesses=aT,i.addProjectAttachment=ST,i.addProjectAttachments=AT,i.addProjectFile=VT,i.addProjectFiles=BT,i.addProjects=YT,i.addTeam=II,i.addTeamMembership=rI,i.addTeamMemberships=dI,i.addTeams=OI,i.addUser=Cn,i.addUsers=mw,i.addWorkflow=qI,i.addWorkflowIssueLink=QI,i.addWorkflowIssueLinks=XI,i.addWorkflowStep=j_,i.addWorkflowStepAssignee=oO,i.addWorkflowStepAssignees=hO,i.addWorkflowStepComment=gO,i.addWorkflowStepComments=PO,i.addWorkflowStepEvent=jO,i.addWorkflowStepEvents=$O,i.addWorkflowStepFieldValues=jF,i.addWorkflowStepFieldValuesAttachment=PF,i.addWorkflowStepFieldValuesAttachments=ma,i.addWorkflowStepFieldValuesMany=$F,i.addWorkflowStepFieldValuesReview=h_,i.addWorkflowStepFieldValuesReviewRequest=xF,i.addWorkflowStepFieldValuesReviewRequests=wa,i.addWorkflowStepFieldValuesReviews=Oa,i.addWorkflowStepFields=hF,i.addWorkflowStepFieldsAttachment=xO,i.addWorkflowStepFieldsAttachments=la,i.addWorkflowStepFieldsMany=pF,i.addWorkflowStepReviewer=g_,i.addWorkflowStepReviewers=P_,i.addWorkflowSteps=$_,i.addWorkflowType=x_,i.addWorkflowTypes=eg,i.addWorkflows=DI,i.agentsReducer=uc,i.agentsSlice=Is,i.areArraysEqual=Xg,i.assetAttachmentReducer=Fc,i.assetAttachmentSlice=Fs,i.assetProcedureReducer=Kr,i.assetProcedureSlice=qs,i.assetProcedureStepFieldValuesAttachmentReducer=Qd,i.assetProcedureStepFieldValuesAttachmentSlice=Hs,i.assetProcedureStepFieldValuesReducer=ol,i.assetProcedureStepFieldValuesSlice=Zs,i.assetProcedureStepFieldsAttachmentReducer=gd,i.assetProcedureStepFieldsAttachmentSlice=Us,i.assetProcedureStepFieldsReducer=Dd,i.assetProcedureStepFieldsSlice=Ns,i.assetProcedureStepReducer=Ol,i.assetProcedureStepSlice=Qs,i.assetProcedureTypeAttachmentReducer=Bc,i.assetProcedureTypeAttachmentSlice=bs,i.assetProcedureTypeFieldValuesAttachmentReducer=Tr,i.assetProcedureTypeFieldValuesAttachmentSlice=vs,i.assetProcedureTypeFieldValuesReducer=Wr,i.assetProcedureTypeFieldValuesSlice=zs,i.assetProcedureTypeFieldsAttachmentReducer=Yc,i.assetProcedureTypeFieldsAttachmentSlice=Ms,i.assetProcedureTypeFieldsReducer=dr,i.assetProcedureTypeFieldsSlice=Es,i.assetProcedureTypeReducer=dd,i.assetProcedureTypeSlice=$s,i.assetReducer=Dl,i.assetSlice=xs,i.assetStageCompletionReducer=Jl,i.assetStageCompletionSlice=si,i.assetStageReducer=uu,i.assetStageSlice=ii,i.assetTypeAttachmentReducer=gu,i.assetTypeAttachmentSlice=ci,i.assetTypeFieldValuesAttachmentReducer=po,i.assetTypeFieldValuesAttachmentSlice=pi,i.assetTypeFieldValuesReducer=bo,i.assetTypeFieldValuesSlice=Si,i.assetTypeFieldsAttachmentReducer=ju,i.assetTypeFieldsAttachmentSlice=ui,i.assetTypeFieldsReducer=xu,i.assetTypeFieldsSlice=hi,i.assetTypeIdentifierReducer=Co,i.assetTypeIdentifierSlice=Ai,i.assetTypeIdentifierValueReducer=th,i.assetTypeIdentifierValueSlice=Ti,i.assetTypeReducer=yh,i.assetTypeSlice=Ii,i.assetTypeStatusReducer=Mh,i.assetTypeStatusSlice=Fi,i.assetTypeStatusSortFn=tc,i.authReducer=vh,i.authSlice=xt,i.baseReducer=ER,i.baseReducers=Ma,i.clearTokens=sb,i.createModelAdapter=F,i.createOfflineAction=Zw,i.createPayload=R,i.createSelectionAdapter=Jg,i.deleteAsset=El,i.deleteAssetAttachment=Ac,i.deleteAssetAttachments=gs,i.deleteAssetProcedure=Nr,i.deleteAssetProcedureStep=Tl,i.deleteAssetProcedureStepFieldValues=cl,i.deleteAssetProcedureStepFieldValuesAttachment=Hd,i.deleteAssetProcedureStepFieldValuesAttachments=Ys,i.deleteAssetProcedureStepFieldValuesMany=rl,i.deleteAssetProcedureStepFields=Bd,i.deleteAssetProcedureStepFieldsAttachment=Td,i.deleteAssetProcedureStepFieldsAttachments=Id,i.deleteAssetProcedureStepFieldsMany=Wd,i.deleteAssetProcedureSteps=Il,i.deleteAssetProcedureType=nd,i.deleteAssetProcedureTypeAttachment=vc,i.deleteAssetProcedureTypeAttachments=Vc,i.deleteAssetProcedureTypeFieldValues=Vr,i.deleteAssetProcedureTypeFieldValuesAttachment=wr,i.deleteAssetProcedureTypeFieldValuesAttachments=Bs,i.deleteAssetProcedureTypeFieldValuesMany=Br,i.deleteAssetProcedureTypeFields=cr,i.deleteAssetProcedureTypeFieldsAttachment=Hc,i.deleteAssetProcedureTypeFieldsAttachments=Kc,i.deleteAssetProcedureTypeFieldsMany=rr,i.deleteAssetProcedureTypes=ad,i.deleteAssetProcedures=js,i.deleteAssetStage=du,i.deleteAssetStageCompletion=Kl,i.deleteAssetStageCompletions=Yl,i.deleteAssetStages=lu,i.deleteAssetType=uh,i.deleteAssetTypeAttachment=Tu,i.deleteAssetTypeAttachments=di,i.deleteAssetTypeFieldValues=Oo,i.deleteAssetTypeFieldValuesAttachment=ro,i.deleteAssetTypeFieldValuesAttachments=yi,i.deleteAssetTypeFieldValuesMany=Fo,i.deleteAssetTypeFields=Yu,i.deleteAssetTypeFieldsAttachment=Bu,i.deleteAssetTypeFieldsAttachments=Wu,i.deleteAssetTypeFieldsMany=Ju,i.deleteAssetTypeIdentifier=zo,i.deleteAssetTypeIdentifierValue=Zo,i.deleteAssetTypeIdentifierValues=Qo,i.deleteAssetTypeIdentifiers=qo,i.deleteAssetTypeStatus=_h,i.deleteAssetTypeStatuses=gh,i.deleteAssetTypes=oh,i.deleteAssets=ti,i.deleteConversation=IP,i.deleteConversations=OP,i.deleteDocument=tp,i.deleteDocumentAttachment=Ch,i.deleteDocumentAttachments=Uh,i.deleteDocuments=sp,i.deleteEmailDomain=yp,i.deleteEmailDomains=fp,i.deleteForm=km,i.deleteFormIdentifier=vp,i.deleteFormIdentifierValue=Hp,i.deleteFormIdentifierValues=Kp,i.deleteFormIdentifiers=Vp,i.deleteFormRevision=ji,i.deleteFormRevisionAttachment=cm,i.deleteFormRevisionAttachments=rm,i.deleteFormRevisions=$i,i.deleteFormSubmission=ty,i.deleteFormSubmissionAttachment=Lm,i.deleteFormSubmissionAttachments=Hi,i.deleteFormSubmissions=Xi,i.deleteForms=Em,i.deleteGeoImage=yy,i.deleteGeoImages=fy,i.deleteIssue=vf,i.deleteIssueAssociation=Ry,i.deleteIssueAssociations=ft,i.deleteIssueAttachment=Gy,i.deleteIssueAttachments=cn,i.deleteIssueComment=Tf,i.deleteIssueCommentAttachment=cf,i.deleteIssueCommentAttachments=rf,i.deleteIssueComments=If,i.deleteIssueType=WA,i.deleteIssueTypeAttachment=Hf,i.deleteIssueTypeAttachments=Kf,i.deleteIssueTypeFieldValues=TS,i.deleteIssueTypeFieldValuesAttachment=KS,i.deleteIssueTypeFieldValuesAttachments=Fn,i.deleteIssueTypeFieldValuesMany=IS,i.deleteIssueTypeFields=BS,i.deleteIssueTypeFieldsAttachment=cS,i.deleteIssueTypeFieldsAttachments=rS,i.deleteIssueTypeFieldsMany=WS,i.deleteIssueTypeIdentifier=rA,i.deleteIssueTypeIdentifierValue=IA,i.deleteIssueTypeIdentifierValues=OA,i.deleteIssueTypeIdentifiers=dA,i.deleteIssueTypeStatus=JA,i.deleteIssueTypeStatuses=ZA,i.deleteIssueTypes=zA,i.deleteIssueUpdate=zn,i.deleteIssueUpdates=qn,i.deleteIssues=mn,i.deleteOrganization=Lw,i.deleteOrganizationAccess=Mw,i.deleteOrganizationAccesses=kw,i.deleteOrganizations=Nw,i.deleteProject=XT,i.deleteProjectAccess=uT,i.deleteProjectAccesses=oT,i.deleteProjectAttachment=FT,i.deleteProjectAttachments=_T,i.deleteProjectFile=qT,i.deleteProjectFiles=DT,i.deleteProjects=xT,i.deleteTeam=bI,i.deleteTeamMembership=pI,i.deleteTeamMemberships=mI,i.deleteTeams=RI,i.deleteUser=Un,i.deleteUsers=Sw,i.deleteWorkflow=LI,i.deleteWorkflowIssueLink=iO,i.deleteWorkflowIssueLinks=nO,i.deleteWorkflowStep=G_,i.deleteWorkflowStepAssignee=SO,i.deleteWorkflowStepAssignees=AO,i.deleteWorkflowStepComment=EO,i.deleteWorkflowStepComments=vO,i.deleteWorkflowStepEvent=GO,i.deleteWorkflowStepEvents=HO,i.deleteWorkflowStepFieldValues=GF,i.deleteWorkflowStepFieldValuesAttachment=EF,i.deleteWorkflowStepFieldValuesAttachments=ya,i.deleteWorkflowStepFieldValuesMany=HF,i.deleteWorkflowStepFieldValuesReview=S_,i.deleteWorkflowStepFieldValuesReviewRequest=n_,i.deleteWorkflowStepFieldValuesReviewRequests=Ta,i.deleteWorkflowStepFieldValuesReviews=Fa,i.deleteWorkflowStepFields=AF,i.deleteWorkflowStepFieldsAttachment=nF,i.deleteWorkflowStepFieldsAttachments=ua,i.deleteWorkflowStepFieldsMany=wF,i.deleteWorkflowStepReviewer=E_,i.deleteWorkflowStepReviewers=v_,i.deleteWorkflowSteps=H_,i.deleteWorkflowType=ag,i.deleteWorkflowTypes=cg,i.deleteWorkflows=NI,i.dequeue=Ig,i.discard=Fg,i.documentAttachmentReducer=Hh,i.documentAttachmentSlice=gi,i.documentSlice=bi,i.documentsReducer=ip,i.downloadFile=cP,i.emailDomainsReducer=Tp,i.emailDomainsSlice=Mi,i.emailRegex=mP,i.enqueue=Tg,i.enqueueRequest=Xw,i.extractResponseFromError=gg,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=Ut,i.fetchBlobFromObjectUrl=Ya,i.fetchFileFromObjectUrl=Ja,i.fileReducer=Fp,i.fileSlice=Ei,i.formIdentifierReducer=qp,i.formIdentifierSlice=vi,i.formIdentifierValueReducer=Qp,i.formIdentifierValueSlice=Bi,i.formReducer=vm,i.formRevisionAttachmentReducer=om,i.formRevisionAttachmentSlice=Wi,i.formRevisionReducer=Im,i.formRevisionsSlice=zi,i.formSlice=Ui,i.formSubmissionAttachmentReducer=Km,i.formSubmissionAttachmentSlice=Ni,i.formSubmissionReducer=cy,i.formSubmissionSlice=Zi,i.geoImageReducer=Ty,i.geoImageSlice=en,i.getAssetProcedureStepSubTree=ec,i.getAssetProcedureStepTrees=yP,i.getClientSDK=kg,i.getClientStore=Pt,i.getDocumentSubTree=nc,i.getDocumentTrees=fP,i.getFileExtension=Ka,i.getLocalDateString=Ha,i.getLocalRelativeDateString=sP,i.getOutboxCoordinator=It,i.getRenamedFile=aP,i.getRequestDescription=w,i.getS3FileKey=nP,i.hashFile=Lt,i.initSDK=wk,i.initializeAssetAttachments=hc,i.initializeAssetProcedureStepFieldValues=xd,i.initializeAssetProcedureStepFieldValuesAttachments=$d,i.initializeAssetProcedureStepFields=bd,i.initializeAssetProcedureStepFieldsAttachments=pd,i.initializeAssetProcedureSteps=pl,i.initializeAssetProcedureTypeAttachments=gc,i.initializeAssetProcedureTypeFieldValues=Pr,i.initializeAssetProcedureTypeFieldValuesAttachments=pr,i.initializeAssetProcedureTypeFields=xc,i.initializeAssetProcedureTypeFieldsAttachments=jc,i.initializeAssetProcedureTypes=xr,i.initializeAssetProcedures=$r,i.initializeAssetStageCompletions=$l,i.initializeAssetStages=tu,i.initializeAssetTypeAttachments=mu,i.initializeAssetTypeFieldValues=yo,i.initializeAssetTypeFieldValuesAttachments=to,i.initializeAssetTypeFields=Cu,i.initializeAssetTypeFieldsAttachments=bu,i.initializeAssetTypeIdentifierValues=Lo,i.initializeAssetTypeIdentifiers=Mo,i.initializeAssetTypeStatuses=Sh,i.initializeAssetTypes=ih,i.initializeAssets=bl,i.initializeConversations=cc,i.initializeDocumentAttachments=Bh,i.initializeDocuments=Yh,i.initializeEmailDomains=dp,i.initializeFormIdentifierValues=jp,i.initializeFormIdentifiers=gp,i.initializeFormRevisionAttachments=xp,i.initializeFormRevisions=pm,i.initializeFormSubmissionAttachments=qm,i.initializeFormSubmissions=Jm,i.initializeForms=Fm,i.initializeGeoImages=dy,i.initializeIssueAssociations=Oy,i.initializeIssueAttachments=jy,i.initializeIssueCommentAttachments=Xy,i.initializeIssueComments=pf,i.initializeIssueTypeAttachments=jf,i.initializeIssueTypeFieldValues=pS,i.initializeIssueTypeFieldValuesAttachments=CS,i.initializeIssueTypeFields=bS,i.initializeIssueTypeFieldsAttachments=xf,i.initializeIssueTypeIdentifierValues=mA,i.initializeIssueTypeIdentifiers=eA,i.initializeIssueTypeStatuses=UA,i.initializeIssueTypes=RA,i.initializeIssueUpdates=tw,i.initializeIssues=Pf,i.initializeOrganizationAccesses=Ow,i.initializeOrganizations=zw,i.initializeProjectAccesses=iT,i.initializeProjectAttachments=fT,i.initializeProjectFiles=kT,i.initializeProjects=GT,i.initializeTeamMemberships=cI,i.initializeTeams=TI,i.initializeUsers=ow,i.initializeWorkflowIssueLinks=ZI,i.initializeWorkflowStepAssignees=uO,i.initializeWorkflowStepComments=_O,i.initializeWorkflowStepEvents=DO,i.initializeWorkflowStepFieldValues=DF,i.initializeWorkflowStepFieldValuesAttachments=gF,i.initializeWorkflowStepFieldValuesReviewRequests=XF,i.initializeWorkflowStepFieldValuesReviews=o_,i.initializeWorkflowStepFields=oF,i.initializeWorkflowStepFieldsAttachments=XO,i.initializeWorkflowStepReviewers=__,i.initializeWorkflowSteps=D_,i.initializeWorkflowTypes=X_,i.initializeWorkflows=zI,i.isImageFile=rP,i.isObjectUrl=Za,i.isToday=tP,i.issueAssociationReducer=qy,i.issueAssociationSlice=sn,i.issueAttachmentReducer=Zy,i.issueAttachmentSlice=nn,i.issueCommentAttachmentReducer=of,i.issueCommentAttachmentSlice=dn,i.issueCommentReducer=_f,i.issueCommentSlice=un,i.issueReducer=qf,i.issueSlice=hn,i.issueTypeAttachmentReducer=Qf,i.issueTypeAttachmentSlice=yn,i.issueTypeFieldValuesAttachmentReducer=XS,i.issueTypeFieldValuesAttachmentSlice=In,i.issueTypeFieldValuesReducer=gS,i.issueTypeFieldValuesSlice=wn,i.issueTypeFieldsAttachmentReducer=oS,i.issueTypeFieldsAttachmentSlice=Sn,i.issueTypeFieldsReducer=jS,i.issueTypeFieldsSlice=Tn,i.issueTypeIdentifierReducer=hA,i.issueTypeIdentifierSlice=gn,i.issueTypeIdentifierValueReducer=PA,i.issueTypeIdentifierValueSlice=bn,i.issueTypeReducer=$A,i.issueTypeSlice=Rn,i.issueTypeStatusReducer=xA,i.issueTypeStatusSlice=kn,i.issueTypeStatusSortFn=sc,i.issueUpdateReducer=lw,i.issueUpdateSlice=Vn,i.logOnlyOnce=dP,i.markAsDeleted=xw,i.markForDeletion=jb,i.memoize=As,i.organizationAccessReducer=Ew,i.organizationAccessSlice=Nn,i.organizationReducer=Jw,i.organizationSlice=Gn,i.outboxReducer=tT,i.outboxSlice=Hn,i.overmapEnhancer=$R,i.overmapReducer=vR,i.overmapReducers=og,i.performRequest=va,i.performRequestFromAction=Og,i.projectAccessReducer=hT,i.projectAccessSlice=Kn,i.projectAttachmentReducer=RT,i.projectAttachmentSlice=Jn,i.projectFileReducer=LT,i.projectFileSlice=Qn,i.projectReducer=eI,i.projectSlice=Xn,i.rehydratedReducer=nI,i.rehydratedSlice=xn,i.restructureSelectorWithArgs=S,i.runMiddleware=Bg,i.selectAccessToken=ib,i.selectAccessesByUserOfProject=Cb,i.selectAccessibleProjects=Nb,i.selectActiveOrganizationAccess=Wb,i.selectAllDocumentAttachments=Pi,i.selectAssetAttachmentById=Tc,i.selectAssetAttachmentMapping=wc,i.selectAssetAttachments=Ps,i.selectAssetAttachmentsByIds=Ic,i.selectAssetById=zl,i.selectAssetProcedureById=Zr,i.selectAssetProcedureStepById=Fl,i.selectAssetProcedureStepFieldValues=Et,i.selectAssetProcedureStepFieldValuesAttachmentById=Yd,i.selectAssetProcedureStepFieldValuesAttachments=Js,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Jd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Kd,i.selectAssetProcedureStepFieldValuesById=ll,i.selectAssetProcedureStepFieldValuesByIds=ul,i.selectAssetProcedureStepFieldValuesMapping=dl,i.selectAssetProcedureStepFieldValuesOfAsset=qP,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=DP,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=jP,i.selectAssetProcedureStepFields=Yt,i.selectAssetProcedureStepFieldsAttachmentById=Fd,i.selectAssetProcedureStepFieldsAttachments=Ls,i.selectAssetProcedureStepFieldsAttachmentsByIds=_d,i.selectAssetProcedureStepFieldsAttachmentsMapping=Od,i.selectAssetProcedureStepFieldsById=zd,i.selectAssetProcedureStepFieldsByIds=qd,i.selectAssetProcedureStepFieldsMapping=Gs,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=BP,i.selectAssetProcedureStepMapping=Jt,i.selectAssetProcedureSteps=Xs,i.selectAssetProcedureStepsByIds=_l,i.selectAssetProcedureStepsMappingOfAssetProcedureType=$P,i.selectAssetProcedureStepsOfAssetProcedureType=CP,i.selectAssetProcedureTypeAttachmentById=zc,i.selectAssetProcedureTypeAttachmentMapping=Wc,i.selectAssetProcedureTypeAttachments=Rs,i.selectAssetProcedureTypeAttachmentsByIds=qc,i.selectAssetProcedureTypeById=ud,i.selectAssetProcedureTypeFieldValues=Ht,i.selectAssetProcedureTypeFieldValuesAttachmentById=Or,i.selectAssetProcedureTypeFieldValuesAttachments=Ws,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Fr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Ir,i.selectAssetProcedureTypeFieldValuesById=qr,i.selectAssetProcedureTypeFieldValuesByIds=Dr,i.selectAssetProcedureTypeFieldValuesMapping=zr,i.selectAssetProcedureTypeFieldValuesOfAsset=MP,i.selectAssetProcedureTypeFields=Gt,i.selectAssetProcedureTypeFieldsAttachmentById=Zc,i.selectAssetProcedureTypeFieldsAttachments=ks,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Qc,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Jc,i.selectAssetProcedureTypeFieldsById=ur,i.selectAssetProcedureTypeFieldsByIds=or,i.selectAssetProcedureTypeFieldsMapping=lr,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=bP,i.selectAssetProcedureTypes=Cs,i.selectAssetProcedureTypesByIds=od,i.selectAssetProcedureTypesMapping=ld,i.selectAssetProcedureTypesOfOrganization=vP,i.selectAssetProcedures=Kt,i.selectAssetProceduresByIds=Qr,i.selectAssetProceduresMapping=Yr,i.selectAssetProceduresOfAssetProcedureType=Jr,i.selectAssetProceduresOfAssetType=EP,i.selectAssetStageById=ou,i.selectAssetStageCompletionById=Xl,i.selectAssetStageCompletionMapping=Zl,i.selectAssetStageCompletions=Ql,i.selectAssetStageCompletionsByIds=xl,i.selectAssetStages=ai,i.selectAssetStagesByIds=hu,i.selectAssetStagesMappingOfAssetProcedureType=LP,i.selectAssetStagesOfAssetProcedureType=NP,i.selectAssetTypeAttachmentById=Ou,i.selectAssetTypeAttachmentMapping=Iu,i.selectAssetTypeAttachments=li,i.selectAssetTypeAttachmentsByIds=Fu,i.selectAssetTypeById=ph,i.selectAssetTypeFieldValues=Qt,i.selectAssetTypeFieldValuesAttachmentById=uo,i.selectAssetTypeFieldValuesAttachments=fi,i.selectAssetTypeFieldValuesAttachmentsByIds=oo,i.selectAssetTypeFieldValuesAttachmentsMapping=lo,i.selectAssetTypeFieldValuesById=go,i.selectAssetTypeFieldValuesByIds=Po,i.selectAssetTypeFieldValuesMapping=_o,i.selectAssetTypeFieldValuesOfAsset=YP,i.selectAssetTypeFields=vt,i.selectAssetTypeFieldsAttachmentById=qu,i.selectAssetTypeFieldsAttachments=oi,i.selectAssetTypeFieldsAttachmentsByIds=Du,i.selectAssetTypeFieldsAttachmentsMapping=zu,i.selectAssetTypeFieldsById=Qu,i.selectAssetTypeFieldsByIds=Xu,i.selectAssetTypeFieldsMapping=Zu,i.selectAssetTypeFieldsOfAssetType=HP,i.selectAssetTypeIdentifierById=jo,i.selectAssetTypeIdentifierMapping=Do,i.selectAssetTypeIdentifierValueById=xo,i.selectAssetTypeIdentifierValueMapping=Xo,i.selectAssetTypeIdentifierValues=Xt,i.selectAssetTypeIdentifierValuesByIds=eh,i.selectAssetTypeIdentifierValuesOfAsset=QP,i.selectAssetTypeIdentifierValuesOfIdentifier=XP,i.selectAssetTypeIdentifiers=wi,i.selectAssetTypeIdentifiersByIds=$o,i.selectAssetTypeIdentifiersOfAssetType=ZP,i.selectAssetTypeStatusById=bh,i.selectAssetTypeStatusMapping=Ph,i.selectAssetTypeStatuses=_i,i.selectAssetTypeStatusesByIds=Rh,i.selectAssetTypeStatusesOfAssetType=eb,i.selectAssetTypeValuesOfAssetType=JP,i.selectAssetTypes=Oi,i.selectAssetTypesByIds=mh,i.selectAssetTypesMapping=hh,i.selectAssetTypesOfOrganization=xP,i.selectAssets=Zt,i.selectAssetsByIds=ql,i.selectAssetsMapping=Bl,i.selectAssetsOfAssetType=Wl,i.selectAssetsOfProject=UP,i.selectAttachmentsOfAsset=Oc,i.selectAttachmentsOfAssetProcedureStepFieldValues=Zd,i.selectAttachmentsOfAssetProcedureStepFields=VP,i.selectAttachmentsOfAssetProcedureType=gP,i.selectAttachmentsOfAssetProcedureTypeFieldValues=_r,i.selectAttachmentsOfAssetProcedureTypeFields=PP,i.selectAttachmentsOfAssetType=_u,i.selectAttachmentsOfAssetTypeFieldValues=ho,i.selectAttachmentsOfAssetTypeFields=GP,i.selectAttachmentsOfDocument=ab,i.selectAttachmentsOfFormRevision=yb,i.selectAttachmentsOfFormSubmission=Hm,i.selectAttachmentsOfIssue=Ky,i.selectAttachmentsOfIssueComment=wb,i.selectAttachmentsOfIssueType=Ob,i.selectAttachmentsOfIssueTypeFieldValues=QS,i.selectAttachmentsOfIssueTypeFields=Fb,i.selectAttachmentsOfProject=Lb,i.selectAttachmentsOfWorkflowStepFieldValues=WF,i.selectAttachmentsOfWorkflowStepFields=cF,i.selectCommentsOfIssue=Tb,i.selectConversation=_P,i.selectConversationMapping=Os,i.selectConversations=FP,i.selectCurrentUser=ww,i.selectDeletedRequests=qb,i.selectDescendantsOfAssetProcedureStep=gl,i.selectDescendantsOfDocument=cp,i.selectDocumentAttachmentById=Nh,i.selectDocumentAttachmentMapping=Lh,i.selectDocumentAttachmentsByIds=Gh,i.selectDocumentById=np,i.selectDocuments=es,i.selectDocumentsByIds=ap,i.selectDocumentsMapping=Ri,i.selectEmailDomainById=Ap,i.selectEmailDomains=ki,i.selectEmailDomainsAsMapping=Sp,i.selectEmailDomainsByIds=wp,i.selectEmailDomainsOfOrganization=db,i.selectFieldValuesOfAssetProcedure=kP,i.selectFormById=Bm,i.selectFormIdentifierById=Wp,i.selectFormIdentifierMapping=Bp,i.selectFormIdentifierValueById=Jp,i.selectFormIdentifierValueMapping=Yp,i.selectFormIdentifierValues=ts,i.selectFormIdentifierValuesByIds=Zp,i.selectFormIdentifierValuesOfFormSubmission=pb,i.selectFormIdentifierValuesOfIdentifier=mb,i.selectFormIdentifiers=Vi,i.selectFormIdentifiersByIds=zp,i.selectFormIdentifiersOfForm=hb,i.selectFormMapping=Vm,i.selectFormRevisionAttachmentById=lm,i.selectFormRevisionAttachments=dm,i.selectFormRevisionAttachmentsByIds=um,i.selectFormRevisionAttachmentsMapping=ss,i.selectFormRevisionById=Am,i.selectFormRevisionMapping=Ci,i.selectFormRevisions=is,i.selectFormRevisionsByIds=wm,i.selectFormRevisionsOfForm=Tm,i.selectFormSubmissionAttachemntsByIds=Ji,i.selectFormSubmissionAttachmentById=Nm,i.selectFormSubmissionAttachments=Yi,i.selectFormSubmissionAttachmentsByIds=Gm,i.selectFormSubmissionAttachmentsMapping=Ki,i.selectFormSubmissionById=iy,i.selectFormSubmissions=sy,i.selectFormSubmissionsByIds=ny,i.selectFormSubmissionsMapping=xi,i.selectFormSubmissionsOfForm=ay,i.selectForms=Li,i.selectFormsByIds=Wm,i.selectFormsOfOrganization=Sb,i.selectGeoImageById=Ay,i.selectGeoImageMapping=Sy,i.selectGeoImages=tn,i.selectGeoImagesByIds=wy,i.selectGeoImagesOfProject=Ab,i.selectIsLoggedIn=nb,i.selectIssueAssociationById=ky,i.selectIssueAssociationMapping=My,i.selectIssueAssociations=St,i.selectIssueAssociationsByIds=Ey,i.selectIssueAssociationsOfAsset=zy,i.selectIssueAssociationsOfIssue=Wy,i.selectIssueAssociationsOfIssues=By,i.selectIssueAssociationsToIssue=vy,i.selectIssueAssociationsToIssues=Vy,i.selectIssueAttachmentById=Yy,i.selectIssueAttachmentMapping=Hy,i.selectIssueAttachments=rn,i.selectIssueAttachmentsByIds=Jy,i.selectIssueById=Bf,i.selectIssueCommentAttachmentById=lf,i.selectIssueCommentAttachmentMapping=df,i.selectIssueCommentAttachments=ln,i.selectIssueCommentAttachmentsByIds=uf,i.selectIssueCommentById=Of,i.selectIssueCommentMapping=on,i.selectIssueCommentsByIds=Ff,i.selectIssueMapping=Vf,i.selectIssueTypeAttachmentById=Jf,i.selectIssueTypeAttachmentMapping=Yf,i.selectIssueTypeAttachments=fn,i.selectIssueTypeAttachmentsByIds=Zf,i.selectIssueTypeById=DA,i.selectIssueTypeFieldValues=as,i.selectIssueTypeFieldValuesAttachmentById=JS,i.selectIssueTypeFieldValuesAttachments=_n,i.selectIssueTypeFieldValuesAttachmentsByIds=ZS,i.selectIssueTypeFieldValuesAttachmentsMapping=YS,i.selectIssueTypeFieldValuesById=FS,i.selectIssueTypeFieldValuesByIds=_S,i.selectIssueTypeFieldValuesMapping=OS,i.selectIssueTypeFieldValuesOfIssue=_b,i.selectIssueTypeFields=Vt,i.selectIssueTypeFieldsAttachmentById=lS,i.selectIssueTypeFieldsAttachments=An,i.selectIssueTypeFieldsAttachmentsByIds=uS,i.selectIssueTypeFieldsAttachmentsMapping=dS,i.selectIssueTypeFieldsById=qS,i.selectIssueTypeFieldsByIds=DS,i.selectIssueTypeFieldsMapping=zS,i.selectIssueTypeFieldsOfIssueType=gb,i.selectIssueTypeIdentifierById=uA,i.selectIssueTypeIdentifierMapping=lA,i.selectIssueTypeIdentifierValueById=_A,i.selectIssueTypeIdentifierValueMapping=FA,i.selectIssueTypeIdentifierValues=cs,i.selectIssueTypeIdentifierValuesByIds=gA,i.selectIssueTypeIdentifierValuesOfIdentifier=kb,i.selectIssueTypeIdentifierValuesOfIssue=Mb,i.selectIssueTypeIdentifiers=Pn,i.selectIssueTypeIdentifiersByIds=oA,i.selectIssueTypeIdentifiersOfIssueType=Rb,i.selectIssueTypeMapping=qA,i.selectIssueTypeStatusById=vn,i.selectIssueTypeStatusMapping=QA,i.selectIssueTypeStatuses=En,i.selectIssueTypeStatusesByIds=XA,i.selectIssueTypeStatusesOfIssueType=vb,i.selectIssueTypeValuesOfIssueType=bb,i.selectIssueTypes=Mn,i.selectIssueTypesByIds=jA,i.selectIssueTypesOfOrganization=Eb,i.selectIssueUpdateById=cw,i.selectIssueUpdateMapping=Dn,i.selectIssueUpdates=jn,i.selectIssueUpdatesByIds=rw,i.selectIssueUpdatesOfIssue=dw,i.selectIssues=ns,i.selectIssuesByIds=Wf,i.selectIssuesOfIssueType=zf,i.selectIssuesOfProject=Ib,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=WP,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=RP,i.selectLatestAssetTypeFieldsOfAssetType=KP,i.selectLatestFieldsByAssetProcedureStep=zP,i.selectLatestFormRevisionOfForm=fb,i.selectLatestIssueTypeFieldsOfIssueType=Pb,i.selectLatestRetryTime=Db,i.selectLatestReviewOfWorkflowStepFieldValues=FR,i.selectLatestReviewRequestOfWorkflowStepFieldValues=IR,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=TR,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=gR,i.selectLatestWorkflowStepFieldsOfWorkflowStep=fR,i.selectMembershipsByUserOfTeam=Jb,i.selectOrganizationAccessById=vw,i.selectOrganizationAccessMapping=ls,i.selectOrganizationAccessUserMapping=Bw,i.selectOrganizationAccessesByIds=Vw,i.selectOrganizationById=Kw,i.selectOrganizationDocuments=rb,i.selectOrganizations=Hw,i.selectOrganizationsByIds=Yw,i.selectOrganizationsMapping=Gw,i.selectProjectAccessById=pT,i.selectProjectAccessMapping=Yn,i.selectProjectAccesses=Bt,i.selectProjectAccessesByIds=mT,i.selectProjectAccessesOfProject=$b,i.selectProjectAttachmentById=PT,i.selectProjectAttachmentMapping=gT,i.selectProjectAttachments=Zn,i.selectProjectAttachmentsByIds=bT,i.selectProjectById=sI,i.selectProjectDocuments=cb,i.selectProjectFileById=CT,i.selectProjectFileMapping=jT,i.selectProjectFiles=$T,i.selectProjectFilesByIds=UT,i.selectProjectMapping=tI,i.selectProjects=us,i.selectProjectsByIds=iI,i.selectProjectsOfOrganization=Gb,i.selectRehydrated=Yb,i.selectReviewRequestsOfWorkflowStepFieldValues=d_,i.selectReviewsOfWorkflowStepFieldValues=I_,i.selectStageMapping=ni,i.selectTeamById=kI,i.selectTeamMembershipById=SI,i.selectTeamMemberships=os,i.selectTeamMembershipsByIds=AI,i.selectTeamMembershipsMapping=fI,i.selectTeams=sa,i.selectTeamsByIds=EI,i.selectTeamsMapping=MI,i.selectTeamsOfOrganization=Qb,i.selectUploadUrl=ob,i.selectUserById=ds,i.selectUsers=rs,i.selectUsersByIds=Tw,i.selectUsersMapping=Ln,i.selectUsersOfOrganization=zb,i.selectUsersOfProject=Ub,i.selectUsersOfTeam=Zb,i.selectWorkflowById=HI,i.selectWorkflowIssueLinkById=cO,i.selectWorkflowIssueLinks=At,i.selectWorkflowIssueLinksByIds=rO,i.selectWorkflowIssueLinksMapping=aO,i.selectWorkflowIssueLinksOfIssue=iR,i.selectWorkflowIssueLinksOfIssues=nR,i.selectWorkflowIssueLinksOfWorkflow=tR,i.selectWorkflowIssueLinksOfWorkflowAndIssue=aR,i.selectWorkflowIssueLinksOfWorkflows=sR,i.selectWorkflowMapping=GI,i.selectWorkflowStepAssigneeById=TO,i.selectWorkflowStepAssignees=Wt,i.selectWorkflowStepAssigneesByIds=IO,i.selectWorkflowStepAssigneesMapping=wO,i.selectWorkflowStepAssigneesOfWorkflow=cR,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=dR,i.selectWorkflowStepAssigneesOfWorkflowStep=rR,i.selectWorkflowStepById=Y_,i.selectWorkflowStepCommentById=BO,i.selectWorkflowStepComments=zt,i.selectWorkflowStepCommentsByIds=WO,i.selectWorkflowStepCommentsMapping=VO,i.selectWorkflowStepCommentsOfWorkflow=lR,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=oR,i.selectWorkflowStepCommentsOfWorkflowStep=uR,i.selectWorkflowStepEventById=YO,i.selectWorkflowStepEvents=qt,i.selectWorkflowStepEventsByIds=JO,i.selectWorkflowStepEventsMapping=KO,i.selectWorkflowStepEventsOfWorkflow=hR,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=mR,i.selectWorkflowStepEventsOfWorkflowStep=pR,i.selectWorkflowStepFieldValues=pt,i.selectWorkflowStepFieldValuesAttachmentById=VF,i.selectWorkflowStepFieldValuesAttachments=fa,i.selectWorkflowStepFieldValuesAttachmentsByIds=BF,i.selectWorkflowStepFieldValuesAttachmentsMapping=vF,i.selectWorkflowStepFieldValuesById=YF,i.selectWorkflowStepFieldValuesByIds=JF,i.selectWorkflowStepFieldValuesMapping=KF,i.selectWorkflowStepFieldValuesOfWorkflow=SR,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=wR,i.selectWorkflowStepFieldValuesOfWorkflowStep=AR,i.selectWorkflowStepFieldValuesReviewById=w_,i.selectWorkflowStepFieldValuesReviewRequestById=c_,i.selectWorkflowStepFieldValuesReviewRequests=Dt,i.selectWorkflowStepFieldValuesReviewRequestsByIds=r_,i.selectWorkflowStepFieldValuesReviewRequestsMapping=a_,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=OR,i.selectWorkflowStepFieldValuesReviews=Ft,i.selectWorkflowStepFieldValuesReviewsByIds=T_,i.selectWorkflowStepFieldValuesReviewsMapping=A_,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=_R,i.selectWorkflowStepFields=ps,i.selectWorkflowStepFieldsAttachmentById=rF,i.selectWorkflowStepFieldsAttachments=oa,i.selectWorkflowStepFieldsAttachmentsByIds=dF,i.selectWorkflowStepFieldsAttachmentsMapping=aF,i.selectWorkflowStepFieldsById=IF,i.selectWorkflowStepFieldsByIds=OF,i.selectWorkflowStepFieldsMapping=TF,i.selectWorkflowStepFieldsOfWorkflowStep=yR,i.selectWorkflowStepReviewerById=B_,i.selectWorkflowStepReviewers=jt,i.selectWorkflowStepReviewersByIds=W_,i.selectWorkflowStepReviewersMapping=V_,i.selectWorkflowStepReviewersOfWorkflow=PR,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=RR,i.selectWorkflowStepReviewersOfWorkflowStep=bR,i.selectWorkflowSteps=Pa,i.selectWorkflowStepsByIds=J_,i.selectWorkflowStepsMapping=K_,i.selectWorkflowStepsOfWorkflowType=MR,i.selectWorkflowTypeById=dg,i.selectWorkflowTypeMapping=rg,i.selectWorkflowTypes=Ra,i.selectWorkflowTypesByIds=lg,i.selectWorkflowTypesOfOrganization=kR,i.selectWorkflows=hs,i.selectWorkflowsByIds=KI,i.selectWorkflowsOfProject=xb,i.selectWorkflowsOfWorkflowType=eR,i.setAsset=vl,i.setAssetAttachment=mc,i.setAssetAttachments=yc,i.setAssetProcedure=Gr,i.setAssetProcedureStep=ml,i.setAssetProcedureStepFieldValues=sl,i.setAssetProcedureStepFieldValuesAttachment=Ud,i.setAssetProcedureStepFieldValuesAttachments=Ld,i.setAssetProcedureStepFieldValuesMany=il,i.setAssetProcedureStepFields=kd,i.setAssetProcedureStepFieldsAttachment=fd,i.setAssetProcedureStepFieldsAttachments=Sd,i.setAssetProcedureStepFieldsMany=Ed,i.setAssetProcedureSteps=yl,i.setAssetProcedureType=cd,i.setAssetProcedureTypeAttachment=Rc,i.setAssetProcedureTypeAttachments=Mc,i.setAssetProcedureTypeFieldValues=Mr,i.setAssetProcedureTypeFieldValuesAttachment=yr,i.setAssetProcedureTypeFieldValuesAttachments=fr,i.setAssetProcedureTypeFieldValuesMany=kr,i.setAssetProcedureTypeFields=sr,i.setAssetProcedureTypeFieldsAttachment=Uc,i.setAssetProcedureTypeFieldsAttachments=Lc,i.setAssetProcedureTypeFieldsMany=ir,i.setAssetProcedureTypes=rd,i.setAssetProcedures=Hr,i.setAssetStage=su,i.setAssetStageCompletion=Ll,i.setAssetStageCompletions=Nl,i.setAssetStages=iu,i.setAssetType=nh,i.setAssetTypeAttachment=fu,i.setAssetTypeAttachments=Su,i.setAssetTypeFieldValues=Ao,i.setAssetTypeFieldValuesAttachment=io,i.setAssetTypeFieldValuesAttachments=no,i.setAssetTypeFieldValuesMany=wo,i.setAssetTypeFields=Nu,i.setAssetTypeFieldsAttachment=ku,i.setAssetTypeFieldsAttachments=Eu,i.setAssetTypeFieldsMany=Gu,i.setAssetTypeIdentifier=vo,i.setAssetTypeIdentifierValue=Ho,i.setAssetTypeIdentifierValues=Ko,i.setAssetTypeIdentifiers=Vo,i.setAssetTypeStatus=Th,i.setAssetTypeStatuses=Ih,i.setAssetTypes=ah,i.setAssets=Vl,i.setClientSDK=Mg,i.setClientStore=bg,i.setConversation=dc,i.setConversations=wP,i.setCurrentUser=Vb,i.setCurrentUserProfile=Bb,i.setDocument=Qh,i.setDocumentAttachment=qh,i.setDocumentAttachments=Dh,i.setDocuments=Xh,i.setEmailDomain=op,i.setEmailDomains=hp,i.setForm=Pm,i.setFormIdentifier=Rp,i.setFormIdentifierValue=Up,i.setFormIdentifierValues=Lp,i.setFormIdentifiers=Mp,i.setFormRevision=mm,i.setFormRevisionAttachment=sm,i.setFormRevisionAttachments=im,i.setFormRevisions=ym,i.setFormSubmission=Zm,i.setFormSubmissionAttachment=jm,i.setFormSubmissionAttachments=$m,i.setFormSubmissions=Qm,i.setForms=bm,i.setGeoImage=ly,i.setGeoImages=uy,i.setIssue=Rf,i.setIssueAssociation=_y,i.setIssueAssociations=Fy,i.setIssueAttachment=Cy,i.setIssueAttachments=Uy,i.setIssueComment=ff,i.setIssueCommentAttachment=tf,i.setIssueCommentAttachments=sf,i.setIssueComments=Sf,i.setIssueType=EA,i.setIssueTypeAttachment=Uf,i.setIssueTypeAttachments=Lf,i.setIssueTypeFieldValues=fS,i.setIssueTypeFieldValuesAttachment=LS,i.setIssueTypeFieldValuesAttachments=NS,i.setIssueTypeFieldValuesMany=SS,i.setIssueTypeFields=kS,i.setIssueTypeFieldsAttachment=sS,i.setIssueTypeFieldsAttachments=iS,i.setIssueTypeFieldsMany=ES,i.setIssueTypeIdentifier=iA,i.setIssueTypeIdentifierValue=SA,i.setIssueTypeIdentifierValues=AA,i.setIssueTypeIdentifiers=nA,i.setIssueTypeStatus=GA,i.setIssueTypeStatuses=HA,i.setIssueTypes=vA,i.setIssueUpdate=sw,i.setIssueUpdates=iw,i.setIssues=Mf,i.setLoggedIn=Eh,i.setOrganization=Dw,i.setOrganizationAccess=gw,i.setOrganizationAccesses=Pw,i.setOrganizations=qw,i.setProject=KT,i.setProjectAccess=cT,i.setProjectAccesses=rT,i.setProjectAttachment=wT,i.setProjectAttachments=TT,i.setProjectFile=ET,i.setProjectFiles=vT,i.setProjects=HT,i.setRehydrated=Kb,i.setTeam=FI,i.setTeamMembership=lI,i.setTeamMemberships=uI,i.setTeams=_I,i.setTokens=tb,i.setUploadUrl=ub,i.setUser=pw,i.setUsers=hw,i.setWorkflow=jI,i.setWorkflowIssueLink=xI,i.setWorkflowIssueLinks=eO,i.setWorkflowStep=C_,i.setWorkflowStepAssignee=pO,i.setWorkflowStepAssignees=mO,i.setWorkflowStepComment=bO,i.setWorkflowStepComments=RO,i.setWorkflowStepEvent=CO,i.setWorkflowStepEvents=UO,i.setWorkflowStepFieldValues=CF,i.setWorkflowStepFieldValuesAttachment=bF,i.setWorkflowStepFieldValuesAttachments=RF,i.setWorkflowStepFieldValuesMany=UF,i.setWorkflowStepFieldValuesReview=p_,i.setWorkflowStepFieldValuesReviewRequest=e_,i.setWorkflowStepFieldValuesReviewRequests=t_,i.setWorkflowStepFieldValuesReviews=m_,i.setWorkflowStepFields=mF,i.setWorkflowStepFieldsAttachment=eF,i.setWorkflowStepFieldsAttachments=tF,i.setWorkflowStepFieldsMany=yF,i.setWorkflowStepReviewer=b_,i.setWorkflowStepReviewers=R_,i.setWorkflowSteps=U_,i.setWorkflowType=tg,i.setWorkflowTypes=sg,i.setWorkflows=$I,i.shallowEqual=Qg,i.slugify=hP,i.spacesToDashesLower=oP,i.teamMembershipReducer=yI,i.teamMembershipSlice=ea,i.teamReducer=vI,i.teamSlice=ta,i.toFileNameSafeString=uP,i.toUuidArray=V,i.toUuidIdRecord=lP,i.truncate=pP,i.updateAsset=Ml,i.updateAssetAttachment=fc,i.updateAssetAttachments=Sc,i.updateAssetProcedure=Ur,i.updateAssetProcedureStep=Al,i.updateAssetProcedureStepFieldValues=nl,i.updateAssetProcedureStepFieldValuesAttachment=Nd,i.updateAssetProcedureStepFieldValuesAttachments=Gd,i.updateAssetProcedureStepFieldValuesMany=al,i.updateAssetProcedureStepFields=vd,i.updateAssetProcedureStepFieldsAttachment=Ad,i.updateAssetProcedureStepFieldsAttachments=wd,i.updateAssetProcedureStepFieldsMany=Vd,i.updateAssetProcedureSteps=wl,i.updateAssetProcedureType=sd,i.updateAssetProcedureTypeAttachment=kc,i.updateAssetProcedureTypeAttachments=Ec,i.updateAssetProcedureTypeFieldValues=Er,i.updateAssetProcedureTypeFieldValuesAttachment=Sr,i.updateAssetProcedureTypeFieldValuesAttachments=Ar,i.updateAssetProcedureTypeFieldValuesMany=vr,i.updateAssetProcedureTypeFields=nr,i.updateAssetProcedureTypeFieldsAttachment=Nc,i.updateAssetProcedureTypeFieldsAttachments=Gc,i.updateAssetProcedureTypeFieldsMany=ar,i.updateAssetProcedureTypes=id,i.updateAssetProcedures=Lr,i.updateAssetStage=cu,i.updateAssetStageCompletion=Gl,i.updateAssetStageCompletions=Hl,i.updateAssetStages=ru,i.updateAssetType=dh,i.updateAssetTypeAttachment=Au,i.updateAssetTypeAttachments=wu,i.updateAssetTypeFieldValues=To,i.updateAssetTypeFieldValuesAttachment=ao,i.updateAssetTypeFieldValuesAttachments=co,i.updateAssetTypeFieldValuesMany=Io,i.updateAssetTypeFields=Hu,i.updateAssetTypeFieldsAttachment=vu,i.updateAssetTypeFieldsAttachments=Vu,i.updateAssetTypeFieldsMany=Ku,i.updateAssetTypeIdentifier=Bo,i.updateAssetTypeIdentifierValue=Yo,i.updateAssetTypeIdentifierValues=Jo,i.updateAssetTypeIdentifiers=Wo,i.updateAssetTypeStatus=Oh,i.updateAssetTypeStatuses=Fh,i.updateAssetTypes=lh,i.updateAssets=kl,i.updateConversation=lc,i.updateConversations=TP,i.updateDocument=xh,i.updateDocumentAttachment=jh,i.updateDocumentAttachments=$h,i.updateDocuments=ep,i.updateEmailDomain=pp,i.updateEmailDomains=mp,i.updateForm=Rm,i.updateFormIdentifier=kp,i.updateFormIdentifierValue=Np,i.updateFormIdentifierValues=Gp,i.updateFormIdentifiers=Ep,i.updateFormRevision=fm,i.updateFormRevisionAttachment=nm,i.updateFormRevisionAttachments=am,i.updateFormRevisions=Sm,i.updateFormSubmission=xm,i.updateFormSubmissionAttachment=Cm,i.updateFormSubmissionAttachments=Um,i.updateFormSubmissions=ey,i.updateForms=Mm,i.updateGeoImage=py,i.updateGeoImages=my,i.updateIssue=kf,i.updateIssueAssociation=gy,i.updateIssueAssociations=Py,i.updateIssueAttachment=Ly,i.updateIssueAttachments=Ny,i.updateIssueComment=Af,i.updateIssueCommentAttachment=nf,i.updateIssueCommentAttachments=af,i.updateIssueComments=wf,i.updateIssueType=VA,i.updateIssueTypeAttachment=Nf,i.updateIssueTypeAttachments=Gf,i.updateIssueTypeFieldValues=AS,i.updateIssueTypeFieldValuesAttachment=GS,i.updateIssueTypeFieldValuesAttachments=HS,i.updateIssueTypeFieldValuesMany=wS,i.updateIssueTypeFields=vS,i.updateIssueTypeFieldsAttachment=nS,i.updateIssueTypeFieldsAttachments=aS,i.updateIssueTypeFieldsMany=VS,i.updateIssueTypeIdentifier=aA,i.updateIssueTypeIdentifierValue=wA,i.updateIssueTypeIdentifierValues=TA,i.updateIssueTypeIdentifiers=cA,i.updateIssueTypeStatus=KA,i.updateIssueTypeStatuses=YA,i.updateIssueTypes=BA,i.updateIssueUpdate=nw,i.updateIssueUpdates=aw,i.updateIssues=Ef,i.updateOrganization=Uw,i.updateOrganizationAccess=bw,i.updateOrganizationAccesses=Rw,i.updateOrganizations=Cw,i.updateProject=QT,i.updateProjectAccess=dT,i.updateProjectAccesses=lT,i.updateProjectAttachment=IT,i.updateProjectAttachments=OT,i.updateProjectFile=WT,i.updateProjectFiles=zT,i.updateProjects=ZT,i.updateTeam=gI,i.updateTeamMembership=oI,i.updateTeamMemberships=hI,i.updateTeams=PI,i.updateUser=fw,i.updateUsers=yw,i.updateWorkflow=CI,i.updateWorkflowIssueLink=tO,i.updateWorkflowIssueLinks=sO,i.updateWorkflowStep=L_,i.updateWorkflowStepAssignee=yO,i.updateWorkflowStepAssignees=fO,i.updateWorkflowStepComment=MO,i.updateWorkflowStepComments=kO,i.updateWorkflowStepEvent=LO,i.updateWorkflowStepEvents=NO,i.updateWorkflowStepFieldValues=LF,i.updateWorkflowStepFieldValuesAttachment=MF,i.updateWorkflowStepFieldValuesAttachments=kF,i.updateWorkflowStepFieldValuesMany=NF,i.updateWorkflowStepFieldValuesReview=y_,i.updateWorkflowStepFieldValuesReviewRequest=s_,i.updateWorkflowStepFieldValuesReviewRequests=i_,i.updateWorkflowStepFieldValuesReviews=f_,i.updateWorkflowStepFields=fF,i.updateWorkflowStepFieldsAttachment=sF,i.updateWorkflowStepFieldsAttachments=iF,i.updateWorkflowStepFieldsMany=SF,i.updateWorkflowStepReviewer=M_,i.updateWorkflowStepReviewers=k_,i.updateWorkflowSteps=N_,i.updateWorkflowType=ig,i.updateWorkflowTypes=ng,i.updateWorkflows=UI,i.useSelectorBuilder=Zg,i.userReducer=Aw,i.userSlice=$n,i.uuidObj=O,i.uuidObjSortFn=Ts,i.uuidSortFn=Nt,i.versioningReducer=BI,i.versioningSlice=VI,i.workflowIssueLinkReducer=dO,i.workflowIssueLinkSlice=na,i.workflowReducer=YI,i.workflowSlice=ia,i.workflowStepAssigneeReducer=OO,i.workflowStepAssigneeSlice=aa,i.workflowStepCommentReducer=zO,i.workflowStepCommentSlice=ca,i.workflowStepEventReducer=ZO,i.workflowStepEventSlice=ra,i.workflowStepFieldValuesAttachmentReducer=zF,i.workflowStepFieldValuesAttachmentSlice=pa,i.workflowStepFieldValuesReducer=ZF,i.workflowStepFieldValuesReviewReducer=O_,i.workflowStepFieldValuesReviewRequestReducer=l_,i.workflowStepFieldValuesReviewRequestSlice=Aa,i.workflowStepFieldValuesReviewSlice=Ia,i.workflowStepFieldValuesSlice=Sa,i.workflowStepFieldsAttachmentReducer=lF,i.workflowStepFieldsAttachmentSlice=da,i.workflowStepFieldsReducer=FF,i.workflowStepFieldsSlice=ha,i.workflowStepReducer=Z_,i.workflowStepReviewerReducer=z_,i.workflowStepReviewerSlice=_a,i.workflowStepSlice=ga,i.workflowTypeReducer=ug,i.workflowTypeSlice=ba,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});