@overmap-ai/core 1.0.78-procedures.5 → 1.0.78-procedures.6

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.
@@ -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,Nt,Dt,QV,JV,Zs,Ht,ZV,dr,XV,xV,Uq,Lq,ek,tk,sk){"use strict";var $q=Object.defineProperty;var Cq=(i,U,o)=>U in i?$q(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var p=(i,U,o)=>Cq(i,typeof U!="symbol"?U+"":U,o);var KV;const ur=Object.freeze([]),lr=Object.freeze({});var or=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(or||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),hr=(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))(hr||{}),pr=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(pr||{}),Xs=(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))(Xs||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),yr=(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))(yr||{}),Sr=(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))(Sr||{}),Gt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Gt||{}),ts=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(ts||{}),mr=(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))(mr||{}),fr=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(fr||{});const ik=Xs.MEDIUM,Ar=6e4,nk=[ts.APPROVED,ts.REJECTED,ts.CHANGES_REQUESTED],ak=[Gt.ACTIVE,Gt.COMPLETED,Gt.CANCELLED],ck=Gt.ACTIVE;function T(t){return{addOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},addMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},setOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},setMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},updateOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},updateMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},deleteOne:(y,S)=>{delete y.instances[S.payload]},deleteMany:(y,S)=>{for(const f of S.payload)delete y.instances[f]},initialize:(y,S)=>{y.instances={};const f=new Set;for(const F of S.payload){const g=t(F);f.add(g),y.instances[g]=F}f.size!==S.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function rk(){return{initializeSelection:(u,l)=>{u.selection=Array.from(new Set(l.payload))},selectOne:(u,l)=>{new Set(u.selection).has(l.payload)||u.selection.push(l.payload)},selectMany:(u,l)=>{const y=new Set(u.selection);for(const S of l.payload)y.has(S)||y.add(S);u.selection=Array.from(y)},unselectOne:(u,l)=>{const y=new Set(u.selection);y.has(l.payload)&&(y.delete(l.payload),u.selection=Array.from(y))},unselectMany:(u,l)=>{const y=new Set(u.selection);for(const S of l.payload)y.has(S)&&y.delete(S);u.selection=Array.from(y)},toggleOne:(u,l)=>{const y=new Set(u.selection);y.has(l.payload)?y.delete(l.payload):y.add(l.payload),u.selection=Array.from(y)},toggleMany:(u,l)=>{const y=new Set(u.selection);for(const S of l.payload)y.has(S)?y.delete(S):y.add(S);u.selection=Array.from(y)},getInitialState:u=>({...u,selection:[]})}}const ss="versioning",O=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),I=o.createAction("RESET_ORGANIZATION_STATE");function dk(t,s){return QV.useMemo(t,s)}KV=Symbol.toStringTag;class xs{constructor(){p(this,KV,"Promise");p(this,"_promise");p(this,"_resolve");p(this,"_reject");p(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let ei=!1;["true","1"].includes("".toLowerCase())&&(ei=!0);function uk(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 ti(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ei&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ei&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function lk(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?ur:t,is=t=>Object.keys(t).length===0?lr:t,wr=ti(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===si.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),ok=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),hk=1e3*86400,si=new Date,pk=t=>new Date(t).toDateString()===si.toDateString(),yk=ti((t,s,e)=>{const n=Math.round((new Date(t).getTime()-si.getTime())/hk);return n<s||n>e?wr(t):ok.format(n,"days")});function Sk(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Os(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=Sk(c);s(r)})},n.readAsArrayBuffer(t)})}const mk=(t,s)=>`${t}${s?`.${s}`:""}`;function fk(t,s){return new File([t],s,{type:t.type})}function Pr(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Or=async t=>(await fetch(t)).blob(),Tr=async(t,s)=>{const e=await Or(t);return new File([e],s,{type:e.type})};function Ak(t){const s=new Blob([t]);JV.saveAs(s,t.name)}function Ir(t){return typeof t=="string"&&t.startsWith("blob:")}function wk(t){return t.type.startsWith("image/")}const Fr={};function Pk(t,s,e,...n){const a=Fr[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Fr[t]={[s]:!0},c=!0),c&&console[e](...n)}const _r=["created_at","updated_at","index","revision"];function P(t){return{...t,uuid:Dt.v4()}}function Ok(t){const s={};for(const e of t)s[e.uuid]=e;return s}function E(t){return t.map(({uuid:s})=>s)}function Ts(t,s){return t.localeCompare(s)}function ii(t,s){return Ts(t.uuid,s.uuid)}function Tk(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 Ik(t){return t.toLowerCase().replace(" ","-")}function Fk(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function _k(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const gk=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[..._r,"created_by"])e in s&&delete s[e];return s}const gr=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Zs(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Rk=t=>{const{roots:s}=gr(t);return s.map(e=>new Ht.Tree(e))},Rr=(t,s)=>{const{nodes:e}=gr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Ht.Tree(n)},br=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Mr=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,vr=t=>Zs(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),bk=t=>{const{roots:s}=vr(t);return s.map(e=>new Ht.Tree(e))},Er=(t,s)=>{const{nodes:e}=vr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Ht.Tree(n)},Vr=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Zs(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Mk=t=>{const{roots:s}=Vr(t);return s.map(e=>new Ht.Tree(e))},kr=(t,s)=>{const{nodes:e}=Vr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in procedure step tree.`);return new Ht.Tree(n)};class vk{constructor(s){p(this,"operations",[]);p(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return 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 m=t=>(...s)=>e=>t(e,...s),G=T(t=>t.uuid),Br={instances:{}},ni=o.createSlice({name:"agents",initialState:Br,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Br)),reducers:{initializeConversations:G.initialize,addConversation:G.addOne,addConversations:G.addMany,setConversation:G.setOne,setConversations:G.setMany,updateConversation:G.updateOne,updateConversations:G.updateMany,deleteConversation:G.deleteOne,deleteConversations:G.deleteMany}}),{initializeConversations:Dr,addConversation:Wr,addConversations:Ek,setConversation:zr,setConversations:Vk,updateConversation:qr,updateConversations:kk,deleteConversation:Bk,deleteConversations:Dk}=ni.actions,ai=t=>t.agentsReducer.instances,Wk=o.createSelector([ai],t=>Object.values(t)),zk=m(o.createSelector([ai,(t,s)=>s],(t,s)=>t[s])),jr=ni.reducer,K=T(t=>t.uuid),$r={instances:{}},ci=o.createSlice({name:"assetAttachments",initialState:$r,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,$r)),reducers:{initializeAssetAttachments:K.initialize,addAssetAttachment:K.addOne,addAssetAttachments:K.addMany,setAssetAttachment:K.setOne,setAssetAttachments:K.setMany,updateAssetAttachment:K.updateOne,updateAssetAttachments:K.updateMany,deleteAssetAttachment:K.deleteOne,deleteAssetAttachments:K.deleteMany}}),{initializeAssetAttachments:Cr,addAssetAttachment:Ur,addAssetAttachments:ri,setAssetAttachment:Lr,setAssetAttachments:Nr,updateAssetAttachment:Hr,updateAssetAttachments:Gr,deleteAssetAttachment:Kr,deleteAssetAttachments:di}=ci.actions,Yr=t=>t.assetAttachmentReducer.instances,ui=o.createSelector([Yr],t=>Object.values(t)),Qr=t=>s=>s.assetAttachmentReducer.instances[t],Jr=m(o.createSelector([ui,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zr=m(o.createSelector([ui,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Xr=ci.reducer,Y=T(({uuid:t})=>t),xr={instances:{}},li=o.createSlice({name:"assetProcedureTypeAttachments",initialState:xr,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,xr)),reducers:{initializeAssetProcedureTypeAttachments:Y.initialize,addAssetProcedureTypeAttachment:Y.addOne,addAssetProcedureTypeAttachments:Y.addMany,setAssetProcedureTypeAttachment:Y.setOne,setAssetProcedureTypeAttachments:Y.setMany,updateAssetProcedureTypeAttachment:Y.updateOne,updateAssetProcedureTypeAttachments:Y.updateMany,deleteAssetProcedureTypeAttachment:Y.deleteOne,deleteAssetProcedureTypeAttachments:Y.deleteMany}}),{initializeAssetProcedureTypeAttachments:ed,addAssetProcedureTypeAttachment:td,addAssetProcedureTypeAttachments:sd,setAssetProcedureTypeAttachment:id,setAssetProcedureTypeAttachments:nd,updateAssetProcedureTypeAttachment:ad,updateAssetProcedureTypeAttachments:cd,deleteAssetProcedureTypeAttachment:rd,deleteAssetProcedureTypeAttachments:dd}=li.actions,ud=li.reducer,ld=t=>t.assetProcedureTypeAttachmentReducer.instances,oi=o.createSelector([ld],t=>Object.values(t)),od=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],hd=m(o.createSelector([oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qk=m(o.createSelector([oi,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),Q=T(({uuid:t})=>t),pd={instances:{}},hi=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:pd,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,pd)),reducers:{initializeAssetProcedureTypeFieldsAttachments:Q.initialize,addAssetProcedureTypeFieldsAttachment:Q.addOne,addAssetProcedureTypeFieldsAttachments:Q.addMany,setAssetProcedureTypeFieldsAttachment:Q.setOne,setAssetProcedureTypeFieldsAttachments:Q.setMany,updateAssetProcedureTypeFieldsAttachment:Q.updateOne,updateAssetProcedureTypeFieldsAttachments:Q.updateMany,deleteAssetProcedureTypeFieldsAttachment:Q.deleteOne,deleteAssetProcedureTypeFieldsAttachments:Q.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:yd,addAssetProcedureTypeFieldsAttachment:Sd,addAssetProcedureTypeFieldsAttachments:md,setAssetProcedureTypeFieldsAttachment:fd,setAssetProcedureTypeFieldsAttachments:Ad,updateAssetProcedureTypeFieldsAttachment:wd,updateAssetProcedureTypeFieldsAttachments:Pd,deleteAssetProcedureTypeFieldsAttachment:Od,deleteAssetProcedureTypeFieldsAttachments:Td}=hi.actions,Id=hi.reducer,Fd=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,pi=o.createSelector([Fd],t=>Object.values(t)),jk=m(o.createSelector([pi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),_d=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],gd=m(o.createSelector([pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=T(({uuid:t})=>t),Rd={instances:{}},yi=o.createSlice({name:"assetProcedureTypeFields",initialState:Rd,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Rd)),reducers:{initializeAssetProcedureTypeFields:J.initialize,addAssetProcedureTypeFields:J.addOne,addAssetProcedureTypeFieldsMany:J.addMany,setAssetProcedureTypeFields:J.setOne,setAssetProcedureTypeFieldsMany:J.setMany,updateAssetProcedureTypeFields:J.updateOne,updateAssetProcedureTypeFieldsMany:J.updateMany,deleteAssetProcedureTypeFields:J.deleteOne,deleteAssetProcedureTypeFieldsMany:J.deleteMany}}),{initializeAssetProcedureTypeFields:bd,addAssetProcedureTypeFields:Md,addAssetProcedureTypeFieldsMany:vd,setAssetProcedureTypeFields:Ed,setAssetProcedureTypeFieldsMany:Vd,updateAssetProcedureTypeFields:kd,updateAssetProcedureTypeFieldsMany:Bd,deleteAssetProcedureTypeFields:Dd,deleteAssetProcedureTypeFieldsMany:Wd}=yi.actions,zd=yi.reducer,qd=t=>t.assetProcedureTypeFieldsReducer.instances,Is=o.createSelector([qd],t=>Object.values(t)),$k=m(o.createSelector([Is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Ck=m(o.createSelector([Is,(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])),jd=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],$d=m(o.createSelector([Is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Z=T(({uuid:t})=>t),Cd={instances:{}},Si=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:Cd,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Cd)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:Z.initialize,addAssetProcedureTypeFieldValuesAttachment:Z.addOne,addAssetProcedureTypeFieldValuesAttachments:Z.addMany,setAssetProcedureTypeFieldValuesAttachment:Z.setOne,setAssetProcedureTypeFieldValuesAttachments:Z.setMany,updateAssetProcedureTypeFieldValuesAttachment:Z.updateOne,updateAssetProcedureTypeFieldValuesAttachments:Z.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:Z.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:Ud,addAssetProcedureTypeFieldValuesAttachment:Ld,addAssetProcedureTypeFieldValuesAttachments:mi,setAssetProcedureTypeFieldValuesAttachment:Nd,setAssetProcedureTypeFieldValuesAttachments:Hd,updateAssetProcedureTypeFieldValuesAttachment:Gd,updateAssetProcedureTypeFieldValuesAttachments:Kd,deleteAssetProcedureTypeFieldValuesAttachment:Yd,deleteAssetProcedureTypeFieldValuesAttachments:fi}=Si.actions,Qd=Si.reducer,Jd=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Ai=o.createSelector([Jd],t=>Object.values(t)),Zd=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Xd=m(o.createSelector([Ai,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xd=m(o.createSelector([Ai,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),X=T(({uuid:t})=>t),eu={instances:{}},wi=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:eu,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,eu)),reducers:{initializeAssetProcedureTypeFieldValues:X.initialize,addAssetProcedureTypeFieldValues:X.addOne,addAssetProcedureTypeFieldValuesMany:X.addMany,setAssetProcedureTypeFieldValues:X.setOne,setAssetProcedureTypeFieldValuesMany:X.setMany,updateAssetProcedureTypeFieldValues:X.updateOne,updateAssetProcedureTypeFieldValuesMany:X.updateMany,deleteAssetProcedureTypeFieldValues:X.deleteOne,deleteAssetProcedureTypeFieldValuesMany:X.deleteMany}}),{initializeAssetProcedureTypeFieldValues:tu,addAssetProcedureTypeFieldValues:su,addAssetProcedureTypeFieldValuesMany:iu,setAssetProcedureTypeFieldValues:nu,setAssetProcedureTypeFieldValuesMany:au,updateAssetProcedureTypeFieldValues:cu,updateAssetProcedureTypeFieldValuesMany:ru,deleteAssetProcedureTypeFieldValues:du,deleteAssetProcedureTypeFieldValuesMany:uu}=wi.actions,lu=wi.reducer,ou=t=>t.assetProcedureTypeFieldValuesReducer.instances,Fs=o.createSelector([ou],t=>Object.values(t)),Uk=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Lk=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),hu=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],pu=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),x=T(({uuid:t})=>t),yu={instances:{}},Pi=o.createSlice({name:"assetProcedures",initialState:yu,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,yu)),reducers:{initializeAssetProcedures:x.initialize,addAssetProcedure:x.addOne,addAssetProcedures:x.addMany,setAssetProcedure:x.setOne,setAssetProcedures:x.setMany,updateAssetProcedure:x.updateOne,updateAssetProcedures:x.updateMany,deleteAssetProcedure:x.deleteOne,deleteAssetProcedures:x.deleteMany}}),{initializeAssetProcedures:Su,addAssetProcedure:mu,addAssetProcedures:Oi,updateAssetProcedure:fu,updateAssetProcedures:Au,deleteAssetProcedure:wu,deleteAssetProcedures:Ti,setAssetProcedure:Pu,setAssetProcedures:Ou}=Pi.actions,Tu=Pi.reducer,Iu=t=>t.assetProcedureReducer.instances,_s=o.createSelector([Iu],t=>Object.values(t)),Fu=m(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Nk=m(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),_u=t=>s=>s.assetProcedureReducer.instances[t],gu=m(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ee=T(t=>t.uuid),Ru={instances:{}},Ii=o.createSlice({name:"assetProcedureTypes",initialState:Ru,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Ru)),reducers:{initializeAssetProcedureTypes:ee.initialize,addAssetProcedureType:ee.addOne,addAssetProcedureTypes:ee.addMany,setAssetProcedureType:ee.setOne,setAssetProcedureTypes:ee.setMany,updateAssetProcedureType:ee.updateOne,updateAssetProcedureTypes:ee.updateMany,deleteAssetProcedureType:ee.deleteOne,deleteAssetProcedureTypes:ee.deleteMany}}),{initializeAssetProcedureTypes:bu,addAssetProcedureType:Mu,addAssetProcedureTypes:vu,updateAssetProcedureType:Eu,updateAssetProcedureTypes:Vu,deleteAssetProcedureType:ku,deleteAssetProcedureTypes:Bu,setAssetProcedureType:Du,setAssetProcedureTypes:Wu}=Ii.actions,zu=Ii.reducer,qu=t=>t.assetProcedureTypeReducer.instances,Fi=o.createSelector([qu],t=>Object.values(t)),ju=t=>s=>s.assetProcedureTypeReducer.instances[t],$u=m(o.createSelector([Fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hk=m(o.createSelector([Fi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),te=T(t=>t.uuid),Cu={instances:{}},_i=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Cu,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Cu)),reducers:{initializeAssetProcedureStepFieldsAttachments:te.initialize,addAssetProcedureStepFieldsAttachment:te.addOne,addAssetProcedureStepFieldsAttachments:te.addMany,setAssetProcedureStepFieldsAttachment:te.setOne,setAssetProcedureStepFieldsAttachments:te.setMany,updateAssetProcedureStepFieldsAttachment:te.updateOne,updateAssetProcedureStepFieldsAttachments:te.updateMany,deleteAssetProcedureStepFieldsAttachment:te.deleteOne,deleteAssetProcedureStepFieldsAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:Uu,addAssetProcedureStepFieldsAttachment:Lu,addAssetProcedureStepFieldsAttachments:Nu,setAssetProcedureStepFieldsAttachment:Hu,setAssetProcedureStepFieldsAttachments:Gu,updateAssetProcedureStepFieldsAttachment:Ku,updateAssetProcedureStepFieldsAttachments:Yu,deleteAssetProcedureStepFieldsAttachment:Qu,deleteAssetProcedureStepFieldsAttachments:Ju}=_i.actions,Zu=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,gi=o.createSelector([Zu],t=>Object.values(t)),Gk=m(o.createSelector([gi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Xu=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],xu=m(o.createSelector([gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),el=_i.reducer,se=T(t=>t.uuid),tl={instances:{}},Ri=o.createSlice({name:"assetProcedureStepFields",initialState:tl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,tl)),reducers:{initializeAssetProcedureStepFields:se.initialize,addAssetProcedureStepFields:se.addOne,addAssetProcedureStepFieldsMany:se.addMany,setAssetProcedureStepFields:se.setOne,setAssetProcedureStepFieldsMany:se.setMany,updateAssetProcedureStepFields:se.updateOne,updateAssetProcedureStepFieldsMany:se.updateMany,deleteAssetProcedureStepFields:se.deleteOne,deleteAssetProcedureStepFieldsMany:se.deleteMany}}),{initializeAssetProcedureStepFields:sl,addAssetProcedureStepFields:il,addAssetProcedureStepFieldsMany:nl,setAssetProcedureStepFields:al,setAssetProcedureStepFieldsMany:cl,updateAssetProcedureStepFields:rl,updateAssetProcedureStepFieldsMany:dl,deleteAssetProcedureStepFields:ul,deleteAssetProcedureStepFieldsMany:ll}=Ri.actions,bi=t=>t.assetProcedureStepFieldsReducer.instances,gs=o.createSelector([bi],t=>Object.values(t)),Kk=m(o.createSelector([gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),Yk=m(o.createSelector([gs,(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])),Qk=o.createSelector([bi],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}),ol=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],hl=m(o.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pl=Ri.reducer,ie=T(t=>t.uuid),yl={instances:{}},Mi=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:yl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,yl)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:ie.initialize,addAssetProcedureStepFieldValuesAttachment:ie.addOne,addAssetProcedureStepFieldValuesAttachments:ie.addMany,setAssetProcedureStepFieldValuesAttachment:ie.setOne,setAssetProcedureStepFieldValuesAttachments:ie.setMany,updateAssetProcedureStepFieldValuesAttachment:ie.updateOne,updateAssetProcedureStepFieldValuesAttachments:ie.updateMany,deleteAssetProcedureStepFieldValuesAttachment:ie.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:ie.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Sl,addAssetProcedureStepFieldValuesAttachment:ml,addAssetProcedureStepFieldValuesAttachments:vi,setAssetProcedureStepFieldValuesAttachment:fl,setAssetProcedureStepFieldValuesAttachments:Al,updateAssetProcedureStepFieldValuesAttachment:wl,updateAssetProcedureStepFieldValuesAttachments:Pl,deleteAssetProcedureStepFieldValuesAttachment:Ol,deleteAssetProcedureStepFieldValuesAttachments:Ei}=Mi.actions,Tl=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Vi=o.createSelector([Tl],t=>Object.values(t)),Il=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Fl=m(o.createSelector([Vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_l=m(o.createSelector([Vi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),gl=Mi.reducer,ne=T(t=>t.uuid),Rl={instances:{}},ki=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Rl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Rl)),reducers:{initializeAssetProcedureStepFieldValues:ne.initialize,addAssetProcedureStepFieldValues:ne.addOne,addAssetProcedureStepFieldValuesMany:ne.addMany,setAssetProcedureStepFieldValues:ne.setOne,setAssetProcedureStepFieldValuesMany:ne.setMany,updateAssetProcedureStepFieldValues:ne.updateOne,updateAssetProcedureStepFieldValuesMany:ne.updateMany,deleteAssetProcedureStepFieldValues:ne.deleteOne,deleteAssetProcedureStepFieldValuesMany:ne.deleteMany}}),{initializeAssetProcedureStepFieldValues:bl,addAssetProcedureStepFieldValues:Ml,addAssetProcedureStepFieldValuesMany:vl,setAssetProcedureStepFieldValues:El,setAssetProcedureStepFieldValuesMany:Vl,updateAssetProcedureStepFieldValues:kl,updateAssetProcedureStepFieldValuesMany:Bl,deleteAssetProcedureStepFieldValues:Dl,deleteAssetProcedureStepFieldValuesMany:Wl}=ki.actions,zl=t=>t.assetProcedureStepFieldValuesReducer.instances,ns=o.createSelector([zl],t=>Object.values(t)),Jk=m(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Zk=m(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Xk=m(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),ql=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],jl=m(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$l=ki.reducer,ae=T(t=>t.uuid),Cl={instances:{}},Bi=o.createSlice({name:"assetProcedureSteps",initialState:Cl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Cl)),reducers:{initializeAssetProcedureSteps:ae.initialize,setAssetProcedureStep:ae.setOne,setAssetProcedureSteps:ae.setMany,addAssetProcedureStep:ae.addOne,addAssetProcedureSteps:ae.addMany,updateAssetProcedureStep:ae.updateOne,updateAssetProcedureSteps:ae.updateMany,deleteAssetProcedureStep:ae.deleteOne,deleteAssetProcedureSteps:ae.deleteMany}}),{initializeAssetProcedureSteps:Ul,setAssetProcedureStep:Ll,setAssetProcedureSteps:Nl,addAssetProcedureStep:Hl,addAssetProcedureSteps:Gl,updateAssetProcedureStep:Kl,updateAssetProcedureSteps:Yl,deleteAssetProcedureStep:Ql,deleteAssetProcedureSteps:Jl}=Bi.actions,Zl=Bi.reducer,Rs=t=>t.assetProcedureStepReducer.instances,Xl=t=>s=>s.assetProcedureStepReducer.instances[t],Di=o.createSelector([Rs],t=>Object.values(t)),xk=m(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return is(e)})),eB=m(o.createSelector([Di,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),xl=m(o.createSelector([Di,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eo=m(o.createSelector([Rs,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Rr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ce=T(t=>t.uuid),to={instances:{}},Wi=o.createSlice({name:"assets",initialState:to,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,to)),reducers:{initializeAssets:ce.initialize,addAsset:ce.addOne,addAssets:ce.addMany,setAsset:ce.setOne,setAssets:ce.setMany,updateAsset:ce.updateOne,updateAssets:ce.updateMany,deleteAsset:ce.deleteOne,deleteAssets:ce.deleteMany}}),{initializeAssets:so,addAsset:io,addAssets:zi,updateAsset:no,updateAssets:ao,deleteAsset:co,deleteAssets:qi,setAsset:ro,setAssets:uo}=Wi.actions,lo=t=>t.assetReducer.instances,bs=o.createSelector([lo],t=>A(Object.values(t))),tB=m(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),oo=m(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),ho=t=>s=>s.assetReducer.instances[t],po=m(o.createSelector([bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yo=Wi.reducer,re=T(t=>t.uuid),So={instances:{}},ji=o.createSlice({name:"assetStageCompletions",initialState:So,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,So)),reducers:{initializeAssetStageCompletions:re.initialize,addAssetStageCompletion:re.addOne,addAssetStageCompletions:re.addMany,setAssetStageCompletion:re.setOne,setAssetStageCompletions:re.setMany,updateAssetStageCompletion:re.updateOne,updateAssetStageCompletions:re.updateMany,deleteAssetStageCompletion:re.deleteOne,deleteAssetStageCompletions:re.deleteMany}}),{initializeAssetStageCompletions:mo,addAssetStageCompletion:fo,addAssetStageCompletions:Ao,setAssetStageCompletion:wo,setAssetStageCompletions:Po,updateAssetStageCompletion:Oo,updateAssetStageCompletions:To,deleteAssetStageCompletion:Io,deleteAssetStageCompletions:Fo}=ji.actions,_o=ji.reducer,go=t=>t.assetStageCompletionReducer.instances,Ro=o.createSelector([go],t=>Object.values(t)),bo=t=>s=>s.assetStageCompletionReducer.instances[t],Mo=m(o.createSelector([Ro,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),de=T(t=>t.uuid),vo={instances:{}},$i=o.createSlice({name:"assetStages",initialState:vo,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,vo)),reducers:{initializeAssetStages:de.initialize,setAssetStage:de.setOne,setAssetStages:de.setMany,addAssetStage:de.addOne,addAssetStages:de.addMany,updateAssetStage:de.updateOne,updateAssetStages:de.updateMany,deleteAssetStage:de.deleteOne,deleteAssetStages:de.deleteMany}}),{initializeAssetStages:Eo,setAssetStage:Vo,setAssetStages:ko,addAssetStage:Bo,addAssetStages:Do,updateAssetStage:Wo,updateAssetStages:zo,deleteAssetStage:qo,deleteAssetStages:jo}=$i.actions,$o=$i.reducer,Ci=t=>t.assetStageReducer.instances,Co=t=>s=>s.assetStageReducer.instances[t],Ui=o.createSelector([Ci],t=>Object.values(t)),sB=m(o.createSelector([Ci,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return is(e)})),iB=m(o.createSelector([Ui,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Uo=m(o.createSelector([Ui,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ue=T(t=>t.uuid),Lo={instances:{}},Li=o.createSlice({name:"assetTypeAttachments",initialState:Lo,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Lo)),reducers:{initializeAssetTypeAttachments:ue.initialize,addAssetTypeAttachment:ue.addOne,addAssetTypeAttachments:ue.addMany,setAssetTypeAttachment:ue.setOne,setAssetTypeAttachments:ue.setMany,updateAssetTypeAttachment:ue.updateOne,updateAssetTypeAttachments:ue.updateMany,deleteAssetTypeAttachment:ue.deleteOne,deleteAssetTypeAttachments:ue.deleteMany}}),{initializeAssetTypeAttachments:No,addAssetTypeAttachment:Ho,addAssetTypeAttachments:Ni,setAssetTypeAttachment:Go,setAssetTypeAttachments:Ko,updateAssetTypeAttachment:Yo,updateAssetTypeAttachments:Qo,deleteAssetTypeAttachment:Jo,deleteAssetTypeAttachments:Hi}=Li.actions,Zo=t=>t.assetTypeAttachmentReducer.instances,Gi=o.createSelector([Zo],t=>Object.values(t)),Xo=t=>s=>s.assetTypeAttachmentReducer.instances[t],xo=m(o.createSelector([Gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eh=m(o.createSelector([Gi,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),th=Li.reducer,le=T(t=>t.uuid),sh={instances:{}},Ki=o.createSlice({name:"assetTypeFieldsAttachments",initialState:sh,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,sh)),reducers:{initializeAssetTypeFieldsAttachments:le.initialize,addAssetTypeFieldsAttachment:le.addOne,addAssetTypeFieldsAttachments:le.addMany,setAssetTypeFieldsAttachment:le.setOne,setAssetTypeFieldsAttachments:le.setMany,updateAssetTypeFieldsAttachment:le.updateOne,updateAssetTypeFieldsAttachments:le.updateMany,deleteAssetTypeFieldsAttachment:le.deleteOne,deleteAssetTypeFieldsAttachments:le.deleteMany}}),{initializeAssetTypeFieldsAttachments:ih,addAssetTypeFieldsAttachment:nh,addAssetTypeFieldsAttachments:ah,setAssetTypeFieldsAttachment:ch,setAssetTypeFieldsAttachments:rh,updateAssetTypeFieldsAttachment:dh,updateAssetTypeFieldsAttachments:uh,deleteAssetTypeFieldsAttachment:lh,deleteAssetTypeFieldsAttachments:oh}=Ki.actions,hh=t=>t.assetTypeFieldsAttachmentReducer.instances,Yi=o.createSelector([hh],t=>Object.values(t)),nB=m(o.createSelector([Yi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),ph=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],yh=m(o.createSelector([Yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Sh=Ki.reducer,oe=T(t=>t.uuid),mh={instances:{}},Qi=o.createSlice({name:"assetTypeFields",initialState:mh,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,mh)),reducers:{initializeAssetTypeFields:oe.initialize,addAssetTypeFields:oe.addOne,addAssetTypeFieldsMany:oe.addMany,setAssetTypeFields:oe.setOne,setAssetTypeFieldsMany:oe.setMany,updateAssetTypeFields:oe.updateOne,updateAssetTypeFieldsMany:oe.updateMany,deleteAssetTypeFields:oe.deleteOne,deleteAssetTypeFieldsMany:oe.deleteMany}}),{initializeAssetTypeFields:fh,addAssetTypeFields:Ah,addAssetTypeFieldsMany:wh,setAssetTypeFields:Ph,setAssetTypeFieldsMany:Oh,updateAssetTypeFields:Th,updateAssetTypeFieldsMany:Ih,deleteAssetTypeFields:Fh,deleteAssetTypeFieldsMany:_h}=Qi.actions,gh=t=>t.assetTypeFieldsReducer.instances,as=o.createSelector([gh],t=>Object.values(t)),aB=m(o.createSelector([as,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),cB=m(o.createSelector([as,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Rh=t=>s=>s.assetTypeFieldsReducer.instances[t],bh=m(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mh=Qi.reducer,he=T(t=>t.uuid),vh={instances:{}},Ji=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:vh,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,vh)),reducers:{initializeAssetTypeFieldValuesAttachments:he.initialize,addAssetTypeFieldValuesAttachment:he.addOne,addAssetTypeFieldValuesAttachments:he.addMany,setAssetTypeFieldValuesAttachment:he.setOne,setAssetTypeFieldValuesAttachments:he.setMany,updateAssetTypeFieldValuesAttachment:he.updateOne,updateAssetTypeFieldValuesAttachments:he.updateMany,deleteAssetTypeFieldValuesAttachment:he.deleteOne,deleteAssetTypeFieldValuesAttachments:he.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Eh,addAssetTypeFieldValuesAttachment:Vh,addAssetTypeFieldValuesAttachments:Zi,setAssetTypeFieldValuesAttachment:kh,setAssetTypeFieldValuesAttachments:Bh,updateAssetTypeFieldValuesAttachment:Dh,updateAssetTypeFieldValuesAttachments:Wh,deleteAssetTypeFieldValuesAttachment:zh,deleteAssetTypeFieldValuesAttachments:Xi}=Ji.actions,qh=t=>t.assetTypeFieldValuesAttachmentReducer.instances,xi=o.createSelector([qh],t=>Object.values(t)),jh=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],$h=m(o.createSelector([xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ch=m(o.createSelector([xi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Uh=Ji.reducer,pe=T(t=>t.uuid),Lh={instances:{}},en=o.createSlice({name:"assetTypeFieldValues",initialState:Lh,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Lh)),reducers:{initializeAssetTypeFieldValues:pe.initialize,addAssetTypeFieldValues:pe.addOne,addAssetTypeFieldValuesMany:pe.addMany,setAssetTypeFieldValues:pe.setOne,setAssetTypeFieldValuesMany:pe.setMany,updateAssetTypeFieldValues:pe.updateOne,updateAssetTypeFieldValuesMany:pe.updateMany,deleteAssetTypeFieldValues:pe.deleteOne,deleteAssetTypeFieldValuesMany:pe.deleteMany}}),{initializeAssetTypeFieldValues:Nh,addAssetTypeFieldValues:Hh,addAssetTypeFieldValuesMany:Gh,setAssetTypeFieldValues:Kh,setAssetTypeFieldValuesMany:Yh,updateAssetTypeFieldValues:Qh,updateAssetTypeFieldValuesMany:Jh,deleteAssetTypeFieldValues:Zh,deleteAssetTypeFieldValuesMany:Xh}=en.actions,xh=t=>t.assetTypeFieldValuesReducer.instances,Ms=o.createSelector([xh],t=>Object.values(t)),rB=m(o.createSelector([Ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),dB=m(o.createSelector([as,Ms,(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)))})),ep=t=>s=>s.assetTypeFieldValuesReducer.instances[t],tp=m(o.createSelector([Ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sp=en.reducer,ye=T(t=>t.uuid),ip={instances:{}},tn=o.createSlice({name:"assetTypeIdentifiers",initialState:ip,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,ip)),reducers:{initializeAssetTypeIdentifiers:ye.initialize,addAssetTypeIdentifier:ye.addOne,addAssetTypeIdentifiers:ye.addMany,setAssetTypeIdentifier:ye.setOne,setAssetTypeIdentifiers:ye.setMany,updateAssetTypeIdentifier:ye.updateOne,updateAssetTypeIdentifiers:ye.updateMany,deleteAssetTypeIdentifier:ye.deleteOne,deleteAssetTypeIdentifiers:ye.deleteMany}}),{initializeAssetTypeIdentifiers:np,addAssetTypeIdentifier:ap,addAssetTypeIdentifiers:cp,setAssetTypeIdentifier:rp,setAssetTypeIdentifiers:dp,updateAssetTypeIdentifier:up,updateAssetTypeIdentifiers:lp,deleteAssetTypeIdentifier:op,deleteAssetTypeIdentifiers:hp}=tn.actions,pp=t=>t.assetTypeIdentifierReducer.instances,sn=o.createSelector([pp],t=>Object.values(t)),yp=t=>s=>s.assetTypeIdentifierReducer.instances[t],Sp=m(o.createSelector([sn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uB=m(o.createSelector([sn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),mp=tn.reducer,Se=T(t=>t.uuid),fp={instances:{}},nn=o.createSlice({name:"assetTypeIdentifierValues",initialState:fp,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,fp)),reducers:{initializeAssetTypeIdentifierValues:Se.initialize,addAssetTypeIdentifierValue:Se.addOne,addAssetTypeIdentifierValues:Se.addMany,setAssetTypeIdentifierValue:Se.setOne,setAssetTypeIdentifierValues:Se.setMany,updateAssetTypeIdentifierValue:Se.updateOne,updateAssetTypeIdentifierValues:Se.updateMany,deleteAssetTypeIdentifierValue:Se.deleteOne,deleteAssetTypeIdentifierValues:Se.deleteMany}}),{initializeAssetTypeIdentifierValues:Ap,addAssetTypeIdentifierValue:wp,addAssetTypeIdentifierValues:Pp,setAssetTypeIdentifierValue:Op,setAssetTypeIdentifierValues:Tp,updateAssetTypeIdentifierValue:Ip,updateAssetTypeIdentifierValues:Fp,deleteAssetTypeIdentifierValue:_p,deleteAssetTypeIdentifierValues:gp}=nn.actions,Rp=t=>t.assetTypeIdentifierValueReducer.instances,vs=o.createSelector([Rp],t=>Object.values(t)),bp=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],Mp=m(o.createSelector([vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lB=m(o.createSelector([vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),oB=m(o.createSelector([vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),vp=nn.reducer,me=T(t=>t.uuid),Ep={instances:{}},an=o.createSlice({name:"assetTypes",initialState:Ep,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Ep)),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:Vp,setAssetType:kp,setAssetTypes:Bp,addAssetType:Dp,addAssetTypes:Wp,updateAssetType:zp,updateAssetTypes:qp,deleteAssetType:jp,deleteAssetTypes:$p}=an.actions,Cp=t=>t.assetTypeReducer.instances,cn=o.createSelector([Cp],t=>Object.values(t)),Up=t=>s=>s.assetTypeReducer.instances[t],Lp=m(o.createSelector([cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hB=m(o.createSelector([cn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Np=an.reducer,fe=T(t=>t.uuid),Hp={instances:{}},rn=o.createSlice({name:"assetTypeStatuses",initialState:Hp,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Hp)),reducers:{initializeAssetTypeStatuses:fe.initialize,addAssetTypeStatus:fe.addOne,addAssetTypeStatuses:fe.addMany,setAssetTypeStatus:fe.setOne,setAssetTypeStatuses:fe.setMany,updateAssetTypeStatus:fe.updateOne,updateAssetTypeStatuses:fe.updateMany,deleteAssetTypeStatus:fe.deleteOne,deleteAssetTypeStatuses:fe.deleteMany}}),{initializeAssetTypeStatuses:Gp,addAssetTypeStatus:Kp,addAssetTypeStatuses:Yp,setAssetTypeStatus:Qp,setAssetTypeStatuses:Jp,updateAssetTypeStatus:Zp,updateAssetTypeStatuses:Xp,deleteAssetTypeStatus:xp,deleteAssetTypeStatuses:ey}=rn.actions,ty=t=>t.assetTypeStatusReducer.instances,dn=o.createSelector([ty],t=>A(Object.values(t).toSorted(br))),sy=t=>s=>s.assetTypeStatusReducer.instances[t],iy=m(o.createSelector([dn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pB=m(o.createSelector([dn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),ny=rn.reducer,ay={accessToken:"",refreshToken:"",isLoggedIn:!1},Es=o.createSlice({name:"auth",initialState:ay,extraReducers:t=>t.addCase(O,s=>Object.assign(s,ay)),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||Es.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:yB,clearTokens:SB,setLoggedIn:cy}=Es.actions,mB=t=>t.authReducer.accessToken,fB=t=>t.authReducer.isLoggedIn,ry=Es.reducer,Ae=T(t=>t.uuid),dy={instances:{}},un=o.createSlice({name:"documentAttachments",initialState:dy,extraReducers:t=>t.addCase(O,s=>Object.assign(s,dy)),reducers:{initializeDocumentAttachments:Ae.initialize,addDocumentAttachment:Ae.addOne,addDocumentAttachments:Ae.addMany,setDocumentAttachment:Ae.setOne,setDocumentAttachments:Ae.setMany,updateDocumentAttachment:Ae.updateOne,updateDocumentAttachments:Ae.updateMany,deleteDocumentAttachment:Ae.deleteOne,deleteDocumentAttachments:Ae.deleteMany}}),{initializeDocumentAttachments:uy,addDocumentAttachment:ly,addDocumentAttachments:oy,setDocumentAttachment:hy,setDocumentAttachments:py,updateDocumentAttachment:yy,updateDocumentAttachments:Sy,deleteDocumentAttachment:my,deleteDocumentAttachments:fy}=un.actions,Ay=t=>t.documentAttachmentReducer.instances,ln=o.createSelector([Ay],t=>Object.values(t)),wy=t=>s=>s.documentAttachmentReducer.instances[t],Py=m(o.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AB=m(o.createSelector([ln,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),Oy=un.reducer,we=T(({uuid:t})=>t),Ty={instances:{}},on=o.createSlice({name:"documents",initialState:Ty,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>{Object.assign(s,Ty)}),reducers:{initializeDocuments:we.initialize,addDocument:we.addOne,addDocuments:we.addMany,setDocument:we.setOne,setDocuments:we.setMany,updateDocument:we.updateOne,updateDocuments:we.updateMany,deleteDocument:we.deleteOne,deleteDocuments:we.deleteMany}}),{initializeDocuments:Iy,addDocument:Fy,addDocuments:_y,setDocument:gy,setDocuments:Ry,updateDocument:by,updateDocuments:My,deleteDocument:vy,deleteDocuments:Ey}=on.actions,Vy=on.reducer,hn=t=>t.documentsReducer.instances,Vs=o.createSelector([hn],t=>Object.values(t)),ky=t=>s=>s.documentsReducer.instances[t],By=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wB=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),PB=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Dy=m(o.createSelector([hn,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Er(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Pe=T(t=>t.uuid),Wy={instances:{}},pn=o.createSlice({name:"emailDomains",initialState:Wy,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Wy)),reducers:{initializeEmailDomains:Pe.initialize,addEmailDomain:Pe.addOne,addEmailDomains:Pe.addMany,setEmailDomain:Pe.setOne,setEmailDomains:Pe.setMany,updateEmailDomain:Pe.updateOne,updateEmailDomains:Pe.updateMany,deleteEmailDomain:Pe.deleteOne,deleteEmailDomains:Pe.deleteMany}}),{initializeEmailDomains:zy,addEmailDomain:qy,addEmailDomains:jy,setEmailDomain:$y,setEmailDomains:Cy,updateEmailDomain:Uy,updateEmailDomains:Ly,deleteEmailDomain:Ny,deleteEmailDomains:Hy}=pn.actions,Gy=t=>t.emailDomainsReducer.instances,yn=o.createSelector([Gy],t=>Object.values(t)),Ky=t=>s=>s.emailDomainsReducer.instances[t],Yy=m(o.createSelector([yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OB=m(o.createSelector([yn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Qy=pn.reducer,Jy={s3Urls:{}},Zy=1e3*60*60,TB=Zy*24*7,Sn=o.createSlice({name:"file",initialState:Jy,extraReducers:t=>t.addCase(O,s=>Object.assign(s,Jy)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+TB);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:IB}=Sn.actions,FB=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Zy))return e},Xy=Sn.reducer,Oe=T(t=>t.uuid),xy={instances:{}},mn=o.createSlice({name:"formIdentifiers",initialState:xy,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,xy)),reducers:{initializeFormIdentifiers:Oe.initialize,addFormIdentifier:Oe.addOne,addFormIdentifiers:Oe.addMany,setFormIdentifier:Oe.setOne,setFormIdentifiers:Oe.setMany,updateFormIdentifier:Oe.updateOne,updateFormIdentifiers:Oe.updateMany,deleteFormIdentifier:Oe.deleteOne,deleteFormIdentifiers:Oe.deleteMany}}),{initializeFormIdentifiers:eS,addFormIdentifier:tS,addFormIdentifiers:sS,setFormIdentifier:iS,setFormIdentifiers:nS,updateFormIdentifier:aS,updateFormIdentifiers:cS,deleteFormIdentifier:rS,deleteFormIdentifiers:dS}=mn.actions,uS=t=>t.formIdentifierReducer.instances,fn=o.createSelector([uS],t=>Object.values(t)),lS=t=>s=>s.formIdentifierReducer.instances[t],oS=m(o.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_B=m(o.createSelector([fn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),hS=mn.reducer,Te=T(t=>t.uuid),pS={instances:{}},An=o.createSlice({name:"formIdentifierValues",initialState:pS,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,pS)),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:yS,addFormIdentifierValue:SS,addFormIdentifierValues:mS,setFormIdentifierValue:fS,setFormIdentifierValues:AS,updateFormIdentifierValue:wS,updateFormIdentifierValues:PS,deleteFormIdentifierValue:OS,deleteFormIdentifierValues:TS}=An.actions,IS=t=>t.formIdentifierValueReducer.instances,ks=o.createSelector([IS],t=>Object.values(t)),FS=t=>s=>s.formIdentifierValueReducer.instances[t],_S=m(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gB=m(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),RB=m(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),gS=An.reducer,Ie=T(t=>t.uuid),RS={instances:{}},wn=o.createSlice({name:"formRevisionAttachments",initialState:RS,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,RS)),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:bS,addFormRevisionAttachment:MS,addFormRevisionAttachments:vS,setFormRevisionAttachment:ES,setFormRevisionAttachments:VS,updateFormRevisionAttachment:kS,updateFormRevisionAttachments:BS,deleteFormRevisionAttachment:DS,deleteFormRevisionAttachments:WS}=wn.actions,Bs=t=>t.formRevisionAttachmentReducer.instances,zS=o.createSelector([Bs],t=>Object.values(t)),qS=m(o.createSelector([Bs,(t,s)=>s],(t,s)=>t[s])),jS=m(o.createSelector([zS,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bB=m(o.createSelector([Bs,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),$S=wn.reducer,Fe=T(t=>t.uuid),CS={instances:{}},Pn=o.createSlice({name:"formRevisions",initialState:CS,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,CS)),reducers:{initializeFormRevisions:Fe.initialize,addFormRevision:Fe.addOne,addFormRevisions:Fe.addMany,setFormRevision:Fe.setOne,setFormRevisions:Fe.setMany,updateFormRevision:Fe.updateOne,updateFormRevisions:Fe.updateMany,deleteFormRevision:Fe.deleteOne,deleteFormRevisions:Fe.deleteMany}}),{initializeFormRevisions:US,addFormRevision:LS,addFormRevisions:On,setFormRevision:NS,setFormRevisions:HS,updateFormRevision:GS,updateFormRevisions:KS,deleteFormRevision:YS,deleteFormRevisions:Tn}=Pn.actions,QS=t=>t.formRevisionReducer.instances,Ds=o.createSelector([QS],t=>Object.values(t)),JS=t=>s=>s.formRevisionReducer.instances[t],ZS=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),MB=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),XS=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),xS=Pn.reducer,_e=T(t=>t.uuid),em={instances:{}},In=o.createSlice({name:"forms",initialState:em,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,em)),reducers:{initializeForms:_e.initialize,addForm:_e.addOne,addForms:_e.addMany,setForm:_e.setOne,setForms:_e.setMany,updateForm:_e.updateOne,updateForms:_e.updateMany,deleteForm:_e.deleteOne,deleteForms:_e.deleteMany}}),{initializeForms:tm,addForm:sm,addForms:im,setForm:nm,setForms:am,updateForm:cm,updateForms:rm,deleteForm:dm,deleteForms:um}=In.actions,lm=In.reducer,om=t=>t.formReducer.instances,Fn=o.createSelector([om],t=>Object.values(t)),hm=t=>s=>s.formReducer.instances[t],pm=m(o.createSelector([Fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vB=m(o.createSelector([Fn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ge=T(t=>t.uuid),ym={instances:{}},_n=o.createSlice({name:"formSubmissionAttachments",initialState:ym,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,ym)),reducers:{initializeFormSubmissionAttachments:ge.initialize,addFormSubmissionAttachment:ge.addOne,addFormSubmissionAttachments:ge.addMany,setFormSubmissionAttachment:ge.setOne,setFormSubmissionAttachments:ge.setMany,updateFormSubmissionAttachment:ge.updateOne,updateFormSubmissionAttachments:ge.updateMany,deleteFormSubmissionAttachment:ge.deleteOne,deleteFormSubmissionAttachments:ge.deleteMany}}),{initializeFormSubmissionAttachments:Sm,addFormSubmissionAttachment:mm,addFormSubmissionAttachments:gn,setFormSubmissionAttachment:fm,setFormSubmissionAttachments:Am,updateFormSubmissionAttachment:wm,updateFormSubmissionAttachments:Pm,deleteFormSubmissionAttachment:Om,deleteFormSubmissionAttachments:Rn}=_n.actions,bn=t=>t.formSubmissionAttachmentReducer.instances,Mn=o.createSelector([bn],t=>Object.values(t)),Tm=m(o.createSelector([bn,(t,s)=>s],(t,s)=>t[s])),vn=m(o.createSelector([Mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Im=vn,Fm=m(o.createSelector([Mn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),_m=_n.reducer,Re=T(t=>t.uuid),gm={instances:{}},En=o.createSlice({name:"formSubmissions",initialState:gm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,gm)),reducers:{initializeFormSubmissions:Re.initialize,setFormSubmission:Re.setOne,setFormSubmissions:Re.setMany,addFormSubmission:Re.addOne,addFormSubmissions:Re.addMany,updateFormSubmission:Re.updateOne,updateFormSubmissions:Re.updateMany,deleteFormSubmission:Re.deleteOne,deleteFormSubmissions:Re.deleteMany}}),{initializeFormSubmissions:Rm,setFormSubmission:bm,setFormSubmissions:Mm,addFormSubmission:vm,addFormSubmissions:Vn,updateFormSubmission:Em,updateFormSubmissions:Vm,deleteFormSubmission:km,deleteFormSubmissions:kn}=En.actions,Bm=t=>t.formSubmissionReducer.instances,Bn=o.createSelector([Bm],t=>Object.values(t)),Dm=t=>s=>s.formSubmissionReducer.instances[t],Wm=m(o.createSelector([Bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zm=m(o.createSelector([Bn,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s))),qm=En.reducer,be=T(t=>t.uuid),jm={instances:{}},Dn=o.createSlice({name:"geoImages",initialState:jm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,jm)),reducers:{initializeGeoImages:be.initialize,setGeoImage:be.setOne,setGeoImages:be.setMany,addGeoImage:be.addOne,addGeoImages:be.addMany,updateGeoImage:be.updateOne,updateGeoImages:be.updateMany,deleteGeoImage:be.deleteOne,deleteGeoImages:be.deleteMany}}),{initializeGeoImages:$m,setGeoImage:Cm,setGeoImages:Um,addGeoImage:Lm,addGeoImages:Nm,updateGeoImage:Hm,updateGeoImages:Gm,deleteGeoImage:Km,deleteGeoImages:Ym}=Dn.actions,Qm=t=>t.geoImageReducer.instances,Wn=o.createSelector([Qm],t=>Object.values(t)),Jm=t=>s=>s.geoImageReducer.instances[t],Zm=m(o.createSelector([Wn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),EB=m(o.createSelector([Wn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Xm=Dn.reducer,Me=T(t=>t.uuid),xm={instances:{}},zn=o.createSlice({name:"issueAssociations",initialState:xm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,xm)),reducers:{initializeIssueAssociations:Me.initialize,addIssueAssociation:Me.addOne,addIssueAssociations:Me.addMany,setIssueAssociation:Me.setOne,setIssueAssociations:Me.setMany,updateIssueAssociation:Me.updateOne,updateIssueAssociations:Me.updateMany,deleteIssueAssociation:Me.deleteOne,deleteIssueAssociations:Me.deleteMany}}),{initializeIssueAssociations:ef,setIssueAssociations:tf,setIssueAssociation:sf,updateIssueAssociation:nf,updateIssueAssociations:af,addIssueAssociation:cf,addIssueAssociations:jt,deleteIssueAssociation:rf,deleteIssueAssociations:$t}=zn.actions,df=t=>t.issueAssociationReducer.instances,Ct=o.createSelector([df],t=>Object.values(t)),uf=t=>s=>s.issueAssociationReducer.instances[t],lf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),of=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),hf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),pf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),yf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),Sf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),mf=zn.reducer,ve=T(t=>t.uuid),ff={instances:{}},qn=o.createSlice({name:"issueAttachments",initialState:ff,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,ff)),reducers:{initializeIssueAttachments:ve.initialize,addIssueAttachment:ve.addOne,addIssueAttachments:ve.addMany,setIssueAttachment:ve.setOne,setIssueAttachments:ve.setMany,updateIssueAttachment:ve.updateOne,updateIssueAttachments:ve.updateMany,deleteIssueAttachment:ve.deleteOne,deleteIssueAttachments:ve.deleteMany}}),{initializeIssueAttachments:Af,addIssueAttachment:wf,addIssueAttachments:jn,setIssueAttachment:Pf,setIssueAttachments:Of,updateIssueAttachment:Tf,updateIssueAttachments:If,deleteIssueAttachment:Ff,deleteIssueAttachments:$n}=qn.actions,_f=t=>t.issueAttachmentReducer.instances,Cn=o.createSelector([_f],t=>Object.values(t)),gf=m(o.createSelector([Cn,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Rf=t=>s=>s.issueAttachmentReducer.instances[t],bf=m(o.createSelector([Cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mf=qn.reducer,Ee=T(t=>t.uuid),vf={instances:{}},Un=o.createSlice({name:"issueCommentAttachments",initialState:vf,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,vf)),reducers:{initializeIssueCommentAttachments:Ee.initialize,addIssueCommentAttachment:Ee.addOne,addIssueCommentAttachments:Ee.addMany,setIssueCommentAttachment:Ee.setOne,setIssueCommentAttachments:Ee.setMany,updateIssueCommentAttachment:Ee.updateOne,updateIssueCommentAttachments:Ee.updateMany,deleteIssueCommentAttachment:Ee.deleteOne,deleteIssueCommentAttachments:Ee.deleteMany}}),{initializeIssueCommentAttachments:Ef,addIssueCommentAttachment:Vf,addIssueCommentAttachments:kf,setIssueCommentAttachment:Bf,setIssueCommentAttachments:Df,updateIssueCommentAttachment:Wf,updateIssueCommentAttachments:zf,deleteIssueCommentAttachment:qf,deleteIssueCommentAttachments:jf}=Un.actions,$f=t=>t.issueCommentAttachmentReducer.instances,Ln=o.createSelector([$f],t=>Object.values(t)),Cf=t=>s=>s.issueCommentAttachmentReducer.instances[t],Uf=m(o.createSelector([Ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VB=m(o.createSelector([Ln,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),Lf=Un.reducer,Ve=T(t=>t.uuid),Nf={instances:{}},Nn=o.createSlice({name:"issueComments",initialState:Nf,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Nf)),reducers:{initializeIssueComments:Ve.initialize,addIssueComment:Ve.addOne,addIssueComments:Ve.addMany,setIssueComment:Ve.setOne,setIssueComments:Ve.setMany,updateIssueComment:Ve.updateOne,updateIssueComments:Ve.updateMany,deleteIssueComment:Ve.deleteOne,deleteIssueComments:Ve.deleteMany}}),{initializeIssueComments:Hf,addIssueComment:Gf,addIssueComments:Kf,setIssueComment:Yf,setIssueComments:Qf,updateIssueComment:Jf,updateIssueComments:Zf,deleteIssueComment:Xf,deleteIssueComments:xf}=Nn.actions,Hn=t=>t.issueCommentReducer.instances,eA=t=>s=>s.issueCommentReducer.instances[t],tA=m(o.createSelector([Hn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),kB=m(o.createSelector([Hn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),sA=Nn.reducer,ke=T(t=>t.uuid),iA={instances:{}},Gn=o.createSlice({name:"issues",initialState:iA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,iA)),reducers:{initializeIssues:ke.initialize,addIssue:ke.addOne,addIssues:ke.addMany,setIssue:ke.setOne,setIssues:ke.setMany,updateIssue:ke.updateOne,updateIssues:ke.updateMany,deleteIssue:ke.deleteOne,deleteIssues:ke.deleteMany}}),{initializeIssues:nA,addIssue:aA,addIssues:Kn,setIssue:cA,setIssues:rA,updateIssue:dA,updateIssues:uA,deleteIssue:lA,deleteIssues:Yn}=Gn.actions,oA=t=>t.issueReducer.instances,Ws=o.createSelector([oA],t=>Object.values(t)),hA=t=>s=>s.issueReducer.instances[t],pA=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BB=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),yA=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),SA=Gn.reducer,Be=T(t=>t.uuid),mA={instances:{}},Qn=o.createSlice({name:"issueTypeAttachments",initialState:mA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,mA)),reducers:{initializeIssueTypeAttachments:Be.initialize,addIssueTypeAttachment:Be.addOne,addIssueTypeAttachments:Be.addMany,setIssueTypeAttachment:Be.setOne,setIssueTypeAttachments:Be.setMany,updateIssueTypeAttachment:Be.updateOne,updateIssueTypeAttachments:Be.updateMany,deleteIssueTypeAttachment:Be.deleteOne,deleteIssueTypeAttachments:Be.deleteMany}}),{initializeIssueTypeAttachments:fA,addIssueTypeAttachment:AA,addIssueTypeAttachments:wA,setIssueTypeAttachment:PA,setIssueTypeAttachments:OA,updateIssueTypeAttachment:TA,updateIssueTypeAttachments:IA,deleteIssueTypeAttachment:FA,deleteIssueTypeAttachments:_A}=Qn.actions,gA=t=>t.issueTypeAttachmentReducer.instances,Jn=o.createSelector([gA],t=>Object.values(t)),RA=t=>s=>s.issueTypeAttachmentReducer.instances[t],bA=m(o.createSelector([Jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),DB=m(o.createSelector([Jn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),MA=Qn.reducer,De=T(t=>t.uuid),vA={instances:{}},Zn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:vA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,vA)),reducers:{initializeIssueTypeFieldsAttachments:De.initialize,addIssueTypeFieldsAttachment:De.addOne,addIssueTypeFieldsAttachments:De.addMany,setIssueTypeFieldsAttachment:De.setOne,setIssueTypeFieldsAttachments:De.setMany,updateIssueTypeFieldsAttachment:De.updateOne,updateIssueTypeFieldsAttachments:De.updateMany,deleteIssueTypeFieldsAttachment:De.deleteOne,deleteIssueTypeFieldsAttachments:De.deleteMany}}),{initializeIssueTypeFieldsAttachments:EA,addIssueTypeFieldsAttachment:VA,addIssueTypeFieldsAttachments:kA,setIssueTypeFieldsAttachment:BA,setIssueTypeFieldsAttachments:DA,updateIssueTypeFieldsAttachment:WA,updateIssueTypeFieldsAttachments:zA,deleteIssueTypeFieldsAttachment:qA,deleteIssueTypeFieldsAttachments:jA}=Zn.actions,$A=t=>t.issueTypeFieldsAttachmentReducer.instances,Xn=o.createSelector([$A],t=>Object.values(t)),WB=m(o.createSelector([Xn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),CA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],UA=m(o.createSelector([Xn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LA=Zn.reducer,We=T(t=>t.uuid),NA={instances:{}},xn=o.createSlice({name:"issueTypeFieldValues",initialState:NA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,NA)),reducers:{initializeIssueTypeFieldValues:We.initialize,addIssueTypeFieldValues:We.addOne,addIssueTypeFieldValuesMany:We.addMany,setIssueTypeFieldValues:We.setOne,setIssueTypeFieldValuesMany:We.setMany,updateIssueTypeFieldValues:We.updateOne,updateIssueTypeFieldValuesMany:We.updateMany,deleteIssueTypeFieldValues:We.deleteOne,deleteIssueTypeFieldValuesMany:We.deleteMany}}),{initializeIssueTypeFieldValues:HA,addIssueTypeFieldValues:GA,addIssueTypeFieldValuesMany:KA,setIssueTypeFieldValues:YA,setIssueTypeFieldValuesMany:QA,updateIssueTypeFieldValues:JA,updateIssueTypeFieldValuesMany:ZA,deleteIssueTypeFieldValues:XA,deleteIssueTypeFieldValuesMany:xA}=xn.actions,ew=t=>t.issueTypeFieldValuesReducer.instances,zs=o.createSelector([ew],t=>Object.values(t)),zB=m(o.createSelector([zs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),tw=t=>s=>s.issueTypeFieldValuesReducer.instances[t],sw=m(o.createSelector([zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iw=xn.reducer,ze=T(t=>t.uuid),nw={instances:{}},ea=o.createSlice({name:"issueTypeFields",initialState:nw,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,nw)),reducers:{initializeIssueTypeFields:ze.initialize,addIssueTypeFields:ze.addOne,addIssueTypeFieldsMany:ze.addMany,setIssueTypeFields:ze.setOne,setIssueTypeFieldsMany:ze.setMany,updateIssueTypeFields:ze.updateOne,updateIssueTypeFieldsMany:ze.updateMany,deleteIssueTypeFields:ze.deleteOne,deleteIssueTypeFieldsMany:ze.deleteMany}}),{initializeIssueTypeFields:aw,addIssueTypeFields:cw,addIssueTypeFieldsMany:rw,setIssueTypeFields:dw,setIssueTypeFieldsMany:uw,updateIssueTypeFields:lw,updateIssueTypeFieldsMany:ow,deleteIssueTypeFields:hw,deleteIssueTypeFieldsMany:pw}=ea.actions,yw=t=>t.issueTypeFieldsReducer.instances,cs=o.createSelector([yw],t=>Object.values(t)),qB=m(o.createSelector([cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),jB=m(o.createSelector([cs,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),$B=m(o.createSelector([cs,zs,(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)))})),Sw=t=>s=>s.issueTypeFieldsReducer.instances[t],mw=m(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fw=ea.reducer,qe=T(t=>t.uuid),Aw={instances:{}},ta=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:Aw,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Aw)),reducers:{initializeIssueTypeFieldValuesAttachments:qe.initialize,addIssueTypeFieldValuesAttachment:qe.addOne,addIssueTypeFieldValuesAttachments:qe.addMany,setIssueTypeFieldValuesAttachment:qe.setOne,setIssueTypeFieldValuesAttachments:qe.setMany,updateIssueTypeFieldValuesAttachment:qe.updateOne,updateIssueTypeFieldValuesAttachments:qe.updateMany,deleteIssueTypeFieldValuesAttachment:qe.deleteOne,deleteIssueTypeFieldValuesAttachments:qe.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:ww,addIssueTypeFieldValuesAttachment:Pw,addIssueTypeFieldValuesAttachments:sa,setIssueTypeFieldValuesAttachment:Ow,setIssueTypeFieldValuesAttachments:Tw,updateIssueTypeFieldValuesAttachment:Iw,updateIssueTypeFieldValuesAttachments:Fw,deleteIssueTypeFieldValuesAttachment:_w,deleteIssueTypeFieldValuesAttachments:ia}=ta.actions,gw=t=>t.issueTypeFieldValuesAttachmentReducer.instances,na=o.createSelector([gw],t=>Object.values(t)),Rw=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],bw=m(o.createSelector([na,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mw=m(o.createSelector([na,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),vw=ta.reducer,je=T(t=>t.uuid),Ew={instances:{}},aa=o.createSlice({name:"issueTypeIdentifiers",initialState:Ew,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Ew)),reducers:{initializeIssueTypeIdentifiers:je.initialize,addIssueTypeIdentifier:je.addOne,addIssueTypeIdentifiers:je.addMany,setIssueTypeIdentifier:je.setOne,setIssueTypeIdentifiers:je.setMany,updateIssueTypeIdentifier:je.updateOne,updateIssueTypeIdentifiers:je.updateMany,deleteIssueTypeIdentifier:je.deleteOne,deleteIssueTypeIdentifiers:je.deleteMany}}),{initializeIssueTypeIdentifiers:Vw,addIssueTypeIdentifier:kw,addIssueTypeIdentifiers:Bw,setIssueTypeIdentifier:Dw,setIssueTypeIdentifiers:Ww,updateIssueTypeIdentifier:zw,updateIssueTypeIdentifiers:qw,deleteIssueTypeIdentifier:jw,deleteIssueTypeIdentifiers:$w}=aa.actions,Cw=t=>t.issueTypeIdentifierReducer.instances,ca=o.createSelector([Cw],t=>Object.values(t)),Uw=t=>s=>s.issueTypeIdentifierReducer.instances[t],Lw=m(o.createSelector([ca,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CB=m(o.createSelector([ca,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),Nw=aa.reducer,$e=T(t=>t.uuid),Hw={instances:{}},ra=o.createSlice({name:"issueTypeIdentifierValues",initialState:Hw,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Hw)),reducers:{initializeIssueTypeIdentifierValues:$e.initialize,addIssueTypeIdentifierValue:$e.addOne,addIssueTypeIdentifierValues:$e.addMany,setIssueTypeIdentifierValue:$e.setOne,setIssueTypeIdentifierValues:$e.setMany,updateIssueTypeIdentifierValue:$e.updateOne,updateIssueTypeIdentifierValues:$e.updateMany,deleteIssueTypeIdentifierValue:$e.deleteOne,deleteIssueTypeIdentifierValues:$e.deleteMany}}),{initializeIssueTypeIdentifierValues:Gw,addIssueTypeIdentifierValue:Kw,addIssueTypeIdentifierValues:Yw,setIssueTypeIdentifierValue:Qw,setIssueTypeIdentifierValues:Jw,updateIssueTypeIdentifierValue:Zw,updateIssueTypeIdentifierValues:Xw,deleteIssueTypeIdentifierValue:xw,deleteIssueTypeIdentifierValues:eP}=ra.actions,tP=t=>t.issueTypeIdentifierValueReducer.instances,qs=o.createSelector([tP],t=>Object.values(t)),sP=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],iP=m(o.createSelector([qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UB=m(o.createSelector([qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),LB=m(o.createSelector([qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),nP=ra.reducer,Ce=T(t=>t.uuid),aP={instances:{}},da=o.createSlice({name:"issueTypes",initialState:aP,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,aP)),reducers:{initializeIssueTypes:Ce.initialize,addIssueType:Ce.addOne,addIssueTypes:Ce.addMany,setIssueType:Ce.setOne,setIssueTypes:Ce.setMany,updateIssueType:Ce.updateOne,updateIssueTypes:Ce.updateMany,deleteIssueType:Ce.deleteOne,deleteIssueTypes:Ce.deleteMany}}),{initializeIssueTypes:cP,addIssueType:rP,addIssueTypes:dP,setIssueType:uP,setIssueTypes:lP,updateIssueType:oP,updateIssueTypes:hP,deleteIssueType:pP,deleteIssueTypes:yP}=da.actions,SP=t=>t.issueTypeReducer.instances,ua=o.createSelector(SP,t=>Object.values(t)),mP=t=>s=>s.issueTypeReducer.instances[t],fP=m(o.createSelector([ua,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),NB=m(o.createSelector([ua,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),AP=da.reducer,Ue=T(t=>t.uuid),wP={instances:{}},la=o.createSlice({name:"issueTypeStatuses",initialState:wP,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,wP)),reducers:{initializeIssueTypeStatuses:Ue.initialize,addIssueTypeStatus:Ue.addOne,addIssueTypeStatuses:Ue.addMany,setIssueTypeStatus:Ue.setOne,setIssueTypeStatuses:Ue.setMany,updateIssueTypeStatus:Ue.updateOne,updateIssueTypeStatuses:Ue.updateMany,deleteIssueTypeStatus:Ue.deleteOne,deleteIssueTypeStatuses:Ue.deleteMany}}),{initializeIssueTypeStatuses:PP,addIssueTypeStatus:OP,addIssueTypeStatuses:TP,setIssueTypeStatus:IP,setIssueTypeStatuses:FP,updateIssueTypeStatus:_P,updateIssueTypeStatuses:gP,deleteIssueTypeStatus:RP,deleteIssueTypeStatuses:bP}=la.actions,MP=t=>t.issueTypeStatusReducer.instances,oa=o.createSelector([MP],t=>A(Object.values(t).toSorted(Mr))),ha=t=>s=>s.issueTypeStatusReducer.instances[t],vP=m(o.createSelector([oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HB=m(o.createSelector([oa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),EP=la.reducer,Le=T(t=>t.uuid),VP={instances:{}},pa=o.createSlice({name:"issueUpdates",initialState:VP,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,VP)),reducers:{initializeIssueUpdates:Le.initialize,addIssueUpdate:Le.addOne,addIssueUpdates:Le.addMany,setIssueUpdate:Le.setOne,setIssueUpdates:Le.setMany,updateIssueUpdate:Le.updateOne,updateIssueUpdates:Le.updateMany,deleteIssueUpdate:Le.deleteOne,deleteIssueUpdates:Le.deleteMany}}),{initializeIssueUpdates:kP,addIssueUpdate:ya,addIssueUpdates:Sa,setIssueUpdate:BP,setIssueUpdates:DP,updateIssueUpdate:WP,updateIssueUpdates:zP,deleteIssueUpdate:ma,deleteIssueUpdates:fa}=pa.actions,Aa=t=>t.issueUpdateReducer.instances,wa=o.createSelector([Aa],t=>Object.values(t)),qP=m(o.createSelector([Aa,(t,s)=>s],(t,s)=>t[s])),jP=m(o.createSelector([wa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$P=m(o.createSelector([wa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),CP=pa.reducer,Ne=T(t=>t.id),UP={instances:{},currentUser:null},Pa=o.createSlice({name:"users",initialState:UP,extraReducers:t=>t.addCase(O,s=>Object.assign(s,UP)).addCase(I,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ne.initialize,setUsers:Ne.setMany,setUser:Ne.setOne,addUsers:Ne.addMany,addUser:Ne.addOne,updateUsers:Ne.updateMany,updateUser:Ne.updateOne,deleteUser:Ne.deleteOne,deleteUsers:Ne.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:LP,setUsers:NP,setUser:HP,addUsers:GP,addUser:Oa,updateUsers:KP,updateUser:YP,deleteUser:Ta,deleteUsers:QP,setCurrentUser:GB,setCurrentUserProfile:KB}=Pa.actions,JP=Pa.reducer,ZP=t=>t.userReducer.currentUser,Ia=t=>t.userReducer.instances,js=o.createSelector([Ia],t=>Object.values(t)),$s=t=>s=>s.userReducer.instances[t],XP=m(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),He=T(t=>t.uuid),xP={instances:{}},Fa=o.createSlice({name:"organizationAccess",initialState:xP,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,xP)),reducers:{initializeOrganizationAccesses:He.initialize,addOrganizationAccess:He.addOne,addOrganizationAccesses:He.addMany,setOrganizationAccess:He.setOne,setOrganizationAccesses:He.setMany,updateOrganizationAccess:He.updateOne,updateOrganizationAccesses:He.updateMany,deleteOrganizationAccess:He.deleteOne,deleteOrganizationAccesses:He.deleteMany}}),{initializeOrganizationAccesses:eO,addOrganizationAccess:tO,addOrganizationAccesses:sO,setOrganizationAccess:iO,setOrganizationAccesses:nO,updateOrganizationAccess:aO,updateOrganizationAccesses:cO,deleteOrganizationAccess:rO,deleteOrganizationAccesses:dO}=Fa.actions,uO=Fa.reducer,Cs=t=>t.organizationAccessReducer.instances,lO=t=>s=>s.organizationAccessReducer.instances[t],oO=m(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),YB=o.createSelector([ZP,Cs],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),hO=o.createSelector([Cs],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return is(s)}),QB=m(o.createSelector([Ia,hO,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ge=T(t=>t.uuid),pO={instances:{}},_a=o.createSlice({name:"organizations",initialState:pO,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,pO)),reducers:{initializeOrganizations:Ge.initialize,setOrganizations:Ge.setMany,setOrganization:Ge.setOne,addOrganizations:Ge.addMany,addOrganization:Ge.addOne,updateOrganizations:Ge.updateMany,updateOrganization:Ge.updateOne,deleteOrganization:Ge.deleteOne,deleteOrganizations:Ge.deleteMany}}),{initializeOrganizations:yO,setOrganizations:SO,setOrganization:mO,addOrganizations:fO,addOrganization:AO,updateOrganizations:wO,updateOrganization:PO,deleteOrganization:OO,deleteOrganizations:TO}=_a.actions,IO=t=>t.organizationReducer.instances,FO=o.createSelector([IO],t=>Object.values(t)),_O=t=>s=>s.organizationReducer.instances[t],gO=m(o.createSelector([FO,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),RO=_a.reducer,bO=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:Dt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},MO={deletedRequests:[],latestRetryTime:0},ga=o.createSlice({name:"outbox",initialState:MO,extraReducers:t=>t.addCase(O,s=>Object.assign(s,MO)),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 bO(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}}}),JB=t=>t.outboxReducer.deletedRequests,ZB=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:vO,markForDeletion:XB,markAsDeleted:EO,_setLatestRetryTime:VO}=ga.actions,kO=ga.reducer,Ke=T(t=>t.uuid),BO={instances:{}},Ra=o.createSlice({name:"projectAccess",initialState:BO,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,BO)),reducers:{initializeProjectAccesses:Ke.initialize,addProjectAccess:Ke.addOne,addProjectAccesses:Ke.addMany,setProjectAccess:Ke.setOne,setProjectAccesses:Ke.setMany,updateProjectAccess:Ke.updateOne,updateProjectAccesses:Ke.updateMany,deleteProjectAccess:Ke.deleteOne,deleteProjectAccesses:Ke.deleteMany}}),{initializeProjectAccesses:DO,addProjectAccess:WO,addProjectAccesses:zO,setProjectAccess:qO,setProjectAccesses:jO,updateProjectAccess:$O,updateProjectAccesses:CO,deleteProjectAccess:UO,deleteProjectAccesses:LO}=Ra.actions,NO=Ra.reducer,ba=t=>t.projectAccessReducer.instances,rs=o.createSelector(ba,t=>Object.values(t)),HO=t=>s=>s.projectAccessReducer.instances[t],GO=m(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xB=m(o.createSelector([ba,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),eD=m(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),tD=m(o.createSelector([js,rs,(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)))})),Ye=T(t=>t.uuid),KO={instances:{}},Ma=o.createSlice({name:"projectAttachments",initialState:KO,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,KO)),reducers:{initializeProjectAttachments:Ye.initialize,addProjectAttachment:Ye.addOne,addProjectAttachments:Ye.addMany,setProjectAttachment:Ye.setOne,setProjectAttachments:Ye.setMany,updateProjectAttachment:Ye.updateOne,updateProjectAttachments:Ye.updateMany,deleteProjectAttachment:Ye.deleteOne,deleteProjectAttachments:Ye.deleteMany}}),{initializeProjectAttachments:YO,addProjectAttachment:QO,addProjectAttachments:JO,setProjectAttachment:ZO,setProjectAttachments:XO,updateProjectAttachment:xO,updateProjectAttachments:eT,deleteProjectAttachment:tT,deleteProjectAttachments:sT}=Ma.actions,iT=t=>t.projectAttachmentReducer.instances,va=o.createSelector([iT],t=>Object.values(t)),nT=t=>s=>s.projectAttachmentReducer.instances[t],aT=m(o.createSelector([va,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sD=m(o.createSelector([va,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),cT=Ma.reducer,Qe=T(t=>t.uuid),rT={instances:{}},Ea=o.createSlice({name:"projectFiles",initialState:rT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,rT)),reducers:{initializeProjectFiles:Qe.initialize,setProjectFile:Qe.setOne,setProjectFiles:Qe.setMany,addProjectFile:Qe.addOne,addProjectFiles:Qe.addMany,updateProjectFile:Qe.updateOne,updateProjectFiles:Qe.updateMany,deleteProjectFile:Qe.deleteOne,deleteProjectFiles:Qe.deleteMany}}),{initializeProjectFiles:dT,setProjectFile:uT,setProjectFiles:lT,addProjectFile:oT,addProjectFiles:hT,updateProjectFile:pT,updateProjectFiles:yT,deleteProjectFile:ST,deleteProjectFiles:mT}=Ea.actions,fT=t=>t.projectFileReducer.instances,AT=o.createSelector([fT],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),wT=t=>s=>s.projectFileReducer.instances[t],PT=m(o.createSelector([AT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OT=Ea.reducer,Je=T(t=>t.uuid),TT={instances:{}},Va=o.createSlice({name:"projects",initialState:TT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,TT)),reducers:{initializeProjects:Je.initialize,setProjects:Je.setMany,setProject:Je.setOne,addProjects:Je.addMany,addProject:Je.addOne,updateProjects:Je.updateMany,updateProject:Je.updateOne,deleteProject:Je.deleteOne,deleteProjects:Je.deleteMany}}),{initializeProjects:IT,setProjects:FT,setProject:_T,addProjects:gT,addProject:RT,updateProjects:bT,updateProject:MT,deleteProject:vT,deleteProjects:ET}=Va.actions,VT=Va.reducer,kT=t=>t.projectReducer.instances,Us=o.createSelector([kT],t=>Object.values(t)),BT=t=>s=>s.projectReducer.instances[t],DT=m(o.createSelector([Us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iD=m(o.createSelector([Us,rs,(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)))})),nD=m(o.createSelector([Us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Ze=T(({uuid:t})=>t),WT={instances:{}},ka=o.createSlice({name:"procedures",initialState:WT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,WT)),reducers:{initializeProcedures:Ze.initialize,addProcedure:Ze.addOne,addProcedures:Ze.addMany,setProcedure:Ze.setOne,setProcedures:Ze.setMany,updateProcedure:Ze.updateOne,updateProcedures:Ze.updateMany,deleteProcedure:Ze.deleteOne,deleteProcedures:Ze.deleteMany}}),{initializeProcedures:zT,addProcedure:qT,addProcedures:Ba,setProcedure:jT,setProcedures:$T,updateProcedure:CT,updateProcedures:UT,deleteProcedure:LT,deleteProcedures:Da}=ka.actions,NT=ka.reducer,HT=t=>t.procedureReducer.instances,Kt=o.createSelector([HT],t=>Object.values(t)),GT=t=>s=>s.procedureReducer.instances[t],KT=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aD=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),YT=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),cD=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),rD=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),Xe=T(t=>t.uuid),QT={instances:{}},Wa=o.createSlice({name:"procedureStepAssignees",initialState:QT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,QT)),reducers:{initializeProcedureStepAssignees:Xe.initialize,addProcedureStepAssignee:Xe.addOne,addProcedureStepAssignees:Xe.addMany,setProcedureStepAssignee:Xe.setOne,setProcedureStepAssignees:Xe.setMany,updateProcedureStepAssignee:Xe.updateOne,updateProcedureStepAssignees:Xe.updateMany,deleteProcedureStepAssignee:Xe.deleteOne,deleteProcedureStepAssignees:Xe.deleteMany}}),{initializeProcedureStepAssignees:JT,addProcedureStepAssignee:ZT,addProcedureStepAssignees:XT,setProcedureStepAssignee:xT,setProcedureStepAssignees:eI,updateProcedureStepAssignee:tI,updateProcedureStepAssignees:sI,deleteProcedureStepAssignee:iI,deleteProcedureStepAssignees:nI}=Wa.actions,aI=t=>t.procedureStepAssigneeReducer.instances,ds=o.createSelector([aI],t=>Object.values(t)),cI=t=>s=>s.procedureStepAssigneeReducer.instances[t],rI=m(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dD=m(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),uD=m(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),lD=m(o.createSelector([ds,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),dI=Wa.reducer,xe=T(t=>t.uuid),uI={instances:{}},za=o.createSlice({name:"procedureStepComments",initialState:uI,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,uI)),reducers:{initializeProcedureStepComments:xe.initialize,addProcedureStepComment:xe.addOne,addProcedureStepComments:xe.addMany,setProcedureStepComment:xe.setOne,setProcedureStepComments:xe.setMany,updateProcedureStepComment:xe.updateOne,updateProcedureStepComments:xe.updateMany,deleteProcedureStepComment:xe.deleteOne,deleteProcedureStepComments:xe.deleteMany}}),{initializeProcedureStepComments:lI,addProcedureStepComment:oI,addProcedureStepComments:hI,setProcedureStepComment:pI,setProcedureStepComments:yI,updateProcedureStepComment:SI,updateProcedureStepComments:mI,deleteProcedureStepComment:fI,deleteProcedureStepComments:AI}=za.actions,wI=t=>t.procedureStepCommentReducer.instances,us=o.createSelector([wI],t=>Object.values(t)),PI=t=>s=>s.procedureStepCommentReducer.instances[t],OI=m(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),oD=m(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),hD=m(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),pD=m(o.createSelector([us,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),TI=za.reducer,et=T(t=>t.uuid),II={instances:{}},qa=o.createSlice({name:"procedureStepDefaultAssignees",initialState:II,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,II)),reducers:{initializeProcedureStepDefaultAssignees:et.initialize,addProcedureStepDefaultAssignee:et.addOne,addProcedureStepDefaultAssignees:et.addMany,setProcedureStepDefaultAssignee:et.setOne,setProcedureStepDefaultAssignees:et.setMany,updateProcedureStepDefaultAssignee:et.updateOne,updateProcedureStepDefaultAssignees:et.updateMany,deleteProcedureStepDefaultAssignee:et.deleteOne,deleteProcedureStepDefaultAssignees:et.deleteMany}}),{initializeProcedureStepDefaultAssignees:FI,addProcedureStepDefaultAssignee:_I,addProcedureStepDefaultAssignees:gI,setProcedureStepDefaultAssignee:RI,setProcedureStepDefaultAssignees:bI,updateProcedureStepDefaultAssignee:MI,updateProcedureStepDefaultAssignees:vI,deleteProcedureStepDefaultAssignee:EI,deleteProcedureStepDefaultAssignees:VI}=qa.actions,kI=t=>t.procedureStepDefaultAssigneeReducer.instances,ja=o.createSelector([kI],t=>Object.values(t)),BI=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],DI=m(o.createSelector([ja,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yD=m(o.createSelector([ja,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),WI=qa.reducer,tt=T(t=>t.uuid),zI={instances:{}},$a=o.createSlice({name:"procedureStepDefaultReviewers",initialState:zI,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,zI)),reducers:{initializeProcedureStepDefaultReviewers:tt.initialize,addProcedureStepDefaultReviewer:tt.addOne,addProcedureStepDefaultReviewers:tt.addMany,setProcedureStepDefaultReviewer:tt.setOne,setProcedureStepDefaultReviewers:tt.setMany,updateProcedureStepDefaultReviewer:tt.updateOne,updateProcedureStepDefaultReviewers:tt.updateMany,deleteProcedureStepDefaultReviewer:tt.deleteOne,deleteProcedureStepDefaultReviewers:tt.deleteMany}}),{initializeProcedureStepDefaultReviewers:qI,addProcedureStepDefaultReviewer:jI,addProcedureStepDefaultReviewers:$I,setProcedureStepDefaultReviewer:CI,setProcedureStepDefaultReviewers:UI,updateProcedureStepDefaultReviewer:LI,updateProcedureStepDefaultReviewers:NI,deleteProcedureStepDefaultReviewer:HI,deleteProcedureStepDefaultReviewers:GI}=$a.actions,KI=t=>t.procedureStepDefaultReviewerReducer.instances,Ca=o.createSelector([KI],t=>Object.values(t)),YI=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],QI=m(o.createSelector([Ca,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),SD=m(o.createSelector([Ca,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),JI=$a.reducer,st=T(t=>t.uuid),ZI={instances:{}},Ua=o.createSlice({name:"procedureStepEvents",initialState:ZI,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,ZI)),reducers:{initializeProcedureStepEvents:st.initialize,addProcedureStepEvent:st.addOne,addProcedureStepEvents:st.addMany,setProcedureStepEvent:st.setOne,setProcedureStepEvents:st.setMany,updateProcedureStepEvent:st.updateOne,updateProcedureStepEvents:st.updateMany,deleteProcedureStepEvent:st.deleteOne,deleteProcedureStepEvents:st.deleteMany}}),{initializeProcedureStepEvents:XI,addProcedureStepEvent:xI,addProcedureStepEvents:eF,setProcedureStepEvent:tF,setProcedureStepEvents:sF,updateProcedureStepEvent:iF,updateProcedureStepEvents:nF,deleteProcedureStepEvent:aF,deleteProcedureStepEvents:cF}=Ua.actions,rF=t=>t.procedureStepEventReducer.instances,ls=o.createSelector([rF],t=>Object.values(t)),dF=t=>s=>s.procedureStepEventReducer.instances[t],uF=m(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mD=m(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),fD=m(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),AD=m(o.createSelector([ls,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),lF=Ua.reducer,it=T(t=>t.uuid),oF={instances:{}},La=o.createSlice({name:"procedureStepFieldsAttachments",initialState:oF,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,oF)),reducers:{initializeProcedureStepFieldsAttachments:it.initialize,addProcedureStepFieldsAttachment:it.addOne,addProcedureStepFieldsAttachments:it.addMany,setProcedureStepFieldsAttachment:it.setOne,setProcedureStepFieldsAttachments:it.setMany,updateProcedureStepFieldsAttachment:it.updateOne,updateProcedureStepFieldsAttachments:it.updateMany,deleteProcedureStepFieldsAttachment:it.deleteOne,deleteProcedureStepFieldsAttachments:it.deleteMany}}),{initializeProcedureStepFieldsAttachments:hF,addProcedureStepFieldsAttachment:pF,addProcedureStepFieldsAttachments:Na,setProcedureStepFieldsAttachment:yF,setProcedureStepFieldsAttachments:SF,updateProcedureStepFieldsAttachment:mF,updateProcedureStepFieldsAttachments:fF,deleteProcedureStepFieldsAttachment:AF,deleteProcedureStepFieldsAttachments:Ha}=La.actions,wF=t=>t.procedureStepFieldsAttachmentReducer.instances,Ga=o.createSelector([wF],t=>Object.values(t)),PF=m(o.createSelector([Ga,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),OF=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],TF=m(o.createSelector([Ga,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),IF=La.reducer,nt=T(t=>t.uuid),FF={instances:{}},Ka=o.createSlice({name:"procedureStepFields",initialState:FF,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,FF)),reducers:{initializeProcedureStepFields:nt.initialize,addProcedureStepFields:nt.addOne,addProcedureStepFieldsMany:nt.addMany,setProcedureStepFields:nt.setOne,setProcedureStepFieldsMany:nt.setMany,updateProcedureStepFields:nt.updateOne,updateProcedureStepFieldsMany:nt.updateMany,deleteProcedureStepFields:nt.deleteOne,deleteProcedureStepFieldsMany:nt.deleteMany}}),{initializeProcedureStepFields:_F,addProcedureStepFields:gF,addProcedureStepFieldsMany:RF,setProcedureStepFields:bF,setProcedureStepFieldsMany:MF,updateProcedureStepFields:vF,updateProcedureStepFieldsMany:EF,deleteProcedureStepFields:VF,deleteProcedureStepFieldsMany:kF}=Ka.actions,Ya=t=>t.procedureStepFieldsReducer.instances,Ls=o.createSelector([Ya],t=>Object.values(t)),wD=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),PD=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),OD=o.createSelector([Ya],t=>{const s={};for(const e of Object.values(t)){const n=s[e.procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.procedure_step]=e)}return s}),BF=t=>s=>s.procedureStepFieldsReducer.instances[t],DF=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WF=Ka.reducer,at=T(t=>t.uuid),zF={instances:{}},Qa=o.createSlice({name:"procedureStepFieldValuesAttachments",initialState:zF,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,zF)),reducers:{initializeProcedureStepFieldValuesAttachments:at.initialize,addProcedureStepFieldValuesAttachment:at.addOne,addProcedureStepFieldValuesAttachments:at.addMany,setProcedureStepFieldValuesAttachment:at.setOne,setProcedureStepFieldValuesAttachments:at.setMany,updateProcedureStepFieldValuesAttachment:at.updateOne,updateProcedureStepFieldValuesAttachments:at.updateMany,deleteProcedureStepFieldValuesAttachment:at.deleteOne,deleteProcedureStepFieldValuesAttachments:at.deleteMany}}),{initializeProcedureStepFieldValuesAttachments:qF,addProcedureStepFieldValuesAttachment:jF,addProcedureStepFieldValuesAttachments:Ja,setProcedureStepFieldValuesAttachment:$F,setProcedureStepFieldValuesAttachments:CF,updateProcedureStepFieldValuesAttachment:UF,updateProcedureStepFieldValuesAttachments:LF,deleteProcedureStepFieldValuesAttachment:NF,deleteProcedureStepFieldValuesAttachments:Za}=Qa.actions,HF=t=>t.procedureStepFieldValuesAttachmentReducer.instances,Xa=o.createSelector([HF],t=>Object.values(t)),GF=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],KF=m(o.createSelector([Xa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YF=m(o.createSelector([Xa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),QF=Qa.reducer,ct=T(t=>t.uuid),JF={instances:{}},xa=o.createSlice({name:"procedureStepFieldValues",initialState:JF,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,JF)),reducers:{initializeProcedureStepFieldValues:ct.initialize,addProcedureStepFieldValues:ct.addOne,addProcedureStepFieldValuesMany:ct.addMany,setProcedureStepFieldValues:ct.setOne,setProcedureStepFieldValuesMany:ct.setMany,updateProcedureStepFieldValues:ct.updateOne,updateProcedureStepFieldValuesMany:ct.updateMany,deleteProcedureStepFieldValues:ct.deleteOne,deleteProcedureStepFieldValuesMany:ct.deleteMany}}),{initializeProcedureStepFieldValues:ZF,addProcedureStepFieldValues:XF,addProcedureStepFieldValuesMany:xF,setProcedureStepFieldValues:e_,setProcedureStepFieldValuesMany:t_,updateProcedureStepFieldValues:s_,updateProcedureStepFieldValuesMany:i_,deleteProcedureStepFieldValues:n_,deleteProcedureStepFieldValuesMany:a_}=xa.actions,c_=t=>t.procedureStepFieldValuesReducer.instances,Wt=o.createSelector([c_],t=>Object.values(t)),TD=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),ID=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),r_=t=>s=>s.procedureStepFieldValuesReducer.instances[t],d_=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FD=m(o.createSelector([Wt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),_D=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{procedure:a,procedure_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),u_=xa.reducer,rt=T(t=>t.uuid),l_={instances:{}},ec=o.createSlice({name:"procedureStepFieldValuesReviewRequests",initialState:l_,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,l_)),reducers:{initializeProcedureStepFieldValuesReviewRequests:rt.initialize,addProcedureStepFieldValuesReviewRequest:rt.addOne,addProcedureStepFieldValuesReviewRequests:rt.addMany,setProcedureStepFieldValuesReviewRequest:rt.setOne,setProcedureStepFieldValuesReviewRequests:rt.setMany,updateProcedureStepFieldValuesReviewRequest:rt.updateOne,updateProcedureStepFieldValuesReviewRequests:rt.updateMany,deleteProcedureStepFieldValuesReviewRequest:rt.deleteOne,deleteProcedureStepFieldValuesReviewRequests:rt.deleteMany}}),{initializeProcedureStepFieldValuesReviewRequests:o_,addProcedureStepFieldValuesReviewRequest:h_,addProcedureStepFieldValuesReviewRequests:tc,setProcedureStepFieldValuesReviewRequest:p_,setProcedureStepFieldValuesReviewRequests:y_,updateProcedureStepFieldValuesReviewRequest:S_,updateProcedureStepFieldValuesReviewRequests:m_,deleteProcedureStepFieldValuesReviewRequest:f_,deleteProcedureStepFieldValuesReviewRequests:sc}=ec.actions,A_=t=>t.procedureStepFieldValuesReviewRequestReducer.instances,os=o.createSelector([A_],t=>Object.values(t)),w_=t=>s=>s.procedureStepFieldValuesReviewRequestReducer.instances[t],P_=m(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),O_=m(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),gD=m(o.createSelector([os,(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})),RD=m(o.createSelector([Wt,os,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({procedure_step:c,procedure:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),T_=ec.reducer,dt=T(t=>t.uuid),I_={instances:{}},ic=o.createSlice({name:"procedureStepFieldValuesReviews",initialState:I_,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,I_)),reducers:{initializeProcedureStepFieldValuesReviews:dt.initialize,addProcedureStepFieldValuesReview:dt.addOne,addProcedureStepFieldValuesReviews:dt.addMany,setProcedureStepFieldValuesReview:dt.setOne,setProcedureStepFieldValuesReviews:dt.setMany,updateProcedureStepFieldValuesReview:dt.updateOne,updateProcedureStepFieldValuesReviews:dt.updateMany,deleteProcedureStepFieldValuesReview:dt.deleteOne,deleteProcedureStepFieldValuesReviews:dt.deleteMany}}),{initializeProcedureStepFieldValuesReviews:F_,addProcedureStepFieldValuesReview:__,addProcedureStepFieldValuesReviews:nc,setProcedureStepFieldValuesReview:g_,setProcedureStepFieldValuesReviews:R_,updateProcedureStepFieldValuesReview:b_,updateProcedureStepFieldValuesReviews:M_,deleteProcedureStepFieldValuesReview:v_,deleteProcedureStepFieldValuesReviews:ac}=ic.actions,E_=t=>t.procedureStepFieldValuesReviewReducer.instances,Yt=o.createSelector([E_],t=>Object.values(t)),V_=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],k_=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),B_=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),bD=m(o.createSelector([Yt,(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})),MD=m(o.createSelector([Wt,Yt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({procedure_step:c,procedure:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),vD=o.createSelector([Yt],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}),D_=ic.reducer,ut=T(t=>t.uuid),W_={instances:{}},cc=o.createSlice({name:"procedureStepReviewers",initialState:W_,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,W_)),reducers:{initializeProcedureStepReviewers:ut.initialize,addProcedureStepReviewer:ut.addOne,addProcedureStepReviewers:ut.addMany,setProcedureStepReviewer:ut.setOne,setProcedureStepReviewers:ut.setMany,updateProcedureStepReviewer:ut.updateOne,updateProcedureStepReviewers:ut.updateMany,deleteProcedureStepReviewer:ut.deleteOne,deleteProcedureStepReviewers:ut.deleteMany}}),{initializeProcedureStepReviewers:z_,addProcedureStepReviewer:q_,addProcedureStepReviewers:j_,setProcedureStepReviewer:$_,setProcedureStepReviewers:C_,updateProcedureStepReviewer:U_,updateProcedureStepReviewers:L_,deleteProcedureStepReviewer:N_,deleteProcedureStepReviewers:H_}=cc.actions,G_=t=>t.procedureStepReviewerReducer.instances,hs=o.createSelector([G_],t=>Object.values(t)),K_=t=>s=>s.procedureStepReviewerReducer.instances[t],Y_=m(o.createSelector([hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ED=m(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),VD=m(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),kD=m(o.createSelector([hs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),Q_=cc.reducer,lt=T(t=>t.uuid),J_={instances:{}},rc=o.createSlice({name:"procedureSteps",initialState:J_,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,J_)),reducers:{initializeProcedureSteps:lt.initialize,setProcedureStep:lt.setOne,setProcedureSteps:lt.setMany,addProcedureStep:lt.addOne,addProcedureSteps:lt.addMany,updateProcedureStep:lt.updateOne,updateProcedureSteps:lt.updateMany,deleteProcedureStep:lt.deleteOne,deleteProcedureSteps:lt.deleteMany}}),{initializeProcedureSteps:Z_,setProcedureStep:X_,setProcedureSteps:x_,addProcedureStep:eg,addProcedureSteps:tg,updateProcedureStep:sg,updateProcedureSteps:ig,deleteProcedureStep:ng,deleteProcedureSteps:ag}=rc.actions,cg=rc.reducer,Ns=t=>t.procedureStepReducer.instances,rg=t=>s=>s.procedureStepReducer.instances[t],dc=o.createSelector([Ns],t=>Object.values(t)),BD=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.procedure_type===s&&(e[n]=a);return is(e)})),DD=m(o.createSelector([dc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),dg=m(o.createSelector([dc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ug=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=kr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ot=T(({uuid:t})=>t),lg={instances:{}},uc=o.createSlice({name:"procedureTypeAttachments",initialState:lg,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,lg)),reducers:{initializeProcedureTypeAttachments:ot.initialize,addProcedureTypeAttachment:ot.addOne,addProcedureTypeAttachments:ot.addMany,setProcedureTypeAttachment:ot.setOne,setProcedureTypeAttachments:ot.setMany,updateProcedureTypeAttachment:ot.updateOne,updateProcedureTypeAttachments:ot.updateMany,deleteProcedureTypeAttachment:ot.deleteOne,deleteProcedureTypeAttachments:ot.deleteMany}}),{initializeProcedureTypeAttachments:og,addProcedureTypeAttachment:hg,addProcedureTypeAttachments:pg,setProcedureTypeAttachment:yg,setProcedureTypeAttachments:Sg,updateProcedureTypeAttachment:mg,updateProcedureTypeAttachments:fg,deleteProcedureTypeAttachment:Ag,deleteProcedureTypeAttachments:wg}=uc.actions,Pg=uc.reducer,Og=t=>t.procedureTypeAttachmentReducer.instances,lc=o.createSelector([Og],t=>Object.values(t)),Tg=t=>s=>s.procedureTypeAttachmentReducer.instances[t],Ig=m(o.createSelector([lc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WD=m(o.createSelector([lc,(t,s)=>s],(t,s)=>A(t.filter(({procedure_type:e})=>s===e)))),ht=T(({uuid:t})=>t),Fg={instances:{}},oc=o.createSlice({name:"procedureTypeFieldsAttachments",initialState:Fg,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Fg)),reducers:{initializeProcedureTypeFieldsAttachments:ht.initialize,addProcedureTypeFieldsAttachment:ht.addOne,addProcedureTypeFieldsAttachments:ht.addMany,setProcedureTypeFieldsAttachment:ht.setOne,setProcedureTypeFieldsAttachments:ht.setMany,updateProcedureTypeFieldsAttachment:ht.updateOne,updateProcedureTypeFieldsAttachments:ht.updateMany,deleteProcedureTypeFieldsAttachment:ht.deleteOne,deleteProcedureTypeFieldsAttachments:ht.deleteMany}}),{initializeProcedureTypeFieldsAttachments:_g,addProcedureTypeFieldsAttachment:gg,addProcedureTypeFieldsAttachments:Rg,setProcedureTypeFieldsAttachment:bg,setProcedureTypeFieldsAttachments:Mg,updateProcedureTypeFieldsAttachment:vg,updateProcedureTypeFieldsAttachments:Eg,deleteProcedureTypeFieldsAttachment:Vg,deleteProcedureTypeFieldsAttachments:kg}=oc.actions,Bg=oc.reducer,Dg=t=>t.procedureTypeFieldsAttachmentReducer.instances,hc=o.createSelector([Dg],t=>Object.values(t)),zD=m(o.createSelector([hc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Wg=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],zg=m(o.createSelector([hc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pt=T(({uuid:t})=>t),qg={instances:{}},pc=o.createSlice({name:"procedureTypeFields",initialState:qg,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,qg)),reducers:{initializeProcedureTypeFields:pt.initialize,addProcedureTypeFields:pt.addOne,addProcedureTypeFieldsMany:pt.addMany,setProcedureTypeFields:pt.setOne,setProcedureTypeFieldsMany:pt.setMany,updateProcedureTypeFields:pt.updateOne,updateProcedureTypeFieldsMany:pt.updateMany,deleteProcedureTypeFields:pt.deleteOne,deleteProcedureTypeFieldsMany:pt.deleteMany}}),{initializeProcedureTypeFields:jg,addProcedureTypeFields:$g,addProcedureTypeFieldsMany:Cg,setProcedureTypeFields:Ug,setProcedureTypeFieldsMany:Lg,updateProcedureTypeFields:Ng,updateProcedureTypeFieldsMany:Hg,deleteProcedureTypeFields:Gg,deleteProcedureTypeFieldsMany:Kg}=pc.actions,Yg=pc.reducer,Qg=t=>t.procedureTypeFieldsReducer.instances,Hs=o.createSelector([Qg],t=>Object.values(t)),qD=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),jD=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Jg=t=>s=>s.procedureTypeFieldsReducer.instances[t],Zg=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yt=T(({uuid:t})=>t),Xg={instances:{}},yc=o.createSlice({name:"procedureFieldValuesAttachments",initialState:Xg,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Xg)),reducers:{initializeProcedureFieldValuesAttachments:yt.initialize,addProcedureFieldValuesAttachment:yt.addOne,addProcedureFieldValuesAttachments:yt.addMany,setProcedureFieldValuesAttachment:yt.setOne,setProcedureFieldValuesAttachments:yt.setMany,updateProcedureFieldValuesAttachment:yt.updateOne,updateProcedureFieldValuesAttachments:yt.updateMany,deleteProcedureFieldValuesAttachment:yt.deleteOne,deleteProcedureFieldValuesAttachments:yt.deleteMany}}),{initializeProcedureFieldValuesAttachments:xg,addProcedureFieldValuesAttachment:eR,addProcedureFieldValuesAttachments:Sc,setProcedureFieldValuesAttachment:tR,setProcedureFieldValuesAttachments:sR,updateProcedureFieldValuesAttachment:iR,updateProcedureFieldValuesAttachments:nR,deleteProcedureFieldValuesAttachment:aR,deleteProcedureFieldValuesAttachments:mc}=yc.actions,cR=yc.reducer,rR=t=>t.procedureFieldValuesAttachmentReducer.instances,fc=o.createSelector([rR],t=>Object.values(t)),dR=t=>s=>s.procedureFieldValuesAttachmentReducer.instances[t],uR=m(o.createSelector([fc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lR=m(o.createSelector([fc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),St=T(({uuid:t})=>t),oR={instances:{}},Ac=o.createSlice({name:"procedureFieldValues",initialState:oR,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,oR)),reducers:{initializeProcedureFieldValues:St.initialize,addProcedureFieldValues:St.addOne,addProcedureFieldValuesMany:St.addMany,setProcedureFieldValues:St.setOne,setProcedureFieldValuesMany:St.setMany,updateProcedureFieldValues:St.updateOne,updateProcedureFieldValuesMany:St.updateMany,deleteProcedureFieldValues:St.deleteOne,deleteProcedureFieldValuesMany:St.deleteMany}}),{initializeProcedureFieldValues:hR,addProcedureFieldValues:pR,addProcedureFieldValuesMany:yR,setProcedureFieldValues:SR,setProcedureFieldValuesMany:mR,updateProcedureFieldValues:fR,updateProcedureFieldValuesMany:AR,deleteProcedureFieldValues:wR,deleteProcedureFieldValuesMany:PR}=Ac.actions,OR=Ac.reducer,TR=t=>t.procedureFieldValuesReducer.instances,wc=o.createSelector([TR],t=>Object.values(t)),$D=m(o.createSelector([wc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),IR=t=>s=>s.procedureFieldValuesReducer.instances[t],FR=m(o.createSelector([wc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mt=T(t=>t.uuid),_R={instances:{}},Pc=o.createSlice({name:"procedureTypes",initialState:_R,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,_R)),reducers:{initializeProcedureTypes:mt.initialize,addProcedureType:mt.addOne,addProcedureTypes:mt.addMany,setProcedureType:mt.setOne,setProcedureTypes:mt.setMany,updateProcedureType:mt.updateOne,updateProcedureTypes:mt.updateMany,deleteProcedureType:mt.deleteOne,deleteProcedureTypes:mt.deleteMany}}),{initializeProcedureTypes:gR,addProcedureType:RR,addProcedureTypes:bR,setProcedureType:MR,setProcedureTypes:vR,updateProcedureType:ER,updateProcedureTypes:VR,deleteProcedureType:kR,deleteProcedureTypes:BR}=Pc.actions,DR=Pc.reducer,WR=t=>t.procedureTypeReducer.instances,Gs=o.createSelector([WR],t=>Object.values(t)),zR=t=>s=>s.procedureTypeReducer.instances[t],qR=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CD=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),UD=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),LD={isRehydrated:!1},Oc=o.createSlice({name:"rehydrated",initialState:LD,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:ND}=Oc.actions,HD=t=>t.rehydratedReducer.isRehydrated,jR=Oc.reducer,ft=T(t=>t.uuid),$R={instances:{}},Tc=o.createSlice({name:"teamMemberships",initialState:$R,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,$R)),reducers:{initializeTeamMemberships:ft.initialize,addTeamMembership:ft.addOne,addTeamMemberships:ft.addMany,setTeamMembership:ft.setOne,setTeamMemberships:ft.setMany,updateTeamMembership:ft.updateOne,updateTeamMemberships:ft.updateMany,deleteTeamMembership:ft.deleteOne,deleteTeamMemberships:ft.deleteMany}}),{initializeTeamMemberships:CR,addTeamMembership:UR,addTeamMemberships:LR,setTeamMembership:NR,setTeamMemberships:HR,updateTeamMembership:GR,updateTeamMemberships:KR,deleteTeamMembership:YR,deleteTeamMemberships:QR}=Tc.actions,JR=Tc.reducer,ZR=t=>t.teamMembershipReducer.instances,Ks=o.createSelector([ZR],t=>Object.values(t)),XR=t=>s=>s.teamMembershipReducer.instances[t],xR=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GD=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),KD=m(o.createSelector([js,Ks,(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)))})),At=T(t=>t.uuid),eb={instances:{}},Ic=o.createSlice({name:"teams",initialState:eb,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,eb)),reducers:{initializeTeams:At.initialize,addTeam:At.addOne,addTeams:At.addMany,setTeam:At.setOne,setTeams:At.setMany,updateTeam:At.updateOne,updateTeams:At.updateMany,deleteTeam:At.deleteOne,deleteTeams:At.deleteMany}}),{initializeTeams:tb,addTeam:sb,addTeams:ib,setTeam:nb,setTeams:ab,updateTeam:cb,updateTeams:rb,deleteTeam:db,deleteTeams:ub}=Ic.actions,lb=t=>t.teamReducer.instances,Fc=o.createSelector([lb],t=>Object.values(t)),ob=t=>s=>s.teamReducer.instances[t],hb=m(o.createSelector([Fc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YD=m(o.createSelector([Fc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),pb=Ic.reducer,QD={version:0},yb=o.createSlice({name:"versioning",initialState:QD,reducers:{}}),Sb=yb.reducer,wt=T(t=>t.uuid),mb={instances:{}},_c=o.createSlice({name:"workflows",initialState:mb,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,mb)),reducers:{initializeWorkflows:wt.initialize,addWorkflow:wt.addOne,addWorkflows:wt.addMany,setWorkflow:wt.setOne,setWorkflows:wt.setMany,updateWorkflow:wt.updateOne,updateWorkflows:wt.updateMany,deleteWorkflow:wt.deleteOne,deleteWorkflows:wt.deleteMany}}),{initializeWorkflows:fb,addWorkflow:Ab,addWorkflows:wb,setWorkflow:Pb,setWorkflows:Ob,updateWorkflow:Tb,updateWorkflows:Ib,deleteWorkflow:Fb,deleteWorkflows:_b}=_c.actions,gb=t=>t.workflowReducer.instances,Ys=o.createSelector([gb],t=>Object.values(t)),Rb=t=>s=>s.workflowReducer.instances[t],bb=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),JD=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),ZD=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),Mb=_c.reducer,Pt=T(t=>t.uuid),vb={instances:{}},gc=o.createSlice({name:"workflowIssueLinks",initialState:vb,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,vb)),reducers:{initializeWorkflowIssueLinks:Pt.initialize,addWorkflowIssueLink:Pt.addOne,addWorkflowIssueLinks:Pt.addMany,setWorkflowIssueLink:Pt.setOne,setWorkflowIssueLinks:Pt.setMany,updateWorkflowIssueLink:Pt.updateOne,updateWorkflowIssueLinks:Pt.updateMany,deleteWorkflowIssueLink:Pt.deleteOne,deleteWorkflowIssueLinks:Pt.deleteMany}}),{initializeWorkflowIssueLinks:Eb,addWorkflowIssueLink:Vb,addWorkflowIssueLinks:ps,setWorkflowIssueLink:kb,setWorkflowIssueLinks:Bb,updateWorkflowIssueLink:Db,updateWorkflowIssueLinks:Wb,deleteWorkflowIssueLink:zb,deleteWorkflowIssueLinks:ys}=gc.actions,qb=t=>t.workflowIssueLinkReducer.instances,Qt=o.createSelector([qb],t=>Object.values(t)),jb=t=>s=>s.workflowIssueLinkReducer.instances[t],$b=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Cb=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Ub=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),Lb=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),XD=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),Nb=gc.reducer,Ot=T(t=>t.uuid),Hb={instances:{}},Rc=o.createSlice({name:"workflowStepAssignees",initialState:Hb,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Hb)),reducers:{initializeWorkflowStepAssignees:Ot.initialize,addWorkflowStepAssignee:Ot.addOne,addWorkflowStepAssignees:Ot.addMany,setWorkflowStepAssignee:Ot.setOne,setWorkflowStepAssignees:Ot.setMany,updateWorkflowStepAssignee:Ot.updateOne,updateWorkflowStepAssignees:Ot.updateMany,deleteWorkflowStepAssignee:Ot.deleteOne,deleteWorkflowStepAssignees:Ot.deleteMany}}),{initializeWorkflowStepAssignees:Gb,addWorkflowStepAssignee:Kb,addWorkflowStepAssignees:Yb,setWorkflowStepAssignee:Qb,setWorkflowStepAssignees:Jb,updateWorkflowStepAssignee:Zb,updateWorkflowStepAssignees:Xb,deleteWorkflowStepAssignee:xb,deleteWorkflowStepAssignees:eM}=Rc.actions,tM=t=>t.workflowStepAssigneeReducer.instances,Ss=o.createSelector([tM],t=>Object.values(t)),sM=t=>s=>s.workflowStepAssigneeReducer.instances[t],iM=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xD=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),eW=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),tW=m(o.createSelector([Ss,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),nM=Rc.reducer,Tt=T(t=>t.uuid),aM={instances:{}},bc=o.createSlice({name:"workflowStepComments",initialState:aM,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,aM)),reducers:{initializeWorkflowStepComments:Tt.initialize,addWorkflowStepComment:Tt.addOne,addWorkflowStepComments:Tt.addMany,setWorkflowStepComment:Tt.setOne,setWorkflowStepComments:Tt.setMany,updateWorkflowStepComment:Tt.updateOne,updateWorkflowStepComments:Tt.updateMany,deleteWorkflowStepComment:Tt.deleteOne,deleteWorkflowStepComments:Tt.deleteMany}}),{initializeWorkflowStepComments:cM,addWorkflowStepComment:rM,addWorkflowStepComments:dM,setWorkflowStepComment:uM,setWorkflowStepComments:lM,updateWorkflowStepComment:oM,updateWorkflowStepComments:hM,deleteWorkflowStepComment:pM,deleteWorkflowStepComments:yM}=bc.actions,SM=t=>t.workflowStepCommentReducer.instances,ms=o.createSelector([SM],t=>Object.values(t)),mM=t=>s=>s.workflowStepCommentReducer.instances[t],fM=m(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sW=m(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),iW=m(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),nW=m(o.createSelector([ms,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),AM=bc.reducer,It=T(t=>t.uuid),wM={instances:{}},Mc=o.createSlice({name:"workflowStepDefaultAssignees",initialState:wM,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,wM)),reducers:{initializeWorkflowStepDefaultAssignees:It.initialize,addWorkflowStepDefaultAssignee:It.addOne,addWorkflowStepDefaultAssignees:It.addMany,setWorkflowStepDefaultAssignee:It.setOne,setWorkflowStepDefaultAssignees:It.setMany,updateWorkflowStepDefaultAssignee:It.updateOne,updateWorkflowStepDefaultAssignees:It.updateMany,deleteWorkflowStepDefaultAssignee:It.deleteOne,deleteWorkflowStepDefaultAssignees:It.deleteMany}}),{initializeWorkflowStepDefaultAssignees:PM,addWorkflowStepDefaultAssignee:OM,addWorkflowStepDefaultAssignees:TM,setWorkflowStepDefaultAssignee:IM,setWorkflowStepDefaultAssignees:FM,updateWorkflowStepDefaultAssignee:_M,updateWorkflowStepDefaultAssignees:gM,deleteWorkflowStepDefaultAssignee:RM,deleteWorkflowStepDefaultAssignees:bM}=Mc.actions,MM=t=>t.workflowStepDefaultAssigneeReducer.instances,vc=o.createSelector([MM],t=>Object.values(t)),vM=t=>s=>s.workflowStepDefaultAssigneeReducer.instances[t],EM=m(o.createSelector([vc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aW=m(o.createSelector([vc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),VM=Mc.reducer,Ft=T(t=>t.uuid),kM={instances:{}},Ec=o.createSlice({name:"workflowStepDefaultReviewers",initialState:kM,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,kM)),reducers:{initializeWorkflowStepDefaultReviewers:Ft.initialize,addWorkflowStepDefaultReviewer:Ft.addOne,addWorkflowStepDefaultReviewers:Ft.addMany,setWorkflowStepDefaultReviewer:Ft.setOne,setWorkflowStepDefaultReviewers:Ft.setMany,updateWorkflowStepDefaultReviewer:Ft.updateOne,updateWorkflowStepDefaultReviewers:Ft.updateMany,deleteWorkflowStepDefaultReviewer:Ft.deleteOne,deleteWorkflowStepDefaultReviewers:Ft.deleteMany}}),{initializeWorkflowStepDefaultReviewers:BM,addWorkflowStepDefaultReviewer:DM,addWorkflowStepDefaultReviewers:WM,setWorkflowStepDefaultReviewer:zM,setWorkflowStepDefaultReviewers:qM,updateWorkflowStepDefaultReviewer:jM,updateWorkflowStepDefaultReviewers:$M,deleteWorkflowStepDefaultReviewer:CM,deleteWorkflowStepDefaultReviewers:UM}=Ec.actions,LM=t=>t.workflowStepDefaultReviewerReducer.instances,Vc=o.createSelector([LM],t=>Object.values(t)),NM=t=>s=>s.workflowStepDefaultReviewerReducer.instances[t],HM=m(o.createSelector([Vc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cW=m(o.createSelector([Vc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),GM=Ec.reducer,_t=T(t=>t.uuid),KM={instances:{}},kc=o.createSlice({name:"workflowStepEvents",initialState:KM,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,KM)),reducers:{initializeWorkflowStepEvents:_t.initialize,addWorkflowStepEvent:_t.addOne,addWorkflowStepEvents:_t.addMany,setWorkflowStepEvent:_t.setOne,setWorkflowStepEvents:_t.setMany,updateWorkflowStepEvent:_t.updateOne,updateWorkflowStepEvents:_t.updateMany,deleteWorkflowStepEvent:_t.deleteOne,deleteWorkflowStepEvents:_t.deleteMany}}),{initializeWorkflowStepEvents:YM,addWorkflowStepEvent:QM,addWorkflowStepEvents:JM,setWorkflowStepEvent:ZM,setWorkflowStepEvents:XM,updateWorkflowStepEvent:xM,updateWorkflowStepEvents:ev,deleteWorkflowStepEvent:tv,deleteWorkflowStepEvents:sv}=kc.actions,iv=t=>t.workflowStepEventReducer.instances,fs=o.createSelector([iv],t=>Object.values(t)),nv=t=>s=>s.workflowStepEventReducer.instances[t],av=m(o.createSelector([fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rW=m(o.createSelector([fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),dW=m(o.createSelector([fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),uW=m(o.createSelector([fs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),cv=kc.reducer,gt=T(t=>t.uuid),rv={instances:{}},Bc=o.createSlice({name:"workflowStepFieldsAttachments",initialState:rv,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,rv)),reducers:{initializeWorkflowStepFieldsAttachments:gt.initialize,addWorkflowStepFieldsAttachment:gt.addOne,addWorkflowStepFieldsAttachments:gt.addMany,setWorkflowStepFieldsAttachment:gt.setOne,setWorkflowStepFieldsAttachments:gt.setMany,updateWorkflowStepFieldsAttachment:gt.updateOne,updateWorkflowStepFieldsAttachments:gt.updateMany,deleteWorkflowStepFieldsAttachment:gt.deleteOne,deleteWorkflowStepFieldsAttachments:gt.deleteMany}}),{initializeWorkflowStepFieldsAttachments:dv,addWorkflowStepFieldsAttachment:uv,addWorkflowStepFieldsAttachments:Dc,setWorkflowStepFieldsAttachment:lv,setWorkflowStepFieldsAttachments:ov,updateWorkflowStepFieldsAttachment:hv,updateWorkflowStepFieldsAttachments:pv,deleteWorkflowStepFieldsAttachment:yv,deleteWorkflowStepFieldsAttachments:Wc}=Bc.actions,Sv=t=>t.workflowStepFieldsAttachmentReducer.instances,zc=o.createSelector([Sv],t=>Object.values(t)),mv=m(o.createSelector([zc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),fv=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],Av=m(o.createSelector([zc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wv=Bc.reducer,Rt=T(t=>t.uuid),Pv={instances:{}},qc=o.createSlice({name:"workflowStepFields",initialState:Pv,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Pv)),reducers:{initializeWorkflowStepFields:Rt.initialize,addWorkflowStepFields:Rt.addOne,addWorkflowStepFieldsMany:Rt.addMany,setWorkflowStepFields:Rt.setOne,setWorkflowStepFieldsMany:Rt.setMany,updateWorkflowStepFields:Rt.updateOne,updateWorkflowStepFieldsMany:Rt.updateMany,deleteWorkflowStepFields:Rt.deleteOne,deleteWorkflowStepFieldsMany:Rt.deleteMany}}),{initializeWorkflowStepFields:Ov,addWorkflowStepFields:Tv,addWorkflowStepFieldsMany:Iv,setWorkflowStepFields:Fv,setWorkflowStepFieldsMany:_v,updateWorkflowStepFields:gv,updateWorkflowStepFieldsMany:Rv,deleteWorkflowStepFields:bv,deleteWorkflowStepFieldsMany:Mv}=qc.actions,vv=t=>t.workflowStepFieldsReducer.instances,Qs=o.createSelector([vv],t=>Object.values(t)),lW=m(o.createSelector([Qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),oW=m(o.createSelector([Qs,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Ev=t=>s=>s.workflowStepFieldsReducer.instances[t],Vv=m(o.createSelector([Qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kv=qc.reducer,bt=T(t=>t.uuid),Bv={instances:{}},jc=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:Bv,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Bv)),reducers:{initializeWorkflowStepFieldValuesAttachments:bt.initialize,addWorkflowStepFieldValuesAttachment:bt.addOne,addWorkflowStepFieldValuesAttachments:bt.addMany,setWorkflowStepFieldValuesAttachment:bt.setOne,setWorkflowStepFieldValuesAttachments:bt.setMany,updateWorkflowStepFieldValuesAttachment:bt.updateOne,updateWorkflowStepFieldValuesAttachments:bt.updateMany,deleteWorkflowStepFieldValuesAttachment:bt.deleteOne,deleteWorkflowStepFieldValuesAttachments:bt.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:Dv,addWorkflowStepFieldValuesAttachment:Wv,addWorkflowStepFieldValuesAttachments:$c,setWorkflowStepFieldValuesAttachment:zv,setWorkflowStepFieldValuesAttachments:qv,updateWorkflowStepFieldValuesAttachment:jv,updateWorkflowStepFieldValuesAttachments:$v,deleteWorkflowStepFieldValuesAttachment:Cv,deleteWorkflowStepFieldValuesAttachments:Cc}=jc.actions,Uv=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Uc=o.createSelector([Uv],t=>Object.values(t)),Lv=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],Nv=m(o.createSelector([Uc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hv=m(o.createSelector([Uc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Gv=jc.reducer,Mt=T(t=>t.uuid),Kv={instances:{}},Lc=o.createSlice({name:"workflowStepFieldValues",initialState:Kv,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Kv)),reducers:{initializeWorkflowStepFieldValues:Mt.initialize,addWorkflowStepFieldValues:Mt.addOne,addWorkflowStepFieldValuesMany:Mt.addMany,setWorkflowStepFieldValues:Mt.setOne,setWorkflowStepFieldValuesMany:Mt.setMany,updateWorkflowStepFieldValues:Mt.updateOne,updateWorkflowStepFieldValuesMany:Mt.updateMany,deleteWorkflowStepFieldValues:Mt.deleteOne,deleteWorkflowStepFieldValuesMany:Mt.deleteMany}}),{initializeWorkflowStepFieldValues:Yv,addWorkflowStepFieldValues:Qv,addWorkflowStepFieldValuesMany:Jv,setWorkflowStepFieldValues:Zv,setWorkflowStepFieldValuesMany:Xv,updateWorkflowStepFieldValues:xv,updateWorkflowStepFieldValuesMany:eE,deleteWorkflowStepFieldValues:tE,deleteWorkflowStepFieldValuesMany:sE}=Lc.actions,iE=t=>t.workflowStepFieldValuesReducer.instances,zt=o.createSelector([iE],t=>Object.values(t)),hW=m(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),pW=m(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),nE=t=>s=>s.workflowStepFieldValuesReducer.instances[t],aE=m(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yW=m(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)))),SW=m(o.createSelector([zt,(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})),cE=Lc.reducer,vt=T(t=>t.uuid),rE={instances:{}},Nc=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:rE,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,rE)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:vt.initialize,addWorkflowStepFieldValuesReviewRequest:vt.addOne,addWorkflowStepFieldValuesReviewRequests:vt.addMany,setWorkflowStepFieldValuesReviewRequest:vt.setOne,setWorkflowStepFieldValuesReviewRequests:vt.setMany,updateWorkflowStepFieldValuesReviewRequest:vt.updateOne,updateWorkflowStepFieldValuesReviewRequests:vt.updateMany,deleteWorkflowStepFieldValuesReviewRequest:vt.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:vt.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:dE,addWorkflowStepFieldValuesReviewRequest:uE,addWorkflowStepFieldValuesReviewRequests:Hc,setWorkflowStepFieldValuesReviewRequest:lE,setWorkflowStepFieldValuesReviewRequests:oE,updateWorkflowStepFieldValuesReviewRequest:hE,updateWorkflowStepFieldValuesReviewRequests:pE,deleteWorkflowStepFieldValuesReviewRequest:yE,deleteWorkflowStepFieldValuesReviewRequests:Gc}=Nc.actions,SE=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,As=o.createSelector([SE],t=>Object.values(t)),mE=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],fE=m(o.createSelector([As,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AE=m(o.createSelector([As,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),mW=m(o.createSelector([As,(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})),fW=m(o.createSelector([zt,As,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),wE=Nc.reducer,Et=T(t=>t.uuid),PE={instances:{}},Kc=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:PE,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,PE)),reducers:{initializeWorkflowStepFieldValuesReviews:Et.initialize,addWorkflowStepFieldValuesReview:Et.addOne,addWorkflowStepFieldValuesReviews:Et.addMany,setWorkflowStepFieldValuesReview:Et.setOne,setWorkflowStepFieldValuesReviews:Et.setMany,updateWorkflowStepFieldValuesReview:Et.updateOne,updateWorkflowStepFieldValuesReviews:Et.updateMany,deleteWorkflowStepFieldValuesReview:Et.deleteOne,deleteWorkflowStepFieldValuesReviews:Et.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:OE,addWorkflowStepFieldValuesReview:TE,addWorkflowStepFieldValuesReviews:Yc,setWorkflowStepFieldValuesReview:IE,setWorkflowStepFieldValuesReviews:FE,updateWorkflowStepFieldValuesReview:_E,updateWorkflowStepFieldValuesReviews:gE,deleteWorkflowStepFieldValuesReview:RE,deleteWorkflowStepFieldValuesReviews:Qc}=Kc.actions,bE=t=>t.workflowStepFieldValuesReviewReducer.instances,Jt=o.createSelector([bE],t=>Object.values(t)),ME=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],vE=m(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),EE=m(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),AW=m(o.createSelector([Jt,(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})),wW=m(o.createSelector([zt,Jt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),PW=o.createSelector([Jt],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}),VE=Kc.reducer,Vt=T(t=>t.uuid),kE={instances:{}},Jc=o.createSlice({name:"workflowStepReviewers",initialState:kE,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,kE)),reducers:{initializeWorkflowStepReviewers:Vt.initialize,addWorkflowStepReviewer:Vt.addOne,addWorkflowStepReviewers:Vt.addMany,setWorkflowStepReviewer:Vt.setOne,setWorkflowStepReviewers:Vt.setMany,updateWorkflowStepReviewer:Vt.updateOne,updateWorkflowStepReviewers:Vt.updateMany,deleteWorkflowStepReviewer:Vt.deleteOne,deleteWorkflowStepReviewers:Vt.deleteMany}}),{initializeWorkflowStepReviewers:BE,addWorkflowStepReviewer:DE,addWorkflowStepReviewers:WE,setWorkflowStepReviewer:zE,setWorkflowStepReviewers:qE,updateWorkflowStepReviewer:jE,updateWorkflowStepReviewers:$E,deleteWorkflowStepReviewer:CE,deleteWorkflowStepReviewers:UE}=Jc.actions,LE=t=>t.workflowStepReviewerReducer.instances,ws=o.createSelector([LE],t=>Object.values(t)),NE=t=>s=>s.workflowStepReviewerReducer.instances[t],HE=m(o.createSelector([ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OW=m(o.createSelector([ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),TW=m(o.createSelector([ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),IW=m(o.createSelector([ws,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),GE=Jc.reducer,kt=T(t=>t.uuid),KE={instances:{}},Zc=o.createSlice({name:"workflowSteps",initialState:KE,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,KE)),reducers:{initializeWorkflowSteps:kt.initialize,addWorkflowStep:kt.addOne,addWorkflowSteps:kt.addMany,setWorkflowStep:kt.setOne,setWorkflowSteps:kt.setMany,updateWorkflowStep:kt.updateOne,updateWorkflowSteps:kt.updateMany,deleteWorkflowStep:kt.deleteOne,deleteWorkflowSteps:kt.deleteMany}}),{initializeWorkflowSteps:YE,addWorkflowStep:QE,addWorkflowSteps:JE,setWorkflowStep:ZE,setWorkflowSteps:XE,updateWorkflowStep:xE,updateWorkflowSteps:eV,deleteWorkflowStep:tV,deleteWorkflowSteps:sV}=Zc.actions,iV=t=>t.workflowStepReducer.instances,Xc=o.createSelector([iV],t=>Object.values(t)),nV=t=>s=>s.workflowStepReducer.instances[t],aV=m(o.createSelector([Xc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FW=m(o.createSelector([Xc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),cV=Zc.reducer,Bt=T(t=>t.uuid),rV={instances:{}},xc=o.createSlice({name:"workflowTypes",initialState:rV,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,rV)),reducers:{initializeWorkflowTypes:Bt.initialize,addWorkflowType:Bt.addOne,addWorkflowTypes:Bt.addMany,setWorkflowType:Bt.setOne,setWorkflowTypes:Bt.setMany,updateWorkflowType:Bt.updateOne,updateWorkflowTypes:Bt.updateMany,deleteWorkflowType:Bt.deleteOne,deleteWorkflowTypes:Bt.deleteMany}}),{initializeWorkflowTypes:dV,addWorkflowType:uV,addWorkflowTypes:lV,setWorkflowType:oV,setWorkflowTypes:hV,updateWorkflowType:pV,updateWorkflowTypes:yV,deleteWorkflowType:SV,deleteWorkflowTypes:mV}=xc.actions,fV=t=>t.workflowTypeReducer.instances,er=o.createSelector([fV],t=>Object.values(t)),AV=t=>s=>s.workflowTypeReducer.instances[t],wV=m(o.createSelector([er,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_W=m(o.createSelector([er,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),PV=xc.reducer,tr={outboxReducer:kO,fileReducer:Xy,authReducer:ry},gW=o.combineReducers(tr),OV={...tr,[ss]:Sb,assetReducer:yo,assetAttachmentReducer:Xr,assetStageCompletionReducer:_o,assetStageReducer:$o,assetTypeReducer:Np,assetTypeAttachmentReducer:th,issueReducer:SA,issueAttachmentReducer:Mf,issueTypeReducer:AP,issueTypeAttachmentReducer:MA,organizationReducer:RO,projectReducer:VT,projectAttachmentReducer:cT,projectAccessReducer:NO,organizationAccessReducer:uO,projectFileReducer:OT,procedureTypeReducer:DR,procedureReducer:NT,procedureTypeFieldsReducer:Yg,procedureFieldValuesReducer:OR,procedureTypeAttachmentReducer:Pg,procedureTypeFieldsAttachmentReducer:Bg,procedureFieldValuesAttachmentReducer:cR,procedureStepFieldsAttachmentReducer:IF,procedureStepFieldsReducer:WF,procedureStepFieldValuesAttachmentReducer:QF,procedureStepFieldValuesReducer:u_,procedureStepFieldValuesReviewReducer:D_,procedureStepFieldValuesReviewRequestReducer:T_,procedureStepAssigneeReducer:dI,procedureStepCommentReducer:TI,procedureStepDefaultAssigneeReducer:WI,procedureStepDefaultReviewerReducer:JI,procedureStepEventReducer:lF,procedureStepReviewerReducer:Q_,procedureStepReducer:cg,rehydratedReducer:jR,formReducer:lm,formRevisionReducer:xS,formRevisionAttachmentReducer:$S,formSubmissionAttachmentReducer:_m,formSubmissionReducer:qm,formIdentifierReducer:hS,formIdentifierValueReducer:gS,userReducer:JP,emailDomainsReducer:Qy,documentsReducer:Vy,documentAttachmentReducer:Oy,teamReducer:pb,agentsReducer:jr,issueCommentReducer:sA,issueCommentAttachmentReducer:Lf,issueUpdateReducer:CP,geoImageReducer:Xm,issueAssociationReducer:mf,issueTypeFieldsReducer:fw,issueTypeFieldValuesReducer:iw,issueTypeFieldsAttachmentReducer:LA,issueTypeFieldValuesAttachmentReducer:vw,issueTypeIdentifierReducer:Nw,issueTypeIdentifierValueReducer:nP,issueTypeStatusReducer:EP,assetTypeFieldsReducer:Mh,assetTypeFieldValuesReducer:sp,assetTypeFieldsAttachmentReducer:Sh,assetTypeFieldValuesAttachmentReducer:Uh,assetTypeIdentifierReducer:mp,assetTypeIdentifierValueReducer:vp,assetTypeStatusReducer:ny,assetProcedureTypeReducer:zu,assetProcedureReducer:Tu,assetProcedureTypeFieldsReducer:zd,assetProcedureTypeFieldValuesReducer:lu,assetProcedureTypeFieldsAttachmentReducer:Id,assetProcedureTypeFieldValuesAttachmentReducer:Qd,assetProcedureTypeAttachmentReducer:ud,assetProcedureStepFieldsAttachmentReducer:el,assetProcedureStepFieldsReducer:pl,assetProcedureStepFieldValuesAttachmentReducer:gl,assetProcedureStepFieldValuesReducer:$l,assetProcedureStepReducer:Zl,teamMembershipReducer:JR,workflowTypeReducer:PV,workflowStepReducer:cV,workflowStepFieldsReducer:kv,workflowStepFieldsAttachmentReducer:wv,workflowReducer:Mb,workflowIssueLinkReducer:Nb,workflowStepAssigneeReducer:nM,workflowStepCommentReducer:AM,workflowStepDefaultAssigneeReducer:VM,workflowStepDefaultReviewerReducer:GM,workflowStepEventReducer:cv,workflowStepFieldValuesReducer:cE,workflowStepFieldValuesAttachmentReducer:Gv,workflowStepFieldValuesReviewReducer:VE,workflowStepFieldValuesReviewRequestReducer:wE,workflowStepReviewerReducer:GE},RW=o.combineReducers(OV),TV=1e4,IV=200,sr=[400,409,403,404,405,500],L=1e4,FV={};class _V{constructor(s){p(this,"client");p(this,"pageSize",TV);FV[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 gV=()=>MV.length-1,RV=t=>(t[ss]={version:gV()},t),bV=()=>RV({}),bW=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),MW=t=>s=>{var e;return s===void 0&&(s={}),((e=s[ss])==null?void 0:e.version)===gV()?s:t(s)},MV=[RV,bV,bV,bW],vW=Object.fromEntries(MV.map((t,s)=>[s,MW(t)])),EW=t=>{if(t)throw t;const s=xt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},vV=(t,s,e)=>{const n=Lt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},EV=(t,s,e)=>{const n=Lt();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 VW(t,s){if(!s.payload)throw new Error("Received empty payload");return HV(s)}const kW={...dr,effect:VW,discard:kV,returnPromises:!0,persistCallback:EW,retry:zW,persistOptions:{storage:XV},queue:{...dr.queue,enqueue:vV,dequeue:EV,peek:(...t)=>WW(...t)}},BW=xV(vW,ss),DW=o.compose(ZV.offline(kW),BW);async function VV(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=FV[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return nr(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function kV(t,s,e=0){var l;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,Nt,Dt,GV,KV,rr,Ps,YV,dr,QV,JV,qq,jq,ZV,XV,xV){"use strict";var Wq=Object.defineProperty;var zq=(i,U,o)=>U in i?Wq(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var p=(i,U,o)=>zq(i,typeof U!="symbol"?U+"":U,o);var NV;const lr=Object.freeze([]),ur=Object.freeze({});var or=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(or||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),hr=(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))(hr||{}),pr=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(pr||{}),Js=(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))(Js||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),yr=(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))(yr||{}),Sr=(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))(Sr||{}),Ht=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Ht||{}),es=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(es||{}),mr=(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))(mr||{}),fr=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(fr||{});const ek=Js.MEDIUM,Ar=6e4,tk=[es.APPROVED,es.REJECTED,es.CHANGES_REQUESTED],sk=[Ht.ACTIVE,Ht.COMPLETED,Ht.CANCELLED],ik=Ht.ACTIVE;function T(t){return{addOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},addMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},setOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},setMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},updateOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},updateMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},deleteOne:(y,S)=>{delete y.instances[S.payload]},deleteMany:(y,S)=>{for(const f of S.payload)delete y.instances[f]},initialize:(y,S)=>{y.instances={};const f=new Set;for(const F of S.payload){const g=t(F);f.add(g),y.instances[g]=F}f.size!==S.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function nk(){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 y=new Set(l.selection);for(const S of u.payload)y.has(S)||y.add(S);l.selection=Array.from(y)},unselectOne:(l,u)=>{const y=new Set(l.selection);y.has(u.payload)&&(y.delete(u.payload),l.selection=Array.from(y))},unselectMany:(l,u)=>{const y=new Set(l.selection);for(const S of u.payload)y.has(S)&&y.delete(S);l.selection=Array.from(y)},toggleOne:(l,u)=>{const y=new Set(l.selection);y.has(u.payload)?y.delete(u.payload):y.add(u.payload),l.selection=Array.from(y)},toggleMany:(l,u)=>{const y=new Set(l.selection);for(const S of u.payload)y.has(S)?y.delete(S):y.add(S);l.selection=Array.from(y)},getInitialState:l=>({...l,selection:[]})}}const ts="versioning",O=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),I=o.createAction("RESET_ORGANIZATION_STATE");function ak(t,s){return GV.useMemo(t,s)}NV=Symbol.toStringTag;class Zs{constructor(){p(this,NV,"Promise");p(this,"_promise");p(this,"_resolve");p(this,"_reject");p(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let Xs=!1;["true","1"].includes("".toLowerCase())&&(Xs=!0);function ck(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 xs(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Xs&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Xs&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function rk(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?lr:t,ss=t=>Object.keys(t).length===0?ur:t,wr=xs(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===ei.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),dk=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),lk=1e3*86400,ei=new Date,uk=t=>new Date(t).toDateString()===ei.toDateString(),ok=xs((t,s,e)=>{const n=Math.round((new Date(t).getTime()-ei.getTime())/lk);return n<s||n>e?wr(t):dk.format(n,"days")});function hk(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Os(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=hk(c);s(r)})},n.readAsArrayBuffer(t)})}const pk=(t,s)=>`${t}${s?`.${s}`:""}`;function yk(t,s){return new File([t],s,{type:t.type})}function Pr(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Or=async t=>(await fetch(t)).blob(),Tr=async(t,s)=>{const e=await Or(t);return new File([e],s,{type:e.type})};function Sk(t){const s=new Blob([t]);KV.saveAs(s,t.name)}function Ir(t){return typeof t=="string"&&t.startsWith("blob:")}function mk(t){return t.type.startsWith("image/")}const Fr={};function fk(t,s,e,...n){const a=Fr[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Fr[t]={[s]:!0},c=!0),c&&console[e](...n)}const _r=["created_at","updated_at","index","revision"];function P(t){return{...t,uuid:Dt.v4()}}function Ak(t){const s={};for(const e of t)s[e.uuid]=e;return s}function E(t){return t.map(({uuid:s})=>s)}function Ts(t,s){return t.localeCompare(s)}function ti(t,s){return Ts(t.uuid,s.uuid)}function wk(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 Pk(t){return t.toLowerCase().replace(" ","-")}function Ok(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function Tk(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const Ik=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[..._r,"created_by"])e in s&&delete s[e];return s}const gr=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return rr(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Fk=t=>{const{roots:s}=gr(t);return s.map(e=>new Ps.Tree(e))},Rr=(t,s)=>{const{nodes:e}=gr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Ps.Tree(n)},br=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Mr=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,vr=t=>rr(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),_k=t=>{const{roots:s}=vr(t);return s.map(e=>new Ps.Tree(e))},Er=(t,s)=>{const{nodes:e}=vr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Ps.Tree(n)};class gk{constructor(s){p(this,"operations",[]);p(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return 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 m=t=>(...s)=>e=>t(e,...s),G=T(t=>t.uuid),Vr={instances:{}},si=o.createSlice({name:"agents",initialState:Vr,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Vr)),reducers:{initializeConversations:G.initialize,addConversation:G.addOne,addConversations:G.addMany,setConversation:G.setOne,setConversations:G.setMany,updateConversation:G.updateOne,updateConversations:G.updateMany,deleteConversation:G.deleteOne,deleteConversations:G.deleteMany}}),{initializeConversations:kr,addConversation:Br,addConversations:Rk,setConversation:Dr,setConversations:bk,updateConversation:Wr,updateConversations:Mk,deleteConversation:vk,deleteConversations:Ek}=si.actions,ii=t=>t.agentsReducer.instances,Vk=o.createSelector([ii],t=>Object.values(t)),kk=m(o.createSelector([ii,(t,s)=>s],(t,s)=>t[s])),zr=si.reducer,K=T(t=>t.uuid),qr={instances:{}},ni=o.createSlice({name:"assetAttachments",initialState:qr,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,qr)),reducers:{initializeAssetAttachments:K.initialize,addAssetAttachment:K.addOne,addAssetAttachments:K.addMany,setAssetAttachment:K.setOne,setAssetAttachments:K.setMany,updateAssetAttachment:K.updateOne,updateAssetAttachments:K.updateMany,deleteAssetAttachment:K.deleteOne,deleteAssetAttachments:K.deleteMany}}),{initializeAssetAttachments:jr,addAssetAttachment:$r,addAssetAttachments:ai,setAssetAttachment:Cr,setAssetAttachments:Ur,updateAssetAttachment:Lr,updateAssetAttachments:Nr,deleteAssetAttachment:Hr,deleteAssetAttachments:ci}=ni.actions,Gr=t=>t.assetAttachmentReducer.instances,ri=o.createSelector([Gr],t=>Object.values(t)),Kr=t=>s=>s.assetAttachmentReducer.instances[t],Yr=m(o.createSelector([ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Qr=m(o.createSelector([ri,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Jr=ni.reducer,Y=T(({uuid:t})=>t),Zr={instances:{}},di=o.createSlice({name:"assetProcedureTypeAttachments",initialState:Zr,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Zr)),reducers:{initializeAssetProcedureTypeAttachments:Y.initialize,addAssetProcedureTypeAttachment:Y.addOne,addAssetProcedureTypeAttachments:Y.addMany,setAssetProcedureTypeAttachment:Y.setOne,setAssetProcedureTypeAttachments:Y.setMany,updateAssetProcedureTypeAttachment:Y.updateOne,updateAssetProcedureTypeAttachments:Y.updateMany,deleteAssetProcedureTypeAttachment:Y.deleteOne,deleteAssetProcedureTypeAttachments:Y.deleteMany}}),{initializeAssetProcedureTypeAttachments:Xr,addAssetProcedureTypeAttachment:xr,addAssetProcedureTypeAttachments:ed,setAssetProcedureTypeAttachment:td,setAssetProcedureTypeAttachments:sd,updateAssetProcedureTypeAttachment:id,updateAssetProcedureTypeAttachments:nd,deleteAssetProcedureTypeAttachment:ad,deleteAssetProcedureTypeAttachments:cd}=di.actions,rd=di.reducer,dd=t=>t.assetProcedureTypeAttachmentReducer.instances,li=o.createSelector([dd],t=>Object.values(t)),ld=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],ud=m(o.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Bk=m(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),Q=T(({uuid:t})=>t),od={instances:{}},ui=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:od,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,od)),reducers:{initializeAssetProcedureTypeFieldsAttachments:Q.initialize,addAssetProcedureTypeFieldsAttachment:Q.addOne,addAssetProcedureTypeFieldsAttachments:Q.addMany,setAssetProcedureTypeFieldsAttachment:Q.setOne,setAssetProcedureTypeFieldsAttachments:Q.setMany,updateAssetProcedureTypeFieldsAttachment:Q.updateOne,updateAssetProcedureTypeFieldsAttachments:Q.updateMany,deleteAssetProcedureTypeFieldsAttachment:Q.deleteOne,deleteAssetProcedureTypeFieldsAttachments:Q.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:hd,addAssetProcedureTypeFieldsAttachment:pd,addAssetProcedureTypeFieldsAttachments:yd,setAssetProcedureTypeFieldsAttachment:Sd,setAssetProcedureTypeFieldsAttachments:md,updateAssetProcedureTypeFieldsAttachment:fd,updateAssetProcedureTypeFieldsAttachments:Ad,deleteAssetProcedureTypeFieldsAttachment:wd,deleteAssetProcedureTypeFieldsAttachments:Pd}=ui.actions,Od=ui.reducer,Td=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,oi=o.createSelector([Td],t=>Object.values(t)),Dk=m(o.createSelector([oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Id=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Fd=m(o.createSelector([oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=T(({uuid:t})=>t),_d={instances:{}},hi=o.createSlice({name:"assetProcedureTypeFields",initialState:_d,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,_d)),reducers:{initializeAssetProcedureTypeFields:J.initialize,addAssetProcedureTypeFields:J.addOne,addAssetProcedureTypeFieldsMany:J.addMany,setAssetProcedureTypeFields:J.setOne,setAssetProcedureTypeFieldsMany:J.setMany,updateAssetProcedureTypeFields:J.updateOne,updateAssetProcedureTypeFieldsMany:J.updateMany,deleteAssetProcedureTypeFields:J.deleteOne,deleteAssetProcedureTypeFieldsMany:J.deleteMany}}),{initializeAssetProcedureTypeFields:gd,addAssetProcedureTypeFields:Rd,addAssetProcedureTypeFieldsMany:bd,setAssetProcedureTypeFields:Md,setAssetProcedureTypeFieldsMany:vd,updateAssetProcedureTypeFields:Ed,updateAssetProcedureTypeFieldsMany:Vd,deleteAssetProcedureTypeFields:kd,deleteAssetProcedureTypeFieldsMany:Bd}=hi.actions,Dd=hi.reducer,Wd=t=>t.assetProcedureTypeFieldsReducer.instances,Is=o.createSelector([Wd],t=>Object.values(t)),Wk=m(o.createSelector([Is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),zk=m(o.createSelector([Is,(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])),zd=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],qd=m(o.createSelector([Is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Z=T(({uuid:t})=>t),jd={instances:{}},pi=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:jd,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,jd)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:Z.initialize,addAssetProcedureTypeFieldValuesAttachment:Z.addOne,addAssetProcedureTypeFieldValuesAttachments:Z.addMany,setAssetProcedureTypeFieldValuesAttachment:Z.setOne,setAssetProcedureTypeFieldValuesAttachments:Z.setMany,updateAssetProcedureTypeFieldValuesAttachment:Z.updateOne,updateAssetProcedureTypeFieldValuesAttachments:Z.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:Z.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:$d,addAssetProcedureTypeFieldValuesAttachment:Cd,addAssetProcedureTypeFieldValuesAttachments:yi,setAssetProcedureTypeFieldValuesAttachment:Ud,setAssetProcedureTypeFieldValuesAttachments:Ld,updateAssetProcedureTypeFieldValuesAttachment:Nd,updateAssetProcedureTypeFieldValuesAttachments:Hd,deleteAssetProcedureTypeFieldValuesAttachment:Gd,deleteAssetProcedureTypeFieldValuesAttachments:Si}=pi.actions,Kd=pi.reducer,Yd=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,mi=o.createSelector([Yd],t=>Object.values(t)),Qd=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Jd=m(o.createSelector([mi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zd=m(o.createSelector([mi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),X=T(({uuid:t})=>t),Xd={instances:{}},fi=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:Xd,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Xd)),reducers:{initializeAssetProcedureTypeFieldValues:X.initialize,addAssetProcedureTypeFieldValues:X.addOne,addAssetProcedureTypeFieldValuesMany:X.addMany,setAssetProcedureTypeFieldValues:X.setOne,setAssetProcedureTypeFieldValuesMany:X.setMany,updateAssetProcedureTypeFieldValues:X.updateOne,updateAssetProcedureTypeFieldValuesMany:X.updateMany,deleteAssetProcedureTypeFieldValues:X.deleteOne,deleteAssetProcedureTypeFieldValuesMany:X.deleteMany}}),{initializeAssetProcedureTypeFieldValues:xd,addAssetProcedureTypeFieldValues:el,addAssetProcedureTypeFieldValuesMany:tl,setAssetProcedureTypeFieldValues:sl,setAssetProcedureTypeFieldValuesMany:il,updateAssetProcedureTypeFieldValues:nl,updateAssetProcedureTypeFieldValuesMany:al,deleteAssetProcedureTypeFieldValues:cl,deleteAssetProcedureTypeFieldValuesMany:rl}=fi.actions,dl=fi.reducer,ll=t=>t.assetProcedureTypeFieldValuesReducer.instances,Fs=o.createSelector([ll],t=>Object.values(t)),qk=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),jk=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),ul=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],ol=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),x=T(({uuid:t})=>t),hl={instances:{}},Ai=o.createSlice({name:"assetProcedures",initialState:hl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,hl)),reducers:{initializeAssetProcedures:x.initialize,addAssetProcedure:x.addOne,addAssetProcedures:x.addMany,setAssetProcedure:x.setOne,setAssetProcedures:x.setMany,updateAssetProcedure:x.updateOne,updateAssetProcedures:x.updateMany,deleteAssetProcedure:x.deleteOne,deleteAssetProcedures:x.deleteMany}}),{initializeAssetProcedures:pl,addAssetProcedure:yl,addAssetProcedures:wi,updateAssetProcedure:Sl,updateAssetProcedures:ml,deleteAssetProcedure:fl,deleteAssetProcedures:Pi,setAssetProcedure:Al,setAssetProcedures:wl}=Ai.actions,Pl=Ai.reducer,Ol=t=>t.assetProcedureReducer.instances,_s=o.createSelector([Ol],t=>Object.values(t)),Tl=m(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),$k=m(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Il=t=>s=>s.assetProcedureReducer.instances[t],Fl=m(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ee=T(t=>t.uuid),_l={instances:{}},Oi=o.createSlice({name:"assetProcedureTypes",initialState:_l,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,_l)),reducers:{initializeAssetProcedureTypes:ee.initialize,addAssetProcedureType:ee.addOne,addAssetProcedureTypes:ee.addMany,setAssetProcedureType:ee.setOne,setAssetProcedureTypes:ee.setMany,updateAssetProcedureType:ee.updateOne,updateAssetProcedureTypes:ee.updateMany,deleteAssetProcedureType:ee.deleteOne,deleteAssetProcedureTypes:ee.deleteMany}}),{initializeAssetProcedureTypes:gl,addAssetProcedureType:Rl,addAssetProcedureTypes:bl,updateAssetProcedureType:Ml,updateAssetProcedureTypes:vl,deleteAssetProcedureType:El,deleteAssetProcedureTypes:Vl,setAssetProcedureType:kl,setAssetProcedureTypes:Bl}=Oi.actions,Dl=Oi.reducer,Wl=t=>t.assetProcedureTypeReducer.instances,Ti=o.createSelector([Wl],t=>Object.values(t)),zl=t=>s=>s.assetProcedureTypeReducer.instances[t],ql=m(o.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ck=m(o.createSelector([Ti,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),te=T(t=>t.uuid),jl={instances:{}},Ii=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:jl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,jl)),reducers:{initializeAssetProcedureStepFieldsAttachments:te.initialize,addAssetProcedureStepFieldsAttachment:te.addOne,addAssetProcedureStepFieldsAttachments:te.addMany,setAssetProcedureStepFieldsAttachment:te.setOne,setAssetProcedureStepFieldsAttachments:te.setMany,updateAssetProcedureStepFieldsAttachment:te.updateOne,updateAssetProcedureStepFieldsAttachments:te.updateMany,deleteAssetProcedureStepFieldsAttachment:te.deleteOne,deleteAssetProcedureStepFieldsAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:$l,addAssetProcedureStepFieldsAttachment:Cl,addAssetProcedureStepFieldsAttachments:Ul,setAssetProcedureStepFieldsAttachment:Ll,setAssetProcedureStepFieldsAttachments:Nl,updateAssetProcedureStepFieldsAttachment:Hl,updateAssetProcedureStepFieldsAttachments:Gl,deleteAssetProcedureStepFieldsAttachment:Kl,deleteAssetProcedureStepFieldsAttachments:Yl}=Ii.actions,Ql=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Fi=o.createSelector([Ql],t=>Object.values(t)),Uk=m(o.createSelector([Fi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Jl=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Zl=m(o.createSelector([Fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Xl=Ii.reducer,se=T(t=>t.uuid),xl={instances:{}},_i=o.createSlice({name:"assetProcedureStepFields",initialState:xl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,xl)),reducers:{initializeAssetProcedureStepFields:se.initialize,addAssetProcedureStepFields:se.addOne,addAssetProcedureStepFieldsMany:se.addMany,setAssetProcedureStepFields:se.setOne,setAssetProcedureStepFieldsMany:se.setMany,updateAssetProcedureStepFields:se.updateOne,updateAssetProcedureStepFieldsMany:se.updateMany,deleteAssetProcedureStepFields:se.deleteOne,deleteAssetProcedureStepFieldsMany:se.deleteMany}}),{initializeAssetProcedureStepFields:eu,addAssetProcedureStepFields:tu,addAssetProcedureStepFieldsMany:su,setAssetProcedureStepFields:iu,setAssetProcedureStepFieldsMany:nu,updateAssetProcedureStepFields:au,updateAssetProcedureStepFieldsMany:cu,deleteAssetProcedureStepFields:ru,deleteAssetProcedureStepFieldsMany:du}=_i.actions,gi=t=>t.assetProcedureStepFieldsReducer.instances,gs=o.createSelector([gi],t=>Object.values(t)),Lk=m(o.createSelector([gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),Nk=m(o.createSelector([gs,(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])),Hk=o.createSelector([gi],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}),lu=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],uu=m(o.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ou=_i.reducer,ie=T(t=>t.uuid),hu={instances:{}},Ri=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:hu,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,hu)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:ie.initialize,addAssetProcedureStepFieldValuesAttachment:ie.addOne,addAssetProcedureStepFieldValuesAttachments:ie.addMany,setAssetProcedureStepFieldValuesAttachment:ie.setOne,setAssetProcedureStepFieldValuesAttachments:ie.setMany,updateAssetProcedureStepFieldValuesAttachment:ie.updateOne,updateAssetProcedureStepFieldValuesAttachments:ie.updateMany,deleteAssetProcedureStepFieldValuesAttachment:ie.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:ie.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:pu,addAssetProcedureStepFieldValuesAttachment:yu,addAssetProcedureStepFieldValuesAttachments:bi,setAssetProcedureStepFieldValuesAttachment:Su,setAssetProcedureStepFieldValuesAttachments:mu,updateAssetProcedureStepFieldValuesAttachment:fu,updateAssetProcedureStepFieldValuesAttachments:Au,deleteAssetProcedureStepFieldValuesAttachment:wu,deleteAssetProcedureStepFieldValuesAttachments:Mi}=Ri.actions,Pu=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,vi=o.createSelector([Pu],t=>Object.values(t)),Ou=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Tu=m(o.createSelector([vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Iu=m(o.createSelector([vi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Fu=Ri.reducer,ne=T(t=>t.uuid),_u={instances:{}},Ei=o.createSlice({name:"assetProcedureStepFieldValues",initialState:_u,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,_u)),reducers:{initializeAssetProcedureStepFieldValues:ne.initialize,addAssetProcedureStepFieldValues:ne.addOne,addAssetProcedureStepFieldValuesMany:ne.addMany,setAssetProcedureStepFieldValues:ne.setOne,setAssetProcedureStepFieldValuesMany:ne.setMany,updateAssetProcedureStepFieldValues:ne.updateOne,updateAssetProcedureStepFieldValuesMany:ne.updateMany,deleteAssetProcedureStepFieldValues:ne.deleteOne,deleteAssetProcedureStepFieldValuesMany:ne.deleteMany}}),{initializeAssetProcedureStepFieldValues:gu,addAssetProcedureStepFieldValues:Ru,addAssetProcedureStepFieldValuesMany:bu,setAssetProcedureStepFieldValues:Mu,setAssetProcedureStepFieldValuesMany:vu,updateAssetProcedureStepFieldValues:Eu,updateAssetProcedureStepFieldValuesMany:Vu,deleteAssetProcedureStepFieldValues:ku,deleteAssetProcedureStepFieldValuesMany:Bu}=Ei.actions,Du=t=>t.assetProcedureStepFieldValuesReducer.instances,is=o.createSelector([Du],t=>Object.values(t)),Gk=m(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Kk=m(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Yk=m(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),Wu=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],zu=m(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qu=Ei.reducer,ae=T(t=>t.uuid),ju={instances:{}},Vi=o.createSlice({name:"assetProcedureSteps",initialState:ju,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,ju)),reducers:{initializeAssetProcedureSteps:ae.initialize,setAssetProcedureStep:ae.setOne,setAssetProcedureSteps:ae.setMany,addAssetProcedureStep:ae.addOne,addAssetProcedureSteps:ae.addMany,updateAssetProcedureStep:ae.updateOne,updateAssetProcedureSteps:ae.updateMany,deleteAssetProcedureStep:ae.deleteOne,deleteAssetProcedureSteps:ae.deleteMany}}),{initializeAssetProcedureSteps:$u,setAssetProcedureStep:Cu,setAssetProcedureSteps:Uu,addAssetProcedureStep:Lu,addAssetProcedureSteps:Nu,updateAssetProcedureStep:Hu,updateAssetProcedureSteps:Gu,deleteAssetProcedureStep:Ku,deleteAssetProcedureSteps:Yu}=Vi.actions,Qu=Vi.reducer,Rs=t=>t.assetProcedureStepReducer.instances,Ju=t=>s=>s.assetProcedureStepReducer.instances[t],ki=o.createSelector([Rs],t=>Object.values(t)),Qk=m(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ss(e)})),Jk=m(o.createSelector([ki,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Zu=m(o.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Xu=m(o.createSelector([Rs,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Rr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ce=T(t=>t.uuid),xu={instances:{}},Bi=o.createSlice({name:"assets",initialState:xu,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,xu)),reducers:{initializeAssets:ce.initialize,addAsset:ce.addOne,addAssets:ce.addMany,setAsset:ce.setOne,setAssets:ce.setMany,updateAsset:ce.updateOne,updateAssets:ce.updateMany,deleteAsset:ce.deleteOne,deleteAssets:ce.deleteMany}}),{initializeAssets:eo,addAsset:to,addAssets:Di,updateAsset:so,updateAssets:io,deleteAsset:no,deleteAssets:Wi,setAsset:ao,setAssets:co}=Bi.actions,ro=t=>t.assetReducer.instances,bs=o.createSelector([ro],t=>A(Object.values(t))),Zk=m(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),lo=m(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),uo=t=>s=>s.assetReducer.instances[t],oo=m(o.createSelector([bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ho=Bi.reducer,re=T(t=>t.uuid),po={instances:{}},zi=o.createSlice({name:"assetStageCompletions",initialState:po,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,po)),reducers:{initializeAssetStageCompletions:re.initialize,addAssetStageCompletion:re.addOne,addAssetStageCompletions:re.addMany,setAssetStageCompletion:re.setOne,setAssetStageCompletions:re.setMany,updateAssetStageCompletion:re.updateOne,updateAssetStageCompletions:re.updateMany,deleteAssetStageCompletion:re.deleteOne,deleteAssetStageCompletions:re.deleteMany}}),{initializeAssetStageCompletions:yo,addAssetStageCompletion:So,addAssetStageCompletions:mo,setAssetStageCompletion:fo,setAssetStageCompletions:Ao,updateAssetStageCompletion:wo,updateAssetStageCompletions:Po,deleteAssetStageCompletion:Oo,deleteAssetStageCompletions:To}=zi.actions,Io=zi.reducer,Fo=t=>t.assetStageCompletionReducer.instances,_o=o.createSelector([Fo],t=>Object.values(t)),go=t=>s=>s.assetStageCompletionReducer.instances[t],Ro=m(o.createSelector([_o,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),de=T(t=>t.uuid),bo={instances:{}},qi=o.createSlice({name:"assetStages",initialState:bo,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,bo)),reducers:{initializeAssetStages:de.initialize,setAssetStage:de.setOne,setAssetStages:de.setMany,addAssetStage:de.addOne,addAssetStages:de.addMany,updateAssetStage:de.updateOne,updateAssetStages:de.updateMany,deleteAssetStage:de.deleteOne,deleteAssetStages:de.deleteMany}}),{initializeAssetStages:Mo,setAssetStage:vo,setAssetStages:Eo,addAssetStage:Vo,addAssetStages:ko,updateAssetStage:Bo,updateAssetStages:Do,deleteAssetStage:Wo,deleteAssetStages:zo}=qi.actions,qo=qi.reducer,ji=t=>t.assetStageReducer.instances,jo=t=>s=>s.assetStageReducer.instances[t],$i=o.createSelector([ji],t=>Object.values(t)),Xk=m(o.createSelector([ji,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ss(e)})),xk=m(o.createSelector([$i,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),$o=m(o.createSelector([$i,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),le=T(t=>t.uuid),Co={instances:{}},Ci=o.createSlice({name:"assetTypeAttachments",initialState:Co,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Co)),reducers:{initializeAssetTypeAttachments:le.initialize,addAssetTypeAttachment:le.addOne,addAssetTypeAttachments:le.addMany,setAssetTypeAttachment:le.setOne,setAssetTypeAttachments:le.setMany,updateAssetTypeAttachment:le.updateOne,updateAssetTypeAttachments:le.updateMany,deleteAssetTypeAttachment:le.deleteOne,deleteAssetTypeAttachments:le.deleteMany}}),{initializeAssetTypeAttachments:Uo,addAssetTypeAttachment:Lo,addAssetTypeAttachments:Ui,setAssetTypeAttachment:No,setAssetTypeAttachments:Ho,updateAssetTypeAttachment:Go,updateAssetTypeAttachments:Ko,deleteAssetTypeAttachment:Yo,deleteAssetTypeAttachments:Li}=Ci.actions,Qo=t=>t.assetTypeAttachmentReducer.instances,Ni=o.createSelector([Qo],t=>Object.values(t)),Jo=t=>s=>s.assetTypeAttachmentReducer.instances[t],Zo=m(o.createSelector([Ni,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Xo=m(o.createSelector([Ni,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),xo=Ci.reducer,ue=T(t=>t.uuid),eh={instances:{}},Hi=o.createSlice({name:"assetTypeFieldsAttachments",initialState:eh,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,eh)),reducers:{initializeAssetTypeFieldsAttachments:ue.initialize,addAssetTypeFieldsAttachment:ue.addOne,addAssetTypeFieldsAttachments:ue.addMany,setAssetTypeFieldsAttachment:ue.setOne,setAssetTypeFieldsAttachments:ue.setMany,updateAssetTypeFieldsAttachment:ue.updateOne,updateAssetTypeFieldsAttachments:ue.updateMany,deleteAssetTypeFieldsAttachment:ue.deleteOne,deleteAssetTypeFieldsAttachments:ue.deleteMany}}),{initializeAssetTypeFieldsAttachments:th,addAssetTypeFieldsAttachment:sh,addAssetTypeFieldsAttachments:ih,setAssetTypeFieldsAttachment:nh,setAssetTypeFieldsAttachments:ah,updateAssetTypeFieldsAttachment:ch,updateAssetTypeFieldsAttachments:rh,deleteAssetTypeFieldsAttachment:dh,deleteAssetTypeFieldsAttachments:lh}=Hi.actions,uh=t=>t.assetTypeFieldsAttachmentReducer.instances,Gi=o.createSelector([uh],t=>Object.values(t)),eB=m(o.createSelector([Gi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),oh=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],hh=m(o.createSelector([Gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ph=Hi.reducer,oe=T(t=>t.uuid),yh={instances:{}},Ki=o.createSlice({name:"assetTypeFields",initialState:yh,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,yh)),reducers:{initializeAssetTypeFields:oe.initialize,addAssetTypeFields:oe.addOne,addAssetTypeFieldsMany:oe.addMany,setAssetTypeFields:oe.setOne,setAssetTypeFieldsMany:oe.setMany,updateAssetTypeFields:oe.updateOne,updateAssetTypeFieldsMany:oe.updateMany,deleteAssetTypeFields:oe.deleteOne,deleteAssetTypeFieldsMany:oe.deleteMany}}),{initializeAssetTypeFields:Sh,addAssetTypeFields:mh,addAssetTypeFieldsMany:fh,setAssetTypeFields:Ah,setAssetTypeFieldsMany:wh,updateAssetTypeFields:Ph,updateAssetTypeFieldsMany:Oh,deleteAssetTypeFields:Th,deleteAssetTypeFieldsMany:Ih}=Ki.actions,Fh=t=>t.assetTypeFieldsReducer.instances,ns=o.createSelector([Fh],t=>Object.values(t)),tB=m(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),sB=m(o.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),_h=t=>s=>s.assetTypeFieldsReducer.instances[t],gh=m(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Rh=Ki.reducer,he=T(t=>t.uuid),bh={instances:{}},Yi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:bh,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,bh)),reducers:{initializeAssetTypeFieldValuesAttachments:he.initialize,addAssetTypeFieldValuesAttachment:he.addOne,addAssetTypeFieldValuesAttachments:he.addMany,setAssetTypeFieldValuesAttachment:he.setOne,setAssetTypeFieldValuesAttachments:he.setMany,updateAssetTypeFieldValuesAttachment:he.updateOne,updateAssetTypeFieldValuesAttachments:he.updateMany,deleteAssetTypeFieldValuesAttachment:he.deleteOne,deleteAssetTypeFieldValuesAttachments:he.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Mh,addAssetTypeFieldValuesAttachment:vh,addAssetTypeFieldValuesAttachments:Qi,setAssetTypeFieldValuesAttachment:Eh,setAssetTypeFieldValuesAttachments:Vh,updateAssetTypeFieldValuesAttachment:kh,updateAssetTypeFieldValuesAttachments:Bh,deleteAssetTypeFieldValuesAttachment:Dh,deleteAssetTypeFieldValuesAttachments:Ji}=Yi.actions,Wh=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Zi=o.createSelector([Wh],t=>Object.values(t)),zh=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],qh=m(o.createSelector([Zi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),jh=m(o.createSelector([Zi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),$h=Yi.reducer,pe=T(t=>t.uuid),Ch={instances:{}},Xi=o.createSlice({name:"assetTypeFieldValues",initialState:Ch,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Ch)),reducers:{initializeAssetTypeFieldValues:pe.initialize,addAssetTypeFieldValues:pe.addOne,addAssetTypeFieldValuesMany:pe.addMany,setAssetTypeFieldValues:pe.setOne,setAssetTypeFieldValuesMany:pe.setMany,updateAssetTypeFieldValues:pe.updateOne,updateAssetTypeFieldValuesMany:pe.updateMany,deleteAssetTypeFieldValues:pe.deleteOne,deleteAssetTypeFieldValuesMany:pe.deleteMany}}),{initializeAssetTypeFieldValues:Uh,addAssetTypeFieldValues:Lh,addAssetTypeFieldValuesMany:Nh,setAssetTypeFieldValues:Hh,setAssetTypeFieldValuesMany:Gh,updateAssetTypeFieldValues:Kh,updateAssetTypeFieldValuesMany:Yh,deleteAssetTypeFieldValues:Qh,deleteAssetTypeFieldValuesMany:Jh}=Xi.actions,Zh=t=>t.assetTypeFieldValuesReducer.instances,Ms=o.createSelector([Zh],t=>Object.values(t)),iB=m(o.createSelector([Ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),nB=m(o.createSelector([ns,Ms,(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)))})),Xh=t=>s=>s.assetTypeFieldValuesReducer.instances[t],xh=m(o.createSelector([Ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ep=Xi.reducer,ye=T(t=>t.uuid),tp={instances:{}},xi=o.createSlice({name:"assetTypeIdentifiers",initialState:tp,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,tp)),reducers:{initializeAssetTypeIdentifiers:ye.initialize,addAssetTypeIdentifier:ye.addOne,addAssetTypeIdentifiers:ye.addMany,setAssetTypeIdentifier:ye.setOne,setAssetTypeIdentifiers:ye.setMany,updateAssetTypeIdentifier:ye.updateOne,updateAssetTypeIdentifiers:ye.updateMany,deleteAssetTypeIdentifier:ye.deleteOne,deleteAssetTypeIdentifiers:ye.deleteMany}}),{initializeAssetTypeIdentifiers:sp,addAssetTypeIdentifier:ip,addAssetTypeIdentifiers:np,setAssetTypeIdentifier:ap,setAssetTypeIdentifiers:cp,updateAssetTypeIdentifier:rp,updateAssetTypeIdentifiers:dp,deleteAssetTypeIdentifier:lp,deleteAssetTypeIdentifiers:up}=xi.actions,op=t=>t.assetTypeIdentifierReducer.instances,en=o.createSelector([op],t=>Object.values(t)),hp=t=>s=>s.assetTypeIdentifierReducer.instances[t],pp=m(o.createSelector([en,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aB=m(o.createSelector([en,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),yp=xi.reducer,Se=T(t=>t.uuid),Sp={instances:{}},tn=o.createSlice({name:"assetTypeIdentifierValues",initialState:Sp,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Sp)),reducers:{initializeAssetTypeIdentifierValues:Se.initialize,addAssetTypeIdentifierValue:Se.addOne,addAssetTypeIdentifierValues:Se.addMany,setAssetTypeIdentifierValue:Se.setOne,setAssetTypeIdentifierValues:Se.setMany,updateAssetTypeIdentifierValue:Se.updateOne,updateAssetTypeIdentifierValues:Se.updateMany,deleteAssetTypeIdentifierValue:Se.deleteOne,deleteAssetTypeIdentifierValues:Se.deleteMany}}),{initializeAssetTypeIdentifierValues:mp,addAssetTypeIdentifierValue:fp,addAssetTypeIdentifierValues:Ap,setAssetTypeIdentifierValue:wp,setAssetTypeIdentifierValues:Pp,updateAssetTypeIdentifierValue:Op,updateAssetTypeIdentifierValues:Tp,deleteAssetTypeIdentifierValue:Ip,deleteAssetTypeIdentifierValues:Fp}=tn.actions,_p=t=>t.assetTypeIdentifierValueReducer.instances,vs=o.createSelector([_p],t=>Object.values(t)),gp=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],Rp=m(o.createSelector([vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cB=m(o.createSelector([vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),rB=m(o.createSelector([vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),bp=tn.reducer,me=T(t=>t.uuid),Mp={instances:{}},sn=o.createSlice({name:"assetTypes",initialState:Mp,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Mp)),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:vp,setAssetType:Ep,setAssetTypes:Vp,addAssetType:kp,addAssetTypes:Bp,updateAssetType:Dp,updateAssetTypes:Wp,deleteAssetType:zp,deleteAssetTypes:qp}=sn.actions,jp=t=>t.assetTypeReducer.instances,nn=o.createSelector([jp],t=>Object.values(t)),$p=t=>s=>s.assetTypeReducer.instances[t],Cp=m(o.createSelector([nn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dB=m(o.createSelector([nn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Up=sn.reducer,fe=T(t=>t.uuid),Lp={instances:{}},an=o.createSlice({name:"assetTypeStatuses",initialState:Lp,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Lp)),reducers:{initializeAssetTypeStatuses:fe.initialize,addAssetTypeStatus:fe.addOne,addAssetTypeStatuses:fe.addMany,setAssetTypeStatus:fe.setOne,setAssetTypeStatuses:fe.setMany,updateAssetTypeStatus:fe.updateOne,updateAssetTypeStatuses:fe.updateMany,deleteAssetTypeStatus:fe.deleteOne,deleteAssetTypeStatuses:fe.deleteMany}}),{initializeAssetTypeStatuses:Np,addAssetTypeStatus:Hp,addAssetTypeStatuses:Gp,setAssetTypeStatus:Kp,setAssetTypeStatuses:Yp,updateAssetTypeStatus:Qp,updateAssetTypeStatuses:Jp,deleteAssetTypeStatus:Zp,deleteAssetTypeStatuses:Xp}=an.actions,xp=t=>t.assetTypeStatusReducer.instances,cn=o.createSelector([xp],t=>A(Object.values(t).toSorted(br))),ey=t=>s=>s.assetTypeStatusReducer.instances[t],ty=m(o.createSelector([cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lB=m(o.createSelector([cn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),sy=an.reducer,iy={accessToken:"",refreshToken:"",isLoggedIn:!1},Es=o.createSlice({name:"auth",initialState:iy,extraReducers:t=>t.addCase(O,s=>Object.assign(s,iy)),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||Es.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:uB,clearTokens:oB,setLoggedIn:ny}=Es.actions,hB=t=>t.authReducer.accessToken,pB=t=>t.authReducer.isLoggedIn,ay=Es.reducer,Ae=T(t=>t.uuid),cy={instances:{}},rn=o.createSlice({name:"documentAttachments",initialState:cy,extraReducers:t=>t.addCase(O,s=>Object.assign(s,cy)),reducers:{initializeDocumentAttachments:Ae.initialize,addDocumentAttachment:Ae.addOne,addDocumentAttachments:Ae.addMany,setDocumentAttachment:Ae.setOne,setDocumentAttachments:Ae.setMany,updateDocumentAttachment:Ae.updateOne,updateDocumentAttachments:Ae.updateMany,deleteDocumentAttachment:Ae.deleteOne,deleteDocumentAttachments:Ae.deleteMany}}),{initializeDocumentAttachments:ry,addDocumentAttachment:dy,addDocumentAttachments:ly,setDocumentAttachment:uy,setDocumentAttachments:oy,updateDocumentAttachment:hy,updateDocumentAttachments:py,deleteDocumentAttachment:yy,deleteDocumentAttachments:Sy}=rn.actions,my=t=>t.documentAttachmentReducer.instances,dn=o.createSelector([my],t=>Object.values(t)),fy=t=>s=>s.documentAttachmentReducer.instances[t],Ay=m(o.createSelector([dn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yB=m(o.createSelector([dn,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),wy=rn.reducer,we=T(({uuid:t})=>t),Py={instances:{}},ln=o.createSlice({name:"documents",initialState:Py,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>{Object.assign(s,Py)}),reducers:{initializeDocuments:we.initialize,addDocument:we.addOne,addDocuments:we.addMany,setDocument:we.setOne,setDocuments:we.setMany,updateDocument:we.updateOne,updateDocuments:we.updateMany,deleteDocument:we.deleteOne,deleteDocuments:we.deleteMany}}),{initializeDocuments:Oy,addDocument:Ty,addDocuments:Iy,setDocument:Fy,setDocuments:_y,updateDocument:gy,updateDocuments:Ry,deleteDocument:by,deleteDocuments:My}=ln.actions,vy=ln.reducer,un=t=>t.documentsReducer.instances,Vs=o.createSelector([un],t=>Object.values(t)),Ey=t=>s=>s.documentsReducer.instances[t],Vy=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),SB=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),mB=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),ky=m(o.createSelector([un,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Er(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Pe=T(t=>t.uuid),By={instances:{}},on=o.createSlice({name:"emailDomains",initialState:By,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,By)),reducers:{initializeEmailDomains:Pe.initialize,addEmailDomain:Pe.addOne,addEmailDomains:Pe.addMany,setEmailDomain:Pe.setOne,setEmailDomains:Pe.setMany,updateEmailDomain:Pe.updateOne,updateEmailDomains:Pe.updateMany,deleteEmailDomain:Pe.deleteOne,deleteEmailDomains:Pe.deleteMany}}),{initializeEmailDomains:Dy,addEmailDomain:Wy,addEmailDomains:zy,setEmailDomain:qy,setEmailDomains:jy,updateEmailDomain:$y,updateEmailDomains:Cy,deleteEmailDomain:Uy,deleteEmailDomains:Ly}=on.actions,Ny=t=>t.emailDomainsReducer.instances,hn=o.createSelector([Ny],t=>Object.values(t)),Hy=t=>s=>s.emailDomainsReducer.instances[t],Gy=m(o.createSelector([hn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fB=m(o.createSelector([hn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Ky=on.reducer,Yy={s3Urls:{}},Qy=1e3*60*60,AB=Qy*24*7,pn=o.createSlice({name:"file",initialState:Yy,extraReducers:t=>t.addCase(O,s=>Object.assign(s,Yy)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+AB);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:wB}=pn.actions,PB=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Qy))return e},Jy=pn.reducer,Oe=T(t=>t.uuid),Zy={instances:{}},yn=o.createSlice({name:"formIdentifiers",initialState:Zy,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Zy)),reducers:{initializeFormIdentifiers:Oe.initialize,addFormIdentifier:Oe.addOne,addFormIdentifiers:Oe.addMany,setFormIdentifier:Oe.setOne,setFormIdentifiers:Oe.setMany,updateFormIdentifier:Oe.updateOne,updateFormIdentifiers:Oe.updateMany,deleteFormIdentifier:Oe.deleteOne,deleteFormIdentifiers:Oe.deleteMany}}),{initializeFormIdentifiers:Xy,addFormIdentifier:xy,addFormIdentifiers:eS,setFormIdentifier:tS,setFormIdentifiers:sS,updateFormIdentifier:iS,updateFormIdentifiers:nS,deleteFormIdentifier:aS,deleteFormIdentifiers:cS}=yn.actions,rS=t=>t.formIdentifierReducer.instances,Sn=o.createSelector([rS],t=>Object.values(t)),dS=t=>s=>s.formIdentifierReducer.instances[t],lS=m(o.createSelector([Sn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OB=m(o.createSelector([Sn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),uS=yn.reducer,Te=T(t=>t.uuid),oS={instances:{}},mn=o.createSlice({name:"formIdentifierValues",initialState:oS,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,oS)),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:hS,addFormIdentifierValue:pS,addFormIdentifierValues:yS,setFormIdentifierValue:SS,setFormIdentifierValues:mS,updateFormIdentifierValue:fS,updateFormIdentifierValues:AS,deleteFormIdentifierValue:wS,deleteFormIdentifierValues:PS}=mn.actions,OS=t=>t.formIdentifierValueReducer.instances,ks=o.createSelector([OS],t=>Object.values(t)),TS=t=>s=>s.formIdentifierValueReducer.instances[t],IS=m(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),TB=m(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),IB=m(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),FS=mn.reducer,Ie=T(t=>t.uuid),_S={instances:{}},fn=o.createSlice({name:"formRevisionAttachments",initialState:_S,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,_S)),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:gS,addFormRevisionAttachment:RS,addFormRevisionAttachments:bS,setFormRevisionAttachment:MS,setFormRevisionAttachments:vS,updateFormRevisionAttachment:ES,updateFormRevisionAttachments:VS,deleteFormRevisionAttachment:kS,deleteFormRevisionAttachments:BS}=fn.actions,Bs=t=>t.formRevisionAttachmentReducer.instances,DS=o.createSelector([Bs],t=>Object.values(t)),WS=m(o.createSelector([Bs,(t,s)=>s],(t,s)=>t[s])),zS=m(o.createSelector([DS,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FB=m(o.createSelector([Bs,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),qS=fn.reducer,Fe=T(t=>t.uuid),jS={instances:{}},An=o.createSlice({name:"formRevisions",initialState:jS,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,jS)),reducers:{initializeFormRevisions:Fe.initialize,addFormRevision:Fe.addOne,addFormRevisions:Fe.addMany,setFormRevision:Fe.setOne,setFormRevisions:Fe.setMany,updateFormRevision:Fe.updateOne,updateFormRevisions:Fe.updateMany,deleteFormRevision:Fe.deleteOne,deleteFormRevisions:Fe.deleteMany}}),{initializeFormRevisions:$S,addFormRevision:CS,addFormRevisions:wn,setFormRevision:US,setFormRevisions:LS,updateFormRevision:NS,updateFormRevisions:HS,deleteFormRevision:GS,deleteFormRevisions:Pn}=An.actions,KS=t=>t.formRevisionReducer.instances,Ds=o.createSelector([KS],t=>Object.values(t)),YS=t=>s=>s.formRevisionReducer.instances[t],QS=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_B=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),JS=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),ZS=An.reducer,_e=T(t=>t.uuid),XS={instances:{}},On=o.createSlice({name:"forms",initialState:XS,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,XS)),reducers:{initializeForms:_e.initialize,addForm:_e.addOne,addForms:_e.addMany,setForm:_e.setOne,setForms:_e.setMany,updateForm:_e.updateOne,updateForms:_e.updateMany,deleteForm:_e.deleteOne,deleteForms:_e.deleteMany}}),{initializeForms:xS,addForm:em,addForms:tm,setForm:sm,setForms:im,updateForm:nm,updateForms:am,deleteForm:cm,deleteForms:rm}=On.actions,dm=On.reducer,lm=t=>t.formReducer.instances,Tn=o.createSelector([lm],t=>Object.values(t)),um=t=>s=>s.formReducer.instances[t],om=m(o.createSelector([Tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gB=m(o.createSelector([Tn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ge=T(t=>t.uuid),hm={instances:{}},In=o.createSlice({name:"formSubmissionAttachments",initialState:hm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,hm)),reducers:{initializeFormSubmissionAttachments:ge.initialize,addFormSubmissionAttachment:ge.addOne,addFormSubmissionAttachments:ge.addMany,setFormSubmissionAttachment:ge.setOne,setFormSubmissionAttachments:ge.setMany,updateFormSubmissionAttachment:ge.updateOne,updateFormSubmissionAttachments:ge.updateMany,deleteFormSubmissionAttachment:ge.deleteOne,deleteFormSubmissionAttachments:ge.deleteMany}}),{initializeFormSubmissionAttachments:pm,addFormSubmissionAttachment:ym,addFormSubmissionAttachments:Fn,setFormSubmissionAttachment:Sm,setFormSubmissionAttachments:mm,updateFormSubmissionAttachment:fm,updateFormSubmissionAttachments:Am,deleteFormSubmissionAttachment:wm,deleteFormSubmissionAttachments:_n}=In.actions,gn=t=>t.formSubmissionAttachmentReducer.instances,Rn=o.createSelector([gn],t=>Object.values(t)),Pm=m(o.createSelector([gn,(t,s)=>s],(t,s)=>t[s])),bn=m(o.createSelector([Rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Om=bn,Tm=m(o.createSelector([Rn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Im=In.reducer,Re=T(t=>t.uuid),Fm={instances:{}},Mn=o.createSlice({name:"formSubmissions",initialState:Fm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Fm)),reducers:{initializeFormSubmissions:Re.initialize,setFormSubmission:Re.setOne,setFormSubmissions:Re.setMany,addFormSubmission:Re.addOne,addFormSubmissions:Re.addMany,updateFormSubmission:Re.updateOne,updateFormSubmissions:Re.updateMany,deleteFormSubmission:Re.deleteOne,deleteFormSubmissions:Re.deleteMany}}),{initializeFormSubmissions:_m,setFormSubmission:gm,setFormSubmissions:Rm,addFormSubmission:bm,addFormSubmissions:vn,updateFormSubmission:Mm,updateFormSubmissions:vm,deleteFormSubmission:Em,deleteFormSubmissions:En}=Mn.actions,Vm=t=>t.formSubmissionReducer.instances,Vn=o.createSelector([Vm],t=>Object.values(t)),km=t=>s=>s.formSubmissionReducer.instances[t],Bm=m(o.createSelector([Vn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Dm=m(o.createSelector([Vn,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s))),Wm=Mn.reducer,be=T(t=>t.uuid),zm={instances:{}},kn=o.createSlice({name:"geoImages",initialState:zm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,zm)),reducers:{initializeGeoImages:be.initialize,setGeoImage:be.setOne,setGeoImages:be.setMany,addGeoImage:be.addOne,addGeoImages:be.addMany,updateGeoImage:be.updateOne,updateGeoImages:be.updateMany,deleteGeoImage:be.deleteOne,deleteGeoImages:be.deleteMany}}),{initializeGeoImages:qm,setGeoImage:jm,setGeoImages:$m,addGeoImage:Cm,addGeoImages:Um,updateGeoImage:Lm,updateGeoImages:Nm,deleteGeoImage:Hm,deleteGeoImages:Gm}=kn.actions,Km=t=>t.geoImageReducer.instances,Bn=o.createSelector([Km],t=>Object.values(t)),Ym=t=>s=>s.geoImageReducer.instances[t],Qm=m(o.createSelector([Bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),RB=m(o.createSelector([Bn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Jm=kn.reducer,Me=T(t=>t.uuid),Zm={instances:{}},Dn=o.createSlice({name:"issueAssociations",initialState:Zm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Zm)),reducers:{initializeIssueAssociations:Me.initialize,addIssueAssociation:Me.addOne,addIssueAssociations:Me.addMany,setIssueAssociation:Me.setOne,setIssueAssociations:Me.setMany,updateIssueAssociation:Me.updateOne,updateIssueAssociations:Me.updateMany,deleteIssueAssociation:Me.deleteOne,deleteIssueAssociations:Me.deleteMany}}),{initializeIssueAssociations:Xm,setIssueAssociations:xm,setIssueAssociation:ef,updateIssueAssociation:tf,updateIssueAssociations:sf,addIssueAssociation:nf,addIssueAssociations:jt,deleteIssueAssociation:af,deleteIssueAssociations:$t}=Dn.actions,cf=t=>t.issueAssociationReducer.instances,Ct=o.createSelector([cf],t=>Object.values(t)),rf=t=>s=>s.issueAssociationReducer.instances[t],df=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),uf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),of=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),hf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),pf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),yf=Dn.reducer,ve=T(t=>t.uuid),Sf={instances:{}},Wn=o.createSlice({name:"issueAttachments",initialState:Sf,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Sf)),reducers:{initializeIssueAttachments:ve.initialize,addIssueAttachment:ve.addOne,addIssueAttachments:ve.addMany,setIssueAttachment:ve.setOne,setIssueAttachments:ve.setMany,updateIssueAttachment:ve.updateOne,updateIssueAttachments:ve.updateMany,deleteIssueAttachment:ve.deleteOne,deleteIssueAttachments:ve.deleteMany}}),{initializeIssueAttachments:mf,addIssueAttachment:ff,addIssueAttachments:zn,setIssueAttachment:Af,setIssueAttachments:wf,updateIssueAttachment:Pf,updateIssueAttachments:Of,deleteIssueAttachment:Tf,deleteIssueAttachments:qn}=Wn.actions,If=t=>t.issueAttachmentReducer.instances,jn=o.createSelector([If],t=>Object.values(t)),Ff=m(o.createSelector([jn,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),_f=t=>s=>s.issueAttachmentReducer.instances[t],gf=m(o.createSelector([jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Rf=Wn.reducer,Ee=T(t=>t.uuid),bf={instances:{}},$n=o.createSlice({name:"issueCommentAttachments",initialState:bf,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,bf)),reducers:{initializeIssueCommentAttachments:Ee.initialize,addIssueCommentAttachment:Ee.addOne,addIssueCommentAttachments:Ee.addMany,setIssueCommentAttachment:Ee.setOne,setIssueCommentAttachments:Ee.setMany,updateIssueCommentAttachment:Ee.updateOne,updateIssueCommentAttachments:Ee.updateMany,deleteIssueCommentAttachment:Ee.deleteOne,deleteIssueCommentAttachments:Ee.deleteMany}}),{initializeIssueCommentAttachments:Mf,addIssueCommentAttachment:vf,addIssueCommentAttachments:Ef,setIssueCommentAttachment:Vf,setIssueCommentAttachments:kf,updateIssueCommentAttachment:Bf,updateIssueCommentAttachments:Df,deleteIssueCommentAttachment:Wf,deleteIssueCommentAttachments:zf}=$n.actions,qf=t=>t.issueCommentAttachmentReducer.instances,Cn=o.createSelector([qf],t=>Object.values(t)),jf=t=>s=>s.issueCommentAttachmentReducer.instances[t],$f=m(o.createSelector([Cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bB=m(o.createSelector([Cn,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),Cf=$n.reducer,Ve=T(t=>t.uuid),Uf={instances:{}},Un=o.createSlice({name:"issueComments",initialState:Uf,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Uf)),reducers:{initializeIssueComments:Ve.initialize,addIssueComment:Ve.addOne,addIssueComments:Ve.addMany,setIssueComment:Ve.setOne,setIssueComments:Ve.setMany,updateIssueComment:Ve.updateOne,updateIssueComments:Ve.updateMany,deleteIssueComment:Ve.deleteOne,deleteIssueComments:Ve.deleteMany}}),{initializeIssueComments:Lf,addIssueComment:Nf,addIssueComments:Hf,setIssueComment:Gf,setIssueComments:Kf,updateIssueComment:Yf,updateIssueComments:Qf,deleteIssueComment:Jf,deleteIssueComments:Zf}=Un.actions,Ln=t=>t.issueCommentReducer.instances,Xf=t=>s=>s.issueCommentReducer.instances[t],xf=m(o.createSelector([Ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),MB=m(o.createSelector([Ln,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),eA=Un.reducer,ke=T(t=>t.uuid),tA={instances:{}},Nn=o.createSlice({name:"issues",initialState:tA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,tA)),reducers:{initializeIssues:ke.initialize,addIssue:ke.addOne,addIssues:ke.addMany,setIssue:ke.setOne,setIssues:ke.setMany,updateIssue:ke.updateOne,updateIssues:ke.updateMany,deleteIssue:ke.deleteOne,deleteIssues:ke.deleteMany}}),{initializeIssues:sA,addIssue:iA,addIssues:Hn,setIssue:nA,setIssues:aA,updateIssue:cA,updateIssues:rA,deleteIssue:dA,deleteIssues:Gn}=Nn.actions,lA=t=>t.issueReducer.instances,Ws=o.createSelector([lA],t=>Object.values(t)),uA=t=>s=>s.issueReducer.instances[t],oA=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vB=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),hA=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),pA=Nn.reducer,Be=T(t=>t.uuid),yA={instances:{}},Kn=o.createSlice({name:"issueTypeAttachments",initialState:yA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,yA)),reducers:{initializeIssueTypeAttachments:Be.initialize,addIssueTypeAttachment:Be.addOne,addIssueTypeAttachments:Be.addMany,setIssueTypeAttachment:Be.setOne,setIssueTypeAttachments:Be.setMany,updateIssueTypeAttachment:Be.updateOne,updateIssueTypeAttachments:Be.updateMany,deleteIssueTypeAttachment:Be.deleteOne,deleteIssueTypeAttachments:Be.deleteMany}}),{initializeIssueTypeAttachments:SA,addIssueTypeAttachment:mA,addIssueTypeAttachments:fA,setIssueTypeAttachment:AA,setIssueTypeAttachments:wA,updateIssueTypeAttachment:PA,updateIssueTypeAttachments:OA,deleteIssueTypeAttachment:TA,deleteIssueTypeAttachments:IA}=Kn.actions,FA=t=>t.issueTypeAttachmentReducer.instances,Yn=o.createSelector([FA],t=>Object.values(t)),_A=t=>s=>s.issueTypeAttachmentReducer.instances[t],gA=m(o.createSelector([Yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),EB=m(o.createSelector([Yn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),RA=Kn.reducer,De=T(t=>t.uuid),bA={instances:{}},Qn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:bA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,bA)),reducers:{initializeIssueTypeFieldsAttachments:De.initialize,addIssueTypeFieldsAttachment:De.addOne,addIssueTypeFieldsAttachments:De.addMany,setIssueTypeFieldsAttachment:De.setOne,setIssueTypeFieldsAttachments:De.setMany,updateIssueTypeFieldsAttachment:De.updateOne,updateIssueTypeFieldsAttachments:De.updateMany,deleteIssueTypeFieldsAttachment:De.deleteOne,deleteIssueTypeFieldsAttachments:De.deleteMany}}),{initializeIssueTypeFieldsAttachments:MA,addIssueTypeFieldsAttachment:vA,addIssueTypeFieldsAttachments:EA,setIssueTypeFieldsAttachment:VA,setIssueTypeFieldsAttachments:kA,updateIssueTypeFieldsAttachment:BA,updateIssueTypeFieldsAttachments:DA,deleteIssueTypeFieldsAttachment:WA,deleteIssueTypeFieldsAttachments:zA}=Qn.actions,qA=t=>t.issueTypeFieldsAttachmentReducer.instances,Jn=o.createSelector([qA],t=>Object.values(t)),VB=m(o.createSelector([Jn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),jA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],$A=m(o.createSelector([Jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CA=Qn.reducer,We=T(t=>t.uuid),UA={instances:{}},Zn=o.createSlice({name:"issueTypeFieldValues",initialState:UA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,UA)),reducers:{initializeIssueTypeFieldValues:We.initialize,addIssueTypeFieldValues:We.addOne,addIssueTypeFieldValuesMany:We.addMany,setIssueTypeFieldValues:We.setOne,setIssueTypeFieldValuesMany:We.setMany,updateIssueTypeFieldValues:We.updateOne,updateIssueTypeFieldValuesMany:We.updateMany,deleteIssueTypeFieldValues:We.deleteOne,deleteIssueTypeFieldValuesMany:We.deleteMany}}),{initializeIssueTypeFieldValues:LA,addIssueTypeFieldValues:NA,addIssueTypeFieldValuesMany:HA,setIssueTypeFieldValues:GA,setIssueTypeFieldValuesMany:KA,updateIssueTypeFieldValues:YA,updateIssueTypeFieldValuesMany:QA,deleteIssueTypeFieldValues:JA,deleteIssueTypeFieldValuesMany:ZA}=Zn.actions,XA=t=>t.issueTypeFieldValuesReducer.instances,zs=o.createSelector([XA],t=>Object.values(t)),kB=m(o.createSelector([zs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),xA=t=>s=>s.issueTypeFieldValuesReducer.instances[t],ew=m(o.createSelector([zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tw=Zn.reducer,ze=T(t=>t.uuid),sw={instances:{}},Xn=o.createSlice({name:"issueTypeFields",initialState:sw,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,sw)),reducers:{initializeIssueTypeFields:ze.initialize,addIssueTypeFields:ze.addOne,addIssueTypeFieldsMany:ze.addMany,setIssueTypeFields:ze.setOne,setIssueTypeFieldsMany:ze.setMany,updateIssueTypeFields:ze.updateOne,updateIssueTypeFieldsMany:ze.updateMany,deleteIssueTypeFields:ze.deleteOne,deleteIssueTypeFieldsMany:ze.deleteMany}}),{initializeIssueTypeFields:iw,addIssueTypeFields:nw,addIssueTypeFieldsMany:aw,setIssueTypeFields:cw,setIssueTypeFieldsMany:rw,updateIssueTypeFields:dw,updateIssueTypeFieldsMany:lw,deleteIssueTypeFields:uw,deleteIssueTypeFieldsMany:ow}=Xn.actions,hw=t=>t.issueTypeFieldsReducer.instances,as=o.createSelector([hw],t=>Object.values(t)),BB=m(o.createSelector([as,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),DB=m(o.createSelector([as,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),WB=m(o.createSelector([as,zs,(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)))})),pw=t=>s=>s.issueTypeFieldsReducer.instances[t],yw=m(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Sw=Xn.reducer,qe=T(t=>t.uuid),mw={instances:{}},xn=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:mw,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,mw)),reducers:{initializeIssueTypeFieldValuesAttachments:qe.initialize,addIssueTypeFieldValuesAttachment:qe.addOne,addIssueTypeFieldValuesAttachments:qe.addMany,setIssueTypeFieldValuesAttachment:qe.setOne,setIssueTypeFieldValuesAttachments:qe.setMany,updateIssueTypeFieldValuesAttachment:qe.updateOne,updateIssueTypeFieldValuesAttachments:qe.updateMany,deleteIssueTypeFieldValuesAttachment:qe.deleteOne,deleteIssueTypeFieldValuesAttachments:qe.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:fw,addIssueTypeFieldValuesAttachment:Aw,addIssueTypeFieldValuesAttachments:ea,setIssueTypeFieldValuesAttachment:ww,setIssueTypeFieldValuesAttachments:Pw,updateIssueTypeFieldValuesAttachment:Ow,updateIssueTypeFieldValuesAttachments:Tw,deleteIssueTypeFieldValuesAttachment:Iw,deleteIssueTypeFieldValuesAttachments:ta}=xn.actions,Fw=t=>t.issueTypeFieldValuesAttachmentReducer.instances,sa=o.createSelector([Fw],t=>Object.values(t)),_w=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],gw=m(o.createSelector([sa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Rw=m(o.createSelector([sa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),bw=xn.reducer,je=T(t=>t.uuid),Mw={instances:{}},ia=o.createSlice({name:"issueTypeIdentifiers",initialState:Mw,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Mw)),reducers:{initializeIssueTypeIdentifiers:je.initialize,addIssueTypeIdentifier:je.addOne,addIssueTypeIdentifiers:je.addMany,setIssueTypeIdentifier:je.setOne,setIssueTypeIdentifiers:je.setMany,updateIssueTypeIdentifier:je.updateOne,updateIssueTypeIdentifiers:je.updateMany,deleteIssueTypeIdentifier:je.deleteOne,deleteIssueTypeIdentifiers:je.deleteMany}}),{initializeIssueTypeIdentifiers:vw,addIssueTypeIdentifier:Ew,addIssueTypeIdentifiers:Vw,setIssueTypeIdentifier:kw,setIssueTypeIdentifiers:Bw,updateIssueTypeIdentifier:Dw,updateIssueTypeIdentifiers:Ww,deleteIssueTypeIdentifier:zw,deleteIssueTypeIdentifiers:qw}=ia.actions,jw=t=>t.issueTypeIdentifierReducer.instances,na=o.createSelector([jw],t=>Object.values(t)),$w=t=>s=>s.issueTypeIdentifierReducer.instances[t],Cw=m(o.createSelector([na,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zB=m(o.createSelector([na,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),Uw=ia.reducer,$e=T(t=>t.uuid),Lw={instances:{}},aa=o.createSlice({name:"issueTypeIdentifierValues",initialState:Lw,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Lw)),reducers:{initializeIssueTypeIdentifierValues:$e.initialize,addIssueTypeIdentifierValue:$e.addOne,addIssueTypeIdentifierValues:$e.addMany,setIssueTypeIdentifierValue:$e.setOne,setIssueTypeIdentifierValues:$e.setMany,updateIssueTypeIdentifierValue:$e.updateOne,updateIssueTypeIdentifierValues:$e.updateMany,deleteIssueTypeIdentifierValue:$e.deleteOne,deleteIssueTypeIdentifierValues:$e.deleteMany}}),{initializeIssueTypeIdentifierValues:Nw,addIssueTypeIdentifierValue:Hw,addIssueTypeIdentifierValues:Gw,setIssueTypeIdentifierValue:Kw,setIssueTypeIdentifierValues:Yw,updateIssueTypeIdentifierValue:Qw,updateIssueTypeIdentifierValues:Jw,deleteIssueTypeIdentifierValue:Zw,deleteIssueTypeIdentifierValues:Xw}=aa.actions,xw=t=>t.issueTypeIdentifierValueReducer.instances,qs=o.createSelector([xw],t=>Object.values(t)),eP=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],tP=m(o.createSelector([qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qB=m(o.createSelector([qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),jB=m(o.createSelector([qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),sP=aa.reducer,Ce=T(t=>t.uuid),iP={instances:{}},ca=o.createSlice({name:"issueTypes",initialState:iP,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,iP)),reducers:{initializeIssueTypes:Ce.initialize,addIssueType:Ce.addOne,addIssueTypes:Ce.addMany,setIssueType:Ce.setOne,setIssueTypes:Ce.setMany,updateIssueType:Ce.updateOne,updateIssueTypes:Ce.updateMany,deleteIssueType:Ce.deleteOne,deleteIssueTypes:Ce.deleteMany}}),{initializeIssueTypes:nP,addIssueType:aP,addIssueTypes:cP,setIssueType:rP,setIssueTypes:dP,updateIssueType:lP,updateIssueTypes:uP,deleteIssueType:oP,deleteIssueTypes:hP}=ca.actions,pP=t=>t.issueTypeReducer.instances,ra=o.createSelector(pP,t=>Object.values(t)),yP=t=>s=>s.issueTypeReducer.instances[t],SP=m(o.createSelector([ra,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$B=m(o.createSelector([ra,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),mP=ca.reducer,Ue=T(t=>t.uuid),fP={instances:{}},da=o.createSlice({name:"issueTypeStatuses",initialState:fP,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,fP)),reducers:{initializeIssueTypeStatuses:Ue.initialize,addIssueTypeStatus:Ue.addOne,addIssueTypeStatuses:Ue.addMany,setIssueTypeStatus:Ue.setOne,setIssueTypeStatuses:Ue.setMany,updateIssueTypeStatus:Ue.updateOne,updateIssueTypeStatuses:Ue.updateMany,deleteIssueTypeStatus:Ue.deleteOne,deleteIssueTypeStatuses:Ue.deleteMany}}),{initializeIssueTypeStatuses:AP,addIssueTypeStatus:wP,addIssueTypeStatuses:PP,setIssueTypeStatus:OP,setIssueTypeStatuses:TP,updateIssueTypeStatus:IP,updateIssueTypeStatuses:FP,deleteIssueTypeStatus:_P,deleteIssueTypeStatuses:gP}=da.actions,RP=t=>t.issueTypeStatusReducer.instances,la=o.createSelector([RP],t=>A(Object.values(t).toSorted(Mr))),ua=t=>s=>s.issueTypeStatusReducer.instances[t],bP=m(o.createSelector([la,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CB=m(o.createSelector([la,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),MP=da.reducer,Le=T(t=>t.uuid),vP={instances:{}},oa=o.createSlice({name:"issueUpdates",initialState:vP,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,vP)),reducers:{initializeIssueUpdates:Le.initialize,addIssueUpdate:Le.addOne,addIssueUpdates:Le.addMany,setIssueUpdate:Le.setOne,setIssueUpdates:Le.setMany,updateIssueUpdate:Le.updateOne,updateIssueUpdates:Le.updateMany,deleteIssueUpdate:Le.deleteOne,deleteIssueUpdates:Le.deleteMany}}),{initializeIssueUpdates:EP,addIssueUpdate:ha,addIssueUpdates:pa,setIssueUpdate:VP,setIssueUpdates:kP,updateIssueUpdate:BP,updateIssueUpdates:DP,deleteIssueUpdate:ya,deleteIssueUpdates:Sa}=oa.actions,ma=t=>t.issueUpdateReducer.instances,fa=o.createSelector([ma],t=>Object.values(t)),WP=m(o.createSelector([ma,(t,s)=>s],(t,s)=>t[s])),zP=m(o.createSelector([fa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qP=m(o.createSelector([fa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),jP=oa.reducer,Ne=T(t=>t.id),$P={instances:{},currentUser:null},Aa=o.createSlice({name:"users",initialState:$P,extraReducers:t=>t.addCase(O,s=>Object.assign(s,$P)).addCase(I,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ne.initialize,setUsers:Ne.setMany,setUser:Ne.setOne,addUsers:Ne.addMany,addUser:Ne.addOne,updateUsers:Ne.updateMany,updateUser:Ne.updateOne,deleteUser:Ne.deleteOne,deleteUsers:Ne.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:CP,setUsers:UP,setUser:LP,addUsers:NP,addUser:wa,updateUsers:HP,updateUser:GP,deleteUser:Pa,deleteUsers:KP,setCurrentUser:UB,setCurrentUserProfile:LB}=Aa.actions,YP=Aa.reducer,QP=t=>t.userReducer.currentUser,Oa=t=>t.userReducer.instances,js=o.createSelector([Oa],t=>Object.values(t)),$s=t=>s=>s.userReducer.instances[t],JP=m(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),He=T(t=>t.uuid),ZP={instances:{}},Ta=o.createSlice({name:"organizationAccess",initialState:ZP,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,ZP)),reducers:{initializeOrganizationAccesses:He.initialize,addOrganizationAccess:He.addOne,addOrganizationAccesses:He.addMany,setOrganizationAccess:He.setOne,setOrganizationAccesses:He.setMany,updateOrganizationAccess:He.updateOne,updateOrganizationAccesses:He.updateMany,deleteOrganizationAccess:He.deleteOne,deleteOrganizationAccesses:He.deleteMany}}),{initializeOrganizationAccesses:XP,addOrganizationAccess:xP,addOrganizationAccesses:eO,setOrganizationAccess:tO,setOrganizationAccesses:sO,updateOrganizationAccess:iO,updateOrganizationAccesses:nO,deleteOrganizationAccess:aO,deleteOrganizationAccesses:cO}=Ta.actions,rO=Ta.reducer,Cs=t=>t.organizationAccessReducer.instances,dO=t=>s=>s.organizationAccessReducer.instances[t],lO=m(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),NB=o.createSelector([QP,Cs],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),uO=o.createSelector([Cs],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return ss(s)}),HB=m(o.createSelector([Oa,uO,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ge=T(t=>t.uuid),oO={instances:{}},Ia=o.createSlice({name:"organizations",initialState:oO,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,oO)),reducers:{initializeOrganizations:Ge.initialize,setOrganizations:Ge.setMany,setOrganization:Ge.setOne,addOrganizations:Ge.addMany,addOrganization:Ge.addOne,updateOrganizations:Ge.updateMany,updateOrganization:Ge.updateOne,deleteOrganization:Ge.deleteOne,deleteOrganizations:Ge.deleteMany}}),{initializeOrganizations:hO,setOrganizations:pO,setOrganization:yO,addOrganizations:SO,addOrganization:mO,updateOrganizations:fO,updateOrganization:AO,deleteOrganization:wO,deleteOrganizations:PO}=Ia.actions,OO=t=>t.organizationReducer.instances,TO=o.createSelector([OO],t=>Object.values(t)),IO=t=>s=>s.organizationReducer.instances[t],FO=m(o.createSelector([TO,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_O=Ia.reducer,gO=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:Dt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},RO={deletedRequests:[],latestRetryTime:0},Fa=o.createSlice({name:"outbox",initialState:RO,extraReducers:t=>t.addCase(O,s=>Object.assign(s,RO)),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 gO(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}}}),GB=t=>t.outboxReducer.deletedRequests,KB=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:bO,markForDeletion:YB,markAsDeleted:MO,_setLatestRetryTime:vO}=Fa.actions,EO=Fa.reducer,Ke=T(t=>t.uuid),VO={instances:{}},_a=o.createSlice({name:"projectAccess",initialState:VO,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,VO)),reducers:{initializeProjectAccesses:Ke.initialize,addProjectAccess:Ke.addOne,addProjectAccesses:Ke.addMany,setProjectAccess:Ke.setOne,setProjectAccesses:Ke.setMany,updateProjectAccess:Ke.updateOne,updateProjectAccesses:Ke.updateMany,deleteProjectAccess:Ke.deleteOne,deleteProjectAccesses:Ke.deleteMany}}),{initializeProjectAccesses:kO,addProjectAccess:BO,addProjectAccesses:DO,setProjectAccess:WO,setProjectAccesses:zO,updateProjectAccess:qO,updateProjectAccesses:jO,deleteProjectAccess:$O,deleteProjectAccesses:CO}=_a.actions,UO=_a.reducer,ga=t=>t.projectAccessReducer.instances,cs=o.createSelector(ga,t=>Object.values(t)),LO=t=>s=>s.projectAccessReducer.instances[t],NO=m(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QB=m(o.createSelector([ga,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),JB=m(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),ZB=m(o.createSelector([js,cs,(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)))})),Ye=T(t=>t.uuid),HO={instances:{}},Ra=o.createSlice({name:"projectAttachments",initialState:HO,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,HO)),reducers:{initializeProjectAttachments:Ye.initialize,addProjectAttachment:Ye.addOne,addProjectAttachments:Ye.addMany,setProjectAttachment:Ye.setOne,setProjectAttachments:Ye.setMany,updateProjectAttachment:Ye.updateOne,updateProjectAttachments:Ye.updateMany,deleteProjectAttachment:Ye.deleteOne,deleteProjectAttachments:Ye.deleteMany}}),{initializeProjectAttachments:GO,addProjectAttachment:KO,addProjectAttachments:YO,setProjectAttachment:QO,setProjectAttachments:JO,updateProjectAttachment:ZO,updateProjectAttachments:XO,deleteProjectAttachment:xO,deleteProjectAttachments:eT}=Ra.actions,tT=t=>t.projectAttachmentReducer.instances,ba=o.createSelector([tT],t=>Object.values(t)),sT=t=>s=>s.projectAttachmentReducer.instances[t],iT=m(o.createSelector([ba,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XB=m(o.createSelector([ba,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),nT=Ra.reducer,Qe=T(t=>t.uuid),aT={instances:{}},Ma=o.createSlice({name:"projectFiles",initialState:aT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,aT)),reducers:{initializeProjectFiles:Qe.initialize,setProjectFile:Qe.setOne,setProjectFiles:Qe.setMany,addProjectFile:Qe.addOne,addProjectFiles:Qe.addMany,updateProjectFile:Qe.updateOne,updateProjectFiles:Qe.updateMany,deleteProjectFile:Qe.deleteOne,deleteProjectFiles:Qe.deleteMany}}),{initializeProjectFiles:cT,setProjectFile:rT,setProjectFiles:dT,addProjectFile:lT,addProjectFiles:uT,updateProjectFile:oT,updateProjectFiles:hT,deleteProjectFile:pT,deleteProjectFiles:yT}=Ma.actions,ST=t=>t.projectFileReducer.instances,mT=o.createSelector([ST],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),fT=t=>s=>s.projectFileReducer.instances[t],AT=m(o.createSelector([mT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wT=Ma.reducer,Je=T(t=>t.uuid),PT={instances:{}},va=o.createSlice({name:"projects",initialState:PT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,PT)),reducers:{initializeProjects:Je.initialize,setProjects:Je.setMany,setProject:Je.setOne,addProjects:Je.addMany,addProject:Je.addOne,updateProjects:Je.updateMany,updateProject:Je.updateOne,deleteProject:Je.deleteOne,deleteProjects:Je.deleteMany}}),{initializeProjects:OT,setProjects:TT,setProject:IT,addProjects:FT,addProject:_T,updateProjects:gT,updateProject:RT,deleteProject:bT,deleteProjects:MT}=va.actions,vT=va.reducer,ET=t=>t.projectReducer.instances,Us=o.createSelector([ET],t=>Object.values(t)),VT=t=>s=>s.projectReducer.instances[t],kT=m(o.createSelector([Us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xB=m(o.createSelector([Us,cs,(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)))})),eD=m(o.createSelector([Us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Ze=T(({uuid:t})=>t),BT={instances:{}},Ea=o.createSlice({name:"procedures",initialState:BT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,BT)),reducers:{initializeProcedures:Ze.initialize,addProcedure:Ze.addOne,addProcedures:Ze.addMany,setProcedure:Ze.setOne,setProcedures:Ze.setMany,updateProcedure:Ze.updateOne,updateProcedures:Ze.updateMany,deleteProcedure:Ze.deleteOne,deleteProcedures:Ze.deleteMany}}),{initializeProcedures:DT,addProcedure:WT,addProcedures:Va,setProcedure:zT,setProcedures:qT,updateProcedure:jT,updateProcedures:$T,deleteProcedure:CT,deleteProcedures:ka}=Ea.actions,UT=Ea.reducer,LT=t=>t.procedureReducer.instances,Gt=o.createSelector([LT],t=>Object.values(t)),NT=t=>s=>s.procedureReducer.instances[t],HT=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tD=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),GT=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),sD=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),iD=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),Xe=T(t=>t.uuid),KT={instances:{}},Ba=o.createSlice({name:"procedureStepAssignees",initialState:KT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,KT)),reducers:{initializeProcedureStepAssignees:Xe.initialize,addProcedureStepAssignee:Xe.addOne,addProcedureStepAssignees:Xe.addMany,setProcedureStepAssignee:Xe.setOne,setProcedureStepAssignees:Xe.setMany,updateProcedureStepAssignee:Xe.updateOne,updateProcedureStepAssignees:Xe.updateMany,deleteProcedureStepAssignee:Xe.deleteOne,deleteProcedureStepAssignees:Xe.deleteMany}}),{initializeProcedureStepAssignees:YT,addProcedureStepAssignee:QT,addProcedureStepAssignees:JT,setProcedureStepAssignee:ZT,setProcedureStepAssignees:XT,updateProcedureStepAssignee:xT,updateProcedureStepAssignees:eI,deleteProcedureStepAssignee:tI,deleteProcedureStepAssignees:sI}=Ba.actions,iI=t=>t.procedureStepAssigneeReducer.instances,rs=o.createSelector([iI],t=>Object.values(t)),nI=t=>s=>s.procedureStepAssigneeReducer.instances[t],aI=m(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nD=m(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),aD=m(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),cD=m(o.createSelector([rs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),cI=Ba.reducer,xe=T(t=>t.uuid),rI={instances:{}},Da=o.createSlice({name:"procedureStepComments",initialState:rI,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,rI)),reducers:{initializeProcedureStepComments:xe.initialize,addProcedureStepComment:xe.addOne,addProcedureStepComments:xe.addMany,setProcedureStepComment:xe.setOne,setProcedureStepComments:xe.setMany,updateProcedureStepComment:xe.updateOne,updateProcedureStepComments:xe.updateMany,deleteProcedureStepComment:xe.deleteOne,deleteProcedureStepComments:xe.deleteMany}}),{initializeProcedureStepComments:dI,addProcedureStepComment:lI,addProcedureStepComments:uI,setProcedureStepComment:oI,setProcedureStepComments:hI,updateProcedureStepComment:pI,updateProcedureStepComments:yI,deleteProcedureStepComment:SI,deleteProcedureStepComments:mI}=Da.actions,fI=t=>t.procedureStepCommentReducer.instances,ds=o.createSelector([fI],t=>Object.values(t)),AI=t=>s=>s.procedureStepCommentReducer.instances[t],wI=m(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rD=m(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),dD=m(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),lD=m(o.createSelector([ds,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),PI=Da.reducer,et=T(t=>t.uuid),OI={instances:{}},Wa=o.createSlice({name:"procedureStepDefaultAssignees",initialState:OI,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,OI)),reducers:{initializeProcedureStepDefaultAssignees:et.initialize,addProcedureStepDefaultAssignee:et.addOne,addProcedureStepDefaultAssignees:et.addMany,setProcedureStepDefaultAssignee:et.setOne,setProcedureStepDefaultAssignees:et.setMany,updateProcedureStepDefaultAssignee:et.updateOne,updateProcedureStepDefaultAssignees:et.updateMany,deleteProcedureStepDefaultAssignee:et.deleteOne,deleteProcedureStepDefaultAssignees:et.deleteMany}}),{initializeProcedureStepDefaultAssignees:TI,addProcedureStepDefaultAssignee:II,addProcedureStepDefaultAssignees:FI,setProcedureStepDefaultAssignee:_I,setProcedureStepDefaultAssignees:gI,updateProcedureStepDefaultAssignee:RI,updateProcedureStepDefaultAssignees:bI,deleteProcedureStepDefaultAssignee:MI,deleteProcedureStepDefaultAssignees:vI}=Wa.actions,EI=t=>t.procedureStepDefaultAssigneeReducer.instances,za=o.createSelector([EI],t=>Object.values(t)),VI=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],kI=m(o.createSelector([za,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uD=m(o.createSelector([za,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),BI=Wa.reducer,tt=T(t=>t.uuid),DI={instances:{}},qa=o.createSlice({name:"procedureStepDefaultReviewers",initialState:DI,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,DI)),reducers:{initializeProcedureStepDefaultReviewers:tt.initialize,addProcedureStepDefaultReviewer:tt.addOne,addProcedureStepDefaultReviewers:tt.addMany,setProcedureStepDefaultReviewer:tt.setOne,setProcedureStepDefaultReviewers:tt.setMany,updateProcedureStepDefaultReviewer:tt.updateOne,updateProcedureStepDefaultReviewers:tt.updateMany,deleteProcedureStepDefaultReviewer:tt.deleteOne,deleteProcedureStepDefaultReviewers:tt.deleteMany}}),{initializeProcedureStepDefaultReviewers:WI,addProcedureStepDefaultReviewer:zI,addProcedureStepDefaultReviewers:qI,setProcedureStepDefaultReviewer:jI,setProcedureStepDefaultReviewers:$I,updateProcedureStepDefaultReviewer:CI,updateProcedureStepDefaultReviewers:UI,deleteProcedureStepDefaultReviewer:LI,deleteProcedureStepDefaultReviewers:NI}=qa.actions,HI=t=>t.procedureStepDefaultReviewerReducer.instances,ja=o.createSelector([HI],t=>Object.values(t)),GI=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],KI=m(o.createSelector([ja,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),oD=m(o.createSelector([ja,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),YI=qa.reducer,st=T(t=>t.uuid),QI={instances:{}},$a=o.createSlice({name:"procedureStepEvents",initialState:QI,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,QI)),reducers:{initializeProcedureStepEvents:st.initialize,addProcedureStepEvent:st.addOne,addProcedureStepEvents:st.addMany,setProcedureStepEvent:st.setOne,setProcedureStepEvents:st.setMany,updateProcedureStepEvent:st.updateOne,updateProcedureStepEvents:st.updateMany,deleteProcedureStepEvent:st.deleteOne,deleteProcedureStepEvents:st.deleteMany}}),{initializeProcedureStepEvents:JI,addProcedureStepEvent:ZI,addProcedureStepEvents:XI,setProcedureStepEvent:xI,setProcedureStepEvents:eF,updateProcedureStepEvent:tF,updateProcedureStepEvents:sF,deleteProcedureStepEvent:iF,deleteProcedureStepEvents:nF}=$a.actions,aF=t=>t.procedureStepEventReducer.instances,ls=o.createSelector([aF],t=>Object.values(t)),cF=t=>s=>s.procedureStepEventReducer.instances[t],rF=m(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hD=m(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),pD=m(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),yD=m(o.createSelector([ls,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),dF=$a.reducer,it=T(t=>t.uuid),lF={instances:{}},Ca=o.createSlice({name:"procedureStepFieldsAttachments",initialState:lF,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,lF)),reducers:{initializeProcedureStepFieldsAttachments:it.initialize,addProcedureStepFieldsAttachment:it.addOne,addProcedureStepFieldsAttachments:it.addMany,setProcedureStepFieldsAttachment:it.setOne,setProcedureStepFieldsAttachments:it.setMany,updateProcedureStepFieldsAttachment:it.updateOne,updateProcedureStepFieldsAttachments:it.updateMany,deleteProcedureStepFieldsAttachment:it.deleteOne,deleteProcedureStepFieldsAttachments:it.deleteMany}}),{initializeProcedureStepFieldsAttachments:uF,addProcedureStepFieldsAttachment:oF,addProcedureStepFieldsAttachments:Ua,setProcedureStepFieldsAttachment:hF,setProcedureStepFieldsAttachments:pF,updateProcedureStepFieldsAttachment:yF,updateProcedureStepFieldsAttachments:SF,deleteProcedureStepFieldsAttachment:mF,deleteProcedureStepFieldsAttachments:La}=Ca.actions,fF=t=>t.procedureStepFieldsAttachmentReducer.instances,Na=o.createSelector([fF],t=>Object.values(t)),AF=m(o.createSelector([Na,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),wF=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],PF=m(o.createSelector([Na,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OF=Ca.reducer,nt=T(t=>t.uuid),TF={instances:{}},Ha=o.createSlice({name:"procedureStepFields",initialState:TF,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,TF)),reducers:{initializeProcedureStepFields:nt.initialize,addProcedureStepFields:nt.addOne,addProcedureStepFieldsMany:nt.addMany,setProcedureStepFields:nt.setOne,setProcedureStepFieldsMany:nt.setMany,updateProcedureStepFields:nt.updateOne,updateProcedureStepFieldsMany:nt.updateMany,deleteProcedureStepFields:nt.deleteOne,deleteProcedureStepFieldsMany:nt.deleteMany}}),{initializeProcedureStepFields:IF,addProcedureStepFields:FF,addProcedureStepFieldsMany:_F,setProcedureStepFields:gF,setProcedureStepFieldsMany:RF,updateProcedureStepFields:bF,updateProcedureStepFieldsMany:MF,deleteProcedureStepFields:vF,deleteProcedureStepFieldsMany:EF}=Ha.actions,Ga=t=>t.procedureStepFieldsReducer.instances,Ls=o.createSelector([Ga],t=>Object.values(t)),SD=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),mD=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),fD=o.createSelector([Ga],t=>{const s={};for(const e of Object.values(t)){const n=s[e.procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.procedure_step]=e)}return s}),VF=t=>s=>s.procedureStepFieldsReducer.instances[t],kF=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BF=Ha.reducer,at=T(t=>t.uuid),DF={instances:{}},Ka=o.createSlice({name:"procedureStepFieldValuesAttachments",initialState:DF,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,DF)),reducers:{initializeProcedureStepFieldValuesAttachments:at.initialize,addProcedureStepFieldValuesAttachment:at.addOne,addProcedureStepFieldValuesAttachments:at.addMany,setProcedureStepFieldValuesAttachment:at.setOne,setProcedureStepFieldValuesAttachments:at.setMany,updateProcedureStepFieldValuesAttachment:at.updateOne,updateProcedureStepFieldValuesAttachments:at.updateMany,deleteProcedureStepFieldValuesAttachment:at.deleteOne,deleteProcedureStepFieldValuesAttachments:at.deleteMany}}),{initializeProcedureStepFieldValuesAttachments:WF,addProcedureStepFieldValuesAttachment:zF,addProcedureStepFieldValuesAttachments:Ya,setProcedureStepFieldValuesAttachment:qF,setProcedureStepFieldValuesAttachments:jF,updateProcedureStepFieldValuesAttachment:$F,updateProcedureStepFieldValuesAttachments:CF,deleteProcedureStepFieldValuesAttachment:UF,deleteProcedureStepFieldValuesAttachments:Qa}=Ka.actions,LF=t=>t.procedureStepFieldValuesAttachmentReducer.instances,Ja=o.createSelector([LF],t=>Object.values(t)),NF=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],HF=m(o.createSelector([Ja,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GF=m(o.createSelector([Ja,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),KF=Ka.reducer,ct=T(t=>t.uuid),YF={instances:{}},Za=o.createSlice({name:"procedureStepFieldValues",initialState:YF,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,YF)),reducers:{initializeProcedureStepFieldValues:ct.initialize,addProcedureStepFieldValues:ct.addOne,addProcedureStepFieldValuesMany:ct.addMany,setProcedureStepFieldValues:ct.setOne,setProcedureStepFieldValuesMany:ct.setMany,updateProcedureStepFieldValues:ct.updateOne,updateProcedureStepFieldValuesMany:ct.updateMany,deleteProcedureStepFieldValues:ct.deleteOne,deleteProcedureStepFieldValuesMany:ct.deleteMany}}),{initializeProcedureStepFieldValues:QF,addProcedureStepFieldValues:JF,addProcedureStepFieldValuesMany:ZF,setProcedureStepFieldValues:XF,setProcedureStepFieldValuesMany:xF,updateProcedureStepFieldValues:e_,updateProcedureStepFieldValuesMany:t_,deleteProcedureStepFieldValues:s_,deleteProcedureStepFieldValuesMany:i_}=Za.actions,n_=t=>t.procedureStepFieldValuesReducer.instances,Wt=o.createSelector([n_],t=>Object.values(t)),AD=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),wD=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),a_=t=>s=>s.procedureStepFieldValuesReducer.instances[t],c_=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),PD=m(o.createSelector([Wt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),OD=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{procedure:a,procedure_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),r_=Za.reducer,rt=T(t=>t.uuid),d_={instances:{}},Xa=o.createSlice({name:"procedureStepFieldValuesReviewRequests",initialState:d_,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,d_)),reducers:{initializeProcedureStepFieldValuesReviewRequests:rt.initialize,addProcedureStepFieldValuesReviewRequest:rt.addOne,addProcedureStepFieldValuesReviewRequests:rt.addMany,setProcedureStepFieldValuesReviewRequest:rt.setOne,setProcedureStepFieldValuesReviewRequests:rt.setMany,updateProcedureStepFieldValuesReviewRequest:rt.updateOne,updateProcedureStepFieldValuesReviewRequests:rt.updateMany,deleteProcedureStepFieldValuesReviewRequest:rt.deleteOne,deleteProcedureStepFieldValuesReviewRequests:rt.deleteMany}}),{initializeProcedureStepFieldValuesReviewRequests:l_,addProcedureStepFieldValuesReviewRequest:u_,addProcedureStepFieldValuesReviewRequests:xa,setProcedureStepFieldValuesReviewRequest:o_,setProcedureStepFieldValuesReviewRequests:h_,updateProcedureStepFieldValuesReviewRequest:p_,updateProcedureStepFieldValuesReviewRequests:y_,deleteProcedureStepFieldValuesReviewRequest:S_,deleteProcedureStepFieldValuesReviewRequests:ec}=Xa.actions,m_=t=>t.procedureStepFieldValuesReviewRequestReducer.instances,us=o.createSelector([m_],t=>Object.values(t)),f_=t=>s=>s.procedureStepFieldValuesReviewRequestReducer.instances[t],A_=m(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),w_=m(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),TD=m(o.createSelector([us,(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})),ID=m(o.createSelector([Wt,us,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({procedure_step:c,procedure:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),P_=Xa.reducer,dt=T(t=>t.uuid),O_={instances:{}},tc=o.createSlice({name:"procedureStepFieldValuesReviews",initialState:O_,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,O_)),reducers:{initializeProcedureStepFieldValuesReviews:dt.initialize,addProcedureStepFieldValuesReview:dt.addOne,addProcedureStepFieldValuesReviews:dt.addMany,setProcedureStepFieldValuesReview:dt.setOne,setProcedureStepFieldValuesReviews:dt.setMany,updateProcedureStepFieldValuesReview:dt.updateOne,updateProcedureStepFieldValuesReviews:dt.updateMany,deleteProcedureStepFieldValuesReview:dt.deleteOne,deleteProcedureStepFieldValuesReviews:dt.deleteMany}}),{initializeProcedureStepFieldValuesReviews:T_,addProcedureStepFieldValuesReview:I_,addProcedureStepFieldValuesReviews:sc,setProcedureStepFieldValuesReview:F_,setProcedureStepFieldValuesReviews:__,updateProcedureStepFieldValuesReview:g_,updateProcedureStepFieldValuesReviews:R_,deleteProcedureStepFieldValuesReview:b_,deleteProcedureStepFieldValuesReviews:ic}=tc.actions,M_=t=>t.procedureStepFieldValuesReviewReducer.instances,Kt=o.createSelector([M_],t=>Object.values(t)),v_=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],E_=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),V_=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),FD=m(o.createSelector([Kt,(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})),_D=m(o.createSelector([Wt,Kt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({procedure_step:c,procedure:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),gD=o.createSelector([Kt],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}),k_=tc.reducer,lt=T(t=>t.uuid),B_={instances:{}},nc=o.createSlice({name:"procedureStepReviewers",initialState:B_,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,B_)),reducers:{initializeProcedureStepReviewers:lt.initialize,addProcedureStepReviewer:lt.addOne,addProcedureStepReviewers:lt.addMany,setProcedureStepReviewer:lt.setOne,setProcedureStepReviewers:lt.setMany,updateProcedureStepReviewer:lt.updateOne,updateProcedureStepReviewers:lt.updateMany,deleteProcedureStepReviewer:lt.deleteOne,deleteProcedureStepReviewers:lt.deleteMany}}),{initializeProcedureStepReviewers:D_,addProcedureStepReviewer:W_,addProcedureStepReviewers:z_,setProcedureStepReviewer:q_,setProcedureStepReviewers:j_,updateProcedureStepReviewer:$_,updateProcedureStepReviewers:C_,deleteProcedureStepReviewer:U_,deleteProcedureStepReviewers:L_}=nc.actions,N_=t=>t.procedureStepReviewerReducer.instances,os=o.createSelector([N_],t=>Object.values(t)),H_=t=>s=>s.procedureStepReviewerReducer.instances[t],G_=m(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),RD=m(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),bD=m(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),MD=m(o.createSelector([os,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),K_=nc.reducer,ut=T(t=>t.uuid),Y_={instances:{}},ac=o.createSlice({name:"procedureSteps",initialState:Y_,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Y_)),reducers:{initializeProcedureSteps:ut.initialize,setProcedureStep:ut.setOne,setProcedureSteps:ut.setMany,addProcedureStep:ut.addOne,addProcedureSteps:ut.addMany,updateProcedureStep:ut.updateOne,updateProcedureSteps:ut.updateMany,deleteProcedureStep:ut.deleteOne,deleteProcedureSteps:ut.deleteMany}}),{initializeProcedureSteps:Q_,setProcedureStep:J_,setProcedureSteps:Z_,addProcedureStep:X_,addProcedureSteps:x_,updateProcedureStep:eg,updateProcedureSteps:tg,deleteProcedureStep:sg,deleteProcedureSteps:ig}=ac.actions,ng=ac.reducer,cc=t=>t.procedureStepReducer.instances,ag=t=>s=>s.procedureStepReducer.instances[t],rc=o.createSelector([cc],t=>Object.values(t)),vD=m(o.createSelector([cc,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.procedure_type===s&&(e[n]=a);return ss(e)})),ED=m(o.createSelector([rc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),cg=m(o.createSelector([rc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ot=T(({uuid:t})=>t),rg={instances:{}},dc=o.createSlice({name:"procedureTypeAttachments",initialState:rg,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,rg)),reducers:{initializeProcedureTypeAttachments:ot.initialize,addProcedureTypeAttachment:ot.addOne,addProcedureTypeAttachments:ot.addMany,setProcedureTypeAttachment:ot.setOne,setProcedureTypeAttachments:ot.setMany,updateProcedureTypeAttachment:ot.updateOne,updateProcedureTypeAttachments:ot.updateMany,deleteProcedureTypeAttachment:ot.deleteOne,deleteProcedureTypeAttachments:ot.deleteMany}}),{initializeProcedureTypeAttachments:dg,addProcedureTypeAttachment:lg,addProcedureTypeAttachments:ug,setProcedureTypeAttachment:og,setProcedureTypeAttachments:hg,updateProcedureTypeAttachment:pg,updateProcedureTypeAttachments:yg,deleteProcedureTypeAttachment:Sg,deleteProcedureTypeAttachments:mg}=dc.actions,fg=dc.reducer,Ag=t=>t.procedureTypeAttachmentReducer.instances,lc=o.createSelector([Ag],t=>Object.values(t)),wg=t=>s=>s.procedureTypeAttachmentReducer.instances[t],Pg=m(o.createSelector([lc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VD=m(o.createSelector([lc,(t,s)=>s],(t,s)=>A(t.filter(({procedure_type:e})=>s===e)))),ht=T(({uuid:t})=>t),Og={instances:{}},uc=o.createSlice({name:"procedureTypeFieldsAttachments",initialState:Og,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Og)),reducers:{initializeProcedureTypeFieldsAttachments:ht.initialize,addProcedureTypeFieldsAttachment:ht.addOne,addProcedureTypeFieldsAttachments:ht.addMany,setProcedureTypeFieldsAttachment:ht.setOne,setProcedureTypeFieldsAttachments:ht.setMany,updateProcedureTypeFieldsAttachment:ht.updateOne,updateProcedureTypeFieldsAttachments:ht.updateMany,deleteProcedureTypeFieldsAttachment:ht.deleteOne,deleteProcedureTypeFieldsAttachments:ht.deleteMany}}),{initializeProcedureTypeFieldsAttachments:Tg,addProcedureTypeFieldsAttachment:Ig,addProcedureTypeFieldsAttachments:Fg,setProcedureTypeFieldsAttachment:_g,setProcedureTypeFieldsAttachments:gg,updateProcedureTypeFieldsAttachment:Rg,updateProcedureTypeFieldsAttachments:bg,deleteProcedureTypeFieldsAttachment:Mg,deleteProcedureTypeFieldsAttachments:vg}=uc.actions,Eg=uc.reducer,Vg=t=>t.procedureTypeFieldsAttachmentReducer.instances,oc=o.createSelector([Vg],t=>Object.values(t)),kD=m(o.createSelector([oc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),kg=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],Bg=m(o.createSelector([oc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pt=T(({uuid:t})=>t),Dg={instances:{}},hc=o.createSlice({name:"procedureTypeFields",initialState:Dg,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,Dg)),reducers:{initializeProcedureTypeFields:pt.initialize,addProcedureTypeFields:pt.addOne,addProcedureTypeFieldsMany:pt.addMany,setProcedureTypeFields:pt.setOne,setProcedureTypeFieldsMany:pt.setMany,updateProcedureTypeFields:pt.updateOne,updateProcedureTypeFieldsMany:pt.updateMany,deleteProcedureTypeFields:pt.deleteOne,deleteProcedureTypeFieldsMany:pt.deleteMany}}),{initializeProcedureTypeFields:Wg,addProcedureTypeFields:zg,addProcedureTypeFieldsMany:qg,setProcedureTypeFields:jg,setProcedureTypeFieldsMany:$g,updateProcedureTypeFields:Cg,updateProcedureTypeFieldsMany:Ug,deleteProcedureTypeFields:Lg,deleteProcedureTypeFieldsMany:Ng}=hc.actions,Hg=hc.reducer,Gg=t=>t.procedureTypeFieldsReducer.instances,Ns=o.createSelector([Gg],t=>Object.values(t)),BD=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),DD=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Kg=t=>s=>s.procedureTypeFieldsReducer.instances[t],Yg=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yt=T(({uuid:t})=>t),Qg={instances:{}},pc=o.createSlice({name:"procedureFieldValuesAttachments",initialState:Qg,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Qg)),reducers:{initializeProcedureFieldValuesAttachments:yt.initialize,addProcedureFieldValuesAttachment:yt.addOne,addProcedureFieldValuesAttachments:yt.addMany,setProcedureFieldValuesAttachment:yt.setOne,setProcedureFieldValuesAttachments:yt.setMany,updateProcedureFieldValuesAttachment:yt.updateOne,updateProcedureFieldValuesAttachments:yt.updateMany,deleteProcedureFieldValuesAttachment:yt.deleteOne,deleteProcedureFieldValuesAttachments:yt.deleteMany}}),{initializeProcedureFieldValuesAttachments:Jg,addProcedureFieldValuesAttachment:Zg,addProcedureFieldValuesAttachments:yc,setProcedureFieldValuesAttachment:Xg,setProcedureFieldValuesAttachments:xg,updateProcedureFieldValuesAttachment:eR,updateProcedureFieldValuesAttachments:tR,deleteProcedureFieldValuesAttachment:sR,deleteProcedureFieldValuesAttachments:Sc}=pc.actions,iR=pc.reducer,nR=t=>t.procedureFieldValuesAttachmentReducer.instances,mc=o.createSelector([nR],t=>Object.values(t)),aR=t=>s=>s.procedureFieldValuesAttachmentReducer.instances[t],cR=m(o.createSelector([mc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rR=m(o.createSelector([mc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),St=T(({uuid:t})=>t),dR={instances:{}},fc=o.createSlice({name:"procedureFieldValues",initialState:dR,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,dR)),reducers:{initializeProcedureFieldValues:St.initialize,addProcedureFieldValues:St.addOne,addProcedureFieldValuesMany:St.addMany,setProcedureFieldValues:St.setOne,setProcedureFieldValuesMany:St.setMany,updateProcedureFieldValues:St.updateOne,updateProcedureFieldValuesMany:St.updateMany,deleteProcedureFieldValues:St.deleteOne,deleteProcedureFieldValuesMany:St.deleteMany}}),{initializeProcedureFieldValues:lR,addProcedureFieldValues:uR,addProcedureFieldValuesMany:oR,setProcedureFieldValues:hR,setProcedureFieldValuesMany:pR,updateProcedureFieldValues:yR,updateProcedureFieldValuesMany:SR,deleteProcedureFieldValues:mR,deleteProcedureFieldValuesMany:fR}=fc.actions,AR=fc.reducer,wR=t=>t.procedureFieldValuesReducer.instances,Ac=o.createSelector([wR],t=>Object.values(t)),WD=m(o.createSelector([Ac,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),PR=t=>s=>s.procedureFieldValuesReducer.instances[t],OR=m(o.createSelector([Ac,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mt=T(t=>t.uuid),TR={instances:{}},wc=o.createSlice({name:"procedureTypes",initialState:TR,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,TR)),reducers:{initializeProcedureTypes:mt.initialize,addProcedureType:mt.addOne,addProcedureTypes:mt.addMany,setProcedureType:mt.setOne,setProcedureTypes:mt.setMany,updateProcedureType:mt.updateOne,updateProcedureTypes:mt.updateMany,deleteProcedureType:mt.deleteOne,deleteProcedureTypes:mt.deleteMany}}),{initializeProcedureTypes:IR,addProcedureType:FR,addProcedureTypes:_R,setProcedureType:gR,setProcedureTypes:RR,updateProcedureType:bR,updateProcedureTypes:MR,deleteProcedureType:vR,deleteProcedureTypes:ER}=wc.actions,VR=wc.reducer,kR=t=>t.procedureTypeReducer.instances,Hs=o.createSelector([kR],t=>Object.values(t)),BR=t=>s=>s.procedureTypeReducer.instances[t],DR=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zD=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),qD=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),jD={isRehydrated:!1},Pc=o.createSlice({name:"rehydrated",initialState:jD,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:$D}=Pc.actions,CD=t=>t.rehydratedReducer.isRehydrated,WR=Pc.reducer,ft=T(t=>t.uuid),zR={instances:{}},Oc=o.createSlice({name:"teamMemberships",initialState:zR,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,zR)),reducers:{initializeTeamMemberships:ft.initialize,addTeamMembership:ft.addOne,addTeamMemberships:ft.addMany,setTeamMembership:ft.setOne,setTeamMemberships:ft.setMany,updateTeamMembership:ft.updateOne,updateTeamMemberships:ft.updateMany,deleteTeamMembership:ft.deleteOne,deleteTeamMemberships:ft.deleteMany}}),{initializeTeamMemberships:qR,addTeamMembership:jR,addTeamMemberships:$R,setTeamMembership:CR,setTeamMemberships:UR,updateTeamMembership:LR,updateTeamMemberships:NR,deleteTeamMembership:HR,deleteTeamMemberships:GR}=Oc.actions,KR=Oc.reducer,YR=t=>t.teamMembershipReducer.instances,Gs=o.createSelector([YR],t=>Object.values(t)),QR=t=>s=>s.teamMembershipReducer.instances[t],JR=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UD=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),LD=m(o.createSelector([js,Gs,(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)))})),At=T(t=>t.uuid),ZR={instances:{}},Tc=o.createSlice({name:"teams",initialState:ZR,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,ZR)),reducers:{initializeTeams:At.initialize,addTeam:At.addOne,addTeams:At.addMany,setTeam:At.setOne,setTeams:At.setMany,updateTeam:At.updateOne,updateTeams:At.updateMany,deleteTeam:At.deleteOne,deleteTeams:At.deleteMany}}),{initializeTeams:XR,addTeam:xR,addTeams:eb,setTeam:tb,setTeams:sb,updateTeam:ib,updateTeams:nb,deleteTeam:ab,deleteTeams:cb}=Tc.actions,rb=t=>t.teamReducer.instances,Ic=o.createSelector([rb],t=>Object.values(t)),db=t=>s=>s.teamReducer.instances[t],lb=m(o.createSelector([Ic,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ND=m(o.createSelector([Ic,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ub=Tc.reducer,HD={version:0},ob=o.createSlice({name:"versioning",initialState:HD,reducers:{}}),hb=ob.reducer,wt=T(t=>t.uuid),pb={instances:{}},Fc=o.createSlice({name:"workflows",initialState:pb,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,pb)),reducers:{initializeWorkflows:wt.initialize,addWorkflow:wt.addOne,addWorkflows:wt.addMany,setWorkflow:wt.setOne,setWorkflows:wt.setMany,updateWorkflow:wt.updateOne,updateWorkflows:wt.updateMany,deleteWorkflow:wt.deleteOne,deleteWorkflows:wt.deleteMany}}),{initializeWorkflows:yb,addWorkflow:Sb,addWorkflows:mb,setWorkflow:fb,setWorkflows:Ab,updateWorkflow:wb,updateWorkflows:Pb,deleteWorkflow:Ob,deleteWorkflows:Tb}=Fc.actions,Ib=t=>t.workflowReducer.instances,Ks=o.createSelector([Ib],t=>Object.values(t)),Fb=t=>s=>s.workflowReducer.instances[t],_b=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GD=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),KD=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),gb=Fc.reducer,Pt=T(t=>t.uuid),Rb={instances:{}},_c=o.createSlice({name:"workflowIssueLinks",initialState:Rb,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Rb)),reducers:{initializeWorkflowIssueLinks:Pt.initialize,addWorkflowIssueLink:Pt.addOne,addWorkflowIssueLinks:Pt.addMany,setWorkflowIssueLink:Pt.setOne,setWorkflowIssueLinks:Pt.setMany,updateWorkflowIssueLink:Pt.updateOne,updateWorkflowIssueLinks:Pt.updateMany,deleteWorkflowIssueLink:Pt.deleteOne,deleteWorkflowIssueLinks:Pt.deleteMany}}),{initializeWorkflowIssueLinks:bb,addWorkflowIssueLink:Mb,addWorkflowIssueLinks:hs,setWorkflowIssueLink:vb,setWorkflowIssueLinks:Eb,updateWorkflowIssueLink:Vb,updateWorkflowIssueLinks:kb,deleteWorkflowIssueLink:Bb,deleteWorkflowIssueLinks:ps}=_c.actions,Db=t=>t.workflowIssueLinkReducer.instances,Yt=o.createSelector([Db],t=>Object.values(t)),Wb=t=>s=>s.workflowIssueLinkReducer.instances[t],zb=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qb=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),jb=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),$b=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),YD=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),Cb=_c.reducer,Ot=T(t=>t.uuid),Ub={instances:{}},gc=o.createSlice({name:"workflowStepAssignees",initialState:Ub,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Ub)),reducers:{initializeWorkflowStepAssignees:Ot.initialize,addWorkflowStepAssignee:Ot.addOne,addWorkflowStepAssignees:Ot.addMany,setWorkflowStepAssignee:Ot.setOne,setWorkflowStepAssignees:Ot.setMany,updateWorkflowStepAssignee:Ot.updateOne,updateWorkflowStepAssignees:Ot.updateMany,deleteWorkflowStepAssignee:Ot.deleteOne,deleteWorkflowStepAssignees:Ot.deleteMany}}),{initializeWorkflowStepAssignees:Lb,addWorkflowStepAssignee:Nb,addWorkflowStepAssignees:Hb,setWorkflowStepAssignee:Gb,setWorkflowStepAssignees:Kb,updateWorkflowStepAssignee:Yb,updateWorkflowStepAssignees:Qb,deleteWorkflowStepAssignee:Jb,deleteWorkflowStepAssignees:Zb}=gc.actions,Xb=t=>t.workflowStepAssigneeReducer.instances,ys=o.createSelector([Xb],t=>Object.values(t)),xb=t=>s=>s.workflowStepAssigneeReducer.instances[t],eM=m(o.createSelector([ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QD=m(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),JD=m(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),ZD=m(o.createSelector([ys,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),tM=gc.reducer,Tt=T(t=>t.uuid),sM={instances:{}},Rc=o.createSlice({name:"workflowStepComments",initialState:sM,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,sM)),reducers:{initializeWorkflowStepComments:Tt.initialize,addWorkflowStepComment:Tt.addOne,addWorkflowStepComments:Tt.addMany,setWorkflowStepComment:Tt.setOne,setWorkflowStepComments:Tt.setMany,updateWorkflowStepComment:Tt.updateOne,updateWorkflowStepComments:Tt.updateMany,deleteWorkflowStepComment:Tt.deleteOne,deleteWorkflowStepComments:Tt.deleteMany}}),{initializeWorkflowStepComments:iM,addWorkflowStepComment:nM,addWorkflowStepComments:aM,setWorkflowStepComment:cM,setWorkflowStepComments:rM,updateWorkflowStepComment:dM,updateWorkflowStepComments:lM,deleteWorkflowStepComment:uM,deleteWorkflowStepComments:oM}=Rc.actions,hM=t=>t.workflowStepCommentReducer.instances,Ss=o.createSelector([hM],t=>Object.values(t)),pM=t=>s=>s.workflowStepCommentReducer.instances[t],yM=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XD=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),xD=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),eW=m(o.createSelector([Ss,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),SM=Rc.reducer,It=T(t=>t.uuid),mM={instances:{}},bc=o.createSlice({name:"workflowStepDefaultAssignees",initialState:mM,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,mM)),reducers:{initializeWorkflowStepDefaultAssignees:It.initialize,addWorkflowStepDefaultAssignee:It.addOne,addWorkflowStepDefaultAssignees:It.addMany,setWorkflowStepDefaultAssignee:It.setOne,setWorkflowStepDefaultAssignees:It.setMany,updateWorkflowStepDefaultAssignee:It.updateOne,updateWorkflowStepDefaultAssignees:It.updateMany,deleteWorkflowStepDefaultAssignee:It.deleteOne,deleteWorkflowStepDefaultAssignees:It.deleteMany}}),{initializeWorkflowStepDefaultAssignees:fM,addWorkflowStepDefaultAssignee:AM,addWorkflowStepDefaultAssignees:wM,setWorkflowStepDefaultAssignee:PM,setWorkflowStepDefaultAssignees:OM,updateWorkflowStepDefaultAssignee:TM,updateWorkflowStepDefaultAssignees:IM,deleteWorkflowStepDefaultAssignee:FM,deleteWorkflowStepDefaultAssignees:_M}=bc.actions,gM=t=>t.workflowStepDefaultAssigneeReducer.instances,Mc=o.createSelector([gM],t=>Object.values(t)),RM=t=>s=>s.workflowStepDefaultAssigneeReducer.instances[t],bM=m(o.createSelector([Mc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tW=m(o.createSelector([Mc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),MM=bc.reducer,Ft=T(t=>t.uuid),vM={instances:{}},vc=o.createSlice({name:"workflowStepDefaultReviewers",initialState:vM,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,vM)),reducers:{initializeWorkflowStepDefaultReviewers:Ft.initialize,addWorkflowStepDefaultReviewer:Ft.addOne,addWorkflowStepDefaultReviewers:Ft.addMany,setWorkflowStepDefaultReviewer:Ft.setOne,setWorkflowStepDefaultReviewers:Ft.setMany,updateWorkflowStepDefaultReviewer:Ft.updateOne,updateWorkflowStepDefaultReviewers:Ft.updateMany,deleteWorkflowStepDefaultReviewer:Ft.deleteOne,deleteWorkflowStepDefaultReviewers:Ft.deleteMany}}),{initializeWorkflowStepDefaultReviewers:EM,addWorkflowStepDefaultReviewer:VM,addWorkflowStepDefaultReviewers:kM,setWorkflowStepDefaultReviewer:BM,setWorkflowStepDefaultReviewers:DM,updateWorkflowStepDefaultReviewer:WM,updateWorkflowStepDefaultReviewers:zM,deleteWorkflowStepDefaultReviewer:qM,deleteWorkflowStepDefaultReviewers:jM}=vc.actions,$M=t=>t.workflowStepDefaultReviewerReducer.instances,Ec=o.createSelector([$M],t=>Object.values(t)),CM=t=>s=>s.workflowStepDefaultReviewerReducer.instances[t],UM=m(o.createSelector([Ec,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sW=m(o.createSelector([Ec,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),LM=vc.reducer,_t=T(t=>t.uuid),NM={instances:{}},Vc=o.createSlice({name:"workflowStepEvents",initialState:NM,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,NM)),reducers:{initializeWorkflowStepEvents:_t.initialize,addWorkflowStepEvent:_t.addOne,addWorkflowStepEvents:_t.addMany,setWorkflowStepEvent:_t.setOne,setWorkflowStepEvents:_t.setMany,updateWorkflowStepEvent:_t.updateOne,updateWorkflowStepEvents:_t.updateMany,deleteWorkflowStepEvent:_t.deleteOne,deleteWorkflowStepEvents:_t.deleteMany}}),{initializeWorkflowStepEvents:HM,addWorkflowStepEvent:GM,addWorkflowStepEvents:KM,setWorkflowStepEvent:YM,setWorkflowStepEvents:QM,updateWorkflowStepEvent:JM,updateWorkflowStepEvents:ZM,deleteWorkflowStepEvent:XM,deleteWorkflowStepEvents:xM}=Vc.actions,ev=t=>t.workflowStepEventReducer.instances,ms=o.createSelector([ev],t=>Object.values(t)),tv=t=>s=>s.workflowStepEventReducer.instances[t],sv=m(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iW=m(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),nW=m(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),aW=m(o.createSelector([ms,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),iv=Vc.reducer,gt=T(t=>t.uuid),nv={instances:{}},kc=o.createSlice({name:"workflowStepFieldsAttachments",initialState:nv,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,nv)),reducers:{initializeWorkflowStepFieldsAttachments:gt.initialize,addWorkflowStepFieldsAttachment:gt.addOne,addWorkflowStepFieldsAttachments:gt.addMany,setWorkflowStepFieldsAttachment:gt.setOne,setWorkflowStepFieldsAttachments:gt.setMany,updateWorkflowStepFieldsAttachment:gt.updateOne,updateWorkflowStepFieldsAttachments:gt.updateMany,deleteWorkflowStepFieldsAttachment:gt.deleteOne,deleteWorkflowStepFieldsAttachments:gt.deleteMany}}),{initializeWorkflowStepFieldsAttachments:av,addWorkflowStepFieldsAttachment:cv,addWorkflowStepFieldsAttachments:Bc,setWorkflowStepFieldsAttachment:rv,setWorkflowStepFieldsAttachments:dv,updateWorkflowStepFieldsAttachment:lv,updateWorkflowStepFieldsAttachments:uv,deleteWorkflowStepFieldsAttachment:ov,deleteWorkflowStepFieldsAttachments:Dc}=kc.actions,hv=t=>t.workflowStepFieldsAttachmentReducer.instances,Wc=o.createSelector([hv],t=>Object.values(t)),pv=m(o.createSelector([Wc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),yv=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],Sv=m(o.createSelector([Wc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mv=kc.reducer,Rt=T(t=>t.uuid),fv={instances:{}},zc=o.createSlice({name:"workflowStepFields",initialState:fv,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,fv)),reducers:{initializeWorkflowStepFields:Rt.initialize,addWorkflowStepFields:Rt.addOne,addWorkflowStepFieldsMany:Rt.addMany,setWorkflowStepFields:Rt.setOne,setWorkflowStepFieldsMany:Rt.setMany,updateWorkflowStepFields:Rt.updateOne,updateWorkflowStepFieldsMany:Rt.updateMany,deleteWorkflowStepFields:Rt.deleteOne,deleteWorkflowStepFieldsMany:Rt.deleteMany}}),{initializeWorkflowStepFields:Av,addWorkflowStepFields:wv,addWorkflowStepFieldsMany:Pv,setWorkflowStepFields:Ov,setWorkflowStepFieldsMany:Tv,updateWorkflowStepFields:Iv,updateWorkflowStepFieldsMany:Fv,deleteWorkflowStepFields:_v,deleteWorkflowStepFieldsMany:gv}=zc.actions,Rv=t=>t.workflowStepFieldsReducer.instances,Ys=o.createSelector([Rv],t=>Object.values(t)),cW=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),rW=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),bv=t=>s=>s.workflowStepFieldsReducer.instances[t],Mv=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vv=zc.reducer,bt=T(t=>t.uuid),Ev={instances:{}},qc=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:Ev,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Ev)),reducers:{initializeWorkflowStepFieldValuesAttachments:bt.initialize,addWorkflowStepFieldValuesAttachment:bt.addOne,addWorkflowStepFieldValuesAttachments:bt.addMany,setWorkflowStepFieldValuesAttachment:bt.setOne,setWorkflowStepFieldValuesAttachments:bt.setMany,updateWorkflowStepFieldValuesAttachment:bt.updateOne,updateWorkflowStepFieldValuesAttachments:bt.updateMany,deleteWorkflowStepFieldValuesAttachment:bt.deleteOne,deleteWorkflowStepFieldValuesAttachments:bt.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:Vv,addWorkflowStepFieldValuesAttachment:kv,addWorkflowStepFieldValuesAttachments:jc,setWorkflowStepFieldValuesAttachment:Bv,setWorkflowStepFieldValuesAttachments:Dv,updateWorkflowStepFieldValuesAttachment:Wv,updateWorkflowStepFieldValuesAttachments:zv,deleteWorkflowStepFieldValuesAttachment:qv,deleteWorkflowStepFieldValuesAttachments:$c}=qc.actions,jv=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Cc=o.createSelector([jv],t=>Object.values(t)),$v=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],Cv=m(o.createSelector([Cc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Uv=m(o.createSelector([Cc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Lv=qc.reducer,Mt=T(t=>t.uuid),Nv={instances:{}},Uc=o.createSlice({name:"workflowStepFieldValues",initialState:Nv,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,Nv)),reducers:{initializeWorkflowStepFieldValues:Mt.initialize,addWorkflowStepFieldValues:Mt.addOne,addWorkflowStepFieldValuesMany:Mt.addMany,setWorkflowStepFieldValues:Mt.setOne,setWorkflowStepFieldValuesMany:Mt.setMany,updateWorkflowStepFieldValues:Mt.updateOne,updateWorkflowStepFieldValuesMany:Mt.updateMany,deleteWorkflowStepFieldValues:Mt.deleteOne,deleteWorkflowStepFieldValuesMany:Mt.deleteMany}}),{initializeWorkflowStepFieldValues:Hv,addWorkflowStepFieldValues:Gv,addWorkflowStepFieldValuesMany:Kv,setWorkflowStepFieldValues:Yv,setWorkflowStepFieldValuesMany:Qv,updateWorkflowStepFieldValues:Jv,updateWorkflowStepFieldValuesMany:Zv,deleteWorkflowStepFieldValues:Xv,deleteWorkflowStepFieldValuesMany:xv}=Uc.actions,eE=t=>t.workflowStepFieldValuesReducer.instances,zt=o.createSelector([eE],t=>Object.values(t)),dW=m(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),lW=m(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),tE=t=>s=>s.workflowStepFieldValuesReducer.instances[t],sE=m(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uW=m(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)))),oW=m(o.createSelector([zt,(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})),iE=Uc.reducer,vt=T(t=>t.uuid),nE={instances:{}},Lc=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:nE,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,nE)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:vt.initialize,addWorkflowStepFieldValuesReviewRequest:vt.addOne,addWorkflowStepFieldValuesReviewRequests:vt.addMany,setWorkflowStepFieldValuesReviewRequest:vt.setOne,setWorkflowStepFieldValuesReviewRequests:vt.setMany,updateWorkflowStepFieldValuesReviewRequest:vt.updateOne,updateWorkflowStepFieldValuesReviewRequests:vt.updateMany,deleteWorkflowStepFieldValuesReviewRequest:vt.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:vt.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:aE,addWorkflowStepFieldValuesReviewRequest:cE,addWorkflowStepFieldValuesReviewRequests:Nc,setWorkflowStepFieldValuesReviewRequest:rE,setWorkflowStepFieldValuesReviewRequests:dE,updateWorkflowStepFieldValuesReviewRequest:lE,updateWorkflowStepFieldValuesReviewRequests:uE,deleteWorkflowStepFieldValuesReviewRequest:oE,deleteWorkflowStepFieldValuesReviewRequests:Hc}=Lc.actions,hE=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,fs=o.createSelector([hE],t=>Object.values(t)),pE=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],yE=m(o.createSelector([fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),SE=m(o.createSelector([fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),hW=m(o.createSelector([fs,(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})),pW=m(o.createSelector([zt,fs,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),mE=Lc.reducer,Et=T(t=>t.uuid),fE={instances:{}},Gc=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:fE,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,fE)),reducers:{initializeWorkflowStepFieldValuesReviews:Et.initialize,addWorkflowStepFieldValuesReview:Et.addOne,addWorkflowStepFieldValuesReviews:Et.addMany,setWorkflowStepFieldValuesReview:Et.setOne,setWorkflowStepFieldValuesReviews:Et.setMany,updateWorkflowStepFieldValuesReview:Et.updateOne,updateWorkflowStepFieldValuesReviews:Et.updateMany,deleteWorkflowStepFieldValuesReview:Et.deleteOne,deleteWorkflowStepFieldValuesReviews:Et.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:AE,addWorkflowStepFieldValuesReview:wE,addWorkflowStepFieldValuesReviews:Kc,setWorkflowStepFieldValuesReview:PE,setWorkflowStepFieldValuesReviews:OE,updateWorkflowStepFieldValuesReview:TE,updateWorkflowStepFieldValuesReviews:IE,deleteWorkflowStepFieldValuesReview:FE,deleteWorkflowStepFieldValuesReviews:Yc}=Gc.actions,_E=t=>t.workflowStepFieldValuesReviewReducer.instances,Qt=o.createSelector([_E],t=>Object.values(t)),gE=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],RE=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bE=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),yW=m(o.createSelector([Qt,(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})),SW=m(o.createSelector([zt,Qt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),mW=o.createSelector([Qt],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}),ME=Gc.reducer,Vt=T(t=>t.uuid),vE={instances:{}},Qc=o.createSlice({name:"workflowStepReviewers",initialState:vE,extraReducers:t=>t.addMatcher(o.isAnyOf(O,B,I),s=>Object.assign(s,vE)),reducers:{initializeWorkflowStepReviewers:Vt.initialize,addWorkflowStepReviewer:Vt.addOne,addWorkflowStepReviewers:Vt.addMany,setWorkflowStepReviewer:Vt.setOne,setWorkflowStepReviewers:Vt.setMany,updateWorkflowStepReviewer:Vt.updateOne,updateWorkflowStepReviewers:Vt.updateMany,deleteWorkflowStepReviewer:Vt.deleteOne,deleteWorkflowStepReviewers:Vt.deleteMany}}),{initializeWorkflowStepReviewers:EE,addWorkflowStepReviewer:VE,addWorkflowStepReviewers:kE,setWorkflowStepReviewer:BE,setWorkflowStepReviewers:DE,updateWorkflowStepReviewer:WE,updateWorkflowStepReviewers:zE,deleteWorkflowStepReviewer:qE,deleteWorkflowStepReviewers:jE}=Qc.actions,$E=t=>t.workflowStepReviewerReducer.instances,As=o.createSelector([$E],t=>Object.values(t)),CE=t=>s=>s.workflowStepReviewerReducer.instances[t],UE=m(o.createSelector([As,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fW=m(o.createSelector([As,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),AW=m(o.createSelector([As,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),wW=m(o.createSelector([As,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),LE=Qc.reducer,kt=T(t=>t.uuid),NE={instances:{}},Jc=o.createSlice({name:"workflowSteps",initialState:NE,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,NE)),reducers:{initializeWorkflowSteps:kt.initialize,addWorkflowStep:kt.addOne,addWorkflowSteps:kt.addMany,setWorkflowStep:kt.setOne,setWorkflowSteps:kt.setMany,updateWorkflowStep:kt.updateOne,updateWorkflowSteps:kt.updateMany,deleteWorkflowStep:kt.deleteOne,deleteWorkflowSteps:kt.deleteMany}}),{initializeWorkflowSteps:HE,addWorkflowStep:GE,addWorkflowSteps:KE,setWorkflowStep:YE,setWorkflowSteps:QE,updateWorkflowStep:JE,updateWorkflowSteps:ZE,deleteWorkflowStep:XE,deleteWorkflowSteps:xE}=Jc.actions,eV=t=>t.workflowStepReducer.instances,Zc=o.createSelector([eV],t=>Object.values(t)),tV=t=>s=>s.workflowStepReducer.instances[t],sV=m(o.createSelector([Zc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),PW=m(o.createSelector([Zc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),iV=Jc.reducer,Bt=T(t=>t.uuid),nV={instances:{}},Xc=o.createSlice({name:"workflowTypes",initialState:nV,extraReducers:t=>t.addMatcher(o.isAnyOf(O,I),s=>Object.assign(s,nV)),reducers:{initializeWorkflowTypes:Bt.initialize,addWorkflowType:Bt.addOne,addWorkflowTypes:Bt.addMany,setWorkflowType:Bt.setOne,setWorkflowTypes:Bt.setMany,updateWorkflowType:Bt.updateOne,updateWorkflowTypes:Bt.updateMany,deleteWorkflowType:Bt.deleteOne,deleteWorkflowTypes:Bt.deleteMany}}),{initializeWorkflowTypes:aV,addWorkflowType:cV,addWorkflowTypes:rV,setWorkflowType:dV,setWorkflowTypes:lV,updateWorkflowType:uV,updateWorkflowTypes:oV,deleteWorkflowType:hV,deleteWorkflowTypes:pV}=Xc.actions,yV=t=>t.workflowTypeReducer.instances,xc=o.createSelector([yV],t=>Object.values(t)),SV=t=>s=>s.workflowTypeReducer.instances[t],mV=m(o.createSelector([xc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OW=m(o.createSelector([xc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),fV=Xc.reducer,er={outboxReducer:EO,fileReducer:Jy,authReducer:ay},TW=o.combineReducers(er),AV={...er,[ts]:hb,assetReducer:ho,assetAttachmentReducer:Jr,assetStageCompletionReducer:Io,assetStageReducer:qo,assetTypeReducer:Up,assetTypeAttachmentReducer:xo,issueReducer:pA,issueAttachmentReducer:Rf,issueTypeReducer:mP,issueTypeAttachmentReducer:RA,organizationReducer:_O,projectReducer:vT,projectAttachmentReducer:nT,projectAccessReducer:UO,organizationAccessReducer:rO,projectFileReducer:wT,procedureTypeReducer:VR,procedureReducer:UT,procedureTypeFieldsReducer:Hg,procedureFieldValuesReducer:AR,procedureTypeAttachmentReducer:fg,procedureTypeFieldsAttachmentReducer:Eg,procedureFieldValuesAttachmentReducer:iR,procedureStepFieldsAttachmentReducer:OF,procedureStepFieldsReducer:BF,procedureStepFieldValuesAttachmentReducer:KF,procedureStepFieldValuesReducer:r_,procedureStepFieldValuesReviewReducer:k_,procedureStepFieldValuesReviewRequestReducer:P_,procedureStepAssigneeReducer:cI,procedureStepCommentReducer:PI,procedureStepDefaultAssigneeReducer:BI,procedureStepDefaultReviewerReducer:YI,procedureStepEventReducer:dF,procedureStepReviewerReducer:K_,procedureStepReducer:ng,rehydratedReducer:WR,formReducer:dm,formRevisionReducer:ZS,formRevisionAttachmentReducer:qS,formSubmissionAttachmentReducer:Im,formSubmissionReducer:Wm,formIdentifierReducer:uS,formIdentifierValueReducer:FS,userReducer:YP,emailDomainsReducer:Ky,documentsReducer:vy,documentAttachmentReducer:wy,teamReducer:ub,agentsReducer:zr,issueCommentReducer:eA,issueCommentAttachmentReducer:Cf,issueUpdateReducer:jP,geoImageReducer:Jm,issueAssociationReducer:yf,issueTypeFieldsReducer:Sw,issueTypeFieldValuesReducer:tw,issueTypeFieldsAttachmentReducer:CA,issueTypeFieldValuesAttachmentReducer:bw,issueTypeIdentifierReducer:Uw,issueTypeIdentifierValueReducer:sP,issueTypeStatusReducer:MP,assetTypeFieldsReducer:Rh,assetTypeFieldValuesReducer:ep,assetTypeFieldsAttachmentReducer:ph,assetTypeFieldValuesAttachmentReducer:$h,assetTypeIdentifierReducer:yp,assetTypeIdentifierValueReducer:bp,assetTypeStatusReducer:sy,assetProcedureTypeReducer:Dl,assetProcedureReducer:Pl,assetProcedureTypeFieldsReducer:Dd,assetProcedureTypeFieldValuesReducer:dl,assetProcedureTypeFieldsAttachmentReducer:Od,assetProcedureTypeFieldValuesAttachmentReducer:Kd,assetProcedureTypeAttachmentReducer:rd,assetProcedureStepFieldsAttachmentReducer:Xl,assetProcedureStepFieldsReducer:ou,assetProcedureStepFieldValuesAttachmentReducer:Fu,assetProcedureStepFieldValuesReducer:qu,assetProcedureStepReducer:Qu,teamMembershipReducer:KR,workflowTypeReducer:fV,workflowStepReducer:iV,workflowStepFieldsReducer:vv,workflowStepFieldsAttachmentReducer:mv,workflowReducer:gb,workflowIssueLinkReducer:Cb,workflowStepAssigneeReducer:tM,workflowStepCommentReducer:SM,workflowStepDefaultAssigneeReducer:MM,workflowStepDefaultReviewerReducer:LM,workflowStepEventReducer:iv,workflowStepFieldValuesReducer:iE,workflowStepFieldValuesAttachmentReducer:Lv,workflowStepFieldValuesReviewReducer:ME,workflowStepFieldValuesReviewRequestReducer:mE,workflowStepReviewerReducer:LE},IW=o.combineReducers(AV),wV=1e4,PV=200,tr=[400,409,403,404,405,500],L=1e4,OV={};class TV{constructor(s){p(this,"client");p(this,"pageSize",wV);OV[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 IV=()=>gV.length-1,FV=t=>(t[ts]={version:IV()},t),_V=()=>FV({}),FW=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),_W=t=>s=>{var e;return s===void 0&&(s={}),((e=s[ts])==null?void 0:e.version)===IV()?s:t(s)},gV=[FV,_V,_V,FW],gW=Object.fromEntries(gV.map((t,s)=>[s,_W(t)])),RW=t=>{if(t)throw t;const s=Xt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},RV=(t,s,e)=>{const n=Lt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},bV=(t,s,e)=>{const n=Lt();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 bW(t,s){if(!s.payload)throw new Error("Received empty payload");return UV(s)}const MW={...dr,effect:bW,discard:vV,returnPromises:!0,persistCallback:RW,retry:kW,persistOptions:{storage:QV},queue:{...dr.queue,enqueue:RV,dequeue:bV,peek:(...t)=>VW(...t)}},vW=JV(gW,ts),EW=o.compose(YV.offline(MW),vW);async function MV(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=OV[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return ir(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function vV(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=xt(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(EO(r));const y=Lt();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid);const S=s.meta.offline.rollback;throw S&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(S)),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 y=t.status||((l=t.response)==null?void 0:l.status);if(y||console.warn("Error has no status code:",t),y!==void 0&&sr.includes(y)){console.warn("Discarding request due to error:",t,`
4
- Action:`,s);const S=Lt();if(!S)throw new Error("Outbox coordinator not set");S.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const u=Lt();if(!u)throw new Error("Outbox coordinator not set");return u.registerRetry(s.payload.uuid),!1}function WW(t,s,e){var n;return(n=Lt())==null?void 0:n.peek()}function zW(t,s){return xt().dispatch(VO(new Date().getTime())),Ar}const Zt="An unknown error occurred",qW=500,BV=["non_field_errors","detail"];function jW(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"?BV.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?BV.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=Xt(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(MO(r));const y=Lt();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid);const S=s.meta.offline.rollback;throw S&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(S)),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 y=t.status||((u=t.response)==null?void 0:u.status);if(y||console.warn("Error has no status code:",t),y!==void 0&&tr.includes(y)){console.warn("Discarding request due to error:",t,`
4
+ Action:`,s);const S=Lt();if(!S)throw new Error("Outbox coordinator not set");S.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=Lt();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function VW(t,s,e){var n;return(n=Lt())==null?void 0:n.peek()}function kW(t,s){return Xt().dispatch(vO(new Date().getTime())),Ar}const Jt="An unknown error occurred",BW=500,EV=["non_field_errors","detail"];function DW(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"?EV.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?EV.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>qW?Zt:e}class C extends Error{constructor(e){super(Zt);p(this,"status");p(this,"response");p(this,"message");p(this,"options");const{response:n,innerError:a}=e;this.message=e.message??jW(n,a)??Zt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function DV(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 $W extends _V{constructor(s){super(s)}}class Ut extends _V{constructor(e,n){super(e);p(this,"auth");this.auth=n}}class CW extends Ut{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(Wr(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(qr(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(zr(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(Dr(n)),n}}function N(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 Ut{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 z extends M{constructor(){super(...arguments);p(this,"pageSize",IV)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,u=null;if("file"in e){const{file:g,...V}=e;d=await this.client.files.getFilePayload(g),u=URL.createObjectURL(g),r={...V,file_sha1:d.sha1,file_type:d.file_type,file_name:g.name,file_extension:d.extension,file_url:u}}else r=e;const l=this.buildModel(r),y=this.buildPayload(l);this.dispatch(n(l));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...y,...d?{file:d}:{}},blockers:this.getBlockers(l),blocks:this.getBlocks(l)});S.then(({instance:g})=>{this.dispatch(a(g))}).catch(g=>{throw this.dispatch(c(this.getId(l))),g}).finally(()=>{u&&URL.revokeObjectURL(u)});const f=S.then(({instance:g})=>g),F=S.then(async({instance:g,presigned_url:V})=>{try{return V&&await this.client.files.processPresignedUrl(g.file_sha1,V),g.file_sha1}catch(_){throw console.error("Upload to s3 using presigned url failed.",_),_}});return[l,f,F]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),u=[],l=new Set,y=N(e,Math.min(n??e.length,L)),S=[];for(const V of y){const _=[],v={},b=[],D=[];for(const W of V){let q;if("file"in W){const{file:rr,...jq}=W,es=await this.client.files.getFilePayload(rr);es.sha1 in v||(v[es.sha1]=es);const YV=URL.createObjectURL(rr);l.add(YV),q={...jq,file_sha1:es.sha1,file_type:es.file_type,file_name:rr.name,file_extension:es.extension,file_url:YV}}else q=W;const k=this.buildModel(q);u.push(k);const H=this.buildBulkPayload(k);_.push(H);const Js=this.getBlockers(k);b.push(...Js);const qq=this.getBlocks(k);D.push(...qq)}const j={payloads:_,submittedAt:d,files:Object.values(v),blockers:b,blocks:D};S.push(j)}this.dispatch(a(u));const f=S.map(V=>{const{submittedAt:_,files:v,payloads:b,blocks:D,blockers:j}=V;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,files:v,payloads:b},blockers:j,blocks:D})});Promise.all(f).then(V=>{const _=V.flatMap(v=>v.instances);this.dispatch(c(_))}).catch(V=>{throw this.dispatch(r(u.map(_=>this.getId(_)))),console.error(V),V}).finally(()=>{for(const V of l)URL.revokeObjectURL(V)});const F=Promise.all(f).then(V=>V.flatMap(({instances:_})=>_)),g=Promise.all(f).then(async V=>{const _=[];for(const{presigned_urls:v}of V){const b=this.client.files.processPresignedUrls(v);for(const[D,j]of Object.entries(b))try{await j,_.push(D)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return _});return[u,F,g]}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(u){throw this.dispatch(a(d)),u}}}class UW extends z{constructor(){super(...arguments);p(this,"name","Asset attachment");p(this,"url","/asset-attachments");p(this,"actions",{addOne:Ur,addMany:ri,setOne:Lr,setMany:Nr,updateOne:Hr,updateMany:Gr,deleteOne:Kr,deleteMany:di,initialize:Cr});p(this,"selectors",{selectById:Qr,selectByIds:Jr})}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 P({...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 LW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Attachment");p(this,"url","/asset-procedure-type-attachments");p(this,"actions",{addOne:td,addMany:sd,setOne:id,setMany:nd,updateOne:ad,updateMany:cd,deleteOne:rd,deleteMany:dd,initialize:ed});p(this,"selectors",{selectById:od,selectByIds:hd})}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:u,file_url:l}=e,y=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,S=new Date().toISOString();return P({file_url:l,file_sha1:c,file_extension:r,file_name:d,file_type:u,created_by:y,submitted_at:S,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 NW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields Attachment");p(this,"url","/asset-procedure-type-fields-attachments");p(this,"actions",{addOne:Sd,addMany:md,setOne:fd,setMany:Ad,updateOne:wd,updateMany:Pd,deleteOne:Od,deleteMany:Td,initialize:yd});p(this,"selectors",{selectById:_d,selectByIds:gd})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}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 HW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields");p(this,"url","/asset-procedure-type-fields");p(this,"actions",{addOne:Md,addMany:vd,setOne:Ed,setMany:Vd,updateOne:kd,updateMany:Bd,deleteOne:Dd,deleteMany:Wd,initialize:bd});p(this,"selectors",{selectById:jd,selectByIds:$d})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.asset_procedure_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(l.uuid)),f}),[l,y]}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 GW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values Attachment");p(this,"url","/asset-procedure-type-field-values-attachments");p(this,"actions",{addOne:Ld,addMany:mi,setOne:Nd,setMany:Hd,updateOne:Gd,updateMany:Kd,deleteOne:Yd,deleteMany:fi,initialize:Ud});p(this,"selectors",{selectById:Zd,selectByIds:Xd})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),u=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(l){throw this.dispatch(c(u)),l}}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 KW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values");p(this,"url","/asset-procedure-type-field-values");p(this,"actions",{addOne:su,addMany:iu,setOne:nu,setMany:au,updateOne:cu,updateMany:ru,deleteOne:du,deleteMany:uu,initialize:tu});p(this,"selectors",{selectById:hu,selectByIds:pu})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),y=P({...e,created_by:u,submitted_at:l}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:u}=this.actions,l=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:l});S.push(D),v.push({uuid:D.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:D.values})}F.push({submitted_at:l,values:a,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({asset:k})=>k),D=v.map(({fields_revision:k})=>k),j=v.map(({asset_procedure:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(u(E(S)))}),[S,g]}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 u={...d,...e};this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.fields_revision,u.asset,u.asset_procedure],blocks:[u.uuid]});return l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const l=xd(e)(d);this.dispatch(a(e)),this.dispatch(fi(E(l)));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(u)),this.dispatch(mi(l)),y}}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 YW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure");p(this,"url","/asset-procedures");p(this,"actions",{addOne:mu,addMany:Oi,setOne:Pu,setMany:Ou,updateOne:fu,updateMany:Au,deleteOne:wu,deleteMany:Ti,initialize:Su});p(this,"selectors",{selectById:_u,selectByIds:gu})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.asset_procedure_type,e.asset_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)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(l){throw this.dispatch(c(u)),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 QW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type");p(this,"url","/asset-procedure-types");p(this,"actions",{addOne:Mu,addMany:vu,setOne:Du,setMany:Wu,updateOne:Eu,updateMany:Vu,deleteOne:ku,deleteMany:Bu,initialize:bu});p(this,"selectors",{selectById:ju,selectByIds:$u})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const l=Fu(e)(d);this.dispatch(a(e)),this.dispatch(Ti(E(l)));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(u)),this.dispatch(Oi(l)),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 JW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields Attachment");p(this,"url","/asset-procedure-step-fields-attachments");p(this,"actions",{addOne:Lu,addMany:Nu,setOne:Hu,setMany:Gu,updateOne:Ku,updateMany:Yu,deleteOne:Qu,deleteMany:Ju,initialize:Uu});p(this,"selectors",{selectById:Xu,selectByIds:xu})}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 P({...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 ZW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields");p(this,"url","/asset-procedure-step-fields");p(this,"actions",{addOne:il,addMany:nl,setOne:al,setMany:cl,updateOne:rl,updateMany:dl,deleteOne:ul,deleteMany:ll,initialize:sl});p(this,"selectors",{selectById:ol,selectByIds:hl})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.asset_procedure_step],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(l.uuid)),f}),[l,y]}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(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(c)),u}),[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 XW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values Attachment");p(this,"url","/asset-procedure-step-field-values-attachments");p(this,"actions",{addOne:ml,addMany:vi,setOne:fl,setMany:Al,updateOne:wl,updateMany:Pl,deleteOne:Ol,deleteMany:Ei,initialize:Sl});p(this,"selectors",{selectById:Il,selectByIds:Fl})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),u=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(l){throw this.dispatch(c(u)),l}}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 xW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values");p(this,"url","/asset-procedure-step-field-values");p(this,"actions",{addOne:Ml,addMany:vl,setOne:El,setMany:Vl,updateOne:kl,updateMany:Bl,deleteOne:Dl,deleteMany:Wl,initialize:bl});p(this,"selectors",{selectById:ql,selectByIds:jl})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),y=P({...e,created_by:u,submitted_at:l}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:u}=this.actions,l=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:l});S.push(D),v.push({uuid:D.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:D.values})}F.push({submitted_at:l,values:c,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({asset:k})=>k),D=v.map(({fields_revision:k})=>k),j=v.map(({asset_procedure:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(u(E(S)))}),[S,g]}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 u={...d,...e};this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.fields_revision,u.asset,u.asset_procedure],blocks:[u.uuid]});return l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const l=_l(e)(d);this.dispatch(a(e)),this.dispatch(Ei(E(l)));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(u)),this.dispatch(vi(l)),y}}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 ez extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step");p(this,"url","/asset-procedure-steps");p(this,"actions",{addOne:Hl,addMany:Gl,setOne:Ll,setMany:Nl,updateOne:Kl,updateMany:Yl,deleteOne:Ql,deleteMany:Jl,initialize:Ul});p(this,"selectors",{selectById:Xl,selectByIds:xl})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.asset_procedure_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:u}=this.selectors,l=n.getState(),y=u(e)(l);if(!y)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const S=eo(e)(l);this.dispatch(d(e)),this.dispatch(a(E(S)));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(y)),this.dispatch(c(S)),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 tz extends M{constructor(){super(...arguments);p(this,"url","/assets");p(this,"name","Asset");p(this,"actions",{addOne:io,addMany:zi,setOne:ro,setMany:uo,updateOne:no,updateMany:ao,deleteOne:co,deleteMany:qi,initialize:so});p(this,"selectors",{selectById:ho,selectByIds:po})}add(e){var S;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.asset_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`No asset with uuid ${e} found in the store`);const l=Zr(e)(d),y=Sf(e)(d);this.dispatch(c(e)),this.dispatch(di(E(l))),this.dispatch($t(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(a(u)),this.dispatch(ri(l)),this.dispatch(jt(y)),S}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=Dt.v4(),d=N(e,Math.min(n??e.length,L)).map(y=>{const S=y.map(f=>P(f));return{batchId:Dt.v4(),payload:{transaction_id:r,submitted_at:c,assets:S}}}),u=[];let l=null;for(const y of d){const{batchId:S,payload:f}=y,F=f.assets.map(({uuid:b})=>b),g=f.assets.map(({asset_type:b})=>b),V=f.assets.map(({project:b})=>b),_=f.assets.map(({status:b})=>b),v=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(l?[l]:[]).concat(g).concat(V).concat(_),blocks:[S].concat(F)});l=y.batchId,u.push(v)}return Promise.all(u).then(y=>{const S=y.flat();this.dispatch(a(S))}),u}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Ts);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=r(d)(a.getState()).toSorted(ii);if(d.length!=u.length)throw new Error(`Attempting to bulk update ${d.length-u.length} assets that dont exist in the store`);const l=[];for(let F=0;F<d.length;F++)l.push({...u[F],...e[F]});this.dispatch(c(l));const y=N(e,Math.min(n??e.length,L)),S=[];let f=null;for(const F of y){const g=Dt.v4(),V=E(F),_=F.map(({status:b})=>b).filter(Boolean),v=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(V).concat(_),blocks:[g].concat(V)});S.push(v),f=g}return Promise.all(S).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(u))}),[l,S]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),u=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(l){throw this.dispatch(a(u)),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 sz extends M{constructor(){super(...arguments);p(this,"name","Asset Stage Completion");p(this,"url","/asset-stage-completions");p(this,"actions",{addOne:fo,addMany:Ao,setOne:wo,setMany:Po,updateOne:Oo,updateMany:To,deleteOne:Io,deleteMany:Fo,initialize:mo});p(this,"selectors",{selectById:bo,selectByIds:Mo})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.asset,e.asset_stage],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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(u){throw this.dispatch(c(d)),u}}bulkAdd(e){var F;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),u=((F=n.getState().userReducer.currentUser)==null?void 0:F.id)??null,l=e.map(g=>P(g)),y=l.map(g=>({...g,created_by:u,submitted_at:d})),S=y.map(({uuid:g})=>g);this.dispatch(a(y));const f=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:l},blockers:[...e.map(g=>g.asset_procedure),...e.map(g=>g.asset_stage),...e.map(g=>g.asset)],blocks:S});return f.then(g=>{this.dispatch(c(g))}).catch(()=>{this.dispatch(r(S))}),[y,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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class iz extends M{constructor(){super(...arguments);p(this,"name","Asset Stage");p(this,"url","/asset-stages");p(this,"actions",{addOne:Bo,addMany:Do,setOne:Vo,setMany:ko,updateOne:Wo,updateMany:zo,deleteOne:qo,deleteMany:jo,initialize:Eo});p(this,"selectors",{selectById:Co,selectByIds:Uo})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.asset_procedure_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(u)),l}}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 nz extends z{constructor(){super(...arguments);p(this,"name","Asset Type Attachment");p(this,"url","/asset-type-attachments");p(this,"actions",{addOne:Ho,addMany:Ni,setOne:Go,setMany:Ko,updateOne:Yo,updateMany:Qo,deleteOne:Jo,deleteMany:Hi,initialize:No});p(this,"selectors",{selectById:Xo,selectByIds:xo})}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 P({...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 az extends z{constructor(){super(...arguments);p(this,"name","Asset Type Fields Attachment");p(this,"url","/asset-type-fields-attachments");p(this,"actions",{addOne:nh,addMany:ah,setOne:ch,setMany:rh,updateOne:dh,updateMany:uh,deleteOne:lh,deleteMany:oh,initialize:ih});p(this,"selectors",{selectById:ph,selectByIds:yh})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}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 cz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Fields");p(this,"url","/asset-type-fields");p(this,"actions",{addOne:Ah,addMany:wh,setOne:Ph,setMany:Oh,updateOne:Th,updateMany:Ih,deleteOne:Fh,deleteMany:_h,initialize:fh});p(this,"selectors",{selectById:Rh,selectByIds:bh})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.asset_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(l.uuid)),f}),[l,y]}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 rz extends z{constructor(){super(...arguments);p(this,"name","Asset Type Field Values Attachment");p(this,"url","/asset-type-field-values-attachments");p(this,"actions",{addOne:Vh,addMany:Zi,setOne:kh,setMany:Bh,updateOne:Dh,updateMany:Wh,deleteOne:zh,deleteMany:Xi,initialize:Eh});p(this,"selectors",{selectById:jh,selectByIds:$h})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),u=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(l){throw this.dispatch(c(u)),l}}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 dz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Field Values");p(this,"url","/asset-type-field-values");p(this,"actions",{addOne:Hh,addMany:Gh,setOne:Kh,setMany:Yh,updateOne:Qh,updateMany:Jh,deleteOne:Zh,deleteMany:Xh,initialize:Nh});p(this,"selectors",{selectById:ep,selectByIds:tp})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),y=P({...e,created_by:u,submitted_at:l}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var g;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:u}=this.actions,l=new Date().toISOString(),y=[],S=N(a,Math.min(n??a.length,L)),f=[];for(const V of S){const _=[];for(const v of V){const b=P({...v,values:v.values,created_by:((g=this.client.store.getState().userReducer.currentUser)==null?void 0:g.id)??null,submitted_at:l});y.push(b),_.push({uuid:b.uuid,asset:v.asset,fields_revision:v.fields_revision,published_at:v.published_at,values:b.values})}f.push({submitted_at:l,values:c,field_values:_})}this.dispatch(r(y));const F=[];for(const V of f){const{field_values:_}=V,v=_.map(({asset:W})=>W),b=_.map(({fields_revision:W})=>W),D=_.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:V,blockers:v.concat(b),blocks:D});F.push(j)}return Promise.all(F).then(V=>{this.dispatch(d(V.flat()))}).catch(()=>{this.dispatch(u(E(y)))}),[y,F]}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 u={...d,...e};this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.uuid,u.fields_revision,u.asset],blocks:[u.uuid]});return l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const l=Ch(e)(d);this.dispatch(a(e)),this.dispatch(Xi(E(l)));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(u)),this.dispatch(Zi(l)),y}}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 uz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier");p(this,"url","/asset-type-identifiers");p(this,"actions",{addOne:ap,addMany:cp,setOne:rp,setMany:dp,updateOne:up,updateMany:lp,deleteOne:op,deleteMany:hp,initialize:np});p(this,"selectors",{selectById:yp,selectByIds:Sp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.asset_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)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(l){throw this.dispatch(c(u)),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 lz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier Value");p(this,"url","/asset-type-identifier-values");p(this,"actions",{addOne:wp,addMany:Pp,setOne:Op,setMany:Tp,updateOne:Ip,updateMany:Fp,deleteOne:_p,deleteMany:gp,initialize:Ap});p(this,"selectors",{selectById:bp,selectByIds:Mp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.asset,e.asset_type_identifier],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}bulkAdd(e,n){var V;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,u=new Date().toISOString(),l=((V=a.getState().userReducer.currentUser)==null?void 0:V.id)??null,y=N(e,Math.min(n??e.length,L)),S=[],f=[];for(const _ of y){const v=[],b=[],D=[];for(const W of _){const q=P({...W,submitted_at:u,created_by:l});f.push(q);const k={uuid:q.uuid,asset:q.asset,asset_type_identifier:q.asset_type_identifier,value:q.value};v.push(k),b.push(q.asset),b.push(q.asset_type_identifier),D.push(q.uuid)}const j={payloads:v,submitted_at:u,blockers:b,blocks:D};S.push(j)}this.dispatch(c(f));const F=S.map(_=>{const{payloads:v,submitted_at:b,blockers:D,blocks:j}=_;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:v},blockers:D,blocks:j})});Promise.all(F).then(_=>{this.dispatch(r(_.flat()))}).catch(_=>{throw this.dispatch(d(E(f))),_});const g=Promise.all(F).then(_=>_.flat());return[f,g]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(u)),l}}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 oz extends M{constructor(){super(...arguments);p(this,"name","Asset Type");p(this,"url","/asset-types");p(this,"actions",{addOne:Dp,addMany:Wp,setOne:kp,setMany:Bp,updateOne:zp,updateMany:qp,deleteOne:jp,deleteMany:$p,initialize:Vp});p(this,"selectors",{selectById:Up,selectByIds:Lp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected asset type with uuid ${e} to exist`);const l=oo(e)(d),y=eh(e)(d);this.dispatch(a(e)),this.dispatch(qi(E(l))),this.dispatch(Hi(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(u)),this.dispatch(zi(l)),this.dispatch(Ni(y)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class hz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Status");p(this,"url","/asset-type-statuses");p(this,"actions",{addOne:Kp,addMany:Yp,setOne:Qp,setMany:Jp,updateOne:Zp,updateMany:Xp,deleteOne:xp,deleteMany:ey,initialize:Gp});p(this,"selectors",{selectById:sy,selectByIds:iy})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.asset_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(n(l))}).catch(()=>{this.dispatch(n(r))}),[d,u]}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(u){throw this.dispatch(c(d)),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 pz extends z{constructor(){super(...arguments);p(this,"name","Document Attachment");p(this,"url","/document-attachments");p(this,"actions",{addOne:ly,addMany:oy,setOne:hy,setMany:py,updateOne:yy,updateMany:Sy,deleteOne:my,deleteMany:fy,initialize:uy});p(this,"selectors",{selectById:wy,selectByIds:Py})}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 P({...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:u,uuid:l}of a)u in d||(d[u]=[]),d[u].push(l);return r.then(u=>{const l=u.flatMap(y=>d[y]??[]);for(const y of l)this.makeReadable(y)}),[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),u=(await Promise.all([c,r])).flat();return this.dispatch(a(u)),u}}class yz extends M{constructor(){super(...arguments);p(this,"name","Document");p(this,"url","/documents");p(this,"actions",{addOne:Fy,addMany:_y,setOne:gy,setMany:Ry,updateOne:by,updateMany:My,deleteOne:vy,deleteMany:Ey,initialize:Iy});p(this,"selectors",{selectById:ky,selectByIds:By})}add(e){var S;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:l.parent_document?[l.parent_document]:[],blocks:[l.uuid]});return y.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:u}=this.selectors,l=n.getState(),y=u(e)(l);if(!y)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const S=Dy(e)(l);this.dispatch(a(e)),this.dispatch(d(E(S)));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(y)),this.dispatch(r(S)),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),u=(await Promise.all([c,r])).flat();return this.dispatch(a(u)),u}}class qt extends Ut{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 Sz extends qt{constructor(){super(...arguments);p(this,"name","Email Domains");p(this,"url","/organization-email-domains");p(this,"actions",{addOne:qy,addMany:jy,setOne:$y,setMany:Cy,updateOne:Uy,updateMany:Ly,deleteOne:Ny,deleteMany:Hy,initialize:zy});p(this,"selectors",{selectById:Ky,selectByIds:Yy})}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 mz extends Ut{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 Ps={},ir=new Set;class fz extends Ut{constructor(){super(...arguments);p(this,"host");p(this,"dbPromise",ek.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 Os(e);if(ir.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),ir.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),ir.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 Ps?d=Ps[c]:Ir(e)?(d=Tr(e,a),Ps[c]=d):(d=new Promise(y=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(S=>{const f=new File([S],a,{type:S.type});y(f)})}),Ps[c]=d);let u;try{u=await d}catch(y){throw y instanceof C&&delete Ps[c],y}const l=await Os(u);if(l!==n){const y=`The hash of the file returned from the server (${l}) 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>BW?Jt:e}class C extends Error{constructor(e){super(Jt);p(this,"status");p(this,"response");p(this,"message");p(this,"options");const{response:n,innerError:a}=e;this.message=e.message??DW(n,a)??Jt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function VV(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 WW extends TV{constructor(s){super(s)}}class Ut extends TV{constructor(e,n){super(e);p(this,"auth");this.auth=n}}class zW extends Ut{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(Br(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(Wr(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(Dr(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(kr(n)),n}}function N(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 Ut{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 z extends M{constructor(){super(...arguments);p(this,"pageSize",PV)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:g,...V}=e;d=await this.client.files.getFilePayload(g),l=URL.createObjectURL(g),r={...V,file_sha1:d.sha1,file_type:d.file_type,file_name:g.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),y=this.buildPayload(u);this.dispatch(n(u));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...y,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});S.then(({instance:g})=>{this.dispatch(a(g))}).catch(g=>{throw this.dispatch(c(this.getId(u))),g}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=S.then(({instance:g})=>g),F=S.then(async({instance:g,presigned_url:V})=>{try{return V&&await this.client.files.processPresignedUrl(g.file_sha1,V),g.file_sha1}catch(_){throw console.error("Upload to s3 using presigned url failed.",_),_}});return[u,f,F]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,y=N(e,Math.min(n??e.length,L)),S=[];for(const V of y){const _=[],v={},b=[],D=[];for(const W of V){let q;if("file"in W){const{file:cr,...Dq}=W,xt=await this.client.files.getFilePayload(cr);xt.sha1 in v||(v[xt.sha1]=xt);const HV=URL.createObjectURL(cr);u.add(HV),q={...Dq,file_sha1:xt.sha1,file_type:xt.file_type,file_name:cr.name,file_extension:xt.extension,file_url:HV}}else q=W;const k=this.buildModel(q);l.push(k);const H=this.buildBulkPayload(k);_.push(H);const Qs=this.getBlockers(k);b.push(...Qs);const Bq=this.getBlocks(k);D.push(...Bq)}const j={payloads:_,submittedAt:d,files:Object.values(v),blockers:b,blocks:D};S.push(j)}this.dispatch(a(l));const f=S.map(V=>{const{submittedAt:_,files:v,payloads:b,blocks:D,blockers:j}=V;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,files:v,payloads:b},blockers:j,blocks:D})});Promise.all(f).then(V=>{const _=V.flatMap(v=>v.instances);this.dispatch(c(_))}).catch(V=>{throw this.dispatch(r(l.map(_=>this.getId(_)))),console.error(V),V}).finally(()=>{for(const V of u)URL.revokeObjectURL(V)});const F=Promise.all(f).then(V=>V.flatMap(({instances:_})=>_)),g=Promise.all(f).then(async V=>{const _=[];for(const{presigned_urls:v}of V){const b=this.client.files.processPresignedUrls(v);for(const[D,j]of Object.entries(b))try{await j,_.push(D)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return _});return[l,F,g]}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 qW extends z{constructor(){super(...arguments);p(this,"name","Asset attachment");p(this,"url","/asset-attachments");p(this,"actions",{addOne:$r,addMany:ai,setOne:Cr,setMany:Ur,updateOne:Lr,updateMany:Nr,deleteOne:Hr,deleteMany:ci,initialize:jr});p(this,"selectors",{selectById:Kr,selectByIds:Yr})}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 P({...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 jW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Attachment");p(this,"url","/asset-procedure-type-attachments");p(this,"actions",{addOne:xr,addMany:ed,setOne:td,setMany:sd,updateOne:id,updateMany:nd,deleteOne:ad,deleteMany:cd,initialize:Xr});p(this,"selectors",{selectById:ld,selectByIds:ud})}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,y=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,S=new Date().toISOString();return P({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:y,submitted_at:S,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 $W extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields Attachment");p(this,"url","/asset-procedure-type-fields-attachments");p(this,"actions",{addOne:pd,addMany:yd,setOne:Sd,setMany:md,updateOne:fd,updateMany:Ad,deleteOne:wd,deleteMany:Pd,initialize:hd});p(this,"selectors",{selectById:Id,selectByIds:Fd})}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 P({...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 CW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields");p(this,"url","/asset-procedure-type-fields");p(this,"actions",{addOne:Rd,addMany:bd,setOne:Md,setMany:vd,updateOne:Ed,updateMany:Vd,deleteOne:kd,deleteMany:Bd,initialize:gd});p(this,"selectors",{selectById:zd,selectByIds:qd})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}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 UW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values Attachment");p(this,"url","/asset-procedure-type-field-values-attachments");p(this,"actions",{addOne:Cd,addMany:yi,setOne:Ud,setMany:Ld,updateOne:Nd,updateMany:Hd,deleteOne:Gd,deleteMany:Si,initialize:$d});p(this,"selectors",{selectById:Qd,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 P({...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 LW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values");p(this,"url","/asset-procedure-type-field-values");p(this,"actions",{addOne:el,addMany:tl,setOne:sl,setMany:il,updateOne:nl,updateMany:al,deleteOne:cl,deleteMany:rl,initialize:xd});p(this,"selectors",{selectById:ul,selectByIds:ol})}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(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:a,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({asset:k})=>k),D=v.map(({fields_revision:k})=>k),j=v.map(({asset_procedure:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}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(y=>{this.dispatch(a(y))}).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(Si(E(u)));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(yi(u)),y}}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 NW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure");p(this,"url","/asset-procedures");p(this,"actions",{addOne:yl,addMany:wi,setOne:Al,setMany:wl,updateOne:Sl,updateMany:ml,deleteOne:fl,deleteMany:Pi,initialize:pl});p(this,"selectors",{selectById:Il,selectByIds:Fl})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 HW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type");p(this,"url","/asset-procedure-types");p(this,"actions",{addOne:Rl,addMany:bl,setOne:kl,setMany:Bl,updateOne:Ml,updateMany:vl,deleteOne:El,deleteMany:Vl,initialize:gl});p(this,"selectors",{selectById:zl,selectByIds:ql})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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=Tl(e)(d);this.dispatch(a(e)),this.dispatch(Pi(E(u)));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(wi(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 GW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields Attachment");p(this,"url","/asset-procedure-step-fields-attachments");p(this,"actions",{addOne:Cl,addMany:Ul,setOne:Ll,setMany:Nl,updateOne:Hl,updateMany:Gl,deleteOne:Kl,deleteMany:Yl,initialize:$l});p(this,"selectors",{selectById:Jl,selectByIds:Zl})}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 P({...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 KW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields");p(this,"url","/asset-procedure-step-fields");p(this,"actions",{addOne:tu,addMany:su,setOne:iu,setMany:nu,updateOne:au,updateMany:cu,deleteOne:ru,deleteMany:du,initialize:eu});p(this,"selectors",{selectById:lu,selectByIds:uu})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}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 YW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values Attachment");p(this,"url","/asset-procedure-step-field-values-attachments");p(this,"actions",{addOne:yu,addMany:bi,setOne:Su,setMany:mu,updateOne:fu,updateMany:Au,deleteOne:wu,deleteMany:Mi,initialize:pu});p(this,"selectors",{selectById:Ou,selectByIds:Tu})}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 P({...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 QW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values");p(this,"url","/asset-procedure-step-field-values");p(this,"actions",{addOne:Ru,addMany:bu,setOne:Mu,setMany:vu,updateOne:Eu,updateMany:Vu,deleteOne:ku,deleteMany:Bu,initialize:gu});p(this,"selectors",{selectById:Wu,selectByIds:zu})}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(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.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:D.values})}F.push({submitted_at:u,values:c,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({asset:k})=>k),D=v.map(({fields_revision:k})=>k),j=v.map(({asset_procedure:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}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(y=>{this.dispatch(a(y))}).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=Iu(e)(d);this.dispatch(a(e)),this.dispatch(Mi(E(u)));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(bi(u)),y}}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 JW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step");p(this,"url","/asset-procedure-steps");p(this,"actions",{addOne:Lu,addMany:Nu,setOne:Cu,setMany:Uu,updateOne:Hu,updateMany:Gu,deleteOne:Ku,deleteMany:Yu,initialize:$u});p(this,"selectors",{selectById:Ju,selectByIds:Zu})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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(),y=l(e)(u);if(!y)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const S=Xu(e)(u);this.dispatch(d(e)),this.dispatch(a(E(S)));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(y)),this.dispatch(c(S)),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 ZW extends M{constructor(){super(...arguments);p(this,"url","/assets");p(this,"name","Asset");p(this,"actions",{addOne:to,addMany:Di,setOne:ao,setMany:co,updateOne:so,updateMany:io,deleteOne:no,deleteMany:Wi,initialize:eo});p(this,"selectors",{selectById:uo,selectByIds:oo})}add(e){var S;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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=Qr(e)(d),y=pf(e)(d);this.dispatch(c(e)),this.dispatch(ci(E(u))),this.dispatch($t(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(a(l)),this.dispatch(ai(u)),this.dispatch(jt(y)),S}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=Dt.v4(),d=N(e,Math.min(n??e.length,L)).map(y=>{const S=y.map(f=>P(f));return{batchId:Dt.v4(),payload:{transaction_id:r,submitted_at:c,assets:S}}}),l=[];let u=null;for(const y of d){const{batchId:S,payload:f}=y,F=f.assets.map(({uuid:b})=>b),g=f.assets.map(({asset_type:b})=>b),V=f.assets.map(({project:b})=>b),_=f.assets.map(({status:b})=>b),v=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(g).concat(V).concat(_),blocks:[S].concat(F)});u=y.batchId,l.push(v)}return Promise.all(l).then(y=>{const S=y.flat();this.dispatch(a(S))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Ts);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(ti);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 F=0;F<d.length;F++)u.push({...l[F],...e[F]});this.dispatch(c(u));const y=N(e,Math.min(n??e.length,L)),S=[];let f=null;for(const F of y){const g=Dt.v4(),V=E(F),_=F.map(({status:b})=>b).filter(Boolean),v=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(V).concat(_),blocks:[g].concat(V)});S.push(v),f=g}return Promise.all(S).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,S]}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 XW extends M{constructor(){super(...arguments);p(this,"name","Asset Stage Completion");p(this,"url","/asset-stage-completions");p(this,"actions",{addOne:So,addMany:mo,setOne:fo,setMany:Ao,updateOne:wo,updateMany:Po,deleteOne:Oo,deleteMany:To,initialize:yo});p(this,"selectors",{selectById:go,selectByIds:Ro})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 F;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((F=n.getState().userReducer.currentUser)==null?void 0:F.id)??null,u=e.map(g=>P(g)),y=u.map(g=>({...g,created_by:l,submitted_at:d})),S=y.map(({uuid:g})=>g);this.dispatch(a(y));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(g=>g.asset_procedure),...e.map(g=>g.asset_stage),...e.map(g=>g.asset)],blocks:S});return f.then(g=>{this.dispatch(c(g))}).catch(()=>{this.dispatch(r(S))}),[y,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 xW extends M{constructor(){super(...arguments);p(this,"name","Asset Stage");p(this,"url","/asset-stages");p(this,"actions",{addOne:Vo,addMany:ko,setOne:vo,setMany:Eo,updateOne:Bo,updateMany:Do,deleteOne:Wo,deleteMany:zo,initialize:Mo});p(this,"selectors",{selectById:jo,selectByIds:$o})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 ez extends z{constructor(){super(...arguments);p(this,"name","Asset Type Attachment");p(this,"url","/asset-type-attachments");p(this,"actions",{addOne:Lo,addMany:Ui,setOne:No,setMany:Ho,updateOne:Go,updateMany:Ko,deleteOne:Yo,deleteMany:Li,initialize:Uo});p(this,"selectors",{selectById:Jo,selectByIds:Zo})}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 P({...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 tz extends z{constructor(){super(...arguments);p(this,"name","Asset Type Fields Attachment");p(this,"url","/asset-type-fields-attachments");p(this,"actions",{addOne:sh,addMany:ih,setOne:nh,setMany:ah,updateOne:ch,updateMany:rh,deleteOne:dh,deleteMany:lh,initialize:th});p(this,"selectors",{selectById:oh,selectByIds:hh})}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 P({...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 sz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Fields");p(this,"url","/asset-type-fields");p(this,"actions",{addOne:mh,addMany:fh,setOne:Ah,setMany:wh,updateOne:Ph,updateMany:Oh,deleteOne:Th,deleteMany:Ih,initialize:Sh});p(this,"selectors",{selectById:_h,selectByIds:gh})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}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 iz extends z{constructor(){super(...arguments);p(this,"name","Asset Type Field Values Attachment");p(this,"url","/asset-type-field-values-attachments");p(this,"actions",{addOne:vh,addMany:Qi,setOne:Eh,setMany:Vh,updateOne:kh,updateMany:Bh,deleteOne:Dh,deleteMany:Ji,initialize:Mh});p(this,"selectors",{selectById:zh,selectByIds:qh})}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 P({...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 nz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Field Values");p(this,"url","/asset-type-field-values");p(this,"actions",{addOne:Lh,addMany:Nh,setOne:Hh,setMany:Gh,updateOne:Kh,updateMany:Yh,deleteOne:Qh,deleteMany:Jh,initialize:Uh});p(this,"selectors",{selectById:Xh,selectByIds:xh})}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(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var g;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=[],S=N(a,Math.min(n??a.length,L)),f=[];for(const V of S){const _=[];for(const v of V){const b=P({...v,values:v.values,created_by:((g=this.client.store.getState().userReducer.currentUser)==null?void 0:g.id)??null,submitted_at:u});y.push(b),_.push({uuid:b.uuid,asset:v.asset,fields_revision:v.fields_revision,published_at:v.published_at,values:b.values})}f.push({submitted_at:u,values:c,field_values:_})}this.dispatch(r(y));const F=[];for(const V of f){const{field_values:_}=V,v=_.map(({asset:W})=>W),b=_.map(({fields_revision:W})=>W),D=_.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:V,blockers:v.concat(b),blocks:D});F.push(j)}return Promise.all(F).then(V=>{this.dispatch(d(V.flat()))}).catch(()=>{this.dispatch(l(E(y)))}),[y,F]}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(y=>{this.dispatch(a(y))}).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=jh(e)(d);this.dispatch(a(e)),this.dispatch(Ji(E(u)));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(Qi(u)),y}}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 az extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier");p(this,"url","/asset-type-identifiers");p(this,"actions",{addOne:ip,addMany:np,setOne:ap,setMany:cp,updateOne:rp,updateMany:dp,deleteOne:lp,deleteMany:up,initialize:sp});p(this,"selectors",{selectById:hp,selectByIds:pp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 cz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier Value");p(this,"url","/asset-type-identifier-values");p(this,"actions",{addOne:fp,addMany:Ap,setOne:wp,setMany:Pp,updateOne:Op,updateMany:Tp,deleteOne:Ip,deleteMany:Fp,initialize:mp});p(this,"selectors",{selectById:gp,selectByIds:Rp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}bulkAdd(e,n){var V;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((V=a.getState().userReducer.currentUser)==null?void 0:V.id)??null,y=N(e,Math.min(n??e.length,L)),S=[],f=[];for(const _ of y){const v=[],b=[],D=[];for(const W of _){const q=P({...W,submitted_at:l,created_by:u});f.push(q);const k={uuid:q.uuid,asset:q.asset,asset_type_identifier:q.asset_type_identifier,value:q.value};v.push(k),b.push(q.asset),b.push(q.asset_type_identifier),D.push(q.uuid)}const j={payloads:v,submitted_at:l,blockers:b,blocks:D};S.push(j)}this.dispatch(c(f));const F=S.map(_=>{const{payloads:v,submitted_at:b,blockers:D,blocks:j}=_;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:v},blockers:D,blocks:j})});Promise.all(F).then(_=>{this.dispatch(r(_.flat()))}).catch(_=>{throw this.dispatch(d(E(f))),_});const g=Promise.all(F).then(_=>_.flat());return[f,g]}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 rz extends M{constructor(){super(...arguments);p(this,"name","Asset Type");p(this,"url","/asset-types");p(this,"actions",{addOne:kp,addMany:Bp,setOne:Ep,setMany:Vp,updateOne:Dp,updateMany:Wp,deleteOne:zp,deleteMany:qp,initialize:vp});p(this,"selectors",{selectById:$p,selectByIds:Cp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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=lo(e)(d),y=Xo(e)(d);this.dispatch(a(e)),this.dispatch(Wi(E(u))),this.dispatch(Li(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(l)),this.dispatch(Di(u)),this.dispatch(Ui(y)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class dz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Status");p(this,"url","/asset-type-statuses");p(this,"actions",{addOne:Hp,addMany:Gp,setOne:Kp,setMany:Yp,updateOne:Qp,updateMany:Jp,deleteOne:Zp,deleteMany:Xp,initialize:Np});p(this,"selectors",{selectById:ey,selectByIds:ty})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 lz extends z{constructor(){super(...arguments);p(this,"name","Document Attachment");p(this,"url","/document-attachments");p(this,"actions",{addOne:dy,addMany:ly,setOne:uy,setMany:oy,updateOne:hy,updateMany:py,deleteOne:yy,deleteMany:Sy,initialize:ry});p(this,"selectors",{selectById:fy,selectByIds:Ay})}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 P({...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(y=>d[y]??[]);for(const y of u)this.makeReadable(y)}),[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 uz extends M{constructor(){super(...arguments);p(this,"name","Document");p(this,"url","/documents");p(this,"actions",{addOne:Ty,addMany:Iy,setOne:Fy,setMany:_y,updateOne:gy,updateMany:Ry,deleteOne:by,deleteMany:My,initialize:Oy});p(this,"selectors",{selectById:Ey,selectByIds:Vy})}add(e){var S;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,y]}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(),y=l(e)(u);if(!y)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const S=ky(e)(u);this.dispatch(a(e)),this.dispatch(d(E(S)));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(y)),this.dispatch(r(S)),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 qt extends Ut{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 oz extends qt{constructor(){super(...arguments);p(this,"name","Email Domains");p(this,"url","/organization-email-domains");p(this,"actions",{addOne:Wy,addMany:zy,setOne:qy,setMany:jy,updateOne:$y,updateMany:Cy,deleteOne:Uy,deleteMany:Ly,initialize:Dy});p(this,"selectors",{selectById:Hy,selectByIds:Gy})}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 hz extends Ut{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 ws={},sr=new Set;class pz extends Ut{constructor(){super(...arguments);p(this,"host");p(this,"dbPromise",ZV.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 Os(e);if(sr.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),sr.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),sr.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 ws?d=ws[c]:Ir(e)?(d=Tr(e,a),ws[c]=d):(d=new Promise(y=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(S=>{const f=new File([S],a,{type:S.type});y(f)})}),ws[c]=d);let l;try{l=await d}catch(y){throw y instanceof C&&delete ws[c],y}const u=await Os(l);if(u!==n){const y=`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(y)}return await this.addCache(u),u}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 Os(e),file_type:e.type,extension:Pr(e),size:e.size};return await this.client.files.addCache(e),a}}class Az extends M{constructor(){super(...arguments);p(this,"name","Form Identifier");p(this,"url","/form-identifiers");p(this,"actions",{addOne:tS,addMany:sS,setOne:iS,setMany:nS,updateOne:aS,updateMany:cS,deleteOne:rS,deleteMany:dS,initialize:eS});p(this,"selectors",{selectById:lS,selectByIds:oS})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.form],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)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(l){throw this.dispatch(c(u)),l}}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 wz extends M{constructor(){super(...arguments);p(this,"name","Form Identifier Value");p(this,"url","/form-identifier-values");p(this,"actions",{addOne:SS,addMany:mS,setOne:fS,setMany:AS,updateOne:wS,updateMany:PS,deleteOne:OS,deleteMany:TS,initialize:yS});p(this,"selectors",{selectById:FS,selectByIds:_S})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.form_submission,e.form_identifier],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)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(l){throw this.dispatch(c(u)),l}}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 Pz extends z{constructor(){super(...arguments);p(this,"name","Form Revision Attachment");p(this,"url","/form-revision-attachments");p(this,"actions",{addOne:MS,addMany:vS,setOne:ES,setMany:VS,updateOne:kS,updateMany:BS,deleteOne:DS,deleteMany:WS,initialize:bS});p(this,"selectors",{selectById:qS,selectByIds:jS})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:u}}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 Oz extends M{constructor(){super(...arguments);p(this,"name","Form Revision");p(this,"url","/form-revisions");p(this,"actions",{addOne:LS,addMany:On,setOne:NS,setMany:HS,updateOne:GS,updateMany:KS,deleteOne:YS,deleteMany:Tn,initialize:US});p(this,"selectors",{selectById:JS,selectByIds:ZS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),y=P({...e,created_by:u,submitted_at:l});this.dispatch(a(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.form],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}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 Tz extends M{constructor(){super(...arguments);p(this,"name","Form");p(this,"url","/forms");p(this,"actions",{addOne:sm,addMany:im,setOne:nm,setMany:am,updateOne:cm,updateMany:rm,deleteOne:dm,deleteMany:um,initialize:tm});p(this,"selectors",{selectById:hm,selectByIds:pm})}add(e){var S;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),u=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=P({...e,submitted_at:d,created_by:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error("Expected form to exist");const l=zm(e)(d),y=XS(e)(d);this.dispatch(a(e)),this.dispatch(kn(E(l))),this.dispatch(Tn(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(u)),this.dispatch(On(y)),this.dispatch(Vn(l)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Iz extends z{constructor(){super(...arguments);p(this,"name","Form Submission Attachment");p(this,"url","/form-submission-attachments");p(this,"actions",{addOne:mm,addMany:gn,setOne:fm,setMany:Am,updateOne:wm,updateMany:Pm,deleteOne:Om,deleteMany:Rn,initialize:Sm});p(this,"selectors",{selectById:Tm,selectByIds:Im})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:u}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=vn(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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class Fz extends M{constructor(){super(...arguments);p(this,"name","Form Submission");p(this,"url","/form-submissions");p(this,"actions",{addOne:vm,addMany:Vn,setOne:bm,setMany:Mm,updateOne:Em,updateMany:Vm,deleteOne:km,deleteMany:kn,initialize:Rm});p(this,"selectors",{selectById:Dm,selectByIds:Wm})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),y=P({...e,created_by:u,submitted_at:l}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.form_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}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 u={...d,...e};this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${u.uuid}/`,payload:e,blockers:[u.uuid],blocks:[u.uuid]});return l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const l=Fm(e)(d);this.dispatch(a(e)),this.dispatch(Rn(E(l)));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(u)),this.dispatch(gn(l)),y}}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 _z extends z{constructor(){super(...arguments);p(this,"name","Geo Image");p(this,"url","/geo-images");p(this,"actions",{addOne:Lm,addMany:Nm,setOne:Cm,setMany:Um,updateOne:Hm,updateMany:Gm,deleteOne:Km,deleteMany:Ym,initialize:$m});p(this,"selectors",{selectById:Jm,selectByIds:Zm})}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 P({...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 u={...d,...e};this.dispatch(a(u));const l=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 l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class gz extends M{constructor(){super(...arguments);p(this,"name","Issue Association");p(this,"url","/issue-associations");p(this,"actions",{addOne:cf,addMany:jt,setOne:sf,setMany:tf,updateOne:nf,updateMany:af,deleteOne:rf,deleteMany:$t,initialize:ef});p(this,"selectors",{selectById:uf,selectByIds:lf})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),u=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=P({...e,submitted_at:d,created_by:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Rz extends z{constructor(){super(...arguments);p(this,"name","Issue Attachment");p(this,"url","/issue-attachments");p(this,"actions",{addOne:wf,addMany:jn,setOne:Pf,setMany:Of,updateOne:Tf,updateMany:If,deleteOne:Ff,deleteMany:$n,initialize:Af});p(this,"selectors",{selectById:Rf,selectByIds:bf})}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 P({...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 bz extends z{constructor(){super(...arguments);p(this,"name","Issue Comment Attachment");p(this,"url","/issue-comment-attachments");p(this,"actions",{addOne:Vf,addMany:kf,setOne:Bf,setMany:Df,updateOne:Wf,updateMany:zf,deleteOne:qf,deleteMany:jf,initialize:Ef});p(this,"selectors",{selectById:Cf,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 P({...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 Mz extends M{constructor(){super(...arguments);p(this,"name","Issue Comment");p(this,"url","/issue-comments");p(this,"actions",{addOne:Gf,addMany:Kf,setOne:Yf,setMany:Qf,updateOne:Jf,updateMany:Zf,deleteOne:Xf,deleteMany:xf,initialize:Hf});p(this,"selectors",{selectById:eA,selectByIds:tA})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(c(l))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{setMany:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class vz extends M{constructor(){super(...arguments);p(this,"name","Issue");p(this,"url","/issues");p(this,"actions",{addOne:aA,addMany:Kn,setOne:cA,setMany:rA,updateOne:dA,updateMany:uA,deleteOne:lA,deleteMany:Yn,initialize:nA});p(this,"selectors",{selectById:hA,selectByIds:pA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),u=new Date().toISOString(),l=((f=d.userReducer.currentUser)==null?void 0:f.id)??null,y=P({...e,submitted_at:u,created_by:l});this.dispatch(a(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[y.project,y.issue_type,y.status],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(F=>{throw this.dispatch(r(y.uuid)),F}),[y,S]}update(e){var S;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 u={};for(const f of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(f in e&&e[f]!==r[f])switch(f){case $.PRIORITY:u[f]=e[f];break;case $.DUE_DATE:u[f]=e[f];break;case $.DESCRIPTION:u[f]=e[f];break;case $.TITLE:u[f]=e[f];break;case $.STATUS:{const F=e[f],g=ha(F)(c);if(!g)throw new Error(`Trying to update issue type status with ${F} which does not exist in store`);u[f]={name:g.name,color:g.color,uuid:g.uuid};break}case $.ASSIGNED_TO:{const F=e[f];if(F===null)u[f]=null;else{const g=$s(F)(c);if(!g)throw new Error(`Trying to update assigned to with ${F} which does not exist in store.`);u[f]={full_name:g.username,id:g.id}}break}}const l=P({created_by:((S=c.userReducer.currentUser)==null?void 0:S.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:u});this.dispatch(ya(l));const y=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 y.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(ma(l.uuid))}),[d,y]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Ts);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=r(d)(a.getState()).toSorted(ii);if(d.length!=u.length)throw new Error(`Attempting to bulk update ${d.length-u.length} issues that dont exist in the store`);const l=[];for(let F=0;F<d.length;F++)l.push({...u[F],...e[F]});this.dispatch(c(l));const y=N(e,Math.min(n??e.length,L)),S=[];let f=null;for(const F of y){const g=Dt.v4(),V=E(F),_=F.map(({status:b})=>b).filter(Boolean),v=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(V).concat(_),blocks:[g].concat(V)});S.push(v),f=g}return Promise.all(S).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(u))}),[l,S]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`No issue with uuid ${e} found in the store`);const l=of(e)(d),y=yf(e)(d),S=Lb(e)(d),f=gf(e)(d),F=$P(e)(d);this.dispatch(a(e)),this.dispatch($n(E(f))),this.dispatch(fa(E(F))),this.dispatch($t(E(l))),this.dispatch($t(E(y))),this.dispatch(ys(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(g){throw this.dispatch(c(u)),this.dispatch(jn(f)),this.dispatch(Sa(F)),this.dispatch(jt(l)),this.dispatch(jt(y)),this.dispatch(ps(S)),g}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),u=r(e)(d),l=hf(e)(d),y=pf(e)(d),S=Ub(e)(d);this.dispatch(c(e)),this.dispatch($t(E(l))),this.dispatch($t(E(y))),this.dispatch(ys(E(S)));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(f){throw this.dispatch(a(u)),this.dispatch(jt(l)),this.dispatch(jt(y)),this.dispatch(ps(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Ez extends z{constructor(){super(...arguments);p(this,"name","Issue Type Attachment");p(this,"url","/issue-type-attachments");p(this,"actions",{addOne:AA,addMany:wA,setOne:PA,setMany:OA,updateOne:TA,updateMany:IA,deleteOne:FA,deleteMany:_A,initialize:fA});p(this,"selectors",{selectById:RA,selectByIds:bA})}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 P({...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 Vz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Fields Attachment");p(this,"url","/issue-type-fields-attachments");p(this,"actions",{addOne:VA,addMany:kA,setOne:BA,setMany:DA,updateOne:WA,updateMany:zA,deleteOne:qA,deleteMany:jA,initialize:EA});p(this,"selectors",{selectById:CA,selectByIds:UA})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}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 kz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Fields");p(this,"url","/issue-type-fields");p(this,"actions",{addOne:cw,addMany:rw,setOne:dw,setMany:uw,updateOne:lw,updateMany:ow,deleteOne:hw,deleteMany:pw,initialize:aw});p(this,"selectors",{selectById:Sw,selectByIds:mw})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.issue_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(l.uuid)),f}),[l,y]}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 Bz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Field Values Attachment");p(this,"url","/issue-type-field-values-attachments");p(this,"actions",{addOne:Pw,addMany:sa,setOne:Ow,setMany:Tw,updateOne:Iw,updateMany:Fw,deleteOne:_w,deleteMany:ia,initialize:ww});p(this,"selectors",{selectById:Rw,selectByIds:bw})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),u=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(l){throw this.dispatch(c(u)),l}}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 Dz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Field Values");p(this,"url","/issue-type-field-values");p(this,"actions",{addOne:GA,addMany:KA,setOne:YA,setMany:QA,updateOne:JA,updateMany:ZA,deleteOne:XA,deleteMany:xA,initialize:HA});p(this,"selectors",{selectById:tw,selectByIds:sw})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),y=P({...e,created_by:u,submitted_at:l}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.issue,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}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 u={...d,...e};this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.uuid,u.fields_revision,u.issue],blocks:[u.uuid]});return l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const l=Mw(e)(d);this.dispatch(a(e)),this.dispatch(ia(E(l)));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(u)),this.dispatch(sa(l)),y}}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 Wz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier");p(this,"url","/issue-type-identifiers");p(this,"actions",{addOne:kw,addMany:Bw,setOne:Dw,setMany:Ww,updateOne:zw,updateMany:qw,deleteOne:jw,deleteMany:$w,initialize:Vw});p(this,"selectors",{selectById:Uw,selectByIds:Lw})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.issue_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)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(l){throw this.dispatch(c(u)),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 zz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier Value");p(this,"url","/issue-type-identifier-values");p(this,"actions",{addOne:Kw,addMany:Yw,setOne:Qw,setMany:Jw,updateOne:Zw,updateMany:Xw,deleteOne:xw,deleteMany:eP,initialize:Gw});p(this,"selectors",{selectById:sP,selectByIds:iP})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.issue,e.issue_type_identifier],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(u)),l}}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 qz extends M{constructor(){super(...arguments);p(this,"name","Issue Type");p(this,"url","/issue-types");p(this,"actions",{addOne:rP,addMany:dP,setOne:uP,setMany:lP,updateOne:oP,updateMany:hP,deleteOne:pP,deleteMany:yP,initialize:cP});p(this,"selectors",{selectById:mP,selectByIds:fP})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),y=P({...e,submitted_at:l,created_by:u});this.dispatch(a(y));const S=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}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 u={...d,...e};this.dispatch(a(u));const l=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const l=yA(e)(d);this.dispatch(a(e)),this.dispatch(Yn(E(l)));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(u)),this.dispatch(Kn(l)),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 jz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Status");p(this,"url","/issue-type-statuses");p(this,"actions",{addOne:OP,addMany:TP,setOne:IP,setMany:FP,updateOne:_P,updateMany:gP,deleteOne:RP,deleteMany:bP,initialize:PP});p(this,"selectors",{selectById:ha,selectByIds:vP})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.issue_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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 u=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 u.then(l=>{this.dispatch(n(l))}).catch(()=>{this.dispatch(n(r))}),[d,u]}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(u){throw this.dispatch(c(d)),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 $z extends M{constructor(){super(...arguments);p(this,"name","Issue Update");p(this,"url","/issue-updates");p(this,"actions",{addOne:ya,addMany:Sa,setOne:BP,setMany:DP,updateOne:WP,updateMany:zP,deleteOne:ma,deleteMany:fa,initialize:kP});p(this,"selectors",{selectById:qP,selectByIds:jP})}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 Cz=1800;function Uz(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 Lz extends $W{constructor(){super(...arguments);p(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(cy(!1)),this.clearTokens(),this.dispatch(O()),this.dispatch(O())}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=tk(e).exp??n}catch{a=n}return a-n<Cz}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??Zt).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=Dt.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(Uz(a))})}}class Nz extends qt{constructor(){super(...arguments);p(this,"name","Organization Access");p(this,"url","/organization-accesses");p(this,"actions",{addOne:tO,addMany:sO,setOne:iO,setMany:nO,updateOne:aO,updateMany:cO,deleteOne:rO,deleteMany:dO,initialize:eO});p(this,"selectors",{selectById:lO,selectByIds:oO})}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 u=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 u.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(r)),l}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d),l=$s(u.user)(d);this.dispatch(a(u.uuid)),this.dispatch(Ta(u.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${u.uuid}/`,blockers:[u.uuid],blocks:[]})}catch(y){throw this.dispatch(c(u)),this.dispatch(Oa(l)),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 Hz extends qt{constructor(){super(...arguments);p(this,"name","Organization");p(this,"url","/organizations");p(this,"actions",{addOne:AO,addMany:fO,setOne:mO,setMany:SO,updateOne:PO,updateMany:wO,deleteOne:OO,deleteMany:TO,initialize:yO});p(this,"selectors",{selectById:_O,selectByIds:gO})}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 Gz extends M{constructor(){super(...arguments);p(this,"name","Project Access");p(this,"url","/project-accesses");p(this,"actions",{addOne:WO,addMany:zO,setOne:qO,setMany:jO,updateOne:$O,updateMany:CO,deleteOne:UO,deleteMany:LO,initialize:DO});p(this,"selectors",{selectById:HO,selectByIds:GO})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(d.uuid)),y}),[d,u]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=e.map(S=>P({...S,created_by:d}));this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:u.map(S=>R(S))},blockers:u.flatMap(S=>[S.project,S.organization_access]),blocks:u.map(S=>S.uuid)});return l.then(S=>{this.dispatch(r(S))}).catch(S=>{throw this.dispatch(c(u.map(f=>f.uuid))),S}),[u,l]}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 u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return u.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(r)),l}),[d,u]}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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class Kz extends z{constructor(){super(...arguments);p(this,"name","Project Attachment");p(this,"url","/project-attachments");p(this,"actions",{addOne:QO,addMany:JO,setOne:ZO,setMany:XO,updateOne:xO,updateMany:eT,deleteOne:tT,deleteMany:sT,initialize:YO});p(this,"selectors",{selectById:nT,selectByIds:aT})}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 P({...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 Yz extends z{constructor(){super(...arguments);p(this,"name","Project File");p(this,"url","/project-files");p(this,"actions",{addOne:oT,addMany:hT,setOne:uT,setMany:lT,updateOne:pT,updateMany:yT,deleteOne:ST,deleteMany:mT,initialize:dT});p(this,"selectors",{selectById:wT,selectByIds:PT})}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 P({...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 u={...d,...e};this.dispatch(a(u));const l=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 l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,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 Qz extends qt{constructor(){super(...arguments);p(this,"name","Project");p(this,"url","/projects");p(this,"actions",{addOne:RT,addMany:gT,setOne:_T,setMany:FT,updateOne:MT,updateMany:bT,deleteOne:vT,deleteMany:ET,initialize:IT});p(this,"selectors",{selectById:BT,selectByIds:DT})}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}}const WV=(...t)=>t.filter(s=>s!==null);class Jz extends M{constructor(){super(...arguments);p(this,"name","Procedure");p(this,"url","/procedures");p(this,"actions",{addOne:qT,addMany:Ba,setOne:jT,setMany:$T,updateOne:CT,updateMany:UT,deleteOne:LT,deleteMany:Da,initialize:zT});p(this,"selectors",{selectById:GT,selectByIds:KT})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:WV(d.procedure_type,d.project,d.asset,d.issue),blocks:[d.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:WV(r.uuid,d.procedure_type,d.project,d.asset,d.issue),blocks:[r.uuid]});return u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}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 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(d)),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 Zz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Assignee");p(this,"url","/procedure-step-assignees");p(this,"actions",{addOne:ZT,addMany:XT,setOne:xT,setMany:eI,updateOne:tI,updateMany:sI,deleteOne:iI,deleteMany:nI,initialize:JT});p(this,"selectors",{selectById:cI,selectByIds:rI})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure,d.procedure_step],blocks:[d.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=e.map(f=>P({...f,created_by:d,submitted_at:u}));this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:l.map(f=>R(f)),submitted_at:u},blockers:l.flatMap(f=>[f.procedure,f.procedure_step]),blocks:l.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(E(l)))}),[l,y]}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 procedure 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(u){throw this.dispatch(c(d)),u}}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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Xz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Comment");p(this,"url","/procedure-step-comments");p(this,"actions",{addOne:oI,addMany:hI,setOne:pI,setMany:yI,updateOne:SI,updateMany:mI,deleteOne:fI,deleteMany:AI,initialize:lI});p(this,"selectors",{selectById:PI,selectByIds:OI})}add(e){var l;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure,d.procedure_step],blocks:[d.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Procedure step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}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(`Procedure 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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class xz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Assignee");p(this,"url","/procedure-step-default-assignees");p(this,"actions",{addOne:_I,addMany:gI,setOne:RI,setMany:bI,updateOne:MI,updateMany:vI,deleteOne:EI,deleteMany:VI,initialize:FI});p(this,"selectors",{selectById:BI,selectByIds:DI})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_step],blocks:[d.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}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 procedure step default 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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class eq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Reviewer");p(this,"url","/procedure-step-default-reviewers");p(this,"actions",{addOne:jI,addMany:$I,setOne:CI,setMany:UI,updateOne:LI,updateMany:NI,deleteOne:HI,deleteMany:GI,initialize:qI});p(this,"selectors",{selectById:YI,selectByIds:QI})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_step],blocks:[d.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}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 procedure step default 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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class tq extends qt{constructor(){super(...arguments);p(this,"name","Procedure Step Event");p(this,"url","/procedure-step-events");p(this,"actions",{addOne:xI,addMany:eF,setOne:tF,setMany:sF,updateOne:iF,updateMany:nF,deleteOne:aF,deleteMany:cF,initialize:XI});p(this,"selectors",{selectById:dF,selectByIds:uF})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class sq extends z{constructor(){super(...arguments);p(this,"name","Procedure Step Fields Attachment");p(this,"url","/procedure-step-fields-attachments");p(this,"actions",{addOne:pF,addMany:Na,setOne:yF,setMany:SF,updateOne:mF,updateMany:fF,deleteOne:AF,deleteMany:Ha,initialize:hF});p(this,"selectors",{selectById:OF,selectByIds:TF})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class iq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Fields");p(this,"url","/procedure-step-fields");p(this,"actions",{addOne:gF,addMany:RF,setOne:bF,setMany:MF,updateOne:vF,updateMany:EF,deleteOne:VF,deleteMany:kF,initialize:_F});p(this,"selectors",{selectById:BF,selectByIds:DF})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_step],blocks:[d.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected procedure step fields with uuid ${e} to exist`);const l=PF(e)(d);this.dispatch(a(e)),this.dispatch(Ha(E(l)));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(u)),this.dispatch(Na(l)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class nq extends z{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Attachment");p(this,"url","/procedure-step-field-values-attachments");p(this,"actions",{addOne:jF,addMany:Ja,setOne:$F,setMany:CF,updateOne:UF,updateMany:LF,deleteOne:NF,deleteMany:Za,initialize:qF});p(this,"selectors",{selectById:GF,selectByIds:KF})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),u=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(l){throw this.dispatch(c(u)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class aq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Review Request");p(this,"url","/procedure-step-field-values-review-requests");p(this,"actions",{addOne:h_,addMany:tc,setOne:p_,setMany:y_,updateOne:S_,updateMany:m_,deleteOne:f_,deleteMany:sc,initialize:o_});p(this,"selectors",{selectById:w_,selectByIds:P_})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}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(`Procedure 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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class cq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Review");p(this,"url","/procedure-step-field-values-reviews");p(this,"actions",{addOne:__,addMany:nc,setOne:g_,setMany:R_,updateOne:b_,updateMany:M_,deleteOne:v_,deleteMany:ac,initialize:F_});p(this,"selectors",{selectById:V_,selectByIds:k_})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,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(`Procedure step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}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(`Procedure 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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class rq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values");p(this,"url","/procedure-step-field-values");p(this,"actions",{addOne:XF,addMany:xF,setOne:e_,setMany:t_,updateOne:s_,updateMany:i_,deleteOne:n_,deleteMany:a_,initialize:ZF});p(this,"selectors",{selectById:r_,selectByIds:d_})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),y=P({...e,created_by:u,submitted_at:l}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:u}=this.actions,l=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:l});S.push(D),v.push({uuid:D.uuid,fields_revision:b.fields_revision,procedure:b.procedure,procedure_step:b.procedure_step,published_at:b.published_at,values:D.values})}F.push({submitted_at:l,values:c,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({fields_revision:k})=>k),D=v.map(({procedure:k})=>k),j=v.map(({procedure_step:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(u(E(S)))}),[S,g]}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 ProcedureStepFieldValues with uuid ${e.uuid} to exist`);const u={...d,...e};this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.uuid,u.procedure,u.procedure_step,u.fields_revision],blocks:[u.uuid]});return l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e} to exist`);const l=YF(e)(d),y=B_(e)(d),S=O_(e)(d);this.dispatch(a(e)),this.dispatch(Za(E(l))),this.dispatch(ac(E(y))),this.dispatch(sc(E(S)));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(u)),this.dispatch(Ja(l)),this.dispatch(nc(y)),this.dispatch(tc(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class dq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Reviewer");p(this,"url","/procedure-step-reviewers");p(this,"actions",{addOne:q_,addMany:j_,setOne:$_,setMany:C_,updateOne:U_,updateMany:L_,deleteOne:N_,deleteMany:H_,initialize:z_});p(this,"selectors",{selectById:K_,selectByIds:Y_})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure,d.procedure_step],blocks:[d.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=e.map(f=>P({...f,created_by:d,submitted_at:u}));this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:l.map(f=>R(f)),submitted_at:u},blockers:l.flatMap(f=>[f.procedure,f.procedure_step]),blocks:l.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.map(f=>f.uuid)))}),[l,y]}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 procedure 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(u){throw this.dispatch(c(d)),u}}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(u){throw this.dispatch(c(d)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class uq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step");p(this,"url","/procedure-steps");p(this,"actions",{addOne:eg,addMany:tg,setOne:X_,setMany:x_,updateOne:sg,updateMany:ig,deleteOne:ng,deleteMany:ag,initialize:Z_});p(this,"selectors",{selectById:rg,selectByIds:dg})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_type],blocks:[d.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,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(`No procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:u}=this.selectors,l=n.getState(),y=u(e)(l);if(!y)throw new Error(`No procedure step with uuid ${e} found in the store`);const S=ug(e)(l);this.dispatch(d(e)),this.dispatch(a(E(S)));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(y)),this.dispatch(c(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class lq extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Attachment");p(this,"url","/procedure-type-attachments");p(this,"actions",{addOne:hg,addMany:pg,setOne:yg,setMany:Sg,updateOne:mg,updateMany:fg,deleteOne:Ag,deleteMany:wg,initialize:og});p(this,"selectors",{selectById:Tg,selectByIds:Ig})}getId(e){return e.uuid}getBlockers(e){return[e.procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:u,file_url:l}=e,y=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,S=new Date().toISOString();return P({file_url:l,file_sha1:c,file_extension:r,file_name:d,file_type:u,created_by:y,submitted_at:S,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,procedure_type:e.procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class oq extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Fields Attachment");p(this,"url","/procedure-type-fields-attachments");p(this,"actions",{addOne:gg,addMany:Rg,setOne:bg,setMany:Mg,updateOne:vg,updateMany:Eg,deleteOne:Vg,deleteMany:kg,initialize:_g});p(this,"selectors",{selectById:Wg,selectByIds:zg})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class hq extends M{constructor(){super(...arguments);p(this,"name","Procedure Type Fields");p(this,"url","/procedure-type-fields");p(this,"actions",{addOne:$g,addMany:Cg,setOne:Ug,setMany:Lg,updateOne:Ng,updateMany:Hg,deleteOne:Gg,deleteMany:Kg,initialize:jg});p(this,"selectors",{selectById:Jg,selectByIds:Zg})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=P({...e,created_by:d,submitted_at:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[l.procedure_type],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(l.uuid)),f}),[l,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class pq extends z{constructor(){super(...arguments);p(this,"name","Procedure Field Values Attachment");p(this,"url","/procedure-field-values-attachments");p(this,"actions",{addOne:eR,addMany:Sc,setOne:tR,setMany:sR,updateOne:iR,updateMany:nR,deleteOne:aR,deleteMany:mc,initialize:xg});p(this,"selectors",{selectById:dR,selectByIds:uR})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),u=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(l){throw this.dispatch(c(u)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class yq extends M{constructor(){super(...arguments);p(this,"name","Procedure Field Values");p(this,"url","/procedure-field-values");p(this,"actions",{addOne:pR,addMany:yR,setOne:SR,setMany:mR,updateOne:fR,updateMany:AR,deleteOne:wR,deleteMany:PR,initialize:hR});p(this,"selectors",{selectById:IR,selectByIds:FR})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),y=P({...e,created_by:u,submitted_at:l}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.fields_revision,e.procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:u}=this.actions,l=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:l});S.push(D),v.push({uuid:D.uuid,fields_revision:b.fields_revision,procedure:b.procedure,published_at:b.published_at,values:D.values})}F.push({submitted_at:l,values:a,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({fields_revision:q})=>q),D=v.map(({procedure:q})=>q),j=v.map(({uuid:q})=>q),W=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D),blocks:j});g.push(W)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(u(E(S)))}),[S,g]}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 ProcedureFieldValues with uuid ${e.uuid} to exist`);const u={...d,...e};this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.fields_revision,u.procedure],blocks:[u.uuid]});return l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const l=lR(e)(d);this.dispatch(a(e)),this.dispatch(mc(E(l)));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(u)),this.dispatch(Sc(l)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Sq extends M{constructor(){super(...arguments);p(this,"name","Procedure Type");p(this,"url","/procedure-types");p(this,"actions",{addOne:RR,addMany:bR,setOne:MR,setMany:vR,updateOne:ER,updateMany:VR,deleteOne:kR,deleteMany:BR,initialize:gR});p(this,"selectors",{selectById:zR,selectByIds:qR})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),u=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return l.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,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 procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected procedure type with uuid ${e} to exist`);const l=YT(e)(d);this.dispatch(a(e)),this.dispatch(Da(E(l)));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(u)),this.dispatch(Ba(l)),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 mq extends M{constructor(){super(...arguments);p(this,"name","Team Membership");p(this,"url","/team-memberships");p(this,"actions",{addOne:UR,addMany:LR,setOne:NR,setMany:HR,updateOne:GR,updateMany:KR,deleteOne:YR,deleteMany:QR,initialize:CR});p(this,"selectors",{selectById:XR,selectByIds:xR})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}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,u=e.map(S=>P({...S,created_by:d}));this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:u.map(S=>R(S))},blockers:u.map(S=>S.team),blocks:u.map(S=>S.uuid)});return l.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(u.map(S=>S.uuid)))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)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(l){throw this.dispatch(c(u)),l}}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 fq extends M{constructor(){super(...arguments);p(this,"name","Team");p(this,"url","/teams");p(this,"actions",{addOne:sb,addMany:ib,setOne:nb,setMany:ab,updateOne:cb,updateMany:rb,deleteOne:db,deleteMany:ub,initialize:tb});p(this,"selectors",{selectById:ob,selectByIds:hb})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,submitted_at:new Date().toISOString(),created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null});this.dispatch(a(d));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)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(l){throw this.dispatch(c(u)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Aq extends qt{constructor(){super(...arguments);p(this,"name","User");p(this,"url","/user");p(this,"actions",{addOne:Oa,addMany:GP,setOne:HP,setMany:NP,updateOne:YP,updateMany:KP,deleteOne:Ta,deleteMany:QP,initialize:LP});p(this,"selectors",{selectById:$s,selectByIds:XP})}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 wq extends M{constructor(){super(...arguments);p(this,"name","Workflow");p(this,"url","/workflows");p(this,"actions",{addOne:Ab,addMany:wb,setOne:Pb,setMany:Ob,updateOne:Tb,updateMany:Ib,deleteOne:Fb,deleteMany:_b,initialize:fb});p(this,"selectors",{selectById:Rb,selectByIds:bb})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected workflow with uuid ${e} to exist`);const l=Cb(e)(d);this.dispatch(a(e)),this.dispatch(ys(E(l)));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(u)),this.dispatch(ps(l)),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 Pq extends M{constructor(){super(...arguments);p(this,"name","Workflow Issue Link");p(this,"url","/workflow-issue-links");p(this,"actions",{addOne:Vb,addMany:ps,setOne:kb,setMany:Bb,updateOne:Db,updateMany:Wb,deleteOne:zb,deleteMany:ys,initialize:Eb});p(this,"selectors",{selectById:jb,selectByIds:$b})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),u=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=P({...e,submitted_at:d,created_by:u});this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.workflow,e.issue],blocks:[l.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,y]}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(u){throw this.dispatch(c(d)),u}}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 Oq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Assignee");p(this,"url","/workflow-step-assignees");p(this,"actions",{addOne:Kb,addMany:Yb,setOne:Qb,setMany:Jb,updateOne:Zb,updateMany:Xb,deleteOne:xb,deleteMany:eM,initialize:Gb});p(this,"selectors",{selectById:sM,selectByIds:iM})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=e.map(f=>P({...f,created_by:d,submitted_at:u}));this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:l.map(f=>R(f)),submitted_at:u},blockers:l.flatMap(f=>[f.workflow,f.workflow_step]),blocks:l.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(E(l)))}),[l,y]}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(u){throw this.dispatch(c(d)),u}}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(u){throw this.dispatch(c(d)),u}}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 Tq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Comment");p(this,"url","/workflow-step-comments");p(this,"actions",{addOne:rM,addMany:dM,setOne:uM,setMany:lM,updateOne:oM,updateMany:hM,deleteOne:pM,deleteMany:yM,initialize:cM});p(this,"selectors",{selectById:mM,selectByIds:fM})}add(e){var l;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}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(u){throw this.dispatch(c(d)),u}}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 Iq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Assignee");p(this,"url","/workflow-step-default-assignees");p(this,"actions",{addOne:OM,addMany:TM,setOne:IM,setMany:FM,updateOne:_M,updateMany:gM,deleteOne:RM,deleteMany:bM,initialize:PM});p(this,"selectors",{selectById:vM,selectByIds:EM})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}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 default 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(u){throw this.dispatch(c(d)),u}}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 Fq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Reviewer");p(this,"url","/workflow-step-default-reviewers");p(this,"actions",{addOne:DM,addMany:WM,setOne:zM,setMany:qM,updateOne:jM,updateMany:$M,deleteOne:CM,deleteMany:UM,initialize:BM});p(this,"selectors",{selectById:NM,selectByIds:HM})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}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 default 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(u){throw this.dispatch(c(d)),u}}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 _q extends qt{constructor(){super(...arguments);p(this,"name","Workflow Step Event");p(this,"url","/workflow-step-events");p(this,"actions",{addOne:QM,addMany:JM,setOne:ZM,setMany:XM,updateOne:xM,updateMany:ev,deleteOne:tv,deleteMany:sv,initialize:YM});p(this,"selectors",{selectById:nv,selectByIds:av})}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 gq extends z{constructor(){super(...arguments);p(this,"name","Workflow Step Fields Attachment");p(this,"url","/workflow-step-fields-attachments");p(this,"actions",{addOne:uv,addMany:Dc,setOne:lv,setMany:ov,updateOne:hv,updateMany:pv,deleteOne:yv,deleteMany:Wc,initialize:dv});p(this,"selectors",{selectById:fv,selectByIds:Av})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:u}}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 Rq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Fields");p(this,"url","/workflow-step-fields");p(this,"actions",{addOne:Tv,addMany:Iv,setOne:Fv,setMany:_v,updateOne:gv,updateMany:Rv,deleteOne:bv,deleteMany:Mv,initialize:Ov});p(this,"selectors",{selectById:Ev,selectByIds:Vv})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const l=mv(e)(d);this.dispatch(a(e)),this.dispatch(Wc(E(l)));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(u)),this.dispatch(Dc(l)),y}}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 bq extends z{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Attachment");p(this,"url","/workflow-step-field-values-attachments");p(this,"actions",{addOne:Wv,addMany:$c,setOne:zv,setMany:qv,updateOne:jv,updateMany:$v,deleteOne:Cv,deleteMany:Cc,initialize:Dv});p(this,"selectors",{selectById:Lv,selectByIds:Nv})}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 P({...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:u}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:u}}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(u){throw this.dispatch(c(d)),u}}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 Mq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Review Request");p(this,"url","/workflow-step-field-values-review-requests");p(this,"actions",{addOne:uE,addMany:Hc,setOne:lE,setMany:oE,updateOne:hE,updateMany:pE,deleteOne:yE,deleteMany:Gc,initialize:dE});p(this,"selectors",{selectById:mE,selectByIds:fE})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}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(u){throw this.dispatch(c(d)),u}}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 vq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Review");p(this,"url","/workflow-step-field-values-reviews");p(this,"actions",{addOne:TE,addMany:Yc,setOne:IE,setMany:FE,updateOne:_E,updateMany:gE,deleteOne:RE,deleteMany:Qc,initialize:OE});p(this,"selectors",{selectById:ME,selectByIds:vE})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,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(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}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(u){throw this.dispatch(c(d)),u}}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 Eq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values");p(this,"url","/workflow-step-field-values");p(this,"actions",{addOne:Qv,addMany:Jv,setOne:Zv,setMany:Xv,updateOne:xv,updateMany:eE,deleteOne:tE,deleteMany:sE,initialize:Yv});p(this,"selectors",{selectById:nE,selectByIds:aE})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),u=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString()}),l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[u.uuid]});return this.dispatch(a(u)),l.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,l]}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 u={...d,...e};this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.uuid,u.workflow,u.workflow_step,u.fields_revision],blocks:[u.uuid]});return l.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[u,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),u=r(e)(d);if(!u)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const l=Hv(e)(d),y=EE(e)(d),S=AE(e)(d);this.dispatch(a(e)),this.dispatch(Cc(E(l))),this.dispatch(Qc(E(y))),this.dispatch(Gc(E(S)));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(u)),this.dispatch($c(l)),this.dispatch(Yc(y)),this.dispatch(Hc(S)),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 Vq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Reviewer");p(this,"url","/workflow-step-reviewers");p(this,"actions",{addOne:DE,addMany:WE,setOne:zE,setMany:qE,updateOne:jE,updateMany:$E,deleteOne:CE,deleteMany:UE,initialize:BE});p(this,"selectors",{selectById:NE,selectByIds:HE})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,u]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=new Date().toISOString(),l=e.map(f=>P({...f,created_by:d,submitted_at:u}));this.dispatch(a(l));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:l.map(f=>R(f)),submitted_at:u},blockers:l.flatMap(f=>[f.workflow,f.workflow_step]),blocks:l.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.map(f=>f.uuid)))}),[l,y]}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(u){throw this.dispatch(c(d)),u}}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(u){throw this.dispatch(c(d)),u}}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 kq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step");p(this,"url","/workflow-steps");p(this,"actions",{addOne:QE,addMany:JE,setOne:ZE,setMany:XE,updateOne:xE,updateMany:eV,deleteOne:tV,deleteMany:sV,initialize:YE});p(this,"selectors",{selectById:nV,selectByIds:aV})}add(e){var l;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((l=n.getState().userReducer.currentUser)==null?void 0:l.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const u=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 u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,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 step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}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(u){throw this.dispatch(c(d)),u}}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 Bq extends M{constructor(){super(...arguments);p(this,"name","Workflow Type");p(this,"url","/workflow-types");p(this,"actions",{addOne:uV,addMany:lV,setOne:oV,setMany:hV,updateOne:pV,updateMany:yV,deleteOne:SV,deleteMany:mV,initialize:dV});p(this,"selectors",{selectById:AV,selectByIds:wV})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),u=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(u));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return l.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,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 type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const u=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 u.then(l=>{this.dispatch(a(l))}).catch(()=>{this.dispatch(a(r))}),[d,u]}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(u){throw this.dispatch(c(d)),u}}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 nr(t,s,e,n,a){const c=n instanceof Ut;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:u,headers:l,method:y,queryParams:S,attachmentHash:f,isExternalUrl:F,isAuthNeeded:g,isResponseBlob:V}={...r,...s};let _=s.url;const v=f?await e.files.fetchCache(f):void 0;if(f&&!v)throw new Error(`Cannot upload file ${f} because it's not cached.`);!F&&!_.startsWith("http")&&(!_.startsWith("/")&&!_.startsWith("blob:")&&(_="/"+_),_=t+_);const b=k=>{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(!v)throw new Error(`No file for file ${f}`);const H=d.fields["x-amz-checksum-sha1"];if(!H)throw new Error(`No checksum for file ${f}`);return k.set("x-amz-checksum-sha1",H).field({...u,...d.fields}).attach("file",v)}return k.send(u)},j={[h.GET]:()=>V?Nt.get(_.toString()).responseType("blob"):Nt.get(_.toString()),[h.POST]:()=>{const k=Nt.post(_.toString());return b(k)},[h.PATCH]:()=>{const k=Nt.patch(_.toString());return b(k)},[h.PUT]:()=>{const k=Nt.put(_.toString());return b(k)},[h.DELETE]:()=>{const k=Nt.delete(_.toString());return b(k)}}[y];let W=j();const q=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",q),g&&c){const k=n.auth.getAuthHeader();W=W.set("Authorization",k)}l&&(W=W.set(l));try{return await W.query(S)}catch(k){const H=DV(k),Js=H==null?void 0:H.status;if(c&&Js===401)return await n.auth.handleUnauthorized(W,H),W.query(S);throw new C({response:H,innerError:k,discard:sr.includes(Js)})}finally{a==null||a.removeEventListener("abort",q)}}class Dq{constructor(s){p(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new xs,r={...e,uuid:e.uuid??Dt.v4()};return nr(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??Zt).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 xs,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(vO(c)),d=l=>{if(l)a.resolve(l.body);else{const y=new C({message:"Could not get a response from the server.",response:l,discard:!0});a.reject(y)}},u=l=>{l instanceof C?l.options.discard=!0:(console.error("Received an unexpected error while processing a request:",l,`
14
- Converting error to APIError and discarding.`),l=new C({message:"An error occurred while processing the request.",innerError:l,discard:!0})),a.reject(l)};return r.then(d,u),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,u=[];let l=await this.performRequest(s,r,a,c);for(u.push(l.results);l.next;)l=await this.performRequest(s,{url:l.next,method:d},a,c),u.push(l.results);return u}}class Xt{constructor(){p(this,"graph");p(this,"requestAttemptCounter");this.graph=new sk.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Xt;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))&&Xt._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Xt._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 zV;function qV(t){zV=t}function xt(){return zV}let jV;function $V(t){jV=t}function CV(){return jV}let ar=null;function Lt(){const t=xt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(ar)return ar;const s=t.getState().offline.outbox,e=Xt._fromOutbox(s);return ar=e,e}const Wq=(t,s)=>{const e=new s(t);return $V(e),qV(t),e};class zq{constructor(s){p(this,"_all");p(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class cr{constructor(){p(this,"next");this.next=null}then(s){return new zq(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!xt())throw new Error("Client store not set");const n=CV();if(!n)throw new Error("Client SDK not set");return VV(s,n)}}}class UV extends cr{async run(s){return super.run(s)}}class LV extends cr{async run(s){return super.run(s)}}const NV=new UV().then(new LV).compile();function HV(t){var s;return(s=NV[0])==null?void 0:s.run(t)}var GV=(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))(GV||{});i.ALL_MIDDLEWARE=NV,i.APIError=C,i.AgentService=CW,i.AssetAttachmentService=UW,i.AssetProcedureService=YW,i.AssetProcedureStepFieldValuesAttachmentService=XW,i.AssetProcedureStepFieldValuesService=xW,i.AssetProcedureStepFieldsAttachmentService=JW,i.AssetProcedureStepFieldsService=ZW,i.AssetProcedureStepService=ez,i.AssetProcedureTypeAttachmentService=LW,i.AssetProcedureTypeFieldValuesAttachmentService=GW,i.AssetProcedureTypeFieldValuesService=KW,i.AssetProcedureTypeFieldsAttachmentService=NW,i.AssetProcedureTypeFieldsService=HW,i.AssetProcedureTypeService=QW,i.AssetService=tz,i.AssetStageCompletionService=sz,i.AssetStageService=iz,i.AssetStatusType=hr,i.AssetTypeAttachmentService=nz,i.AssetTypeFieldValuesAttachmentService=rz,i.AssetTypeFieldValuesService=dz,i.AssetTypeFieldsAttachmentService=az,i.AssetTypeFieldsService=cz,i.AssetTypeIdentifierService=uz,i.AssetTypeIdentifierValueService=lz,i.AssetTypeService=oz,i.AssetTypeStatusService=hz,i.AttachmentModel=pr,i.BaseApiService=Ut,i.BaseModelApiService=qt,i.BaseOfflineFileModelApiService=z,i.BaseOfflineModelApiService=M,i.BaseSDK=Dq,i.COMMON_AUTO_FIELDS=_r,i.DEFAULT_ISSUE_PRIORITY=ik,i.DEFAULT_PAGE_SIZE=TV,i.DEFAULT_WORKFLOW_STATUS=ck,i.DISCARD_HTTP_STATUSES=sr,i.DeferredPromise=xs,i.DocumentAttachmentService=pz,i.DocumentService=yz,i.EMPTY_ARRAY=ur,i.EMPTY_OBJECT=lr,i.EmailDomainsService=Sz,i.EmailVerificationService=mz,i.FILE_MODEL_DEFAULT_PAGE_SIZE=IV,i.FileService=fz,i.FormIdentifierService=Az,i.FormIdentifierValueService=wz,i.FormRevisionAttachmentService=Pz,i.FormRevisionService=Oz,i.FormService=Tz,i.FormSubmissionAttachmentService=Iz,i.FormSubmissionService=Fz,i.GeoImageService=_z,i.HttpMethod=h,i.IssueAssociationService=gz,i.IssueAttachmentService=Rz,i.IssueCommentAttachmentService=bz,i.IssueCommentService=Mz,i.IssuePriority=Xs,i.IssueService=vz,i.IssueStatusType=yr,i.IssueTypeAttachmentService=Ez,i.IssueTypeFieldValuesAttachmentService=Bz,i.IssueTypeFieldValuesService=Dz,i.IssueTypeFieldsAttachmentService=Vz,i.IssueTypeFieldsService=kz,i.IssueTypeIdentifierService=Wz,i.IssueTypeIdentifierValueService=zz,i.IssueTypeService=qz,i.IssueTypeStatusService=jz,i.IssueUpdateChange=$,i.IssueUpdateService=$z,i.JWTService=Lz,i.MAX_SERVICE_BATCH_SIZE=L,i.OUTBOX_RETRY_DELAY=Ar,i.OfflineAnalyticsMiddleware=UV,i.OfflineMiddleware=cr,i.OrganizationAccessLevel=or,i.OrganizationAccessService=Nz,i.OrganizationService=Hz,i.OutboxCoordinator=Xt,i.ProcedureFieldValuesAttachmentService=pq,i.ProcedureFieldValuesService=yq,i.ProcedureService=Jz,i.ProcedureStepAssigneeService=Zz,i.ProcedureStepCommentService=Xz,i.ProcedureStepDefaultAssigneeService=xz,i.ProcedureStepDefaultReviewerService=eq,i.ProcedureStepEventService=tq,i.ProcedureStepEventType=mr,i.ProcedureStepFieldValuesAttachmentService=nq,i.ProcedureStepFieldValuesReviewRequestService=aq,i.ProcedureStepFieldValuesReviewService=cq,i.ProcedureStepFieldValuesReviewType=fr,i.ProcedureStepFieldValuesService=rq,i.ProcedureStepFieldsAttachmentService=sq,i.ProcedureStepFieldsService=iq,i.ProcedureStepReviewerService=dq,i.ProcedureStepService=uq,i.ProcedureTypeAttachmentService=lq,i.ProcedureTypeFieldsAttachmentService=oq,i.ProcedureTypeFieldsService=hq,i.ProcedureTypeService=Sq,i.ProjectAccessService=Gz,i.ProjectAttachmentService=Kz,i.ProjectFileService=Yz,i.ProjectService=Qz,i.RESET_ORGANIZATION_STATE=I,i.RESET_PROJECT_STATE=B,i.RESET_STATE=O,i.RateLimitingMiddleware=LV,i.SelectorBuilder=vk,i.TeamMembershipService=mq,i.TeamService=fq,i.UNKNOWN_ERROR_MESSAGE=Zt,i.UserService=Aq,i.VERSION_REDUCER_KEY=ss,i.VerificationCodeType=GV,i.WORKFLOW_STATUSES=ak,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=nk,i.WorkflowIssueLinkService=Pq,i.WorkflowService=wq,i.WorkflowStatus=Gt,i.WorkflowStepAssigneeService=Oq,i.WorkflowStepCommentService=Tq,i.WorkflowStepDefaultAssigneeService=Iq,i.WorkflowStepDefaultReviewerService=Fq,i.WorkflowStepEventService=_q,i.WorkflowStepEventType=Sr,i.WorkflowStepFieldValuesAttachmentService=bq,i.WorkflowStepFieldValuesReviewRequestService=Mq,i.WorkflowStepFieldValuesReviewService=vq,i.WorkflowStepFieldValuesReviewType=ts,i.WorkflowStepFieldValuesService=Eq,i.WorkflowStepFieldsAttachmentService=gq,i.WorkflowStepFieldsService=Rq,i.WorkflowStepReviewerService=Vq,i.WorkflowStepService=kq,i.WorkflowTypeService=Bq,i._setLatestRetryTime=VO,i.addAsset=io,i.addAssetAttachment=Ur,i.addAssetAttachments=ri,i.addAssetProcedure=mu,i.addAssetProcedureStep=Hl,i.addAssetProcedureStepFieldValues=Ml,i.addAssetProcedureStepFieldValuesAttachment=ml,i.addAssetProcedureStepFieldValuesAttachments=vi,i.addAssetProcedureStepFieldValuesMany=vl,i.addAssetProcedureStepFields=il,i.addAssetProcedureStepFieldsAttachment=Lu,i.addAssetProcedureStepFieldsAttachments=Nu,i.addAssetProcedureStepFieldsMany=nl,i.addAssetProcedureSteps=Gl,i.addAssetProcedureType=Mu,i.addAssetProcedureTypeAttachment=td,i.addAssetProcedureTypeAttachments=sd,i.addAssetProcedureTypeFieldValues=su,i.addAssetProcedureTypeFieldValuesAttachment=Ld,i.addAssetProcedureTypeFieldValuesAttachments=mi,i.addAssetProcedureTypeFieldValuesMany=iu,i.addAssetProcedureTypeFields=Md,i.addAssetProcedureTypeFieldsAttachment=Sd,i.addAssetProcedureTypeFieldsAttachments=md,i.addAssetProcedureTypeFieldsMany=vd,i.addAssetProcedureTypes=vu,i.addAssetProcedures=Oi,i.addAssetStage=Bo,i.addAssetStageCompletion=fo,i.addAssetStageCompletions=Ao,i.addAssetStages=Do,i.addAssetType=Dp,i.addAssetTypeAttachment=Ho,i.addAssetTypeAttachments=Ni,i.addAssetTypeFieldValues=Hh,i.addAssetTypeFieldValuesAttachment=Vh,i.addAssetTypeFieldValuesAttachments=Zi,i.addAssetTypeFieldValuesMany=Gh,i.addAssetTypeFields=Ah,i.addAssetTypeFieldsAttachment=nh,i.addAssetTypeFieldsAttachments=ah,i.addAssetTypeFieldsMany=wh,i.addAssetTypeIdentifier=ap,i.addAssetTypeIdentifierValue=wp,i.addAssetTypeIdentifierValues=Pp,i.addAssetTypeIdentifiers=cp,i.addAssetTypeStatus=Kp,i.addAssetTypeStatuses=Yp,i.addAssetTypes=Wp,i.addAssets=zi,i.addConversation=Wr,i.addConversations=Ek,i.addDocument=Fy,i.addDocumentAttachment=ly,i.addDocumentAttachments=oy,i.addDocuments=_y,i.addEmailDomain=qy,i.addEmailDomains=jy,i.addForm=sm,i.addFormIdentifier=tS,i.addFormIdentifierValue=SS,i.addFormIdentifierValues=mS,i.addFormIdentifiers=sS,i.addFormRevision=LS,i.addFormRevisionAttachment=MS,i.addFormRevisionAttachments=vS,i.addFormRevisions=On,i.addFormSubmission=vm,i.addFormSubmissionAttachment=mm,i.addFormSubmissionAttachments=gn,i.addFormSubmissions=Vn,i.addForms=im,i.addGeoImage=Lm,i.addGeoImages=Nm,i.addIssue=aA,i.addIssueAssociation=cf,i.addIssueAssociations=jt,i.addIssueAttachment=wf,i.addIssueAttachments=jn,i.addIssueComment=Gf,i.addIssueCommentAttachment=Vf,i.addIssueCommentAttachments=kf,i.addIssueComments=Kf,i.addIssueType=rP,i.addIssueTypeAttachment=AA,i.addIssueTypeAttachments=wA,i.addIssueTypeFieldValues=GA,i.addIssueTypeFieldValuesAttachment=Pw,i.addIssueTypeFieldValuesAttachments=sa,i.addIssueTypeFieldValuesMany=KA,i.addIssueTypeFields=cw,i.addIssueTypeFieldsAttachment=VA,i.addIssueTypeFieldsAttachments=kA,i.addIssueTypeFieldsMany=rw,i.addIssueTypeIdentifier=kw,i.addIssueTypeIdentifierValue=Kw,i.addIssueTypeIdentifierValues=Yw,i.addIssueTypeIdentifiers=Bw,i.addIssueTypeStatus=OP,i.addIssueTypeStatuses=TP,i.addIssueTypes=dP,i.addIssueUpdate=ya,i.addIssueUpdates=Sa,i.addIssues=Kn,i.addOrganization=AO,i.addOrganizationAccess=tO,i.addOrganizationAccesses=sO,i.addOrganizations=fO,i.addProcedure=qT,i.addProcedureFieldValues=pR,i.addProcedureFieldValuesAttachment=eR,i.addProcedureFieldValuesAttachments=Sc,i.addProcedureFieldValuesMany=yR,i.addProcedureStep=eg,i.addProcedureStepAssignee=ZT,i.addProcedureStepAssignees=XT,i.addProcedureStepComment=oI,i.addProcedureStepComments=hI,i.addProcedureStepDefaultAssignee=_I,i.addProcedureStepDefaultAssignees=gI,i.addProcedureStepDefaultReviewer=jI,i.addProcedureStepDefaultReviewers=$I,i.addProcedureStepEvent=xI,i.addProcedureStepEvents=eF,i.addProcedureStepFieldValues=XF,i.addProcedureStepFieldValuesAttachment=jF,i.addProcedureStepFieldValuesAttachments=Ja,i.addProcedureStepFieldValuesMany=xF,i.addProcedureStepFieldValuesReview=__,i.addProcedureStepFieldValuesReviewRequest=h_,i.addProcedureStepFieldValuesReviewRequests=tc,i.addProcedureStepFieldValuesReviews=nc,i.addProcedureStepFields=gF,i.addProcedureStepFieldsAttachment=pF,i.addProcedureStepFieldsAttachments=Na,i.addProcedureStepFieldsMany=RF,i.addProcedureStepReviewer=q_,i.addProcedureStepReviewers=j_,i.addProcedureSteps=tg,i.addProcedureType=RR,i.addProcedureTypeAttachment=hg,i.addProcedureTypeAttachments=pg,i.addProcedureTypeFields=$g,i.addProcedureTypeFieldsAttachment=gg,i.addProcedureTypeFieldsAttachments=Rg,i.addProcedureTypeFieldsMany=Cg,i.addProcedureTypes=bR,i.addProcedures=Ba,i.addProject=RT,i.addProjectAccess=WO,i.addProjectAccesses=zO,i.addProjectAttachment=QO,i.addProjectAttachments=JO,i.addProjectFile=oT,i.addProjectFiles=hT,i.addProjects=gT,i.addTeam=sb,i.addTeamMembership=UR,i.addTeamMemberships=LR,i.addTeams=ib,i.addUser=Oa,i.addUsers=GP,i.addWorkflow=Ab,i.addWorkflowIssueLink=Vb,i.addWorkflowIssueLinks=ps,i.addWorkflowStep=QE,i.addWorkflowStepAssignee=Kb,i.addWorkflowStepAssignees=Yb,i.addWorkflowStepComment=rM,i.addWorkflowStepComments=dM,i.addWorkflowStepDefaultAssignee=OM,i.addWorkflowStepDefaultAssignees=TM,i.addWorkflowStepDefaultReviewer=DM,i.addWorkflowStepDefaultReviewers=WM,i.addWorkflowStepEvent=QM,i.addWorkflowStepEvents=JM,i.addWorkflowStepFieldValues=Qv,i.addWorkflowStepFieldValuesAttachment=Wv,i.addWorkflowStepFieldValuesAttachments=$c,i.addWorkflowStepFieldValuesMany=Jv,i.addWorkflowStepFieldValuesReview=TE,i.addWorkflowStepFieldValuesReviewRequest=uE,i.addWorkflowStepFieldValuesReviewRequests=Hc,i.addWorkflowStepFieldValuesReviews=Yc,i.addWorkflowStepFields=Tv,i.addWorkflowStepFieldsAttachment=uv,i.addWorkflowStepFieldsAttachments=Dc,i.addWorkflowStepFieldsMany=Iv,i.addWorkflowStepReviewer=DE,i.addWorkflowStepReviewers=WE,i.addWorkflowSteps=JE,i.addWorkflowType=uV,i.addWorkflowTypes=lV,i.addWorkflows=wb,i.agentsReducer=jr,i.agentsSlice=ni,i.areArraysEqual=lk,i.assetAttachmentReducer=Xr,i.assetAttachmentSlice=ci,i.assetProcedureReducer=Tu,i.assetProcedureSlice=Pi,i.assetProcedureStepFieldValuesAttachmentReducer=gl,i.assetProcedureStepFieldValuesAttachmentSlice=Mi,i.assetProcedureStepFieldValuesReducer=$l,i.assetProcedureStepFieldValuesSlice=ki,i.assetProcedureStepFieldsAttachmentReducer=el,i.assetProcedureStepFieldsAttachmentSlice=_i,i.assetProcedureStepFieldsReducer=pl,i.assetProcedureStepFieldsSlice=Ri,i.assetProcedureStepReducer=Zl,i.assetProcedureStepSlice=Bi,i.assetProcedureTypeAttachmentReducer=ud,i.assetProcedureTypeAttachmentSlice=li,i.assetProcedureTypeFieldValuesAttachmentReducer=Qd,i.assetProcedureTypeFieldValuesAttachmentSlice=Si,i.assetProcedureTypeFieldValuesReducer=lu,i.assetProcedureTypeFieldValuesSlice=wi,i.assetProcedureTypeFieldsAttachmentReducer=Id,i.assetProcedureTypeFieldsAttachmentSlice=hi,i.assetProcedureTypeFieldsReducer=zd,i.assetProcedureTypeFieldsSlice=yi,i.assetProcedureTypeReducer=zu,i.assetProcedureTypeSlice=Ii,i.assetReducer=yo,i.assetSlice=Wi,i.assetStageCompletionReducer=_o,i.assetStageCompletionSlice=ji,i.assetStageReducer=$o,i.assetStageSlice=$i,i.assetTypeAttachmentReducer=th,i.assetTypeAttachmentSlice=Li,i.assetTypeFieldValuesAttachmentReducer=Uh,i.assetTypeFieldValuesAttachmentSlice=Ji,i.assetTypeFieldValuesReducer=sp,i.assetTypeFieldValuesSlice=en,i.assetTypeFieldsAttachmentReducer=Sh,i.assetTypeFieldsAttachmentSlice=Ki,i.assetTypeFieldsReducer=Mh,i.assetTypeFieldsSlice=Qi,i.assetTypeIdentifierReducer=mp,i.assetTypeIdentifierSlice=tn,i.assetTypeIdentifierValueReducer=vp,i.assetTypeIdentifierValueSlice=nn,i.assetTypeReducer=Np,i.assetTypeSlice=an,i.assetTypeStatusReducer=ny,i.assetTypeStatusSlice=rn,i.assetTypeStatusSortFn=br,i.authReducer=ry,i.authSlice=Es,i.baseReducer=gW,i.baseReducers=tr,i.clearTokens=SB,i.createModelAdapter=T,i.createOfflineAction=bO,i.createPayload=R,i.createSelectionAdapter=rk,i.deleteAsset=co,i.deleteAssetAttachment=Kr,i.deleteAssetAttachments=di,i.deleteAssetProcedure=wu,i.deleteAssetProcedureStep=Ql,i.deleteAssetProcedureStepFieldValues=Dl,i.deleteAssetProcedureStepFieldValuesAttachment=Ol,i.deleteAssetProcedureStepFieldValuesAttachments=Ei,i.deleteAssetProcedureStepFieldValuesMany=Wl,i.deleteAssetProcedureStepFields=ul,i.deleteAssetProcedureStepFieldsAttachment=Qu,i.deleteAssetProcedureStepFieldsAttachments=Ju,i.deleteAssetProcedureStepFieldsMany=ll,i.deleteAssetProcedureSteps=Jl,i.deleteAssetProcedureType=ku,i.deleteAssetProcedureTypeAttachment=rd,i.deleteAssetProcedureTypeAttachments=dd,i.deleteAssetProcedureTypeFieldValues=du,i.deleteAssetProcedureTypeFieldValuesAttachment=Yd,i.deleteAssetProcedureTypeFieldValuesAttachments=fi,i.deleteAssetProcedureTypeFieldValuesMany=uu,i.deleteAssetProcedureTypeFields=Dd,i.deleteAssetProcedureTypeFieldsAttachment=Od,i.deleteAssetProcedureTypeFieldsAttachments=Td,i.deleteAssetProcedureTypeFieldsMany=Wd,i.deleteAssetProcedureTypes=Bu,i.deleteAssetProcedures=Ti,i.deleteAssetStage=qo,i.deleteAssetStageCompletion=Io,i.deleteAssetStageCompletions=Fo,i.deleteAssetStages=jo,i.deleteAssetType=jp,i.deleteAssetTypeAttachment=Jo,i.deleteAssetTypeAttachments=Hi,i.deleteAssetTypeFieldValues=Zh,i.deleteAssetTypeFieldValuesAttachment=zh,i.deleteAssetTypeFieldValuesAttachments=Xi,i.deleteAssetTypeFieldValuesMany=Xh,i.deleteAssetTypeFields=Fh,i.deleteAssetTypeFieldsAttachment=lh,i.deleteAssetTypeFieldsAttachments=oh,i.deleteAssetTypeFieldsMany=_h,i.deleteAssetTypeIdentifier=op,i.deleteAssetTypeIdentifierValue=_p,i.deleteAssetTypeIdentifierValues=gp,i.deleteAssetTypeIdentifiers=hp,i.deleteAssetTypeStatus=xp,i.deleteAssetTypeStatuses=ey,i.deleteAssetTypes=$p,i.deleteAssets=qi,i.deleteConversation=Bk,i.deleteConversations=Dk,i.deleteDocument=vy,i.deleteDocumentAttachment=my,i.deleteDocumentAttachments=fy,i.deleteDocuments=Ey,i.deleteEmailDomain=Ny,i.deleteEmailDomains=Hy,i.deleteForm=dm,i.deleteFormIdentifier=rS,i.deleteFormIdentifierValue=OS,i.deleteFormIdentifierValues=TS,i.deleteFormIdentifiers=dS,i.deleteFormRevision=YS,i.deleteFormRevisionAttachment=DS,i.deleteFormRevisionAttachments=WS,i.deleteFormRevisions=Tn,i.deleteFormSubmission=km,i.deleteFormSubmissionAttachment=Om,i.deleteFormSubmissionAttachments=Rn,i.deleteFormSubmissions=kn,i.deleteForms=um,i.deleteGeoImage=Km,i.deleteGeoImages=Ym,i.deleteIssue=lA,i.deleteIssueAssociation=rf,i.deleteIssueAssociations=$t,i.deleteIssueAttachment=Ff,i.deleteIssueAttachments=$n,i.deleteIssueComment=Xf,i.deleteIssueCommentAttachment=qf,i.deleteIssueCommentAttachments=jf,i.deleteIssueComments=xf,i.deleteIssueType=pP,i.deleteIssueTypeAttachment=FA,i.deleteIssueTypeAttachments=_A,i.deleteIssueTypeFieldValues=XA,i.deleteIssueTypeFieldValuesAttachment=_w,i.deleteIssueTypeFieldValuesAttachments=ia,i.deleteIssueTypeFieldValuesMany=xA,i.deleteIssueTypeFields=hw,i.deleteIssueTypeFieldsAttachment=qA,i.deleteIssueTypeFieldsAttachments=jA,i.deleteIssueTypeFieldsMany=pw,i.deleteIssueTypeIdentifier=jw,i.deleteIssueTypeIdentifierValue=xw,i.deleteIssueTypeIdentifierValues=eP,i.deleteIssueTypeIdentifiers=$w,i.deleteIssueTypeStatus=RP,i.deleteIssueTypeStatuses=bP,i.deleteIssueTypes=yP,i.deleteIssueUpdate=ma,i.deleteIssueUpdates=fa,i.deleteIssues=Yn,i.deleteOrganization=OO,i.deleteOrganizationAccess=rO,i.deleteOrganizationAccesses=dO,i.deleteOrganizations=TO,i.deleteProcedure=LT,i.deleteProcedureFieldValues=wR,i.deleteProcedureFieldValuesAttachment=aR,i.deleteProcedureFieldValuesAttachments=mc,i.deleteProcedureFieldValuesMany=PR,i.deleteProcedureStep=ng,i.deleteProcedureStepAssignee=iI,i.deleteProcedureStepAssignees=nI,i.deleteProcedureStepComment=fI,i.deleteProcedureStepComments=AI,i.deleteProcedureStepDefaultAssignee=EI,i.deleteProcedureStepDefaultAssignees=VI,i.deleteProcedureStepDefaultReviewer=HI,i.deleteProcedureStepDefaultReviewers=GI,i.deleteProcedureStepEvent=aF,i.deleteProcedureStepEvents=cF,i.deleteProcedureStepFieldValues=n_,i.deleteProcedureStepFieldValuesAttachment=NF,i.deleteProcedureStepFieldValuesAttachments=Za,i.deleteProcedureStepFieldValuesMany=a_,i.deleteProcedureStepFieldValuesReview=v_,i.deleteProcedureStepFieldValuesReviewRequest=f_,i.deleteProcedureStepFieldValuesReviewRequests=sc,i.deleteProcedureStepFieldValuesReviews=ac,i.deleteProcedureStepFields=VF,i.deleteProcedureStepFieldsAttachment=AF,i.deleteProcedureStepFieldsAttachments=Ha,i.deleteProcedureStepFieldsMany=kF,i.deleteProcedureStepReviewer=N_,i.deleteProcedureStepReviewers=H_,i.deleteProcedureSteps=ag,i.deleteProcedureType=kR,i.deleteProcedureTypeAttachment=Ag,i.deleteProcedureTypeAttachments=wg,i.deleteProcedureTypeFields=Gg,i.deleteProcedureTypeFieldsAttachment=Vg,i.deleteProcedureTypeFieldsAttachments=kg,i.deleteProcedureTypeFieldsMany=Kg,i.deleteProcedureTypes=BR,i.deleteProcedures=Da,i.deleteProject=vT,i.deleteProjectAccess=UO,i.deleteProjectAccesses=LO,i.deleteProjectAttachment=tT,i.deleteProjectAttachments=sT,i.deleteProjectFile=ST,i.deleteProjectFiles=mT,i.deleteProjects=ET,i.deleteTeam=db,i.deleteTeamMembership=YR,i.deleteTeamMemberships=QR,i.deleteTeams=ub,i.deleteUser=Ta,i.deleteUsers=QP,i.deleteWorkflow=Fb,i.deleteWorkflowIssueLink=zb,i.deleteWorkflowIssueLinks=ys,i.deleteWorkflowStep=tV,i.deleteWorkflowStepAssignee=xb,i.deleteWorkflowStepAssignees=eM,i.deleteWorkflowStepComment=pM,i.deleteWorkflowStepComments=yM,i.deleteWorkflowStepDefaultAssignee=RM,i.deleteWorkflowStepDefaultAssignees=bM,i.deleteWorkflowStepDefaultReviewer=CM,i.deleteWorkflowStepDefaultReviewers=UM,i.deleteWorkflowStepEvent=tv,i.deleteWorkflowStepEvents=sv,i.deleteWorkflowStepFieldValues=tE,i.deleteWorkflowStepFieldValuesAttachment=Cv,i.deleteWorkflowStepFieldValuesAttachments=Cc,i.deleteWorkflowStepFieldValuesMany=sE,i.deleteWorkflowStepFieldValuesReview=RE,i.deleteWorkflowStepFieldValuesReviewRequest=yE,i.deleteWorkflowStepFieldValuesReviewRequests=Gc,i.deleteWorkflowStepFieldValuesReviews=Qc,i.deleteWorkflowStepFields=bv,i.deleteWorkflowStepFieldsAttachment=yv,i.deleteWorkflowStepFieldsAttachments=Wc,i.deleteWorkflowStepFieldsMany=Mv,i.deleteWorkflowStepReviewer=CE,i.deleteWorkflowStepReviewers=UE,i.deleteWorkflowSteps=sV,i.deleteWorkflowType=SV,i.deleteWorkflowTypes=mV,i.deleteWorkflows=_b,i.dequeue=EV,i.discard=kV,i.documentAttachmentReducer=Oy,i.documentAttachmentSlice=un,i.documentSlice=on,i.documentsReducer=Vy,i.downloadFile=Ak,i.emailDomainsReducer=Qy,i.emailDomainsSlice=pn,i.emailRegex=gk,i.enqueue=vV,i.enqueueRequest=vO,i.extractResponseFromError=DV,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=is,i.fetchBlobFromObjectUrl=Or,i.fetchFileFromObjectUrl=Tr,i.fileReducer=Xy,i.fileSlice=Sn,i.formIdentifierReducer=hS,i.formIdentifierSlice=mn,i.formIdentifierValueReducer=gS,i.formIdentifierValueSlice=An,i.formReducer=lm,i.formRevisionAttachmentReducer=$S,i.formRevisionAttachmentSlice=wn,i.formRevisionReducer=xS,i.formRevisionsSlice=Pn,i.formSlice=In,i.formSubmissionAttachmentReducer=_m,i.formSubmissionAttachmentSlice=_n,i.formSubmissionReducer=qm,i.formSubmissionSlice=En,i.geoImageReducer=Xm,i.geoImageSlice=Dn,i.getAssetProcedureStepSubTree=Rr,i.getAssetProcedureStepTrees=Rk,i.getClientSDK=CV,i.getClientStore=xt,i.getDocumentSubTree=Er,i.getDocumentTrees=bk,i.getFileExtension=Pr,i.getLocalDateString=wr,i.getLocalRelativeDateString=yk,i.getOutboxCoordinator=Lt,i.getProcedureStepSubTree=kr,i.getProcedureStepTrees=Mk,i.getRenamedFile=fk,i.getRequestDescription=w,i.getS3FileKey=mk,i.hashFile=Os,i.initSDK=Wq,i.initializeAssetAttachments=Cr,i.initializeAssetProcedureStepFieldValues=bl,i.initializeAssetProcedureStepFieldValuesAttachments=Sl,i.initializeAssetProcedureStepFields=sl,i.initializeAssetProcedureStepFieldsAttachments=Uu,i.initializeAssetProcedureSteps=Ul,i.initializeAssetProcedureTypeAttachments=ed,i.initializeAssetProcedureTypeFieldValues=tu,i.initializeAssetProcedureTypeFieldValuesAttachments=Ud,i.initializeAssetProcedureTypeFields=bd,i.initializeAssetProcedureTypeFieldsAttachments=yd,i.initializeAssetProcedureTypes=bu,i.initializeAssetProcedures=Su,i.initializeAssetStageCompletions=mo,i.initializeAssetStages=Eo,i.initializeAssetTypeAttachments=No,i.initializeAssetTypeFieldValues=Nh,i.initializeAssetTypeFieldValuesAttachments=Eh,i.initializeAssetTypeFields=fh,i.initializeAssetTypeFieldsAttachments=ih,i.initializeAssetTypeIdentifierValues=Ap,i.initializeAssetTypeIdentifiers=np,i.initializeAssetTypeStatuses=Gp,i.initializeAssetTypes=Vp,i.initializeAssets=so,i.initializeConversations=Dr,i.initializeDocumentAttachments=uy,i.initializeDocuments=Iy,i.initializeEmailDomains=zy,i.initializeFormIdentifierValues=yS,i.initializeFormIdentifiers=eS,i.initializeFormRevisionAttachments=bS,i.initializeFormRevisions=US,i.initializeFormSubmissionAttachments=Sm,i.initializeFormSubmissions=Rm,i.initializeForms=tm,i.initializeGeoImages=$m,i.initializeIssueAssociations=ef,i.initializeIssueAttachments=Af,i.initializeIssueCommentAttachments=Ef,i.initializeIssueComments=Hf,i.initializeIssueTypeAttachments=fA,i.initializeIssueTypeFieldValues=HA,i.initializeIssueTypeFieldValuesAttachments=ww,i.initializeIssueTypeFields=aw,i.initializeIssueTypeFieldsAttachments=EA,i.initializeIssueTypeIdentifierValues=Gw,i.initializeIssueTypeIdentifiers=Vw,i.initializeIssueTypeStatuses=PP,i.initializeIssueTypes=cP,i.initializeIssueUpdates=kP,i.initializeIssues=nA,i.initializeOrganizationAccesses=eO,i.initializeOrganizations=yO,i.initializeProcedureFieldValues=hR,i.initializeProcedureFieldValuesAttachments=xg,i.initializeProcedureStepAssignees=JT,i.initializeProcedureStepComments=lI,i.initializeProcedureStepDefaultAssignees=FI,i.initializeProcedureStepDefaultReviewers=qI,i.initializeProcedureStepEvents=XI,i.initializeProcedureStepFieldValues=ZF,i.initializeProcedureStepFieldValuesAttachments=qF,i.initializeProcedureStepFieldValuesReviewRequests=o_,i.initializeProcedureStepFieldValuesReviews=F_,i.initializeProcedureStepFields=_F,i.initializeProcedureStepFieldsAttachments=hF,i.initializeProcedureStepReviewers=z_,i.initializeProcedureSteps=Z_,i.initializeProcedureTypeAttachments=og,i.initializeProcedureTypeFields=jg,i.initializeProcedureTypeFieldsAttachments=_g,i.initializeProcedureTypes=gR,i.initializeProcedures=zT,i.initializeProjectAccesses=DO,i.initializeProjectAttachments=YO,i.initializeProjectFiles=dT,i.initializeProjects=IT,i.initializeTeamMemberships=CR,i.initializeTeams=tb,i.initializeUsers=LP,i.initializeWorkflowIssueLinks=Eb,i.initializeWorkflowStepAssignees=Gb,i.initializeWorkflowStepComments=cM,i.initializeWorkflowStepDefaultAssignees=PM,i.initializeWorkflowStepDefaultReviewers=BM,i.initializeWorkflowStepEvents=YM,i.initializeWorkflowStepFieldValues=Yv,i.initializeWorkflowStepFieldValuesAttachments=Dv,i.initializeWorkflowStepFieldValuesReviewRequests=dE,i.initializeWorkflowStepFieldValuesReviews=OE,i.initializeWorkflowStepFields=Ov,i.initializeWorkflowStepFieldsAttachments=dv,i.initializeWorkflowStepReviewers=BE,i.initializeWorkflowSteps=YE,i.initializeWorkflowTypes=dV,i.initializeWorkflows=fb,i.isImageFile=wk,i.isObjectUrl=Ir,i.isToday=pk,i.issueAssociationReducer=mf,i.issueAssociationSlice=zn,i.issueAttachmentReducer=Mf,i.issueAttachmentSlice=qn,i.issueCommentAttachmentReducer=Lf,i.issueCommentAttachmentSlice=Un,i.issueCommentReducer=sA,i.issueCommentSlice=Nn,i.issueReducer=SA,i.issueSlice=Gn,i.issueTypeAttachmentReducer=MA,i.issueTypeAttachmentSlice=Qn,i.issueTypeFieldValuesAttachmentReducer=vw,i.issueTypeFieldValuesAttachmentSlice=ta,i.issueTypeFieldValuesReducer=iw,i.issueTypeFieldValuesSlice=xn,i.issueTypeFieldsAttachmentReducer=LA,i.issueTypeFieldsAttachmentSlice=Zn,i.issueTypeFieldsReducer=fw,i.issueTypeFieldsSlice=ea,i.issueTypeIdentifierReducer=Nw,i.issueTypeIdentifierSlice=aa,i.issueTypeIdentifierValueReducer=nP,i.issueTypeIdentifierValueSlice=ra,i.issueTypeReducer=AP,i.issueTypeSlice=da,i.issueTypeStatusReducer=EP,i.issueTypeStatusSlice=la,i.issueTypeStatusSortFn=Mr,i.issueUpdateReducer=CP,i.issueUpdateSlice=pa,i.logOnlyOnce=Pk,i.markAsDeleted=EO,i.markForDeletion=XB,i.memoize=ti,i.organizationAccessReducer=uO,i.organizationAccessSlice=Fa,i.organizationReducer=RO,i.organizationSlice=_a,i.outboxReducer=kO,i.outboxSlice=ga,i.overmapEnhancer=DW,i.overmapReducer=RW,i.overmapReducers=OV,i.performRequest=nr,i.performRequestFromAction=VV,i.procedureFieldValuesAttachmentReducer=cR,i.procedureFieldValuesAttachmentSlice=yc,i.procedureFieldValuesReducer=OR,i.procedureFieldValuesSlice=Ac,i.procedureReducer=NT,i.procedureSlice=ka,i.procedureStepAssigneeReducer=dI,i.procedureStepAssigneeSlice=Wa,i.procedureStepCommentReducer=TI,i.procedureStepCommentSlice=za,i.procedureStepDefaultAssigneeReducer=WI,i.procedureStepDefaultAssigneeSlice=qa,i.procedureStepDefaultReviewerReducer=JI,i.procedureStepDefaultReviewerSlice=$a,i.procedureStepEventReducer=lF,i.procedureStepEventSlice=Ua,i.procedureStepFieldValuesAttachmentReducer=QF,i.procedureStepFieldValuesAttachmentSlice=Qa,i.procedureStepFieldValuesReducer=u_,i.procedureStepFieldValuesReviewReducer=D_,i.procedureStepFieldValuesReviewRequestReducer=T_,i.procedureStepFieldValuesReviewRequestSlice=ec,i.procedureStepFieldValuesReviewSlice=ic,i.procedureStepFieldValuesSlice=xa,i.procedureStepFieldsAttachmentReducer=IF,i.procedureStepFieldsAttachmentSlice=La,i.procedureStepFieldsReducer=WF,i.procedureStepFieldsSlice=Ka,i.procedureStepReducer=cg,i.procedureStepReviewerReducer=Q_,i.procedureStepReviewerSlice=cc,i.procedureStepSlice=rc,i.procedureTypeAttachmentReducer=Pg,i.procedureTypeAttachmentSlice=uc,i.procedureTypeFieldsAttachmentReducer=Bg,i.procedureTypeFieldsAttachmentSlice=oc,i.procedureTypeFieldsReducer=Yg,i.procedureTypeFieldsSlice=pc,i.procedureTypeReducer=DR,i.procedureTypeSlice=Pc,i.projectAccessReducer=NO,i.projectAccessSlice=Ra,i.projectAttachmentReducer=cT,i.projectAttachmentSlice=Ma,i.projectFileReducer=OT,i.projectFileSlice=Ea,i.projectReducer=VT,i.projectSlice=Va,i.rehydratedReducer=jR,i.rehydratedSlice=Oc,i.restructureSelectorWithArgs=m,i.runMiddleware=HV,i.selectAccessToken=mB,i.selectAccessesByUserOfProject=eD,i.selectAccessibleProjects=iD,i.selectActiveOrganizationAccess=YB,i.selectAllDocumentAttachments=ln,i.selectAssetAttachmentById=Qr,i.selectAssetAttachmentMapping=Yr,i.selectAssetAttachments=ui,i.selectAssetAttachmentsByIds=Jr,i.selectAssetById=ho,i.selectAssetProcedureById=_u,i.selectAssetProcedureStepById=Xl,i.selectAssetProcedureStepFieldValues=ns,i.selectAssetProcedureStepFieldValuesAttachmentById=Il,i.selectAssetProcedureStepFieldValuesAttachments=Vi,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Fl,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Tl,i.selectAssetProcedureStepFieldValuesById=ql,i.selectAssetProcedureStepFieldValuesByIds=jl,i.selectAssetProcedureStepFieldValuesMapping=zl,i.selectAssetProcedureStepFieldValuesOfAsset=Jk,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=Zk,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Xk,i.selectAssetProcedureStepFields=gs,i.selectAssetProcedureStepFieldsAttachmentById=Xu,i.selectAssetProcedureStepFieldsAttachments=gi,i.selectAssetProcedureStepFieldsAttachmentsByIds=xu,i.selectAssetProcedureStepFieldsAttachmentsMapping=Zu,i.selectAssetProcedureStepFieldsById=ol,i.selectAssetProcedureStepFieldsByIds=hl,i.selectAssetProcedureStepFieldsMapping=bi,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=Kk,i.selectAssetProcedureStepMapping=Rs,i.selectAssetProcedureSteps=Di,i.selectAssetProcedureStepsByIds=xl,i.selectAssetProcedureStepsMappingOfAssetProcedureType=xk,i.selectAssetProcedureStepsOfAssetProcedureType=eB,i.selectAssetProcedureTypeAttachmentById=od,i.selectAssetProcedureTypeAttachmentMapping=ld,i.selectAssetProcedureTypeAttachments=oi,i.selectAssetProcedureTypeAttachmentsByIds=hd,i.selectAssetProcedureTypeById=ju,i.selectAssetProcedureTypeFieldValues=Fs,i.selectAssetProcedureTypeFieldValuesAttachmentById=Zd,i.selectAssetProcedureTypeFieldValuesAttachments=Ai,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Xd,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Jd,i.selectAssetProcedureTypeFieldValuesById=hu,i.selectAssetProcedureTypeFieldValuesByIds=pu,i.selectAssetProcedureTypeFieldValuesMapping=ou,i.selectAssetProcedureTypeFieldValuesOfAsset=Uk,i.selectAssetProcedureTypeFields=Is,i.selectAssetProcedureTypeFieldsAttachmentById=_d,i.selectAssetProcedureTypeFieldsAttachments=pi,i.selectAssetProcedureTypeFieldsAttachmentsByIds=gd,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Fd,i.selectAssetProcedureTypeFieldsById=jd,i.selectAssetProcedureTypeFieldsByIds=$d,i.selectAssetProcedureTypeFieldsMapping=qd,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=$k,i.selectAssetProcedureTypes=Fi,i.selectAssetProcedureTypesByIds=$u,i.selectAssetProcedureTypesMapping=qu,i.selectAssetProcedureTypesOfOrganization=Hk,i.selectAssetProcedures=_s,i.selectAssetProceduresByIds=gu,i.selectAssetProceduresMapping=Iu,i.selectAssetProceduresOfAssetProcedureType=Fu,i.selectAssetProceduresOfAssetType=Nk,i.selectAssetStageById=Co,i.selectAssetStageCompletionById=bo,i.selectAssetStageCompletionMapping=go,i.selectAssetStageCompletions=Ro,i.selectAssetStageCompletionsByIds=Mo,i.selectAssetStages=Ui,i.selectAssetStagesByIds=Uo,i.selectAssetStagesMappingOfAssetProcedureType=sB,i.selectAssetStagesOfAssetProcedureType=iB,i.selectAssetTypeAttachmentById=Xo,i.selectAssetTypeAttachmentMapping=Zo,i.selectAssetTypeAttachments=Gi,i.selectAssetTypeAttachmentsByIds=xo,i.selectAssetTypeById=Up,i.selectAssetTypeFieldValues=Ms,i.selectAssetTypeFieldValuesAttachmentById=jh,i.selectAssetTypeFieldValuesAttachments=xi,i.selectAssetTypeFieldValuesAttachmentsByIds=$h,i.selectAssetTypeFieldValuesAttachmentsMapping=qh,i.selectAssetTypeFieldValuesById=ep,i.selectAssetTypeFieldValuesByIds=tp,i.selectAssetTypeFieldValuesMapping=xh,i.selectAssetTypeFieldValuesOfAsset=rB,i.selectAssetTypeFields=as,i.selectAssetTypeFieldsAttachmentById=ph,i.selectAssetTypeFieldsAttachments=Yi,i.selectAssetTypeFieldsAttachmentsByIds=yh,i.selectAssetTypeFieldsAttachmentsMapping=hh,i.selectAssetTypeFieldsById=Rh,i.selectAssetTypeFieldsByIds=bh,i.selectAssetTypeFieldsMapping=gh,i.selectAssetTypeFieldsOfAssetType=aB,i.selectAssetTypeIdentifierById=yp,i.selectAssetTypeIdentifierMapping=pp,i.selectAssetTypeIdentifierValueById=bp,i.selectAssetTypeIdentifierValueMapping=Rp,i.selectAssetTypeIdentifierValues=vs,i.selectAssetTypeIdentifierValuesByIds=Mp,i.selectAssetTypeIdentifierValuesOfAsset=lB,i.selectAssetTypeIdentifierValuesOfIdentifier=oB,i.selectAssetTypeIdentifiers=sn,i.selectAssetTypeIdentifiersByIds=Sp,i.selectAssetTypeIdentifiersOfAssetType=uB,i.selectAssetTypeStatusById=sy,i.selectAssetTypeStatusMapping=ty,i.selectAssetTypeStatuses=dn,i.selectAssetTypeStatusesByIds=iy,i.selectAssetTypeStatusesOfAssetType=pB,i.selectAssetTypeValuesOfAssetType=dB,i.selectAssetTypes=cn,i.selectAssetTypesByIds=Lp,i.selectAssetTypesMapping=Cp,i.selectAssetTypesOfOrganization=hB,i.selectAssets=bs,i.selectAssetsByIds=po,i.selectAssetsMapping=lo,i.selectAssetsOfAssetType=oo,i.selectAssetsOfProject=tB,i.selectAttachmentsOfAsset=Zr,i.selectAttachmentsOfAssetProcedureStepFieldValues=_l,i.selectAttachmentsOfAssetProcedureStepFields=Gk,i.selectAttachmentsOfAssetProcedureType=qk,i.selectAttachmentsOfAssetProcedureTypeFieldValues=xd,i.selectAttachmentsOfAssetProcedureTypeFields=jk,i.selectAttachmentsOfAssetType=eh,i.selectAttachmentsOfAssetTypeFieldValues=Ch,i.selectAttachmentsOfAssetTypeFields=nB,i.selectAttachmentsOfDocument=AB,i.selectAttachmentsOfFormRevision=bB,i.selectAttachmentsOfFormSubmission=Fm,i.selectAttachmentsOfIssue=gf,i.selectAttachmentsOfIssueComment=VB,i.selectAttachmentsOfIssueType=DB,i.selectAttachmentsOfIssueTypeFieldValues=Mw,i.selectAttachmentsOfIssueTypeFields=WB,i.selectAttachmentsOfProcedureFieldValues=lR,i.selectAttachmentsOfProcedureStepFieldValues=YF,i.selectAttachmentsOfProcedureStepFields=PF,i.selectAttachmentsOfProcedureType=WD,i.selectAttachmentsOfProcedureTypeFields=zD,i.selectAttachmentsOfProject=sD,i.selectAttachmentsOfWorkflowStepFieldValues=Hv,i.selectAttachmentsOfWorkflowStepFields=mv,i.selectCommentsOfIssue=kB,i.selectConversation=zk,i.selectConversationMapping=ai,i.selectConversations=Wk,i.selectCurrentUser=ZP,i.selectDeletedRequests=JB,i.selectDescendantsOfAssetProcedureStep=eo,i.selectDescendantsOfDocument=Dy,i.selectDescendantsOfProcedureStep=ug,i.selectDocumentAttachmentById=wy,i.selectDocumentAttachmentMapping=Ay,i.selectDocumentAttachmentsByIds=Py,i.selectDocumentById=ky,i.selectDocuments=Vs,i.selectDocumentsByIds=By,i.selectDocumentsMapping=hn,i.selectEmailDomainById=Ky,i.selectEmailDomains=yn,i.selectEmailDomainsAsMapping=Gy,i.selectEmailDomainsByIds=Yy,i.selectEmailDomainsOfOrganization=OB,i.selectFieldValuesOfAssetProcedure=Lk,i.selectFieldValuesOfProcedure=$D,i.selectFormById=hm,i.selectFormIdentifierById=lS,i.selectFormIdentifierMapping=uS,i.selectFormIdentifierValueById=FS,i.selectFormIdentifierValueMapping=IS,i.selectFormIdentifierValues=ks,i.selectFormIdentifierValuesByIds=_S,i.selectFormIdentifierValuesOfFormSubmission=gB,i.selectFormIdentifierValuesOfIdentifier=RB,i.selectFormIdentifiers=fn,i.selectFormIdentifiersByIds=oS,i.selectFormIdentifiersOfForm=_B,i.selectFormMapping=om,i.selectFormRevisionAttachmentById=qS,i.selectFormRevisionAttachments=zS,i.selectFormRevisionAttachmentsByIds=jS,i.selectFormRevisionAttachmentsMapping=Bs,i.selectFormRevisionById=JS,i.selectFormRevisionMapping=QS,i.selectFormRevisions=Ds,i.selectFormRevisionsByIds=ZS,i.selectFormRevisionsOfForm=XS,i.selectFormSubmissionAttachemntsByIds=vn,i.selectFormSubmissionAttachmentById=Tm,i.selectFormSubmissionAttachments=Mn,i.selectFormSubmissionAttachmentsByIds=Im,i.selectFormSubmissionAttachmentsMapping=bn,i.selectFormSubmissionById=Dm,i.selectFormSubmissions=Bn,i.selectFormSubmissionsByIds=Wm,i.selectFormSubmissionsMapping=Bm,i.selectFormSubmissionsOfForm=zm,i.selectForms=Fn,i.selectFormsByIds=pm,i.selectFormsOfOrganization=vB,i.selectGeoImageById=Jm,i.selectGeoImageMapping=Qm,i.selectGeoImages=Wn,i.selectGeoImagesByIds=Zm,i.selectGeoImagesOfProject=EB,i.selectIsLoggedIn=fB,i.selectIssueAssociationById=uf,i.selectIssueAssociationMapping=df,i.selectIssueAssociations=Ct,i.selectIssueAssociationsByIds=lf,i.selectIssueAssociationsOfAsset=Sf,i.selectIssueAssociationsOfIssue=yf,i.selectIssueAssociationsOfIssues=pf,i.selectIssueAssociationsToIssue=of,i.selectIssueAssociationsToIssues=hf,i.selectIssueAttachmentById=Rf,i.selectIssueAttachmentMapping=_f,i.selectIssueAttachments=Cn,i.selectIssueAttachmentsByIds=bf,i.selectIssueById=hA,i.selectIssueCommentAttachmentById=Cf,i.selectIssueCommentAttachmentMapping=$f,i.selectIssueCommentAttachments=Ln,i.selectIssueCommentAttachmentsByIds=Uf,i.selectIssueCommentById=eA,i.selectIssueCommentMapping=Hn,i.selectIssueCommentsByIds=tA,i.selectIssueMapping=oA,i.selectIssueTypeAttachmentById=RA,i.selectIssueTypeAttachmentMapping=gA,i.selectIssueTypeAttachments=Jn,i.selectIssueTypeAttachmentsByIds=bA,i.selectIssueTypeById=mP,i.selectIssueTypeFieldValues=zs,i.selectIssueTypeFieldValuesAttachmentById=Rw,i.selectIssueTypeFieldValuesAttachments=na,i.selectIssueTypeFieldValuesAttachmentsByIds=bw,i.selectIssueTypeFieldValuesAttachmentsMapping=gw,i.selectIssueTypeFieldValuesById=tw,i.selectIssueTypeFieldValuesByIds=sw,i.selectIssueTypeFieldValuesMapping=ew,i.selectIssueTypeFieldValuesOfIssue=zB,i.selectIssueTypeFields=cs,i.selectIssueTypeFieldsAttachmentById=CA,i.selectIssueTypeFieldsAttachments=Xn,i.selectIssueTypeFieldsAttachmentsByIds=UA,i.selectIssueTypeFieldsAttachmentsMapping=$A,i.selectIssueTypeFieldsById=Sw,i.selectIssueTypeFieldsByIds=mw,i.selectIssueTypeFieldsMapping=yw,i.selectIssueTypeFieldsOfIssueType=qB,i.selectIssueTypeIdentifierById=Uw,i.selectIssueTypeIdentifierMapping=Cw,i.selectIssueTypeIdentifierValueById=sP,i.selectIssueTypeIdentifierValueMapping=tP,i.selectIssueTypeIdentifierValues=qs,i.selectIssueTypeIdentifierValuesByIds=iP,i.selectIssueTypeIdentifierValuesOfIdentifier=LB,i.selectIssueTypeIdentifierValuesOfIssue=UB,i.selectIssueTypeIdentifiers=ca,i.selectIssueTypeIdentifiersByIds=Lw,i.selectIssueTypeIdentifiersOfIssueType=CB,i.selectIssueTypeMapping=SP,i.selectIssueTypeStatusById=ha,i.selectIssueTypeStatusMapping=MP,i.selectIssueTypeStatuses=oa,i.selectIssueTypeStatusesByIds=vP,i.selectIssueTypeStatusesOfIssueType=HB,i.selectIssueTypeValuesOfIssueType=$B,i.selectIssueTypes=ua,i.selectIssueTypesByIds=fP,i.selectIssueTypesOfOrganization=NB,i.selectIssueUpdateById=qP,i.selectIssueUpdateMapping=Aa,i.selectIssueUpdates=wa,i.selectIssueUpdatesByIds=jP,i.selectIssueUpdatesOfIssue=$P,i.selectIssues=Ws,i.selectIssuesByIds=pA,i.selectIssuesOfIssueType=yA,i.selectIssuesOfProject=BB,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=Yk,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=Ck,i.selectLatestAssetTypeFieldsOfAssetType=cB,i.selectLatestFieldsByAssetProcedureStep=Qk,i.selectLatestFieldsByProcedureStep=OD,i.selectLatestFormRevisionOfForm=MB,i.selectLatestIssueTypeFieldsOfIssueType=jB,i.selectLatestProcedureStepFieldValuesByProcedureStepOfProcedure=_D,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=vD,i.selectLatestProcedureStepFieldsOfProcedureStep=PD,i.selectLatestProcedureTypeFieldsOfProcedureType=jD,i.selectLatestRetryTime=ZB,i.selectLatestReviewOfProcedureStepFieldValues=bD,i.selectLatestReviewOfWorkflowStepFieldValues=AW,i.selectLatestReviewRequestOfProcedureStepFieldValues=gD,i.selectLatestReviewRequestOfWorkflowStepFieldValues=mW,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=SW,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=PW,i.selectLatestWorkflowStepFieldsOfWorkflowStep=oW,i.selectMembershipsByUserOfTeam=GD,i.selectOrganizationAccessById=lO,i.selectOrganizationAccessMapping=Cs,i.selectOrganizationAccessUserMapping=hO,i.selectOrganizationAccessesByIds=oO,i.selectOrganizationById=_O,i.selectOrganizationDocuments=PB,i.selectOrganizations=FO,i.selectOrganizationsByIds=gO,i.selectOrganizationsMapping=IO,i.selectProcedureById=GT,i.selectProcedureFieldValues=wc,i.selectProcedureFieldValuesAttachmentById=dR,i.selectProcedureFieldValuesAttachments=fc,i.selectProcedureFieldValuesAttachmentsByIds=uR,i.selectProcedureFieldValuesAttachmentsMapping=rR,i.selectProcedureFieldValuesById=IR,i.selectProcedureFieldValuesByIds=FR,i.selectProcedureFieldValuesMapping=TR,i.selectProcedureStepAssigneeById=cI,i.selectProcedureStepAssignees=ds,i.selectProcedureStepAssigneesByIds=rI,i.selectProcedureStepAssigneesMapping=aI,i.selectProcedureStepAssigneesOfProcedure=dD,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=lD,i.selectProcedureStepAssigneesOfProcedureStep=uD,i.selectProcedureStepById=rg,i.selectProcedureStepCommentById=PI,i.selectProcedureStepComments=us,i.selectProcedureStepCommentsByIds=OI,i.selectProcedureStepCommentsMapping=wI,i.selectProcedureStepCommentsOfProcedure=oD,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=pD,i.selectProcedureStepCommentsOfProcedureStep=hD,i.selectProcedureStepDefaultAssigneeById=BI,i.selectProcedureStepDefaultAssignees=ja,i.selectProcedureStepDefaultAssigneesByIds=DI,i.selectProcedureStepDefaultAssigneesMapping=kI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=yD,i.selectProcedureStepDefaultReviewerById=YI,i.selectProcedureStepDefaultReviewers=Ca,i.selectProcedureStepDefaultReviewersByIds=QI,i.selectProcedureStepDefaultReviewersMapping=KI,i.selectProcedureStepDefaultReviewersOfProcedureStep=SD,i.selectProcedureStepEventById=dF,i.selectProcedureStepEvents=ls,i.selectProcedureStepEventsByIds=uF,i.selectProcedureStepEventsMapping=rF,i.selectProcedureStepEventsOfProcedure=mD,i.selectProcedureStepEventsOfProcedureAndProcedureStep=AD,i.selectProcedureStepEventsOfProcedureStep=fD,i.selectProcedureStepFieldValues=Wt,i.selectProcedureStepFieldValuesAttachmentById=GF,i.selectProcedureStepFieldValuesAttachments=Xa,i.selectProcedureStepFieldValuesAttachmentsByIds=KF,i.selectProcedureStepFieldValuesAttachmentsMapping=HF,i.selectProcedureStepFieldValuesById=r_,i.selectProcedureStepFieldValuesByIds=d_,i.selectProcedureStepFieldValuesMapping=c_,i.selectProcedureStepFieldValuesOfProcedure=TD,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=FD,i.selectProcedureStepFieldValuesOfProcedureStep=ID,i.selectProcedureStepFieldValuesReviewById=V_,i.selectProcedureStepFieldValuesReviewRequestById=w_,i.selectProcedureStepFieldValuesReviewRequests=os,i.selectProcedureStepFieldValuesReviewRequestsByIds=P_,i.selectProcedureStepFieldValuesReviewRequestsMapping=A_,i.selectProcedureStepFieldValuesReviewRequestsOfProcedureAndProcedureStep=RD,i.selectProcedureStepFieldValuesReviews=Yt,i.selectProcedureStepFieldValuesReviewsByIds=k_,i.selectProcedureStepFieldValuesReviewsMapping=E_,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=MD,i.selectProcedureStepFields=Ls,i.selectProcedureStepFieldsAttachmentById=OF,i.selectProcedureStepFieldsAttachments=Ga,i.selectProcedureStepFieldsAttachmentsByIds=TF,i.selectProcedureStepFieldsAttachmentsMapping=wF,i.selectProcedureStepFieldsById=BF,i.selectProcedureStepFieldsByIds=DF,i.selectProcedureStepFieldsMapping=Ya,i.selectProcedureStepFieldsOfProcedureStep=wD,i.selectProcedureStepReviewerById=K_,i.selectProcedureStepReviewers=hs,i.selectProcedureStepReviewersByIds=Y_,i.selectProcedureStepReviewersMapping=G_,i.selectProcedureStepReviewersOfProcedure=ED,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=kD,i.selectProcedureStepReviewersOfProcedureStep=VD,i.selectProcedureSteps=dc,i.selectProcedureStepsByIds=dg,i.selectProcedureStepsMapping=Ns,i.selectProcedureStepsMappingOfProcedureType=BD,i.selectProcedureStepsOfProcedureType=DD,i.selectProcedureTypeAttachmentById=Tg,i.selectProcedureTypeAttachmentMapping=Og,i.selectProcedureTypeAttachments=lc,i.selectProcedureTypeAttachmentsByIds=Ig,i.selectProcedureTypeById=zR,i.selectProcedureTypeFields=Hs,i.selectProcedureTypeFieldsAttachmentById=Wg,i.selectProcedureTypeFieldsAttachments=hc,i.selectProcedureTypeFieldsAttachmentsByIds=zg,i.selectProcedureTypeFieldsAttachmentsMapping=Dg,i.selectProcedureTypeFieldsById=Jg,i.selectProcedureTypeFieldsByIds=Zg,i.selectProcedureTypeFieldsMapping=Qg,i.selectProcedureTypeFieldsOfProcedureType=qD,i.selectProcedureTypes=Gs,i.selectProcedureTypesByIds=qR,i.selectProcedureTypesMapping=WR,i.selectProcedureTypesOfAssetType=CD,i.selectProcedureTypesOfIssueType=UD,i.selectProcedures=Kt,i.selectProceduresByIds=KT,i.selectProceduresMapping=HT,i.selectProceduresOfAsset=cD,i.selectProceduresOfIssue=rD,i.selectProceduresOfProcedureType=YT,i.selectProceduresOfProject=aD,i.selectProjectAccessById=HO,i.selectProjectAccessMapping=ba,i.selectProjectAccesses=rs,i.selectProjectAccessesByIds=GO,i.selectProjectAccessesOfProject=xB,i.selectProjectAttachmentById=nT,i.selectProjectAttachmentMapping=iT,i.selectProjectAttachments=va,i.selectProjectAttachmentsByIds=aT,i.selectProjectById=BT,i.selectProjectDocuments=wB,i.selectProjectFileById=wT,i.selectProjectFileMapping=fT,i.selectProjectFiles=AT,i.selectProjectFilesByIds=PT,i.selectProjectMapping=kT,i.selectProjects=Us,i.selectProjectsByIds=DT,i.selectProjectsOfOrganization=nD,i.selectRehydrated=HD,i.selectReviewRequestsOfProcedureStepFieldValues=O_,i.selectReviewRequestsOfWorkflowStepFieldValues=AE,i.selectReviewsOfProcedureStepFieldValues=B_,i.selectReviewsOfWorkflowStepFieldValues=EE,i.selectStageMapping=Ci,i.selectTeamById=ob,i.selectTeamMembershipById=XR,i.selectTeamMemberships=Ks,i.selectTeamMembershipsByIds=xR,i.selectTeamMembershipsMapping=ZR,i.selectTeams=Fc,i.selectTeamsByIds=hb,i.selectTeamsMapping=lb,i.selectTeamsOfOrganization=YD,i.selectUploadUrl=FB,i.selectUserById=$s,i.selectUsers=js,i.selectUsersByIds=XP,i.selectUsersMapping=Ia,i.selectUsersOfOrganization=QB,i.selectUsersOfProject=tD,i.selectUsersOfTeam=KD,i.selectWorkflowById=Rb,i.selectWorkflowIssueLinkById=jb,i.selectWorkflowIssueLinks=Qt,i.selectWorkflowIssueLinksByIds=$b,i.selectWorkflowIssueLinksMapping=qb,i.selectWorkflowIssueLinksOfIssue=Lb,i.selectWorkflowIssueLinksOfIssues=XD,i.selectWorkflowIssueLinksOfWorkflow=Cb,i.selectWorkflowIssueLinksOfWorkflows=Ub,i.selectWorkflowMapping=gb,i.selectWorkflowStepAssigneeById=sM,i.selectWorkflowStepAssignees=Ss,i.selectWorkflowStepAssigneesByIds=iM,i.selectWorkflowStepAssigneesMapping=tM,i.selectWorkflowStepAssigneesOfWorkflow=xD,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=tW,i.selectWorkflowStepAssigneesOfWorkflowStep=eW,i.selectWorkflowStepById=nV,i.selectWorkflowStepCommentById=mM,i.selectWorkflowStepComments=ms,i.selectWorkflowStepCommentsByIds=fM,i.selectWorkflowStepCommentsMapping=SM,i.selectWorkflowStepCommentsOfWorkflow=sW,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=nW,i.selectWorkflowStepCommentsOfWorkflowStep=iW,i.selectWorkflowStepDefaultAssigneeById=vM,i.selectWorkflowStepDefaultAssignees=vc,i.selectWorkflowStepDefaultAssigneesByIds=EM,i.selectWorkflowStepDefaultAssigneesMapping=MM,i.selectWorkflowStepDefaultAssigneesOfWorkflowStep=aW,i.selectWorkflowStepDefaultReviewerById=NM,i.selectWorkflowStepDefaultReviewers=Vc,i.selectWorkflowStepDefaultReviewersByIds=HM,i.selectWorkflowStepDefaultReviewersMapping=LM,i.selectWorkflowStepDefaultReviewersOfWorkflowStep=cW,i.selectWorkflowStepEventById=nv,i.selectWorkflowStepEvents=fs,i.selectWorkflowStepEventsByIds=av,i.selectWorkflowStepEventsMapping=iv,i.selectWorkflowStepEventsOfWorkflow=rW,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=uW,i.selectWorkflowStepEventsOfWorkflowStep=dW,i.selectWorkflowStepFieldValues=zt,i.selectWorkflowStepFieldValuesAttachmentById=Lv,i.selectWorkflowStepFieldValuesAttachments=Uc,i.selectWorkflowStepFieldValuesAttachmentsByIds=Nv,i.selectWorkflowStepFieldValuesAttachmentsMapping=Uv,i.selectWorkflowStepFieldValuesById=nE,i.selectWorkflowStepFieldValuesByIds=aE,i.selectWorkflowStepFieldValuesMapping=iE,i.selectWorkflowStepFieldValuesOfWorkflow=hW,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=yW,i.selectWorkflowStepFieldValuesOfWorkflowStep=pW,i.selectWorkflowStepFieldValuesReviewById=ME,i.selectWorkflowStepFieldValuesReviewRequestById=mE,i.selectWorkflowStepFieldValuesReviewRequests=As,i.selectWorkflowStepFieldValuesReviewRequestsByIds=fE,i.selectWorkflowStepFieldValuesReviewRequestsMapping=SE,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=fW,i.selectWorkflowStepFieldValuesReviews=Jt,i.selectWorkflowStepFieldValuesReviewsByIds=vE,i.selectWorkflowStepFieldValuesReviewsMapping=bE,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=wW,i.selectWorkflowStepFields=Qs,i.selectWorkflowStepFieldsAttachmentById=fv,i.selectWorkflowStepFieldsAttachments=zc,i.selectWorkflowStepFieldsAttachmentsByIds=Av,i.selectWorkflowStepFieldsAttachmentsMapping=Sv,i.selectWorkflowStepFieldsById=Ev,i.selectWorkflowStepFieldsByIds=Vv,i.selectWorkflowStepFieldsMapping=vv,i.selectWorkflowStepFieldsOfWorkflowStep=lW,i.selectWorkflowStepReviewerById=NE,i.selectWorkflowStepReviewers=ws,i.selectWorkflowStepReviewersByIds=HE,i.selectWorkflowStepReviewersMapping=LE,i.selectWorkflowStepReviewersOfWorkflow=OW,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=IW,i.selectWorkflowStepReviewersOfWorkflowStep=TW,i.selectWorkflowSteps=Xc,i.selectWorkflowStepsByIds=aV,i.selectWorkflowStepsMapping=iV,i.selectWorkflowStepsOfWorkflowType=FW,i.selectWorkflowTypeById=AV,i.selectWorkflowTypeMapping=fV,i.selectWorkflowTypes=er,i.selectWorkflowTypesByIds=wV,i.selectWorkflowTypesOfOrganization=_W,i.selectWorkflows=Ys,i.selectWorkflowsByIds=bb,i.selectWorkflowsOfProject=JD,i.selectWorkflowsOfWorkflowType=ZD,i.setAsset=ro,i.setAssetAttachment=Lr,i.setAssetAttachments=Nr,i.setAssetProcedure=Pu,i.setAssetProcedureStep=Ll,i.setAssetProcedureStepFieldValues=El,i.setAssetProcedureStepFieldValuesAttachment=fl,i.setAssetProcedureStepFieldValuesAttachments=Al,i.setAssetProcedureStepFieldValuesMany=Vl,i.setAssetProcedureStepFields=al,i.setAssetProcedureStepFieldsAttachment=Hu,i.setAssetProcedureStepFieldsAttachments=Gu,i.setAssetProcedureStepFieldsMany=cl,i.setAssetProcedureSteps=Nl,i.setAssetProcedureType=Du,i.setAssetProcedureTypeAttachment=id,i.setAssetProcedureTypeAttachments=nd,i.setAssetProcedureTypeFieldValues=nu,i.setAssetProcedureTypeFieldValuesAttachment=Nd,i.setAssetProcedureTypeFieldValuesAttachments=Hd,i.setAssetProcedureTypeFieldValuesMany=au,i.setAssetProcedureTypeFields=Ed,i.setAssetProcedureTypeFieldsAttachment=fd,i.setAssetProcedureTypeFieldsAttachments=Ad,i.setAssetProcedureTypeFieldsMany=Vd,i.setAssetProcedureTypes=Wu,i.setAssetProcedures=Ou,i.setAssetStage=Vo,i.setAssetStageCompletion=wo,i.setAssetStageCompletions=Po,i.setAssetStages=ko,i.setAssetType=kp,i.setAssetTypeAttachment=Go,i.setAssetTypeAttachments=Ko,i.setAssetTypeFieldValues=Kh,i.setAssetTypeFieldValuesAttachment=kh,i.setAssetTypeFieldValuesAttachments=Bh,i.setAssetTypeFieldValuesMany=Yh,i.setAssetTypeFields=Ph,i.setAssetTypeFieldsAttachment=ch,i.setAssetTypeFieldsAttachments=rh,i.setAssetTypeFieldsMany=Oh,i.setAssetTypeIdentifier=rp,i.setAssetTypeIdentifierValue=Op,i.setAssetTypeIdentifierValues=Tp,i.setAssetTypeIdentifiers=dp,i.setAssetTypeStatus=Qp,i.setAssetTypeStatuses=Jp,i.setAssetTypes=Bp,i.setAssets=uo,i.setClientSDK=$V,i.setClientStore=qV,i.setConversation=zr,i.setConversations=Vk,i.setCurrentUser=GB,i.setCurrentUserProfile=KB,i.setDocument=gy,i.setDocumentAttachment=hy,i.setDocumentAttachments=py,i.setDocuments=Ry,i.setEmailDomain=$y,i.setEmailDomains=Cy,i.setForm=nm,i.setFormIdentifier=iS,i.setFormIdentifierValue=fS,i.setFormIdentifierValues=AS,i.setFormIdentifiers=nS,i.setFormRevision=NS,i.setFormRevisionAttachment=ES,i.setFormRevisionAttachments=VS,i.setFormRevisions=HS,i.setFormSubmission=bm,i.setFormSubmissionAttachment=fm,i.setFormSubmissionAttachments=Am,i.setFormSubmissions=Mm,i.setForms=am,i.setGeoImage=Cm,i.setGeoImages=Um,i.setIssue=cA,i.setIssueAssociation=sf,i.setIssueAssociations=tf,i.setIssueAttachment=Pf,i.setIssueAttachments=Of,i.setIssueComment=Yf,i.setIssueCommentAttachment=Bf,i.setIssueCommentAttachments=Df,i.setIssueComments=Qf,i.setIssueType=uP,i.setIssueTypeAttachment=PA,i.setIssueTypeAttachments=OA,i.setIssueTypeFieldValues=YA,i.setIssueTypeFieldValuesAttachment=Ow,i.setIssueTypeFieldValuesAttachments=Tw,i.setIssueTypeFieldValuesMany=QA,i.setIssueTypeFields=dw,i.setIssueTypeFieldsAttachment=BA,i.setIssueTypeFieldsAttachments=DA,i.setIssueTypeFieldsMany=uw,i.setIssueTypeIdentifier=Dw,i.setIssueTypeIdentifierValue=Qw,i.setIssueTypeIdentifierValues=Jw,i.setIssueTypeIdentifiers=Ww,i.setIssueTypeStatus=IP,i.setIssueTypeStatuses=FP,i.setIssueTypes=lP,i.setIssueUpdate=BP,i.setIssueUpdates=DP,i.setIssues=rA,i.setLoggedIn=cy,i.setOrganization=mO,i.setOrganizationAccess=iO,i.setOrganizationAccesses=nO,i.setOrganizations=SO,i.setProcedure=jT,i.setProcedureFieldValues=SR,i.setProcedureFieldValuesAttachment=tR,i.setProcedureFieldValuesAttachments=sR,i.setProcedureFieldValuesMany=mR,i.setProcedureStep=X_,i.setProcedureStepAssignee=xT,i.setProcedureStepAssignees=eI,i.setProcedureStepComment=pI,i.setProcedureStepComments=yI,i.setProcedureStepDefaultAssignee=RI,i.setProcedureStepDefaultAssignees=bI,i.setProcedureStepDefaultReviewer=CI,i.setProcedureStepDefaultReviewers=UI,i.setProcedureStepEvent=tF,i.setProcedureStepEvents=sF,i.setProcedureStepFieldValues=e_,i.setProcedureStepFieldValuesAttachment=$F,i.setProcedureStepFieldValuesAttachments=CF,i.setProcedureStepFieldValuesMany=t_,i.setProcedureStepFieldValuesReview=g_,i.setProcedureStepFieldValuesReviewRequest=p_,i.setProcedureStepFieldValuesReviewRequests=y_,i.setProcedureStepFieldValuesReviews=R_,i.setProcedureStepFields=bF,i.setProcedureStepFieldsAttachment=yF,i.setProcedureStepFieldsAttachments=SF,i.setProcedureStepFieldsMany=MF,i.setProcedureStepReviewer=$_,i.setProcedureStepReviewers=C_,i.setProcedureSteps=x_,i.setProcedureType=MR,i.setProcedureTypeAttachment=yg,i.setProcedureTypeAttachments=Sg,i.setProcedureTypeFields=Ug,i.setProcedureTypeFieldsAttachment=bg,i.setProcedureTypeFieldsAttachments=Mg,i.setProcedureTypeFieldsMany=Lg,i.setProcedureTypes=vR,i.setProcedures=$T,i.setProject=_T,i.setProjectAccess=qO,i.setProjectAccesses=jO,i.setProjectAttachment=ZO,i.setProjectAttachments=XO,i.setProjectFile=uT,i.setProjectFiles=lT,i.setProjects=FT,i.setRehydrated=ND,i.setTeam=nb,i.setTeamMembership=NR,i.setTeamMemberships=HR,i.setTeams=ab,i.setTokens=yB,i.setUploadUrl=IB,i.setUser=HP,i.setUsers=NP,i.setWorkflow=Pb,i.setWorkflowIssueLink=kb,i.setWorkflowIssueLinks=Bb,i.setWorkflowStep=ZE,i.setWorkflowStepAssignee=Qb,i.setWorkflowStepAssignees=Jb,i.setWorkflowStepComment=uM,i.setWorkflowStepComments=lM,i.setWorkflowStepDefaultAssignee=IM,i.setWorkflowStepDefaultAssignees=FM,i.setWorkflowStepDefaultReviewer=zM,i.setWorkflowStepDefaultReviewers=qM,i.setWorkflowStepEvent=ZM,i.setWorkflowStepEvents=XM,i.setWorkflowStepFieldValues=Zv,i.setWorkflowStepFieldValuesAttachment=zv,i.setWorkflowStepFieldValuesAttachments=qv,i.setWorkflowStepFieldValuesMany=Xv,i.setWorkflowStepFieldValuesReview=IE,i.setWorkflowStepFieldValuesReviewRequest=lE,i.setWorkflowStepFieldValuesReviewRequests=oE,i.setWorkflowStepFieldValuesReviews=FE,i.setWorkflowStepFields=Fv,i.setWorkflowStepFieldsAttachment=lv,i.setWorkflowStepFieldsAttachments=ov,i.setWorkflowStepFieldsMany=_v,i.setWorkflowStepReviewer=zE,i.setWorkflowStepReviewers=qE,i.setWorkflowSteps=XE,i.setWorkflowType=oV,i.setWorkflowTypes=hV,i.setWorkflows=Ob,i.shallowEqual=uk,i.slugify=Fk,i.spacesToDashesLower=Ik,i.teamMembershipReducer=JR,i.teamMembershipSlice=Tc,i.teamReducer=pb,i.teamSlice=Ic,i.toFileNameSafeString=Tk,i.toUuidArray=E,i.toUuidIdRecord=Ok,i.truncate=_k,i.updateAsset=no,i.updateAssetAttachment=Hr,i.updateAssetAttachments=Gr,i.updateAssetProcedure=fu,i.updateAssetProcedureStep=Kl,i.updateAssetProcedureStepFieldValues=kl,i.updateAssetProcedureStepFieldValuesAttachment=wl,i.updateAssetProcedureStepFieldValuesAttachments=Pl,i.updateAssetProcedureStepFieldValuesMany=Bl,i.updateAssetProcedureStepFields=rl,i.updateAssetProcedureStepFieldsAttachment=Ku,i.updateAssetProcedureStepFieldsAttachments=Yu,i.updateAssetProcedureStepFieldsMany=dl,i.updateAssetProcedureSteps=Yl,i.updateAssetProcedureType=Eu,i.updateAssetProcedureTypeAttachment=ad,i.updateAssetProcedureTypeAttachments=cd,i.updateAssetProcedureTypeFieldValues=cu,i.updateAssetProcedureTypeFieldValuesAttachment=Gd,i.updateAssetProcedureTypeFieldValuesAttachments=Kd,i.updateAssetProcedureTypeFieldValuesMany=ru,i.updateAssetProcedureTypeFields=kd,i.updateAssetProcedureTypeFieldsAttachment=wd,i.updateAssetProcedureTypeFieldsAttachments=Pd,i.updateAssetProcedureTypeFieldsMany=Bd,i.updateAssetProcedureTypes=Vu,i.updateAssetProcedures=Au,i.updateAssetStage=Wo,i.updateAssetStageCompletion=Oo,i.updateAssetStageCompletions=To,i.updateAssetStages=zo,i.updateAssetType=zp,i.updateAssetTypeAttachment=Yo,i.updateAssetTypeAttachments=Qo,i.updateAssetTypeFieldValues=Qh,i.updateAssetTypeFieldValuesAttachment=Dh,i.updateAssetTypeFieldValuesAttachments=Wh,i.updateAssetTypeFieldValuesMany=Jh,i.updateAssetTypeFields=Th,i.updateAssetTypeFieldsAttachment=dh,i.updateAssetTypeFieldsAttachments=uh,i.updateAssetTypeFieldsMany=Ih,i.updateAssetTypeIdentifier=up,i.updateAssetTypeIdentifierValue=Ip,i.updateAssetTypeIdentifierValues=Fp,i.updateAssetTypeIdentifiers=lp,i.updateAssetTypeStatus=Zp,i.updateAssetTypeStatuses=Xp,i.updateAssetTypes=qp,i.updateAssets=ao,i.updateConversation=qr,i.updateConversations=kk,i.updateDocument=by,i.updateDocumentAttachment=yy,i.updateDocumentAttachments=Sy,i.updateDocuments=My,i.updateEmailDomain=Uy,i.updateEmailDomains=Ly,i.updateForm=cm,i.updateFormIdentifier=aS,i.updateFormIdentifierValue=wS,i.updateFormIdentifierValues=PS,i.updateFormIdentifiers=cS,i.updateFormRevision=GS,i.updateFormRevisionAttachment=kS,i.updateFormRevisionAttachments=BS,i.updateFormRevisions=KS,i.updateFormSubmission=Em,i.updateFormSubmissionAttachment=wm,i.updateFormSubmissionAttachments=Pm,i.updateFormSubmissions=Vm,i.updateForms=rm,i.updateGeoImage=Hm,i.updateGeoImages=Gm,i.updateIssue=dA,i.updateIssueAssociation=nf,i.updateIssueAssociations=af,i.updateIssueAttachment=Tf,i.updateIssueAttachments=If,i.updateIssueComment=Jf,i.updateIssueCommentAttachment=Wf,i.updateIssueCommentAttachments=zf,i.updateIssueComments=Zf,i.updateIssueType=oP,i.updateIssueTypeAttachment=TA,i.updateIssueTypeAttachments=IA,i.updateIssueTypeFieldValues=JA,i.updateIssueTypeFieldValuesAttachment=Iw,i.updateIssueTypeFieldValuesAttachments=Fw,i.updateIssueTypeFieldValuesMany=ZA,i.updateIssueTypeFields=lw,i.updateIssueTypeFieldsAttachment=WA,i.updateIssueTypeFieldsAttachments=zA,i.updateIssueTypeFieldsMany=ow,i.updateIssueTypeIdentifier=zw,i.updateIssueTypeIdentifierValue=Zw,i.updateIssueTypeIdentifierValues=Xw,i.updateIssueTypeIdentifiers=qw,i.updateIssueTypeStatus=_P,i.updateIssueTypeStatuses=gP,i.updateIssueTypes=hP,i.updateIssueUpdate=WP,i.updateIssueUpdates=zP,i.updateIssues=uA,i.updateOrganization=PO,i.updateOrganizationAccess=aO,i.updateOrganizationAccesses=cO,i.updateOrganizations=wO,i.updateProcedure=CT,i.updateProcedureFieldValues=fR,i.updateProcedureFieldValuesAttachment=iR,i.updateProcedureFieldValuesAttachments=nR,i.updateProcedureFieldValuesMany=AR,i.updateProcedureStep=sg,i.updateProcedureStepAssignee=tI,i.updateProcedureStepAssignees=sI,i.updateProcedureStepComment=SI,i.updateProcedureStepComments=mI,i.updateProcedureStepDefaultAssignee=MI,i.updateProcedureStepDefaultAssignees=vI,i.updateProcedureStepDefaultReviewer=LI,i.updateProcedureStepDefaultReviewers=NI,i.updateProcedureStepEvent=iF,i.updateProcedureStepEvents=nF,i.updateProcedureStepFieldValues=s_,i.updateProcedureStepFieldValuesAttachment=UF,i.updateProcedureStepFieldValuesAttachments=LF,i.updateProcedureStepFieldValuesMany=i_,i.updateProcedureStepFieldValuesReview=b_,i.updateProcedureStepFieldValuesReviewRequest=S_,i.updateProcedureStepFieldValuesReviewRequests=m_,i.updateProcedureStepFieldValuesReviews=M_,i.updateProcedureStepFields=vF,i.updateProcedureStepFieldsAttachment=mF,i.updateProcedureStepFieldsAttachments=fF,i.updateProcedureStepFieldsMany=EF,i.updateProcedureStepReviewer=U_,i.updateProcedureStepReviewers=L_,i.updateProcedureSteps=ig,i.updateProcedureType=ER,i.updateProcedureTypeAttachment=mg,i.updateProcedureTypeAttachments=fg,i.updateProcedureTypeFields=Ng,i.updateProcedureTypeFieldsAttachment=vg,i.updateProcedureTypeFieldsAttachments=Eg,i.updateProcedureTypeFieldsMany=Hg,i.updateProcedureTypes=VR,i.updateProcedures=UT,i.updateProject=MT,i.updateProjectAccess=$O,i.updateProjectAccesses=CO,i.updateProjectAttachment=xO,i.updateProjectAttachments=eT,i.updateProjectFile=pT,i.updateProjectFiles=yT,i.updateProjects=bT,i.updateTeam=cb,i.updateTeamMembership=GR,i.updateTeamMemberships=KR,i.updateTeams=rb,i.updateUser=YP,i.updateUsers=KP,i.updateWorkflow=Tb,i.updateWorkflowIssueLink=Db,i.updateWorkflowIssueLinks=Wb,i.updateWorkflowStep=xE,i.updateWorkflowStepAssignee=Zb,i.updateWorkflowStepAssignees=Xb,i.updateWorkflowStepComment=oM,i.updateWorkflowStepComments=hM,i.updateWorkflowStepDefaultAssignee=_M,i.updateWorkflowStepDefaultAssignees=gM,i.updateWorkflowStepDefaultReviewer=jM,i.updateWorkflowStepDefaultReviewers=$M,i.updateWorkflowStepEvent=xM,i.updateWorkflowStepEvents=ev,i.updateWorkflowStepFieldValues=xv,i.updateWorkflowStepFieldValuesAttachment=jv,i.updateWorkflowStepFieldValuesAttachments=$v,i.updateWorkflowStepFieldValuesMany=eE,i.updateWorkflowStepFieldValuesReview=_E,i.updateWorkflowStepFieldValuesReviewRequest=hE,i.updateWorkflowStepFieldValuesReviewRequests=pE,i.updateWorkflowStepFieldValuesReviews=gE,i.updateWorkflowStepFields=gv,i.updateWorkflowStepFieldsAttachment=hv,i.updateWorkflowStepFieldsAttachments=pv,i.updateWorkflowStepFieldsMany=Rv,i.updateWorkflowStepReviewer=jE,i.updateWorkflowStepReviewers=$E,i.updateWorkflowSteps=eV,i.updateWorkflowType=pV,i.updateWorkflowTypes=yV,i.updateWorkflows=Ib,i.useSelectorBuilder=dk,i.userReducer=JP,i.userSlice=Pa,i.uuidObj=P,i.uuidObjSortFn=ii,i.uuidSortFn=Ts,i.versioningReducer=Sb,i.versioningSlice=yb,i.workflowIssueLinkReducer=Nb,i.workflowIssueLinkSlice=gc,i.workflowReducer=Mb,i.workflowSlice=_c,i.workflowStepAssigneeReducer=nM,i.workflowStepAssigneeSlice=Rc,i.workflowStepCommentReducer=AM,i.workflowStepCommentSlice=bc,i.workflowStepDefaultAssigneeReducer=VM,i.workflowStepDefaultAssigneeSlice=Mc,i.workflowStepDefaultReviewerReducer=GM,i.workflowStepDefaultReviewerSlice=Ec,i.workflowStepEventReducer=cv,i.workflowStepEventSlice=kc,i.workflowStepFieldValuesAttachmentReducer=Gv,i.workflowStepFieldValuesAttachmentSlice=jc,i.workflowStepFieldValuesReducer=cE,i.workflowStepFieldValuesReviewReducer=VE,i.workflowStepFieldValuesReviewRequestReducer=wE,i.workflowStepFieldValuesReviewRequestSlice=Nc,i.workflowStepFieldValuesReviewSlice=Kc,i.workflowStepFieldValuesSlice=Lc,i.workflowStepFieldsAttachmentReducer=wv,i.workflowStepFieldsAttachmentSlice=Bc,i.workflowStepFieldsReducer=kv,i.workflowStepFieldsSlice=qc,i.workflowStepReducer=cV,i.workflowStepReviewerReducer=GE,i.workflowStepReviewerSlice=Jc,i.workflowStepSlice=Zc,i.workflowTypeReducer=PV,i.workflowTypeSlice=xc,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
13
+ external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(y)}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 Os(e),file_type:e.type,extension:Pr(e),size:e.size};return await this.client.files.addCache(e),a}}class yz extends M{constructor(){super(...arguments);p(this,"name","Form Identifier");p(this,"url","/form-identifiers");p(this,"actions",{addOne:xy,addMany:eS,setOne:tS,setMany:sS,updateOne:iS,updateMany:nS,deleteOne:aS,deleteMany:cS,initialize:Xy});p(this,"selectors",{selectById:dS,selectByIds:lS})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 Sz extends M{constructor(){super(...arguments);p(this,"name","Form Identifier Value");p(this,"url","/form-identifier-values");p(this,"actions",{addOne:pS,addMany:yS,setOne:SS,setMany:mS,updateOne:fS,updateMany:AS,deleteOne:wS,deleteMany:PS,initialize:hS});p(this,"selectors",{selectById:TS,selectByIds:IS})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[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(`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 mz extends z{constructor(){super(...arguments);p(this,"name","Form Revision Attachment");p(this,"url","/form-revision-attachments");p(this,"actions",{addOne:RS,addMany:bS,setOne:MS,setMany:vS,updateOne:ES,updateMany:VS,deleteOne:kS,deleteMany:BS,initialize:gS});p(this,"selectors",{selectById:WS,selectByIds:zS})}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 P({...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 fz extends M{constructor(){super(...arguments);p(this,"name","Form Revision");p(this,"url","/form-revisions");p(this,"actions",{addOne:CS,addMany:wn,setOne:US,setMany:LS,updateOne:NS,updateMany:HS,deleteOne:GS,deleteMany:Pn,initialize:$S});p(this,"selectors",{selectById:YS,selectByIds:QS})}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(),y=P({...e,created_by:l,submitted_at:u});this.dispatch(a(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.form],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}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 Az extends M{constructor(){super(...arguments);p(this,"name","Form");p(this,"url","/forms");p(this,"actions",{addOne:em,addMany:tm,setOne:sm,setMany:im,updateOne:nm,updateMany:am,deleteOne:cm,deleteMany:rm,initialize:xS});p(this,"selectors",{selectById:um,selectByIds:om})}add(e){var S;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=P({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 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 form to exist");const u=Dm(e)(d),y=JS(e)(d);this.dispatch(a(e)),this.dispatch(En(E(u))),this.dispatch(Pn(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(l)),this.dispatch(wn(y)),this.dispatch(vn(u)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class wz extends z{constructor(){super(...arguments);p(this,"name","Form Submission Attachment");p(this,"url","/form-submission-attachments");p(this,"actions",{addOne:ym,addMany:Fn,setOne:Sm,setMany:mm,updateOne:fm,updateMany:Am,deleteOne:wm,deleteMany:_n,initialize:pm});p(this,"selectors",{selectById:Pm,selectByIds:Om})}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 P({...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=bn(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 Pz extends M{constructor(){super(...arguments);p(this,"name","Form Submission");p(this,"url","/form-submissions");p(this,"actions",{addOne:bm,addMany:vn,setOne:gm,setMany:Rm,updateOne:Mm,updateMany:vm,deleteOne:Em,deleteMany:En,initialize:_m});p(this,"selectors",{selectById:km,selectByIds:Bm})}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(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.form_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}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(y=>{this.dispatch(a(y))}).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=Tm(e)(d);this.dispatch(a(e)),this.dispatch(_n(E(u)));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(Fn(u)),y}}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 Oz extends z{constructor(){super(...arguments);p(this,"name","Geo Image");p(this,"url","/geo-images");p(this,"actions",{addOne:Cm,addMany:Um,setOne:jm,setMany:$m,updateOne:Lm,updateMany:Nm,deleteOne:Hm,deleteMany:Gm,initialize:qm});p(this,"selectors",{selectById:Ym,selectByIds:Qm})}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 P({...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(y=>{this.dispatch(a(y))}).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 Tz extends M{constructor(){super(...arguments);p(this,"name","Issue Association");p(this,"url","/issue-associations");p(this,"actions",{addOne:nf,addMany:jt,setOne:ef,setMany:xm,updateOne:tf,updateMany:sf,deleteOne:af,deleteMany:$t,initialize:Xm});p(this,"selectors",{selectById:rf,selectByIds:df})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=P({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 Iz extends z{constructor(){super(...arguments);p(this,"name","Issue Attachment");p(this,"url","/issue-attachments");p(this,"actions",{addOne:ff,addMany:zn,setOne:Af,setMany:wf,updateOne:Pf,updateMany:Of,deleteOne:Tf,deleteMany:qn,initialize:mf});p(this,"selectors",{selectById:_f,selectByIds:gf})}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 P({...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 Fz extends z{constructor(){super(...arguments);p(this,"name","Issue Comment Attachment");p(this,"url","/issue-comment-attachments");p(this,"actions",{addOne:vf,addMany:Ef,setOne:Vf,setMany:kf,updateOne:Bf,updateMany:Df,deleteOne:Wf,deleteMany:zf,initialize:Mf});p(this,"selectors",{selectById:jf,selectByIds:$f})}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 P({...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 _z extends M{constructor(){super(...arguments);p(this,"name","Issue Comment");p(this,"url","/issue-comments");p(this,"actions",{addOne:Nf,addMany:Hf,setOne:Gf,setMany:Kf,updateOne:Yf,updateMany:Qf,deleteOne:Jf,deleteMany:Zf,initialize:Lf});p(this,"selectors",{selectById:Xf,selectByIds:xf})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...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 gz extends M{constructor(){super(...arguments);p(this,"name","Issue");p(this,"url","/issues");p(this,"actions",{addOne:iA,addMany:Hn,setOne:nA,setMany:aA,updateOne:cA,updateMany:rA,deleteOne:dA,deleteMany:Gn,initialize:sA});p(this,"selectors",{selectById:uA,selectByIds:oA})}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,y=P({...e,submitted_at:l,created_by:u});this.dispatch(a(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[y.project,y.issue_type,y.status],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(F=>{throw this.dispatch(r(y.uuid)),F}),[y,S]}update(e){var S;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 F=e[f],g=ua(F)(c);if(!g)throw new Error(`Trying to update issue type status with ${F} which does not exist in store`);l[f]={name:g.name,color:g.color,uuid:g.uuid};break}case $.ASSIGNED_TO:{const F=e[f];if(F===null)l[f]=null;else{const g=$s(F)(c);if(!g)throw new Error(`Trying to update assigned to with ${F} which does not exist in store.`);l[f]={full_name:g.username,id:g.id}}break}}const u=P({created_by:((S=c.userReducer.currentUser)==null?void 0:S.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(ha(u));const y=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 y.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(ya(u.uuid))}),[d,y]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Ts);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(ti);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 F=0;F<d.length;F++)u.push({...l[F],...e[F]});this.dispatch(c(u));const y=N(e,Math.min(n??e.length,L)),S=[];let f=null;for(const F of y){const g=Dt.v4(),V=E(F),_=F.map(({status:b})=>b).filter(Boolean),v=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(V).concat(_),blocks:[g].concat(V)});S.push(v),f=g}return Promise.all(S).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,S]}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=lf(e)(d),y=hf(e)(d),S=$b(e)(d),f=Ff(e)(d),F=qP(e)(d);this.dispatch(a(e)),this.dispatch(qn(E(f))),this.dispatch(Sa(E(F))),this.dispatch($t(E(u))),this.dispatch($t(E(y))),this.dispatch(ps(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(g){throw this.dispatch(c(l)),this.dispatch(zn(f)),this.dispatch(pa(F)),this.dispatch(jt(u)),this.dispatch(jt(y)),this.dispatch(hs(S)),g}}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=uf(e)(d),y=of(e)(d),S=jb(e)(d);this.dispatch(c(e)),this.dispatch($t(E(u))),this.dispatch($t(E(y))),this.dispatch(ps(E(S)));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(f){throw this.dispatch(a(l)),this.dispatch(jt(u)),this.dispatch(jt(y)),this.dispatch(hs(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Rz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Attachment");p(this,"url","/issue-type-attachments");p(this,"actions",{addOne:mA,addMany:fA,setOne:AA,setMany:wA,updateOne:PA,updateMany:OA,deleteOne:TA,deleteMany:IA,initialize:SA});p(this,"selectors",{selectById:_A,selectByIds:gA})}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 P({...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 bz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Fields Attachment");p(this,"url","/issue-type-fields-attachments");p(this,"actions",{addOne:vA,addMany:EA,setOne:VA,setMany:kA,updateOne:BA,updateMany:DA,deleteOne:WA,deleteMany:zA,initialize:MA});p(this,"selectors",{selectById:jA,selectByIds:$A})}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 P({...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 Mz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Fields");p(this,"url","/issue-type-fields");p(this,"actions",{addOne:nw,addMany:aw,setOne:cw,setMany:rw,updateOne:dw,updateMany:lw,deleteOne:uw,deleteMany:ow,initialize:iw});p(this,"selectors",{selectById:pw,selectByIds:yw})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}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 vz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Field Values Attachment");p(this,"url","/issue-type-field-values-attachments");p(this,"actions",{addOne:Aw,addMany:ea,setOne:ww,setMany:Pw,updateOne:Ow,updateMany:Tw,deleteOne:Iw,deleteMany:ta,initialize:fw});p(this,"selectors",{selectById:_w,selectByIds:gw})}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 P({...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 Ez extends M{constructor(){super(...arguments);p(this,"name","Issue Type Field Values");p(this,"url","/issue-type-field-values");p(this,"actions",{addOne:NA,addMany:HA,setOne:GA,setMany:KA,updateOne:YA,updateMany:QA,deleteOne:JA,deleteMany:ZA,initialize:LA});p(this,"selectors",{selectById:xA,selectByIds:ew})}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(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.issue,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}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(y=>{this.dispatch(a(y))}).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=Rw(e)(d);this.dispatch(a(e)),this.dispatch(ta(E(u)));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(ea(u)),y}}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 Vz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier");p(this,"url","/issue-type-identifiers");p(this,"actions",{addOne:Ew,addMany:Vw,setOne:kw,setMany:Bw,updateOne:Dw,updateMany:Ww,deleteOne:zw,deleteMany:qw,initialize:vw});p(this,"selectors",{selectById:$w,selectByIds:Cw})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 kz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier Value");p(this,"url","/issue-type-identifier-values");p(this,"actions",{addOne:Hw,addMany:Gw,setOne:Kw,setMany:Yw,updateOne:Qw,updateMany:Jw,deleteOne:Zw,deleteMany:Xw,initialize:Nw});p(this,"selectors",{selectById:eP,selectByIds:tP})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[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(`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 Bz extends M{constructor(){super(...arguments);p(this,"name","Issue Type");p(this,"url","/issue-types");p(this,"actions",{addOne:aP,addMany:cP,setOne:rP,setMany:dP,updateOne:lP,updateMany:uP,deleteOne:oP,deleteMany:hP,initialize:nP});p(this,"selectors",{selectById:yP,selectByIds:SP})}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(),y=P({...e,submitted_at:u,created_by:l});this.dispatch(a(y));const S=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}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(y=>{this.dispatch(a(y))}).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=hA(e)(d);this.dispatch(a(e)),this.dispatch(Gn(E(u)));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(Hn(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 Dz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Status");p(this,"url","/issue-type-statuses");p(this,"actions",{addOne:wP,addMany:PP,setOne:OP,setMany:TP,updateOne:IP,updateMany:FP,deleteOne:_P,deleteMany:gP,initialize:AP});p(this,"selectors",{selectById:ua,selectByIds:bP})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 Wz extends M{constructor(){super(...arguments);p(this,"name","Issue Update");p(this,"url","/issue-updates");p(this,"actions",{addOne:ha,addMany:pa,setOne:VP,setMany:kP,updateOne:BP,updateMany:DP,deleteOne:ya,deleteMany:Sa,initialize:EP});p(this,"selectors",{selectById:WP,selectByIds:zP})}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 zz=1800;function qz(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 jz extends WW{constructor(){super(...arguments);p(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(ny(!1)),this.clearTokens(),this.dispatch(O()),this.dispatch(O())}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=XV(e).exp??n}catch{a=n}return a-n<zz}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??Jt).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=Dt.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(qz(a))})}}class $z extends qt{constructor(){super(...arguments);p(this,"name","Organization Access");p(this,"url","/organization-accesses");p(this,"actions",{addOne:xP,addMany:eO,setOne:tO,setMany:sO,updateOne:iO,updateMany:nO,deleteOne:aO,deleteMany:cO,initialize:XP});p(this,"selectors",{selectById:dO,selectByIds:lO})}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=$s(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch(Pa(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(y){throw this.dispatch(c(l)),this.dispatch(wa(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 Cz extends qt{constructor(){super(...arguments);p(this,"name","Organization");p(this,"url","/organizations");p(this,"actions",{addOne:mO,addMany:SO,setOne:yO,setMany:pO,updateOne:AO,updateMany:fO,deleteOne:wO,deleteMany:PO,initialize:hO});p(this,"selectors",{selectById:IO,selectByIds:FO})}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 Uz extends M{constructor(){super(...arguments);p(this,"name","Project Access");p(this,"url","/project-accesses");p(this,"actions",{addOne:BO,addMany:DO,setOne:WO,setMany:zO,updateOne:qO,updateMany:jO,deleteOne:$O,deleteMany:CO,initialize:kO});p(this,"selectors",{selectById:LO,selectByIds:NO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(d.uuid)),y}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=e.map(S=>P({...S,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(S=>R(S))},blockers:l.flatMap(S=>[S.project,S.organization_access]),blocks:l.map(S=>S.uuid)});return u.then(S=>{this.dispatch(r(S))}).catch(S=>{throw this.dispatch(c(l.map(f=>f.uuid))),S}),[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 Lz extends z{constructor(){super(...arguments);p(this,"name","Project Attachment");p(this,"url","/project-attachments");p(this,"actions",{addOne:KO,addMany:YO,setOne:QO,setMany:JO,updateOne:ZO,updateMany:XO,deleteOne:xO,deleteMany:eT,initialize:GO});p(this,"selectors",{selectById:sT,selectByIds:iT})}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 P({...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 Nz extends z{constructor(){super(...arguments);p(this,"name","Project File");p(this,"url","/project-files");p(this,"actions",{addOne:lT,addMany:uT,setOne:rT,setMany:dT,updateOne:oT,updateMany:hT,deleteOne:pT,deleteMany:yT,initialize:cT});p(this,"selectors",{selectById:fT,selectByIds:AT})}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 P({...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(y=>{this.dispatch(a(y))}).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 Hz extends qt{constructor(){super(...arguments);p(this,"name","Project");p(this,"url","/projects");p(this,"actions",{addOne:_T,addMany:FT,setOne:IT,setMany:TT,updateOne:RT,updateMany:gT,deleteOne:bT,deleteMany:MT,initialize:OT});p(this,"selectors",{selectById:VT,selectByIds:kT})}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}}const kV=(...t)=>t.filter(s=>s!==null);class Gz extends M{constructor(){super(...arguments);p(this,"name","Procedure");p(this,"url","/procedures");p(this,"actions",{addOne:WT,addMany:Va,setOne:zT,setMany:qT,updateOne:jT,updateMany:$T,deleteOne:CT,deleteMany:ka,initialize:DT});p(this,"selectors",{selectById:NT,selectByIds:HT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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:kV(d.procedure_type,d.project,d.asset,d.issue),blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).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 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:kV(r.uuid,d.procedure_type,d.project,d.asset,d.issue),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 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(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 Kz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Assignee");p(this,"url","/procedure-step-assignees");p(this,"actions",{addOne:QT,addMany:JT,setOne:ZT,setMany:XT,updateOne:xT,updateMany:eI,deleteOne:tI,deleteMany:sI,initialize:YT});p(this,"selectors",{selectById:nI,selectByIds:aI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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.procedure,d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.procedure,f.procedure_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(E(u)))}),[u,y]}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 procedure 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:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Yz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Comment");p(this,"url","/procedure-step-comments");p(this,"actions",{addOne:lI,addMany:uI,setOne:oI,setMany:hI,updateOne:pI,updateMany:yI,deleteOne:SI,deleteMany:mI,initialize:dI});p(this,"selectors",{selectById:AI,selectByIds:wI})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...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.procedure,d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).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(`Procedure 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(`Procedure 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:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Qz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Assignee");p(this,"url","/procedure-step-default-assignees");p(this,"actions",{addOne:II,addMany:FI,setOne:_I,setMany:gI,updateOne:RI,updateMany:bI,deleteOne:MI,deleteMany:vI,initialize:TI});p(this,"selectors",{selectById:VI,selectByIds:kI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).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(`Expected procedure step default 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 refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class Jz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Reviewer");p(this,"url","/procedure-step-default-reviewers");p(this,"actions",{addOne:zI,addMany:qI,setOne:jI,setMany:$I,updateOne:CI,updateMany:UI,deleteOne:LI,deleteMany:NI,initialize:WI});p(this,"selectors",{selectById:GI,selectByIds:KI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).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(`Expected procedure step default 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 refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class Zz extends qt{constructor(){super(...arguments);p(this,"name","Procedure Step Event");p(this,"url","/procedure-step-events");p(this,"actions",{addOne:ZI,addMany:XI,setOne:xI,setMany:eF,updateOne:tF,updateMany:sF,deleteOne:iF,deleteMany:nF,initialize:JI});p(this,"selectors",{selectById:cF,selectByIds:rF})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Xz extends z{constructor(){super(...arguments);p(this,"name","Procedure Step Fields Attachment");p(this,"url","/procedure-step-fields-attachments");p(this,"actions",{addOne:oF,addMany:Ua,setOne:hF,setMany:pF,updateOne:yF,updateMany:SF,deleteOne:mF,deleteMany:La,initialize:uF});p(this,"selectors",{selectById:wF,selectByIds:PF})}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 P({...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__procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class xz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Fields");p(this,"url","/procedure-step-fields");p(this,"actions",{addOne:FF,addMany:_F,setOne:gF,setMany:RF,updateOne:bF,updateMany:MF,deleteOne:vF,deleteMany:EF,initialize:IF});p(this,"selectors",{selectById:VF,selectByIds:kF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).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 procedure step fields with uuid ${e} to exist`);const u=AF(e)(d);this.dispatch(a(e)),this.dispatch(La(E(u)));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(Ua(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class eq extends z{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Attachment");p(this,"url","/procedure-step-field-values-attachments");p(this,"actions",{addOne:zF,addMany:Ya,setOne:qF,setMany:jF,updateOne:$F,updateMany:CF,deleteOne:UF,deleteMany:Qa,initialize:WF});p(this,"selectors",{selectById:NF,selectByIds:HF})}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 P({...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__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class tq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Review Request");p(this,"url","/procedure-step-field-values-review-requests");p(this,"actions",{addOne:u_,addMany:xa,setOne:o_,setMany:h_,updateOne:p_,updateMany:y_,deleteOne:S_,deleteMany:ec,initialize:l_});p(this,"selectors",{selectById:f_,selectByIds:A_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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(`Procedure 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__procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class sq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Review");p(this,"url","/procedure-step-field-values-reviews");p(this,"actions",{addOne:I_,addMany:sc,setOne:F_,setMany:__,updateOne:g_,updateMany:R_,deleteOne:b_,deleteMany:ic,initialize:T_});p(this,"selectors",{selectById:v_,selectByIds:E_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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(`Procedure 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(`Procedure 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__procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class iq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values");p(this,"url","/procedure-step-field-values");p(this,"actions",{addOne:JF,addMany:ZF,setOne:XF,setMany:xF,updateOne:e_,updateMany:t_,deleteOne:s_,deleteMany:i_,initialize:QF});p(this,"selectors",{selectById:a_,selectByIds:c_})}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(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,fields_revision:b.fields_revision,procedure:b.procedure,procedure_step:b.procedure_step,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:c,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({fields_revision:k})=>k),D=v.map(({procedure:k})=>k),j=v.map(({procedure_step:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}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 ProcedureStepFieldValues 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.procedure,l.procedure_step,l.fields_revision],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).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 ProcedureStepFieldValues with uuid ${e} to exist`);const u=GF(e)(d),y=V_(e)(d),S=w_(e)(d);this.dispatch(a(e)),this.dispatch(Qa(E(u))),this.dispatch(ic(E(y))),this.dispatch(ec(E(S)));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(Ya(u)),this.dispatch(sc(y)),this.dispatch(xa(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class nq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Reviewer");p(this,"url","/procedure-step-reviewers");p(this,"actions",{addOne:W_,addMany:z_,setOne:q_,setMany:j_,updateOne:$_,updateMany:C_,deleteOne:U_,deleteMany:L_,initialize:D_});p(this,"selectors",{selectById:H_,selectByIds:G_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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.procedure,d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.procedure,f.procedure_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,y]}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 procedure 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:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class aq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step");p(this,"url","/procedure-steps");p(this,"actions",{addOne:X_,addMany:x_,setOne:J_,setMany:Z_,updateOne:eg,updateMany:tg,deleteOne:sg,deleteMany:ig,initialize:Q_});p(this,"selectors",{selectById:ag,selectByIds:cg})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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.procedure_type],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).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(`No 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: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,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No procedure step with uuid ${e} found in the store`);this.dispatch(c(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(a(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class cq extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Attachment");p(this,"url","/procedure-type-attachments");p(this,"actions",{addOne:lg,addMany:ug,setOne:og,setMany:hg,updateOne:pg,updateMany:yg,deleteOne:Sg,deleteMany:mg,initialize:dg});p(this,"selectors",{selectById:wg,selectByIds:Pg})}getId(e){return e.uuid}getBlockers(e){return[e.procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,y=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,S=new Date().toISOString();return P({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:y,submitted_at:S,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,procedure_type:e.procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class rq extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Fields Attachment");p(this,"url","/procedure-type-fields-attachments");p(this,"actions",{addOne:Ig,addMany:Fg,setOne:_g,setMany:gg,updateOne:Rg,updateMany:bg,deleteOne:Mg,deleteMany:vg,initialize:Tg});p(this,"selectors",{selectById:kg,selectByIds:Bg})}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 P({...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__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class dq extends M{constructor(){super(...arguments);p(this,"name","Procedure Type Fields");p(this,"url","/procedure-type-fields");p(this,"actions",{addOne:zg,addMany:qg,setOne:jg,setMany:$g,updateOne:Cg,updateMany:Ug,deleteOne:Lg,deleteMany:Ng,initialize:Wg});p(this,"selectors",{selectById:Kg,selectByIds:Yg})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.procedure_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class lq extends z{constructor(){super(...arguments);p(this,"name","Procedure Field Values Attachment");p(this,"url","/procedure-field-values-attachments");p(this,"actions",{addOne:Zg,addMany:yc,setOne:Xg,setMany:xg,updateOne:eR,updateMany:tR,deleteOne:sR,deleteMany:Sc,initialize:Jg});p(this,"selectors",{selectById:aR,selectByIds:cR})}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 P({...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__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class uq extends M{constructor(){super(...arguments);p(this,"name","Procedure Field Values");p(this,"url","/procedure-field-values");p(this,"actions",{addOne:uR,addMany:oR,setOne:hR,setMany:pR,updateOne:yR,updateMany:SR,deleteOne:mR,deleteMany:fR,initialize:lR});p(this,"selectors",{selectById:PR,selectByIds:OR})}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(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.fields_revision,e.procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,fields_revision:b.fields_revision,procedure:b.procedure,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:a,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({fields_revision:q})=>q),D=v.map(({procedure:q})=>q),j=v.map(({uuid:q})=>q),W=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D),blocks:j});g.push(W)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}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 ProcedureFieldValues 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.procedure],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).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=rR(e)(d);this.dispatch(a(e)),this.dispatch(Sc(E(u)));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(yc(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class oq extends M{constructor(){super(...arguments);p(this,"name","Procedure Type");p(this,"url","/procedure-types");p(this,"actions",{addOne:FR,addMany:_R,setOne:gR,setMany:RR,updateOne:bR,updateMany:MR,deleteOne:vR,deleteMany:ER,initialize:IR});p(this,"selectors",{selectById:BR,selectByIds:DR})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.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(S=>{this.dispatch(c(S))}).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 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 procedure type with uuid ${e} to exist`);const u=GT(e)(d);this.dispatch(a(e)),this.dispatch(ka(E(u)));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(Va(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 hq extends M{constructor(){super(...arguments);p(this,"name","Team Membership");p(this,"url","/team-memberships");p(this,"actions",{addOne:jR,addMany:$R,setOne:CR,setMany:UR,updateOne:LR,updateMany:NR,deleteOne:HR,deleteMany:GR,initialize:qR});p(this,"selectors",{selectById:QR,selectByIds:JR})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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=e.map(S=>P({...S,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(S=>R(S))},blockers:l.map(S=>S.team),blocks:l.map(S=>S.uuid)});return u.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(l.map(S=>S.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 pq extends M{constructor(){super(...arguments);p(this,"name","Team");p(this,"url","/teams");p(this,"actions",{addOne:xR,addMany:eb,setOne:tb,setMany:sb,updateOne:ib,updateMany:nb,deleteOne:ab,deleteMany:cb,initialize:XR});p(this,"selectors",{selectById:db,selectByIds:lb})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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 yq extends qt{constructor(){super(...arguments);p(this,"name","User");p(this,"url","/user");p(this,"actions",{addOne:wa,addMany:NP,setOne:LP,setMany:UP,updateOne:GP,updateMany:HP,deleteOne:Pa,deleteMany:KP,initialize:CP});p(this,"selectors",{selectById:$s,selectByIds:JP})}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 Sq extends M{constructor(){super(...arguments);p(this,"name","Workflow");p(this,"url","/workflows");p(this,"actions",{addOne:Sb,addMany:mb,setOne:fb,setMany:Ab,updateOne:wb,updateMany:Pb,deleteOne:Ob,deleteMany:Tb,initialize:yb});p(this,"selectors",{selectById:Fb,selectByIds:_b})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const u=qb(e)(d);this.dispatch(a(e)),this.dispatch(ps(E(u)));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(hs(u)),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 mq extends M{constructor(){super(...arguments);p(this,"name","Workflow Issue Link");p(this,"url","/workflow-issue-links");p(this,"actions",{addOne:Mb,addMany:hs,setOne:vb,setMany:Eb,updateOne:Vb,updateMany:kb,deleteOne:Bb,deleteMany:ps,initialize:bb});p(this,"selectors",{selectById:Wb,selectByIds:zb})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=P({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}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 fq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Assignee");p(this,"url","/workflow-step-assignees");p(this,"actions",{addOne:Nb,addMany:Hb,setOne:Gb,setMany:Kb,updateOne:Yb,updateMany:Qb,deleteOne:Jb,deleteMany:Zb,initialize:Lb});p(this,"selectors",{selectById:xb,selectByIds:eM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(E(u)))}),[u,y]}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 Aq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Comment");p(this,"url","/workflow-step-comments");p(this,"actions",{addOne:nM,addMany:aM,setOne:cM,setMany:rM,updateOne:dM,updateMany:lM,deleteOne:uM,deleteMany:oM,initialize:iM});p(this,"selectors",{selectById:pM,selectByIds:yM})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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 wq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Assignee");p(this,"url","/workflow-step-default-assignees");p(this,"actions",{addOne:AM,addMany:wM,setOne:PM,setMany:OM,updateOne:TM,updateMany:IM,deleteOne:FM,deleteMany:_M,initialize:fM});p(this,"selectors",{selectById:RM,selectByIds:bM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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(`Expected workflow step default 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 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 Pq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Reviewer");p(this,"url","/workflow-step-default-reviewers");p(this,"actions",{addOne:VM,addMany:kM,setOne:BM,setMany:DM,updateOne:WM,updateMany:zM,deleteOne:qM,deleteMany:jM,initialize:EM});p(this,"selectors",{selectById:CM,selectByIds:UM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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(`Expected workflow step default 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 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 Oq extends qt{constructor(){super(...arguments);p(this,"name","Workflow Step Event");p(this,"url","/workflow-step-events");p(this,"actions",{addOne:GM,addMany:KM,setOne:YM,setMany:QM,updateOne:JM,updateMany:ZM,deleteOne:XM,deleteMany:xM,initialize:HM});p(this,"selectors",{selectById:tv,selectByIds:sv})}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 Tq extends z{constructor(){super(...arguments);p(this,"name","Workflow Step Fields Attachment");p(this,"url","/workflow-step-fields-attachments");p(this,"actions",{addOne:cv,addMany:Bc,setOne:rv,setMany:dv,updateOne:lv,updateMany:uv,deleteOne:ov,deleteMany:Dc,initialize:av});p(this,"selectors",{selectById:yv,selectByIds:Sv})}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 P({...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 Iq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Fields");p(this,"url","/workflow-step-fields");p(this,"actions",{addOne:wv,addMany:Pv,setOne:Ov,setMany:Tv,updateOne:Iv,updateMany:Fv,deleteOne:_v,deleteMany:gv,initialize:Av});p(this,"selectors",{selectById:bv,selectByIds:Mv})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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=pv(e)(d);this.dispatch(a(e)),this.dispatch(Dc(E(u)));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(Bc(u)),y}}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 Fq extends z{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Attachment");p(this,"url","/workflow-step-field-values-attachments");p(this,"actions",{addOne:kv,addMany:jc,setOne:Bv,setMany:Dv,updateOne:Wv,updateMany:zv,deleteOne:qv,deleteMany:$c,initialize:Vv});p(this,"selectors",{selectById:$v,selectByIds:Cv})}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 P({...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 _q extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Review Request");p(this,"url","/workflow-step-field-values-review-requests");p(this,"actions",{addOne:cE,addMany:Nc,setOne:rE,setMany:dE,updateOne:lE,updateMany:uE,deleteOne:oE,deleteMany:Hc,initialize:aE});p(this,"selectors",{selectById:pE,selectByIds:yE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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 gq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Review");p(this,"url","/workflow-step-field-values-reviews");p(this,"actions",{addOne:wE,addMany:Kc,setOne:PE,setMany:OE,updateOne:TE,updateMany:IE,deleteOne:FE,deleteMany:Yc,initialize:AE});p(this,"selectors",{selectById:gE,selectByIds:RE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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 Rq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values");p(this,"url","/workflow-step-field-values");p(this,"actions",{addOne:Gv,addMany:Kv,setOne:Yv,setMany:Qv,updateOne:Jv,updateMany:Zv,deleteOne:Xv,deleteMany:xv,initialize:Hv});p(this,"selectors",{selectById:tE,selectByIds:sE})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.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(S=>{this.dispatch(c(S))}).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(y=>{this.dispatch(a(y))}).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=Uv(e)(d),y=bE(e)(d),S=SE(e)(d);this.dispatch(a(e)),this.dispatch($c(E(u))),this.dispatch(Yc(E(y))),this.dispatch(Hc(E(S)));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(jc(u)),this.dispatch(Kc(y)),this.dispatch(Nc(S)),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 bq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Reviewer");p(this,"url","/workflow-step-reviewers");p(this,"actions",{addOne:VE,addMany:kE,setOne:BE,setMany:DE,updateOne:WE,updateMany:zE,deleteOne:qE,deleteMany:jE,initialize:EE});p(this,"selectors",{selectById:CE,selectByIds:UE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=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 y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,y]}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 Mq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step");p(this,"url","/workflow-steps");p(this,"actions",{addOne:GE,addMany:KE,setOne:YE,setMany:QE,updateOne:JE,updateMany:ZE,deleteOne:XE,deleteMany:xE,initialize:HE});p(this,"selectors",{selectById:tV,selectByIds:sV})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...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(y=>{this.dispatch(c(y))}).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 vq extends M{constructor(){super(...arguments);p(this,"name","Workflow Type");p(this,"url","/workflow-types");p(this,"actions",{addOne:cV,addMany:rV,setOne:dV,setMany:lV,updateOne:uV,updateMany:oV,deleteOne:hV,deleteMany:pV,initialize:aV});p(this,"selectors",{selectById:SV,selectByIds:mV})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.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(S=>{this.dispatch(c(S))}).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 ir(t,s,e,n,a){const c=n instanceof Ut;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:y,queryParams:S,attachmentHash:f,isExternalUrl:F,isAuthNeeded:g,isResponseBlob:V}={...r,...s};let _=s.url;const v=f?await e.files.fetchCache(f):void 0;if(f&&!v)throw new Error(`Cannot upload file ${f} because it's not cached.`);!F&&!_.startsWith("http")&&(!_.startsWith("/")&&!_.startsWith("blob:")&&(_="/"+_),_=t+_);const b=k=>{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(!v)throw new Error(`No file for file ${f}`);const H=d.fields["x-amz-checksum-sha1"];if(!H)throw new Error(`No checksum for file ${f}`);return k.set("x-amz-checksum-sha1",H).field({...l,...d.fields}).attach("file",v)}return k.send(l)},j={[h.GET]:()=>V?Nt.get(_.toString()).responseType("blob"):Nt.get(_.toString()),[h.POST]:()=>{const k=Nt.post(_.toString());return b(k)},[h.PATCH]:()=>{const k=Nt.patch(_.toString());return b(k)},[h.PUT]:()=>{const k=Nt.put(_.toString());return b(k)},[h.DELETE]:()=>{const k=Nt.delete(_.toString());return b(k)}}[y];let W=j();const q=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",q),g&&c){const k=n.auth.getAuthHeader();W=W.set("Authorization",k)}u&&(W=W.set(u));try{return await W.query(S)}catch(k){const H=VV(k),Qs=H==null?void 0:H.status;if(c&&Qs===401)return await n.auth.handleUnauthorized(W,H),W.query(S);throw new C({response:H,innerError:k,discard:tr.includes(Qs)})}finally{a==null||a.removeEventListener("abort",q)}}class Eq{constructor(s){p(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Zs,r={...e,uuid:e.uuid??Dt.v4()};return ir(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??Jt).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 Zs,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(bO(c)),d=u=>{if(u)a.resolve(u.body);else{const y=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(y)}},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 Zt{constructor(){p(this,"graph");p(this,"requestAttemptCounter");this.graph=new xV.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Zt;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))&&Zt._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Zt._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 BV;function DV(t){BV=t}function Xt(){return BV}let WV;function zV(t){WV=t}function qV(){return WV}let nr=null;function Lt(){const t=Xt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(nr)return nr;const s=t.getState().offline.outbox,e=Zt._fromOutbox(s);return nr=e,e}const Vq=(t,s)=>{const e=new s(t);return zV(e),DV(t),e};class kq{constructor(s){p(this,"_all");p(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class ar{constructor(){p(this,"next");this.next=null}then(s){return new kq(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Xt())throw new Error("Client store not set");const n=qV();if(!n)throw new Error("Client SDK not set");return MV(s,n)}}}class jV extends ar{async run(s){return super.run(s)}}class $V extends ar{async run(s){return super.run(s)}}const CV=new jV().then(new $V).compile();function UV(t){var s;return(s=CV[0])==null?void 0:s.run(t)}var LV=(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))(LV||{});i.ALL_MIDDLEWARE=CV,i.APIError=C,i.AgentService=zW,i.AssetAttachmentService=qW,i.AssetProcedureService=NW,i.AssetProcedureStepFieldValuesAttachmentService=YW,i.AssetProcedureStepFieldValuesService=QW,i.AssetProcedureStepFieldsAttachmentService=GW,i.AssetProcedureStepFieldsService=KW,i.AssetProcedureStepService=JW,i.AssetProcedureTypeAttachmentService=jW,i.AssetProcedureTypeFieldValuesAttachmentService=UW,i.AssetProcedureTypeFieldValuesService=LW,i.AssetProcedureTypeFieldsAttachmentService=$W,i.AssetProcedureTypeFieldsService=CW,i.AssetProcedureTypeService=HW,i.AssetService=ZW,i.AssetStageCompletionService=XW,i.AssetStageService=xW,i.AssetStatusType=hr,i.AssetTypeAttachmentService=ez,i.AssetTypeFieldValuesAttachmentService=iz,i.AssetTypeFieldValuesService=nz,i.AssetTypeFieldsAttachmentService=tz,i.AssetTypeFieldsService=sz,i.AssetTypeIdentifierService=az,i.AssetTypeIdentifierValueService=cz,i.AssetTypeService=rz,i.AssetTypeStatusService=dz,i.AttachmentModel=pr,i.BaseApiService=Ut,i.BaseModelApiService=qt,i.BaseOfflineFileModelApiService=z,i.BaseOfflineModelApiService=M,i.BaseSDK=Eq,i.COMMON_AUTO_FIELDS=_r,i.DEFAULT_ISSUE_PRIORITY=ek,i.DEFAULT_PAGE_SIZE=wV,i.DEFAULT_WORKFLOW_STATUS=ik,i.DISCARD_HTTP_STATUSES=tr,i.DeferredPromise=Zs,i.DocumentAttachmentService=lz,i.DocumentService=uz,i.EMPTY_ARRAY=lr,i.EMPTY_OBJECT=ur,i.EmailDomainsService=oz,i.EmailVerificationService=hz,i.FILE_MODEL_DEFAULT_PAGE_SIZE=PV,i.FileService=pz,i.FormIdentifierService=yz,i.FormIdentifierValueService=Sz,i.FormRevisionAttachmentService=mz,i.FormRevisionService=fz,i.FormService=Az,i.FormSubmissionAttachmentService=wz,i.FormSubmissionService=Pz,i.GeoImageService=Oz,i.HttpMethod=h,i.IssueAssociationService=Tz,i.IssueAttachmentService=Iz,i.IssueCommentAttachmentService=Fz,i.IssueCommentService=_z,i.IssuePriority=Js,i.IssueService=gz,i.IssueStatusType=yr,i.IssueTypeAttachmentService=Rz,i.IssueTypeFieldValuesAttachmentService=vz,i.IssueTypeFieldValuesService=Ez,i.IssueTypeFieldsAttachmentService=bz,i.IssueTypeFieldsService=Mz,i.IssueTypeIdentifierService=Vz,i.IssueTypeIdentifierValueService=kz,i.IssueTypeService=Bz,i.IssueTypeStatusService=Dz,i.IssueUpdateChange=$,i.IssueUpdateService=Wz,i.JWTService=jz,i.MAX_SERVICE_BATCH_SIZE=L,i.OUTBOX_RETRY_DELAY=Ar,i.OfflineAnalyticsMiddleware=jV,i.OfflineMiddleware=ar,i.OrganizationAccessLevel=or,i.OrganizationAccessService=$z,i.OrganizationService=Cz,i.OutboxCoordinator=Zt,i.ProcedureFieldValuesAttachmentService=lq,i.ProcedureFieldValuesService=uq,i.ProcedureService=Gz,i.ProcedureStepAssigneeService=Kz,i.ProcedureStepCommentService=Yz,i.ProcedureStepDefaultAssigneeService=Qz,i.ProcedureStepDefaultReviewerService=Jz,i.ProcedureStepEventService=Zz,i.ProcedureStepEventType=mr,i.ProcedureStepFieldValuesAttachmentService=eq,i.ProcedureStepFieldValuesReviewRequestService=tq,i.ProcedureStepFieldValuesReviewService=sq,i.ProcedureStepFieldValuesReviewType=fr,i.ProcedureStepFieldValuesService=iq,i.ProcedureStepFieldsAttachmentService=Xz,i.ProcedureStepFieldsService=xz,i.ProcedureStepReviewerService=nq,i.ProcedureStepService=aq,i.ProcedureTypeAttachmentService=cq,i.ProcedureTypeFieldsAttachmentService=rq,i.ProcedureTypeFieldsService=dq,i.ProcedureTypeService=oq,i.ProjectAccessService=Uz,i.ProjectAttachmentService=Lz,i.ProjectFileService=Nz,i.ProjectService=Hz,i.RESET_ORGANIZATION_STATE=I,i.RESET_PROJECT_STATE=B,i.RESET_STATE=O,i.RateLimitingMiddleware=$V,i.SelectorBuilder=gk,i.TeamMembershipService=hq,i.TeamService=pq,i.UNKNOWN_ERROR_MESSAGE=Jt,i.UserService=yq,i.VERSION_REDUCER_KEY=ts,i.VerificationCodeType=LV,i.WORKFLOW_STATUSES=sk,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=tk,i.WorkflowIssueLinkService=mq,i.WorkflowService=Sq,i.WorkflowStatus=Ht,i.WorkflowStepAssigneeService=fq,i.WorkflowStepCommentService=Aq,i.WorkflowStepDefaultAssigneeService=wq,i.WorkflowStepDefaultReviewerService=Pq,i.WorkflowStepEventService=Oq,i.WorkflowStepEventType=Sr,i.WorkflowStepFieldValuesAttachmentService=Fq,i.WorkflowStepFieldValuesReviewRequestService=_q,i.WorkflowStepFieldValuesReviewService=gq,i.WorkflowStepFieldValuesReviewType=es,i.WorkflowStepFieldValuesService=Rq,i.WorkflowStepFieldsAttachmentService=Tq,i.WorkflowStepFieldsService=Iq,i.WorkflowStepReviewerService=bq,i.WorkflowStepService=Mq,i.WorkflowTypeService=vq,i._setLatestRetryTime=vO,i.addAsset=to,i.addAssetAttachment=$r,i.addAssetAttachments=ai,i.addAssetProcedure=yl,i.addAssetProcedureStep=Lu,i.addAssetProcedureStepFieldValues=Ru,i.addAssetProcedureStepFieldValuesAttachment=yu,i.addAssetProcedureStepFieldValuesAttachments=bi,i.addAssetProcedureStepFieldValuesMany=bu,i.addAssetProcedureStepFields=tu,i.addAssetProcedureStepFieldsAttachment=Cl,i.addAssetProcedureStepFieldsAttachments=Ul,i.addAssetProcedureStepFieldsMany=su,i.addAssetProcedureSteps=Nu,i.addAssetProcedureType=Rl,i.addAssetProcedureTypeAttachment=xr,i.addAssetProcedureTypeAttachments=ed,i.addAssetProcedureTypeFieldValues=el,i.addAssetProcedureTypeFieldValuesAttachment=Cd,i.addAssetProcedureTypeFieldValuesAttachments=yi,i.addAssetProcedureTypeFieldValuesMany=tl,i.addAssetProcedureTypeFields=Rd,i.addAssetProcedureTypeFieldsAttachment=pd,i.addAssetProcedureTypeFieldsAttachments=yd,i.addAssetProcedureTypeFieldsMany=bd,i.addAssetProcedureTypes=bl,i.addAssetProcedures=wi,i.addAssetStage=Vo,i.addAssetStageCompletion=So,i.addAssetStageCompletions=mo,i.addAssetStages=ko,i.addAssetType=kp,i.addAssetTypeAttachment=Lo,i.addAssetTypeAttachments=Ui,i.addAssetTypeFieldValues=Lh,i.addAssetTypeFieldValuesAttachment=vh,i.addAssetTypeFieldValuesAttachments=Qi,i.addAssetTypeFieldValuesMany=Nh,i.addAssetTypeFields=mh,i.addAssetTypeFieldsAttachment=sh,i.addAssetTypeFieldsAttachments=ih,i.addAssetTypeFieldsMany=fh,i.addAssetTypeIdentifier=ip,i.addAssetTypeIdentifierValue=fp,i.addAssetTypeIdentifierValues=Ap,i.addAssetTypeIdentifiers=np,i.addAssetTypeStatus=Hp,i.addAssetTypeStatuses=Gp,i.addAssetTypes=Bp,i.addAssets=Di,i.addConversation=Br,i.addConversations=Rk,i.addDocument=Ty,i.addDocumentAttachment=dy,i.addDocumentAttachments=ly,i.addDocuments=Iy,i.addEmailDomain=Wy,i.addEmailDomains=zy,i.addForm=em,i.addFormIdentifier=xy,i.addFormIdentifierValue=pS,i.addFormIdentifierValues=yS,i.addFormIdentifiers=eS,i.addFormRevision=CS,i.addFormRevisionAttachment=RS,i.addFormRevisionAttachments=bS,i.addFormRevisions=wn,i.addFormSubmission=bm,i.addFormSubmissionAttachment=ym,i.addFormSubmissionAttachments=Fn,i.addFormSubmissions=vn,i.addForms=tm,i.addGeoImage=Cm,i.addGeoImages=Um,i.addIssue=iA,i.addIssueAssociation=nf,i.addIssueAssociations=jt,i.addIssueAttachment=ff,i.addIssueAttachments=zn,i.addIssueComment=Nf,i.addIssueCommentAttachment=vf,i.addIssueCommentAttachments=Ef,i.addIssueComments=Hf,i.addIssueType=aP,i.addIssueTypeAttachment=mA,i.addIssueTypeAttachments=fA,i.addIssueTypeFieldValues=NA,i.addIssueTypeFieldValuesAttachment=Aw,i.addIssueTypeFieldValuesAttachments=ea,i.addIssueTypeFieldValuesMany=HA,i.addIssueTypeFields=nw,i.addIssueTypeFieldsAttachment=vA,i.addIssueTypeFieldsAttachments=EA,i.addIssueTypeFieldsMany=aw,i.addIssueTypeIdentifier=Ew,i.addIssueTypeIdentifierValue=Hw,i.addIssueTypeIdentifierValues=Gw,i.addIssueTypeIdentifiers=Vw,i.addIssueTypeStatus=wP,i.addIssueTypeStatuses=PP,i.addIssueTypes=cP,i.addIssueUpdate=ha,i.addIssueUpdates=pa,i.addIssues=Hn,i.addOrganization=mO,i.addOrganizationAccess=xP,i.addOrganizationAccesses=eO,i.addOrganizations=SO,i.addProcedure=WT,i.addProcedureFieldValues=uR,i.addProcedureFieldValuesAttachment=Zg,i.addProcedureFieldValuesAttachments=yc,i.addProcedureFieldValuesMany=oR,i.addProcedureStep=X_,i.addProcedureStepAssignee=QT,i.addProcedureStepAssignees=JT,i.addProcedureStepComment=lI,i.addProcedureStepComments=uI,i.addProcedureStepDefaultAssignee=II,i.addProcedureStepDefaultAssignees=FI,i.addProcedureStepDefaultReviewer=zI,i.addProcedureStepDefaultReviewers=qI,i.addProcedureStepEvent=ZI,i.addProcedureStepEvents=XI,i.addProcedureStepFieldValues=JF,i.addProcedureStepFieldValuesAttachment=zF,i.addProcedureStepFieldValuesAttachments=Ya,i.addProcedureStepFieldValuesMany=ZF,i.addProcedureStepFieldValuesReview=I_,i.addProcedureStepFieldValuesReviewRequest=u_,i.addProcedureStepFieldValuesReviewRequests=xa,i.addProcedureStepFieldValuesReviews=sc,i.addProcedureStepFields=FF,i.addProcedureStepFieldsAttachment=oF,i.addProcedureStepFieldsAttachments=Ua,i.addProcedureStepFieldsMany=_F,i.addProcedureStepReviewer=W_,i.addProcedureStepReviewers=z_,i.addProcedureSteps=x_,i.addProcedureType=FR,i.addProcedureTypeAttachment=lg,i.addProcedureTypeAttachments=ug,i.addProcedureTypeFields=zg,i.addProcedureTypeFieldsAttachment=Ig,i.addProcedureTypeFieldsAttachments=Fg,i.addProcedureTypeFieldsMany=qg,i.addProcedureTypes=_R,i.addProcedures=Va,i.addProject=_T,i.addProjectAccess=BO,i.addProjectAccesses=DO,i.addProjectAttachment=KO,i.addProjectAttachments=YO,i.addProjectFile=lT,i.addProjectFiles=uT,i.addProjects=FT,i.addTeam=xR,i.addTeamMembership=jR,i.addTeamMemberships=$R,i.addTeams=eb,i.addUser=wa,i.addUsers=NP,i.addWorkflow=Sb,i.addWorkflowIssueLink=Mb,i.addWorkflowIssueLinks=hs,i.addWorkflowStep=GE,i.addWorkflowStepAssignee=Nb,i.addWorkflowStepAssignees=Hb,i.addWorkflowStepComment=nM,i.addWorkflowStepComments=aM,i.addWorkflowStepDefaultAssignee=AM,i.addWorkflowStepDefaultAssignees=wM,i.addWorkflowStepDefaultReviewer=VM,i.addWorkflowStepDefaultReviewers=kM,i.addWorkflowStepEvent=GM,i.addWorkflowStepEvents=KM,i.addWorkflowStepFieldValues=Gv,i.addWorkflowStepFieldValuesAttachment=kv,i.addWorkflowStepFieldValuesAttachments=jc,i.addWorkflowStepFieldValuesMany=Kv,i.addWorkflowStepFieldValuesReview=wE,i.addWorkflowStepFieldValuesReviewRequest=cE,i.addWorkflowStepFieldValuesReviewRequests=Nc,i.addWorkflowStepFieldValuesReviews=Kc,i.addWorkflowStepFields=wv,i.addWorkflowStepFieldsAttachment=cv,i.addWorkflowStepFieldsAttachments=Bc,i.addWorkflowStepFieldsMany=Pv,i.addWorkflowStepReviewer=VE,i.addWorkflowStepReviewers=kE,i.addWorkflowSteps=KE,i.addWorkflowType=cV,i.addWorkflowTypes=rV,i.addWorkflows=mb,i.agentsReducer=zr,i.agentsSlice=si,i.areArraysEqual=rk,i.assetAttachmentReducer=Jr,i.assetAttachmentSlice=ni,i.assetProcedureReducer=Pl,i.assetProcedureSlice=Ai,i.assetProcedureStepFieldValuesAttachmentReducer=Fu,i.assetProcedureStepFieldValuesAttachmentSlice=Ri,i.assetProcedureStepFieldValuesReducer=qu,i.assetProcedureStepFieldValuesSlice=Ei,i.assetProcedureStepFieldsAttachmentReducer=Xl,i.assetProcedureStepFieldsAttachmentSlice=Ii,i.assetProcedureStepFieldsReducer=ou,i.assetProcedureStepFieldsSlice=_i,i.assetProcedureStepReducer=Qu,i.assetProcedureStepSlice=Vi,i.assetProcedureTypeAttachmentReducer=rd,i.assetProcedureTypeAttachmentSlice=di,i.assetProcedureTypeFieldValuesAttachmentReducer=Kd,i.assetProcedureTypeFieldValuesAttachmentSlice=pi,i.assetProcedureTypeFieldValuesReducer=dl,i.assetProcedureTypeFieldValuesSlice=fi,i.assetProcedureTypeFieldsAttachmentReducer=Od,i.assetProcedureTypeFieldsAttachmentSlice=ui,i.assetProcedureTypeFieldsReducer=Dd,i.assetProcedureTypeFieldsSlice=hi,i.assetProcedureTypeReducer=Dl,i.assetProcedureTypeSlice=Oi,i.assetReducer=ho,i.assetSlice=Bi,i.assetStageCompletionReducer=Io,i.assetStageCompletionSlice=zi,i.assetStageReducer=qo,i.assetStageSlice=qi,i.assetTypeAttachmentReducer=xo,i.assetTypeAttachmentSlice=Ci,i.assetTypeFieldValuesAttachmentReducer=$h,i.assetTypeFieldValuesAttachmentSlice=Yi,i.assetTypeFieldValuesReducer=ep,i.assetTypeFieldValuesSlice=Xi,i.assetTypeFieldsAttachmentReducer=ph,i.assetTypeFieldsAttachmentSlice=Hi,i.assetTypeFieldsReducer=Rh,i.assetTypeFieldsSlice=Ki,i.assetTypeIdentifierReducer=yp,i.assetTypeIdentifierSlice=xi,i.assetTypeIdentifierValueReducer=bp,i.assetTypeIdentifierValueSlice=tn,i.assetTypeReducer=Up,i.assetTypeSlice=sn,i.assetTypeStatusReducer=sy,i.assetTypeStatusSlice=an,i.assetTypeStatusSortFn=br,i.authReducer=ay,i.authSlice=Es,i.baseReducer=TW,i.baseReducers=er,i.clearTokens=oB,i.createModelAdapter=T,i.createOfflineAction=gO,i.createPayload=R,i.createSelectionAdapter=nk,i.deleteAsset=no,i.deleteAssetAttachment=Hr,i.deleteAssetAttachments=ci,i.deleteAssetProcedure=fl,i.deleteAssetProcedureStep=Ku,i.deleteAssetProcedureStepFieldValues=ku,i.deleteAssetProcedureStepFieldValuesAttachment=wu,i.deleteAssetProcedureStepFieldValuesAttachments=Mi,i.deleteAssetProcedureStepFieldValuesMany=Bu,i.deleteAssetProcedureStepFields=ru,i.deleteAssetProcedureStepFieldsAttachment=Kl,i.deleteAssetProcedureStepFieldsAttachments=Yl,i.deleteAssetProcedureStepFieldsMany=du,i.deleteAssetProcedureSteps=Yu,i.deleteAssetProcedureType=El,i.deleteAssetProcedureTypeAttachment=ad,i.deleteAssetProcedureTypeAttachments=cd,i.deleteAssetProcedureTypeFieldValues=cl,i.deleteAssetProcedureTypeFieldValuesAttachment=Gd,i.deleteAssetProcedureTypeFieldValuesAttachments=Si,i.deleteAssetProcedureTypeFieldValuesMany=rl,i.deleteAssetProcedureTypeFields=kd,i.deleteAssetProcedureTypeFieldsAttachment=wd,i.deleteAssetProcedureTypeFieldsAttachments=Pd,i.deleteAssetProcedureTypeFieldsMany=Bd,i.deleteAssetProcedureTypes=Vl,i.deleteAssetProcedures=Pi,i.deleteAssetStage=Wo,i.deleteAssetStageCompletion=Oo,i.deleteAssetStageCompletions=To,i.deleteAssetStages=zo,i.deleteAssetType=zp,i.deleteAssetTypeAttachment=Yo,i.deleteAssetTypeAttachments=Li,i.deleteAssetTypeFieldValues=Qh,i.deleteAssetTypeFieldValuesAttachment=Dh,i.deleteAssetTypeFieldValuesAttachments=Ji,i.deleteAssetTypeFieldValuesMany=Jh,i.deleteAssetTypeFields=Th,i.deleteAssetTypeFieldsAttachment=dh,i.deleteAssetTypeFieldsAttachments=lh,i.deleteAssetTypeFieldsMany=Ih,i.deleteAssetTypeIdentifier=lp,i.deleteAssetTypeIdentifierValue=Ip,i.deleteAssetTypeIdentifierValues=Fp,i.deleteAssetTypeIdentifiers=up,i.deleteAssetTypeStatus=Zp,i.deleteAssetTypeStatuses=Xp,i.deleteAssetTypes=qp,i.deleteAssets=Wi,i.deleteConversation=vk,i.deleteConversations=Ek,i.deleteDocument=by,i.deleteDocumentAttachment=yy,i.deleteDocumentAttachments=Sy,i.deleteDocuments=My,i.deleteEmailDomain=Uy,i.deleteEmailDomains=Ly,i.deleteForm=cm,i.deleteFormIdentifier=aS,i.deleteFormIdentifierValue=wS,i.deleteFormIdentifierValues=PS,i.deleteFormIdentifiers=cS,i.deleteFormRevision=GS,i.deleteFormRevisionAttachment=kS,i.deleteFormRevisionAttachments=BS,i.deleteFormRevisions=Pn,i.deleteFormSubmission=Em,i.deleteFormSubmissionAttachment=wm,i.deleteFormSubmissionAttachments=_n,i.deleteFormSubmissions=En,i.deleteForms=rm,i.deleteGeoImage=Hm,i.deleteGeoImages=Gm,i.deleteIssue=dA,i.deleteIssueAssociation=af,i.deleteIssueAssociations=$t,i.deleteIssueAttachment=Tf,i.deleteIssueAttachments=qn,i.deleteIssueComment=Jf,i.deleteIssueCommentAttachment=Wf,i.deleteIssueCommentAttachments=zf,i.deleteIssueComments=Zf,i.deleteIssueType=oP,i.deleteIssueTypeAttachment=TA,i.deleteIssueTypeAttachments=IA,i.deleteIssueTypeFieldValues=JA,i.deleteIssueTypeFieldValuesAttachment=Iw,i.deleteIssueTypeFieldValuesAttachments=ta,i.deleteIssueTypeFieldValuesMany=ZA,i.deleteIssueTypeFields=uw,i.deleteIssueTypeFieldsAttachment=WA,i.deleteIssueTypeFieldsAttachments=zA,i.deleteIssueTypeFieldsMany=ow,i.deleteIssueTypeIdentifier=zw,i.deleteIssueTypeIdentifierValue=Zw,i.deleteIssueTypeIdentifierValues=Xw,i.deleteIssueTypeIdentifiers=qw,i.deleteIssueTypeStatus=_P,i.deleteIssueTypeStatuses=gP,i.deleteIssueTypes=hP,i.deleteIssueUpdate=ya,i.deleteIssueUpdates=Sa,i.deleteIssues=Gn,i.deleteOrganization=wO,i.deleteOrganizationAccess=aO,i.deleteOrganizationAccesses=cO,i.deleteOrganizations=PO,i.deleteProcedure=CT,i.deleteProcedureFieldValues=mR,i.deleteProcedureFieldValuesAttachment=sR,i.deleteProcedureFieldValuesAttachments=Sc,i.deleteProcedureFieldValuesMany=fR,i.deleteProcedureStep=sg,i.deleteProcedureStepAssignee=tI,i.deleteProcedureStepAssignees=sI,i.deleteProcedureStepComment=SI,i.deleteProcedureStepComments=mI,i.deleteProcedureStepDefaultAssignee=MI,i.deleteProcedureStepDefaultAssignees=vI,i.deleteProcedureStepDefaultReviewer=LI,i.deleteProcedureStepDefaultReviewers=NI,i.deleteProcedureStepEvent=iF,i.deleteProcedureStepEvents=nF,i.deleteProcedureStepFieldValues=s_,i.deleteProcedureStepFieldValuesAttachment=UF,i.deleteProcedureStepFieldValuesAttachments=Qa,i.deleteProcedureStepFieldValuesMany=i_,i.deleteProcedureStepFieldValuesReview=b_,i.deleteProcedureStepFieldValuesReviewRequest=S_,i.deleteProcedureStepFieldValuesReviewRequests=ec,i.deleteProcedureStepFieldValuesReviews=ic,i.deleteProcedureStepFields=vF,i.deleteProcedureStepFieldsAttachment=mF,i.deleteProcedureStepFieldsAttachments=La,i.deleteProcedureStepFieldsMany=EF,i.deleteProcedureStepReviewer=U_,i.deleteProcedureStepReviewers=L_,i.deleteProcedureSteps=ig,i.deleteProcedureType=vR,i.deleteProcedureTypeAttachment=Sg,i.deleteProcedureTypeAttachments=mg,i.deleteProcedureTypeFields=Lg,i.deleteProcedureTypeFieldsAttachment=Mg,i.deleteProcedureTypeFieldsAttachments=vg,i.deleteProcedureTypeFieldsMany=Ng,i.deleteProcedureTypes=ER,i.deleteProcedures=ka,i.deleteProject=bT,i.deleteProjectAccess=$O,i.deleteProjectAccesses=CO,i.deleteProjectAttachment=xO,i.deleteProjectAttachments=eT,i.deleteProjectFile=pT,i.deleteProjectFiles=yT,i.deleteProjects=MT,i.deleteTeam=ab,i.deleteTeamMembership=HR,i.deleteTeamMemberships=GR,i.deleteTeams=cb,i.deleteUser=Pa,i.deleteUsers=KP,i.deleteWorkflow=Ob,i.deleteWorkflowIssueLink=Bb,i.deleteWorkflowIssueLinks=ps,i.deleteWorkflowStep=XE,i.deleteWorkflowStepAssignee=Jb,i.deleteWorkflowStepAssignees=Zb,i.deleteWorkflowStepComment=uM,i.deleteWorkflowStepComments=oM,i.deleteWorkflowStepDefaultAssignee=FM,i.deleteWorkflowStepDefaultAssignees=_M,i.deleteWorkflowStepDefaultReviewer=qM,i.deleteWorkflowStepDefaultReviewers=jM,i.deleteWorkflowStepEvent=XM,i.deleteWorkflowStepEvents=xM,i.deleteWorkflowStepFieldValues=Xv,i.deleteWorkflowStepFieldValuesAttachment=qv,i.deleteWorkflowStepFieldValuesAttachments=$c,i.deleteWorkflowStepFieldValuesMany=xv,i.deleteWorkflowStepFieldValuesReview=FE,i.deleteWorkflowStepFieldValuesReviewRequest=oE,i.deleteWorkflowStepFieldValuesReviewRequests=Hc,i.deleteWorkflowStepFieldValuesReviews=Yc,i.deleteWorkflowStepFields=_v,i.deleteWorkflowStepFieldsAttachment=ov,i.deleteWorkflowStepFieldsAttachments=Dc,i.deleteWorkflowStepFieldsMany=gv,i.deleteWorkflowStepReviewer=qE,i.deleteWorkflowStepReviewers=jE,i.deleteWorkflowSteps=xE,i.deleteWorkflowType=hV,i.deleteWorkflowTypes=pV,i.deleteWorkflows=Tb,i.dequeue=bV,i.discard=vV,i.documentAttachmentReducer=wy,i.documentAttachmentSlice=rn,i.documentSlice=ln,i.documentsReducer=vy,i.downloadFile=Sk,i.emailDomainsReducer=Ky,i.emailDomainsSlice=on,i.emailRegex=Ik,i.enqueue=RV,i.enqueueRequest=bO,i.extractResponseFromError=VV,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=ss,i.fetchBlobFromObjectUrl=Or,i.fetchFileFromObjectUrl=Tr,i.fileReducer=Jy,i.fileSlice=pn,i.formIdentifierReducer=uS,i.formIdentifierSlice=yn,i.formIdentifierValueReducer=FS,i.formIdentifierValueSlice=mn,i.formReducer=dm,i.formRevisionAttachmentReducer=qS,i.formRevisionAttachmentSlice=fn,i.formRevisionReducer=ZS,i.formRevisionsSlice=An,i.formSlice=On,i.formSubmissionAttachmentReducer=Im,i.formSubmissionAttachmentSlice=In,i.formSubmissionReducer=Wm,i.formSubmissionSlice=Mn,i.geoImageReducer=Jm,i.geoImageSlice=kn,i.getAssetProcedureStepSubTree=Rr,i.getAssetProcedureStepTrees=Fk,i.getClientSDK=qV,i.getClientStore=Xt,i.getDocumentSubTree=Er,i.getDocumentTrees=_k,i.getFileExtension=Pr,i.getLocalDateString=wr,i.getLocalRelativeDateString=ok,i.getOutboxCoordinator=Lt,i.getRenamedFile=yk,i.getRequestDescription=w,i.getS3FileKey=pk,i.hashFile=Os,i.initSDK=Vq,i.initializeAssetAttachments=jr,i.initializeAssetProcedureStepFieldValues=gu,i.initializeAssetProcedureStepFieldValuesAttachments=pu,i.initializeAssetProcedureStepFields=eu,i.initializeAssetProcedureStepFieldsAttachments=$l,i.initializeAssetProcedureSteps=$u,i.initializeAssetProcedureTypeAttachments=Xr,i.initializeAssetProcedureTypeFieldValues=xd,i.initializeAssetProcedureTypeFieldValuesAttachments=$d,i.initializeAssetProcedureTypeFields=gd,i.initializeAssetProcedureTypeFieldsAttachments=hd,i.initializeAssetProcedureTypes=gl,i.initializeAssetProcedures=pl,i.initializeAssetStageCompletions=yo,i.initializeAssetStages=Mo,i.initializeAssetTypeAttachments=Uo,i.initializeAssetTypeFieldValues=Uh,i.initializeAssetTypeFieldValuesAttachments=Mh,i.initializeAssetTypeFields=Sh,i.initializeAssetTypeFieldsAttachments=th,i.initializeAssetTypeIdentifierValues=mp,i.initializeAssetTypeIdentifiers=sp,i.initializeAssetTypeStatuses=Np,i.initializeAssetTypes=vp,i.initializeAssets=eo,i.initializeConversations=kr,i.initializeDocumentAttachments=ry,i.initializeDocuments=Oy,i.initializeEmailDomains=Dy,i.initializeFormIdentifierValues=hS,i.initializeFormIdentifiers=Xy,i.initializeFormRevisionAttachments=gS,i.initializeFormRevisions=$S,i.initializeFormSubmissionAttachments=pm,i.initializeFormSubmissions=_m,i.initializeForms=xS,i.initializeGeoImages=qm,i.initializeIssueAssociations=Xm,i.initializeIssueAttachments=mf,i.initializeIssueCommentAttachments=Mf,i.initializeIssueComments=Lf,i.initializeIssueTypeAttachments=SA,i.initializeIssueTypeFieldValues=LA,i.initializeIssueTypeFieldValuesAttachments=fw,i.initializeIssueTypeFields=iw,i.initializeIssueTypeFieldsAttachments=MA,i.initializeIssueTypeIdentifierValues=Nw,i.initializeIssueTypeIdentifiers=vw,i.initializeIssueTypeStatuses=AP,i.initializeIssueTypes=nP,i.initializeIssueUpdates=EP,i.initializeIssues=sA,i.initializeOrganizationAccesses=XP,i.initializeOrganizations=hO,i.initializeProcedureFieldValues=lR,i.initializeProcedureFieldValuesAttachments=Jg,i.initializeProcedureStepAssignees=YT,i.initializeProcedureStepComments=dI,i.initializeProcedureStepDefaultAssignees=TI,i.initializeProcedureStepDefaultReviewers=WI,i.initializeProcedureStepEvents=JI,i.initializeProcedureStepFieldValues=QF,i.initializeProcedureStepFieldValuesAttachments=WF,i.initializeProcedureStepFieldValuesReviewRequests=l_,i.initializeProcedureStepFieldValuesReviews=T_,i.initializeProcedureStepFields=IF,i.initializeProcedureStepFieldsAttachments=uF,i.initializeProcedureStepReviewers=D_,i.initializeProcedureSteps=Q_,i.initializeProcedureTypeAttachments=dg,i.initializeProcedureTypeFields=Wg,i.initializeProcedureTypeFieldsAttachments=Tg,i.initializeProcedureTypes=IR,i.initializeProcedures=DT,i.initializeProjectAccesses=kO,i.initializeProjectAttachments=GO,i.initializeProjectFiles=cT,i.initializeProjects=OT,i.initializeTeamMemberships=qR,i.initializeTeams=XR,i.initializeUsers=CP,i.initializeWorkflowIssueLinks=bb,i.initializeWorkflowStepAssignees=Lb,i.initializeWorkflowStepComments=iM,i.initializeWorkflowStepDefaultAssignees=fM,i.initializeWorkflowStepDefaultReviewers=EM,i.initializeWorkflowStepEvents=HM,i.initializeWorkflowStepFieldValues=Hv,i.initializeWorkflowStepFieldValuesAttachments=Vv,i.initializeWorkflowStepFieldValuesReviewRequests=aE,i.initializeWorkflowStepFieldValuesReviews=AE,i.initializeWorkflowStepFields=Av,i.initializeWorkflowStepFieldsAttachments=av,i.initializeWorkflowStepReviewers=EE,i.initializeWorkflowSteps=HE,i.initializeWorkflowTypes=aV,i.initializeWorkflows=yb,i.isImageFile=mk,i.isObjectUrl=Ir,i.isToday=uk,i.issueAssociationReducer=yf,i.issueAssociationSlice=Dn,i.issueAttachmentReducer=Rf,i.issueAttachmentSlice=Wn,i.issueCommentAttachmentReducer=Cf,i.issueCommentAttachmentSlice=$n,i.issueCommentReducer=eA,i.issueCommentSlice=Un,i.issueReducer=pA,i.issueSlice=Nn,i.issueTypeAttachmentReducer=RA,i.issueTypeAttachmentSlice=Kn,i.issueTypeFieldValuesAttachmentReducer=bw,i.issueTypeFieldValuesAttachmentSlice=xn,i.issueTypeFieldValuesReducer=tw,i.issueTypeFieldValuesSlice=Zn,i.issueTypeFieldsAttachmentReducer=CA,i.issueTypeFieldsAttachmentSlice=Qn,i.issueTypeFieldsReducer=Sw,i.issueTypeFieldsSlice=Xn,i.issueTypeIdentifierReducer=Uw,i.issueTypeIdentifierSlice=ia,i.issueTypeIdentifierValueReducer=sP,i.issueTypeIdentifierValueSlice=aa,i.issueTypeReducer=mP,i.issueTypeSlice=ca,i.issueTypeStatusReducer=MP,i.issueTypeStatusSlice=da,i.issueTypeStatusSortFn=Mr,i.issueUpdateReducer=jP,i.issueUpdateSlice=oa,i.logOnlyOnce=fk,i.markAsDeleted=MO,i.markForDeletion=YB,i.memoize=xs,i.organizationAccessReducer=rO,i.organizationAccessSlice=Ta,i.organizationReducer=_O,i.organizationSlice=Ia,i.outboxReducer=EO,i.outboxSlice=Fa,i.overmapEnhancer=EW,i.overmapReducer=IW,i.overmapReducers=AV,i.performRequest=ir,i.performRequestFromAction=MV,i.procedureFieldValuesAttachmentReducer=iR,i.procedureFieldValuesAttachmentSlice=pc,i.procedureFieldValuesReducer=AR,i.procedureFieldValuesSlice=fc,i.procedureReducer=UT,i.procedureSlice=Ea,i.procedureStepAssigneeReducer=cI,i.procedureStepAssigneeSlice=Ba,i.procedureStepCommentReducer=PI,i.procedureStepCommentSlice=Da,i.procedureStepDefaultAssigneeReducer=BI,i.procedureStepDefaultAssigneeSlice=Wa,i.procedureStepDefaultReviewerReducer=YI,i.procedureStepDefaultReviewerSlice=qa,i.procedureStepEventReducer=dF,i.procedureStepEventSlice=$a,i.procedureStepFieldValuesAttachmentReducer=KF,i.procedureStepFieldValuesAttachmentSlice=Ka,i.procedureStepFieldValuesReducer=r_,i.procedureStepFieldValuesReviewReducer=k_,i.procedureStepFieldValuesReviewRequestReducer=P_,i.procedureStepFieldValuesReviewRequestSlice=Xa,i.procedureStepFieldValuesReviewSlice=tc,i.procedureStepFieldValuesSlice=Za,i.procedureStepFieldsAttachmentReducer=OF,i.procedureStepFieldsAttachmentSlice=Ca,i.procedureStepFieldsReducer=BF,i.procedureStepFieldsSlice=Ha,i.procedureStepReducer=ng,i.procedureStepReviewerReducer=K_,i.procedureStepReviewerSlice=nc,i.procedureStepSlice=ac,i.procedureTypeAttachmentReducer=fg,i.procedureTypeAttachmentSlice=dc,i.procedureTypeFieldsAttachmentReducer=Eg,i.procedureTypeFieldsAttachmentSlice=uc,i.procedureTypeFieldsReducer=Hg,i.procedureTypeFieldsSlice=hc,i.procedureTypeReducer=VR,i.procedureTypeSlice=wc,i.projectAccessReducer=UO,i.projectAccessSlice=_a,i.projectAttachmentReducer=nT,i.projectAttachmentSlice=Ra,i.projectFileReducer=wT,i.projectFileSlice=Ma,i.projectReducer=vT,i.projectSlice=va,i.rehydratedReducer=WR,i.rehydratedSlice=Pc,i.restructureSelectorWithArgs=m,i.runMiddleware=UV,i.selectAccessToken=hB,i.selectAccessesByUserOfProject=JB,i.selectAccessibleProjects=xB,i.selectActiveOrganizationAccess=NB,i.selectAllDocumentAttachments=dn,i.selectAssetAttachmentById=Kr,i.selectAssetAttachmentMapping=Gr,i.selectAssetAttachments=ri,i.selectAssetAttachmentsByIds=Yr,i.selectAssetById=uo,i.selectAssetProcedureById=Il,i.selectAssetProcedureStepById=Ju,i.selectAssetProcedureStepFieldValues=is,i.selectAssetProcedureStepFieldValuesAttachmentById=Ou,i.selectAssetProcedureStepFieldValuesAttachments=vi,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Tu,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Pu,i.selectAssetProcedureStepFieldValuesById=Wu,i.selectAssetProcedureStepFieldValuesByIds=zu,i.selectAssetProcedureStepFieldValuesMapping=Du,i.selectAssetProcedureStepFieldValuesOfAsset=Gk,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=Kk,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Yk,i.selectAssetProcedureStepFields=gs,i.selectAssetProcedureStepFieldsAttachmentById=Jl,i.selectAssetProcedureStepFieldsAttachments=Fi,i.selectAssetProcedureStepFieldsAttachmentsByIds=Zl,i.selectAssetProcedureStepFieldsAttachmentsMapping=Ql,i.selectAssetProcedureStepFieldsById=lu,i.selectAssetProcedureStepFieldsByIds=uu,i.selectAssetProcedureStepFieldsMapping=gi,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=Lk,i.selectAssetProcedureStepMapping=Rs,i.selectAssetProcedureSteps=ki,i.selectAssetProcedureStepsByIds=Zu,i.selectAssetProcedureStepsMappingOfAssetProcedureType=Qk,i.selectAssetProcedureStepsOfAssetProcedureType=Jk,i.selectAssetProcedureTypeAttachmentById=ld,i.selectAssetProcedureTypeAttachmentMapping=dd,i.selectAssetProcedureTypeAttachments=li,i.selectAssetProcedureTypeAttachmentsByIds=ud,i.selectAssetProcedureTypeById=zl,i.selectAssetProcedureTypeFieldValues=Fs,i.selectAssetProcedureTypeFieldValuesAttachmentById=Qd,i.selectAssetProcedureTypeFieldValuesAttachments=mi,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Jd,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Yd,i.selectAssetProcedureTypeFieldValuesById=ul,i.selectAssetProcedureTypeFieldValuesByIds=ol,i.selectAssetProcedureTypeFieldValuesMapping=ll,i.selectAssetProcedureTypeFieldValuesOfAsset=qk,i.selectAssetProcedureTypeFields=Is,i.selectAssetProcedureTypeFieldsAttachmentById=Id,i.selectAssetProcedureTypeFieldsAttachments=oi,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Fd,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Td,i.selectAssetProcedureTypeFieldsById=zd,i.selectAssetProcedureTypeFieldsByIds=qd,i.selectAssetProcedureTypeFieldsMapping=Wd,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=Wk,i.selectAssetProcedureTypes=Ti,i.selectAssetProcedureTypesByIds=ql,i.selectAssetProcedureTypesMapping=Wl,i.selectAssetProcedureTypesOfOrganization=Ck,i.selectAssetProcedures=_s,i.selectAssetProceduresByIds=Fl,i.selectAssetProceduresMapping=Ol,i.selectAssetProceduresOfAssetProcedureType=Tl,i.selectAssetProceduresOfAssetType=$k,i.selectAssetStageById=jo,i.selectAssetStageCompletionById=go,i.selectAssetStageCompletionMapping=Fo,i.selectAssetStageCompletions=_o,i.selectAssetStageCompletionsByIds=Ro,i.selectAssetStages=$i,i.selectAssetStagesByIds=$o,i.selectAssetStagesMappingOfAssetProcedureType=Xk,i.selectAssetStagesOfAssetProcedureType=xk,i.selectAssetTypeAttachmentById=Jo,i.selectAssetTypeAttachmentMapping=Qo,i.selectAssetTypeAttachments=Ni,i.selectAssetTypeAttachmentsByIds=Zo,i.selectAssetTypeById=$p,i.selectAssetTypeFieldValues=Ms,i.selectAssetTypeFieldValuesAttachmentById=zh,i.selectAssetTypeFieldValuesAttachments=Zi,i.selectAssetTypeFieldValuesAttachmentsByIds=qh,i.selectAssetTypeFieldValuesAttachmentsMapping=Wh,i.selectAssetTypeFieldValuesById=Xh,i.selectAssetTypeFieldValuesByIds=xh,i.selectAssetTypeFieldValuesMapping=Zh,i.selectAssetTypeFieldValuesOfAsset=iB,i.selectAssetTypeFields=ns,i.selectAssetTypeFieldsAttachmentById=oh,i.selectAssetTypeFieldsAttachments=Gi,i.selectAssetTypeFieldsAttachmentsByIds=hh,i.selectAssetTypeFieldsAttachmentsMapping=uh,i.selectAssetTypeFieldsById=_h,i.selectAssetTypeFieldsByIds=gh,i.selectAssetTypeFieldsMapping=Fh,i.selectAssetTypeFieldsOfAssetType=tB,i.selectAssetTypeIdentifierById=hp,i.selectAssetTypeIdentifierMapping=op,i.selectAssetTypeIdentifierValueById=gp,i.selectAssetTypeIdentifierValueMapping=_p,i.selectAssetTypeIdentifierValues=vs,i.selectAssetTypeIdentifierValuesByIds=Rp,i.selectAssetTypeIdentifierValuesOfAsset=cB,i.selectAssetTypeIdentifierValuesOfIdentifier=rB,i.selectAssetTypeIdentifiers=en,i.selectAssetTypeIdentifiersByIds=pp,i.selectAssetTypeIdentifiersOfAssetType=aB,i.selectAssetTypeStatusById=ey,i.selectAssetTypeStatusMapping=xp,i.selectAssetTypeStatuses=cn,i.selectAssetTypeStatusesByIds=ty,i.selectAssetTypeStatusesOfAssetType=lB,i.selectAssetTypeValuesOfAssetType=nB,i.selectAssetTypes=nn,i.selectAssetTypesByIds=Cp,i.selectAssetTypesMapping=jp,i.selectAssetTypesOfOrganization=dB,i.selectAssets=bs,i.selectAssetsByIds=oo,i.selectAssetsMapping=ro,i.selectAssetsOfAssetType=lo,i.selectAssetsOfProject=Zk,i.selectAttachmentsOfAsset=Qr,i.selectAttachmentsOfAssetProcedureStepFieldValues=Iu,i.selectAttachmentsOfAssetProcedureStepFields=Uk,i.selectAttachmentsOfAssetProcedureType=Bk,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Zd,i.selectAttachmentsOfAssetProcedureTypeFields=Dk,i.selectAttachmentsOfAssetType=Xo,i.selectAttachmentsOfAssetTypeFieldValues=jh,i.selectAttachmentsOfAssetTypeFields=eB,i.selectAttachmentsOfDocument=yB,i.selectAttachmentsOfFormRevision=FB,i.selectAttachmentsOfFormSubmission=Tm,i.selectAttachmentsOfIssue=Ff,i.selectAttachmentsOfIssueComment=bB,i.selectAttachmentsOfIssueType=EB,i.selectAttachmentsOfIssueTypeFieldValues=Rw,i.selectAttachmentsOfIssueTypeFields=VB,i.selectAttachmentsOfProcedureFieldValues=rR,i.selectAttachmentsOfProcedureStepFieldValues=GF,i.selectAttachmentsOfProcedureStepFields=AF,i.selectAttachmentsOfProcedureType=VD,i.selectAttachmentsOfProcedureTypeFields=kD,i.selectAttachmentsOfProject=XB,i.selectAttachmentsOfWorkflowStepFieldValues=Uv,i.selectAttachmentsOfWorkflowStepFields=pv,i.selectCommentsOfIssue=MB,i.selectConversation=kk,i.selectConversationMapping=ii,i.selectConversations=Vk,i.selectCurrentUser=QP,i.selectDeletedRequests=GB,i.selectDescendantsOfAssetProcedureStep=Xu,i.selectDescendantsOfDocument=ky,i.selectDocumentAttachmentById=fy,i.selectDocumentAttachmentMapping=my,i.selectDocumentAttachmentsByIds=Ay,i.selectDocumentById=Ey,i.selectDocuments=Vs,i.selectDocumentsByIds=Vy,i.selectDocumentsMapping=un,i.selectEmailDomainById=Hy,i.selectEmailDomains=hn,i.selectEmailDomainsAsMapping=Ny,i.selectEmailDomainsByIds=Gy,i.selectEmailDomainsOfOrganization=fB,i.selectFieldValuesOfAssetProcedure=jk,i.selectFieldValuesOfProcedure=WD,i.selectFormById=um,i.selectFormIdentifierById=dS,i.selectFormIdentifierMapping=rS,i.selectFormIdentifierValueById=TS,i.selectFormIdentifierValueMapping=OS,i.selectFormIdentifierValues=ks,i.selectFormIdentifierValuesByIds=IS,i.selectFormIdentifierValuesOfFormSubmission=TB,i.selectFormIdentifierValuesOfIdentifier=IB,i.selectFormIdentifiers=Sn,i.selectFormIdentifiersByIds=lS,i.selectFormIdentifiersOfForm=OB,i.selectFormMapping=lm,i.selectFormRevisionAttachmentById=WS,i.selectFormRevisionAttachments=DS,i.selectFormRevisionAttachmentsByIds=zS,i.selectFormRevisionAttachmentsMapping=Bs,i.selectFormRevisionById=YS,i.selectFormRevisionMapping=KS,i.selectFormRevisions=Ds,i.selectFormRevisionsByIds=QS,i.selectFormRevisionsOfForm=JS,i.selectFormSubmissionAttachemntsByIds=bn,i.selectFormSubmissionAttachmentById=Pm,i.selectFormSubmissionAttachments=Rn,i.selectFormSubmissionAttachmentsByIds=Om,i.selectFormSubmissionAttachmentsMapping=gn,i.selectFormSubmissionById=km,i.selectFormSubmissions=Vn,i.selectFormSubmissionsByIds=Bm,i.selectFormSubmissionsMapping=Vm,i.selectFormSubmissionsOfForm=Dm,i.selectForms=Tn,i.selectFormsByIds=om,i.selectFormsOfOrganization=gB,i.selectGeoImageById=Ym,i.selectGeoImageMapping=Km,i.selectGeoImages=Bn,i.selectGeoImagesByIds=Qm,i.selectGeoImagesOfProject=RB,i.selectIsLoggedIn=pB,i.selectIssueAssociationById=rf,i.selectIssueAssociationMapping=cf,i.selectIssueAssociations=Ct,i.selectIssueAssociationsByIds=df,i.selectIssueAssociationsOfAsset=pf,i.selectIssueAssociationsOfIssue=hf,i.selectIssueAssociationsOfIssues=of,i.selectIssueAssociationsToIssue=lf,i.selectIssueAssociationsToIssues=uf,i.selectIssueAttachmentById=_f,i.selectIssueAttachmentMapping=If,i.selectIssueAttachments=jn,i.selectIssueAttachmentsByIds=gf,i.selectIssueById=uA,i.selectIssueCommentAttachmentById=jf,i.selectIssueCommentAttachmentMapping=qf,i.selectIssueCommentAttachments=Cn,i.selectIssueCommentAttachmentsByIds=$f,i.selectIssueCommentById=Xf,i.selectIssueCommentMapping=Ln,i.selectIssueCommentsByIds=xf,i.selectIssueMapping=lA,i.selectIssueTypeAttachmentById=_A,i.selectIssueTypeAttachmentMapping=FA,i.selectIssueTypeAttachments=Yn,i.selectIssueTypeAttachmentsByIds=gA,i.selectIssueTypeById=yP,i.selectIssueTypeFieldValues=zs,i.selectIssueTypeFieldValuesAttachmentById=_w,i.selectIssueTypeFieldValuesAttachments=sa,i.selectIssueTypeFieldValuesAttachmentsByIds=gw,i.selectIssueTypeFieldValuesAttachmentsMapping=Fw,i.selectIssueTypeFieldValuesById=xA,i.selectIssueTypeFieldValuesByIds=ew,i.selectIssueTypeFieldValuesMapping=XA,i.selectIssueTypeFieldValuesOfIssue=kB,i.selectIssueTypeFields=as,i.selectIssueTypeFieldsAttachmentById=jA,i.selectIssueTypeFieldsAttachments=Jn,i.selectIssueTypeFieldsAttachmentsByIds=$A,i.selectIssueTypeFieldsAttachmentsMapping=qA,i.selectIssueTypeFieldsById=pw,i.selectIssueTypeFieldsByIds=yw,i.selectIssueTypeFieldsMapping=hw,i.selectIssueTypeFieldsOfIssueType=BB,i.selectIssueTypeIdentifierById=$w,i.selectIssueTypeIdentifierMapping=jw,i.selectIssueTypeIdentifierValueById=eP,i.selectIssueTypeIdentifierValueMapping=xw,i.selectIssueTypeIdentifierValues=qs,i.selectIssueTypeIdentifierValuesByIds=tP,i.selectIssueTypeIdentifierValuesOfIdentifier=jB,i.selectIssueTypeIdentifierValuesOfIssue=qB,i.selectIssueTypeIdentifiers=na,i.selectIssueTypeIdentifiersByIds=Cw,i.selectIssueTypeIdentifiersOfIssueType=zB,i.selectIssueTypeMapping=pP,i.selectIssueTypeStatusById=ua,i.selectIssueTypeStatusMapping=RP,i.selectIssueTypeStatuses=la,i.selectIssueTypeStatusesByIds=bP,i.selectIssueTypeStatusesOfIssueType=CB,i.selectIssueTypeValuesOfIssueType=WB,i.selectIssueTypes=ra,i.selectIssueTypesByIds=SP,i.selectIssueTypesOfOrganization=$B,i.selectIssueUpdateById=WP,i.selectIssueUpdateMapping=ma,i.selectIssueUpdates=fa,i.selectIssueUpdatesByIds=zP,i.selectIssueUpdatesOfIssue=qP,i.selectIssues=Ws,i.selectIssuesByIds=oA,i.selectIssuesOfIssueType=hA,i.selectIssuesOfProject=vB,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=Nk,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=zk,i.selectLatestAssetTypeFieldsOfAssetType=sB,i.selectLatestFieldsByAssetProcedureStep=Hk,i.selectLatestFieldsByProcedureStep=fD,i.selectLatestFormRevisionOfForm=_B,i.selectLatestIssueTypeFieldsOfIssueType=DB,i.selectLatestProcedureStepFieldValuesByProcedureStepOfProcedure=OD,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=gD,i.selectLatestProcedureStepFieldsOfProcedureStep=mD,i.selectLatestProcedureTypeFieldsOfProcedureType=DD,i.selectLatestRetryTime=KB,i.selectLatestReviewOfProcedureStepFieldValues=FD,i.selectLatestReviewOfWorkflowStepFieldValues=yW,i.selectLatestReviewRequestOfProcedureStepFieldValues=TD,i.selectLatestReviewRequestOfWorkflowStepFieldValues=hW,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=oW,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=mW,i.selectLatestWorkflowStepFieldsOfWorkflowStep=rW,i.selectMembershipsByUserOfTeam=UD,i.selectOrganizationAccessById=dO,i.selectOrganizationAccessMapping=Cs,i.selectOrganizationAccessUserMapping=uO,i.selectOrganizationAccessesByIds=lO,i.selectOrganizationById=IO,i.selectOrganizationDocuments=mB,i.selectOrganizations=TO,i.selectOrganizationsByIds=FO,i.selectOrganizationsMapping=OO,i.selectProcedureById=NT,i.selectProcedureFieldValues=Ac,i.selectProcedureFieldValuesAttachmentById=aR,i.selectProcedureFieldValuesAttachments=mc,i.selectProcedureFieldValuesAttachmentsByIds=cR,i.selectProcedureFieldValuesAttachmentsMapping=nR,i.selectProcedureFieldValuesById=PR,i.selectProcedureFieldValuesByIds=OR,i.selectProcedureFieldValuesMapping=wR,i.selectProcedureStepAssigneeById=nI,i.selectProcedureStepAssignees=rs,i.selectProcedureStepAssigneesByIds=aI,i.selectProcedureStepAssigneesMapping=iI,i.selectProcedureStepAssigneesOfProcedure=nD,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=cD,i.selectProcedureStepAssigneesOfProcedureStep=aD,i.selectProcedureStepById=ag,i.selectProcedureStepCommentById=AI,i.selectProcedureStepComments=ds,i.selectProcedureStepCommentsByIds=wI,i.selectProcedureStepCommentsMapping=fI,i.selectProcedureStepCommentsOfProcedure=rD,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=lD,i.selectProcedureStepCommentsOfProcedureStep=dD,i.selectProcedureStepDefaultAssigneeById=VI,i.selectProcedureStepDefaultAssignees=za,i.selectProcedureStepDefaultAssigneesByIds=kI,i.selectProcedureStepDefaultAssigneesMapping=EI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=uD,i.selectProcedureStepDefaultReviewerById=GI,i.selectProcedureStepDefaultReviewers=ja,i.selectProcedureStepDefaultReviewersByIds=KI,i.selectProcedureStepDefaultReviewersMapping=HI,i.selectProcedureStepDefaultReviewersOfProcedureStep=oD,i.selectProcedureStepEventById=cF,i.selectProcedureStepEvents=ls,i.selectProcedureStepEventsByIds=rF,i.selectProcedureStepEventsMapping=aF,i.selectProcedureStepEventsOfProcedure=hD,i.selectProcedureStepEventsOfProcedureAndProcedureStep=yD,i.selectProcedureStepEventsOfProcedureStep=pD,i.selectProcedureStepFieldValues=Wt,i.selectProcedureStepFieldValuesAttachmentById=NF,i.selectProcedureStepFieldValuesAttachments=Ja,i.selectProcedureStepFieldValuesAttachmentsByIds=HF,i.selectProcedureStepFieldValuesAttachmentsMapping=LF,i.selectProcedureStepFieldValuesById=a_,i.selectProcedureStepFieldValuesByIds=c_,i.selectProcedureStepFieldValuesMapping=n_,i.selectProcedureStepFieldValuesOfProcedure=AD,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=PD,i.selectProcedureStepFieldValuesOfProcedureStep=wD,i.selectProcedureStepFieldValuesReviewById=v_,i.selectProcedureStepFieldValuesReviewRequestById=f_,i.selectProcedureStepFieldValuesReviewRequests=us,i.selectProcedureStepFieldValuesReviewRequestsByIds=A_,i.selectProcedureStepFieldValuesReviewRequestsMapping=m_,i.selectProcedureStepFieldValuesReviewRequestsOfProcedureAndProcedureStep=ID,i.selectProcedureStepFieldValuesReviews=Kt,i.selectProcedureStepFieldValuesReviewsByIds=E_,i.selectProcedureStepFieldValuesReviewsMapping=M_,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=_D,i.selectProcedureStepFields=Ls,i.selectProcedureStepFieldsAttachmentById=wF,i.selectProcedureStepFieldsAttachments=Na,i.selectProcedureStepFieldsAttachmentsByIds=PF,i.selectProcedureStepFieldsAttachmentsMapping=fF,i.selectProcedureStepFieldsById=VF,i.selectProcedureStepFieldsByIds=kF,i.selectProcedureStepFieldsMapping=Ga,i.selectProcedureStepFieldsOfProcedureStep=SD,i.selectProcedureStepReviewerById=H_,i.selectProcedureStepReviewers=os,i.selectProcedureStepReviewersByIds=G_,i.selectProcedureStepReviewersMapping=N_,i.selectProcedureStepReviewersOfProcedure=RD,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=MD,i.selectProcedureStepReviewersOfProcedureStep=bD,i.selectProcedureSteps=rc,i.selectProcedureStepsByIds=cg,i.selectProcedureStepsMapping=cc,i.selectProcedureStepsMappingOfProcedureType=vD,i.selectProcedureStepsOfProcedureType=ED,i.selectProcedureTypeAttachmentById=wg,i.selectProcedureTypeAttachmentMapping=Ag,i.selectProcedureTypeAttachments=lc,i.selectProcedureTypeAttachmentsByIds=Pg,i.selectProcedureTypeById=BR,i.selectProcedureTypeFields=Ns,i.selectProcedureTypeFieldsAttachmentById=kg,i.selectProcedureTypeFieldsAttachments=oc,i.selectProcedureTypeFieldsAttachmentsByIds=Bg,i.selectProcedureTypeFieldsAttachmentsMapping=Vg,i.selectProcedureTypeFieldsById=Kg,i.selectProcedureTypeFieldsByIds=Yg,i.selectProcedureTypeFieldsMapping=Gg,i.selectProcedureTypeFieldsOfProcedureType=BD,i.selectProcedureTypes=Hs,i.selectProcedureTypesByIds=DR,i.selectProcedureTypesMapping=kR,i.selectProcedureTypesOfAssetType=zD,i.selectProcedureTypesOfIssueType=qD,i.selectProcedures=Gt,i.selectProceduresByIds=HT,i.selectProceduresMapping=LT,i.selectProceduresOfAsset=sD,i.selectProceduresOfIssue=iD,i.selectProceduresOfProcedureType=GT,i.selectProceduresOfProject=tD,i.selectProjectAccessById=LO,i.selectProjectAccessMapping=ga,i.selectProjectAccesses=cs,i.selectProjectAccessesByIds=NO,i.selectProjectAccessesOfProject=QB,i.selectProjectAttachmentById=sT,i.selectProjectAttachmentMapping=tT,i.selectProjectAttachments=ba,i.selectProjectAttachmentsByIds=iT,i.selectProjectById=VT,i.selectProjectDocuments=SB,i.selectProjectFileById=fT,i.selectProjectFileMapping=ST,i.selectProjectFiles=mT,i.selectProjectFilesByIds=AT,i.selectProjectMapping=ET,i.selectProjects=Us,i.selectProjectsByIds=kT,i.selectProjectsOfOrganization=eD,i.selectRehydrated=CD,i.selectReviewRequestsOfProcedureStepFieldValues=w_,i.selectReviewRequestsOfWorkflowStepFieldValues=SE,i.selectReviewsOfProcedureStepFieldValues=V_,i.selectReviewsOfWorkflowStepFieldValues=bE,i.selectStageMapping=ji,i.selectTeamById=db,i.selectTeamMembershipById=QR,i.selectTeamMemberships=Gs,i.selectTeamMembershipsByIds=JR,i.selectTeamMembershipsMapping=YR,i.selectTeams=Ic,i.selectTeamsByIds=lb,i.selectTeamsMapping=rb,i.selectTeamsOfOrganization=ND,i.selectUploadUrl=PB,i.selectUserById=$s,i.selectUsers=js,i.selectUsersByIds=JP,i.selectUsersMapping=Oa,i.selectUsersOfOrganization=HB,i.selectUsersOfProject=ZB,i.selectUsersOfTeam=LD,i.selectWorkflowById=Fb,i.selectWorkflowIssueLinkById=Wb,i.selectWorkflowIssueLinks=Yt,i.selectWorkflowIssueLinksByIds=zb,i.selectWorkflowIssueLinksMapping=Db,i.selectWorkflowIssueLinksOfIssue=$b,i.selectWorkflowIssueLinksOfIssues=YD,i.selectWorkflowIssueLinksOfWorkflow=qb,i.selectWorkflowIssueLinksOfWorkflows=jb,i.selectWorkflowMapping=Ib,i.selectWorkflowStepAssigneeById=xb,i.selectWorkflowStepAssignees=ys,i.selectWorkflowStepAssigneesByIds=eM,i.selectWorkflowStepAssigneesMapping=Xb,i.selectWorkflowStepAssigneesOfWorkflow=QD,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=ZD,i.selectWorkflowStepAssigneesOfWorkflowStep=JD,i.selectWorkflowStepById=tV,i.selectWorkflowStepCommentById=pM,i.selectWorkflowStepComments=Ss,i.selectWorkflowStepCommentsByIds=yM,i.selectWorkflowStepCommentsMapping=hM,i.selectWorkflowStepCommentsOfWorkflow=XD,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=eW,i.selectWorkflowStepCommentsOfWorkflowStep=xD,i.selectWorkflowStepDefaultAssigneeById=RM,i.selectWorkflowStepDefaultAssignees=Mc,i.selectWorkflowStepDefaultAssigneesByIds=bM,i.selectWorkflowStepDefaultAssigneesMapping=gM,i.selectWorkflowStepDefaultAssigneesOfWorkflowStep=tW,i.selectWorkflowStepDefaultReviewerById=CM,i.selectWorkflowStepDefaultReviewers=Ec,i.selectWorkflowStepDefaultReviewersByIds=UM,i.selectWorkflowStepDefaultReviewersMapping=$M,i.selectWorkflowStepDefaultReviewersOfWorkflowStep=sW,i.selectWorkflowStepEventById=tv,i.selectWorkflowStepEvents=ms,i.selectWorkflowStepEventsByIds=sv,i.selectWorkflowStepEventsMapping=ev,i.selectWorkflowStepEventsOfWorkflow=iW,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=aW,i.selectWorkflowStepEventsOfWorkflowStep=nW,i.selectWorkflowStepFieldValues=zt,i.selectWorkflowStepFieldValuesAttachmentById=$v,i.selectWorkflowStepFieldValuesAttachments=Cc,i.selectWorkflowStepFieldValuesAttachmentsByIds=Cv,i.selectWorkflowStepFieldValuesAttachmentsMapping=jv,i.selectWorkflowStepFieldValuesById=tE,i.selectWorkflowStepFieldValuesByIds=sE,i.selectWorkflowStepFieldValuesMapping=eE,i.selectWorkflowStepFieldValuesOfWorkflow=dW,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=uW,i.selectWorkflowStepFieldValuesOfWorkflowStep=lW,i.selectWorkflowStepFieldValuesReviewById=gE,i.selectWorkflowStepFieldValuesReviewRequestById=pE,i.selectWorkflowStepFieldValuesReviewRequests=fs,i.selectWorkflowStepFieldValuesReviewRequestsByIds=yE,i.selectWorkflowStepFieldValuesReviewRequestsMapping=hE,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=pW,i.selectWorkflowStepFieldValuesReviews=Qt,i.selectWorkflowStepFieldValuesReviewsByIds=RE,i.selectWorkflowStepFieldValuesReviewsMapping=_E,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=SW,i.selectWorkflowStepFields=Ys,i.selectWorkflowStepFieldsAttachmentById=yv,i.selectWorkflowStepFieldsAttachments=Wc,i.selectWorkflowStepFieldsAttachmentsByIds=Sv,i.selectWorkflowStepFieldsAttachmentsMapping=hv,i.selectWorkflowStepFieldsById=bv,i.selectWorkflowStepFieldsByIds=Mv,i.selectWorkflowStepFieldsMapping=Rv,i.selectWorkflowStepFieldsOfWorkflowStep=cW,i.selectWorkflowStepReviewerById=CE,i.selectWorkflowStepReviewers=As,i.selectWorkflowStepReviewersByIds=UE,i.selectWorkflowStepReviewersMapping=$E,i.selectWorkflowStepReviewersOfWorkflow=fW,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=wW,i.selectWorkflowStepReviewersOfWorkflowStep=AW,i.selectWorkflowSteps=Zc,i.selectWorkflowStepsByIds=sV,i.selectWorkflowStepsMapping=eV,i.selectWorkflowStepsOfWorkflowType=PW,i.selectWorkflowTypeById=SV,i.selectWorkflowTypeMapping=yV,i.selectWorkflowTypes=xc,i.selectWorkflowTypesByIds=mV,i.selectWorkflowTypesOfOrganization=OW,i.selectWorkflows=Ks,i.selectWorkflowsByIds=_b,i.selectWorkflowsOfProject=GD,i.selectWorkflowsOfWorkflowType=KD,i.setAsset=ao,i.setAssetAttachment=Cr,i.setAssetAttachments=Ur,i.setAssetProcedure=Al,i.setAssetProcedureStep=Cu,i.setAssetProcedureStepFieldValues=Mu,i.setAssetProcedureStepFieldValuesAttachment=Su,i.setAssetProcedureStepFieldValuesAttachments=mu,i.setAssetProcedureStepFieldValuesMany=vu,i.setAssetProcedureStepFields=iu,i.setAssetProcedureStepFieldsAttachment=Ll,i.setAssetProcedureStepFieldsAttachments=Nl,i.setAssetProcedureStepFieldsMany=nu,i.setAssetProcedureSteps=Uu,i.setAssetProcedureType=kl,i.setAssetProcedureTypeAttachment=td,i.setAssetProcedureTypeAttachments=sd,i.setAssetProcedureTypeFieldValues=sl,i.setAssetProcedureTypeFieldValuesAttachment=Ud,i.setAssetProcedureTypeFieldValuesAttachments=Ld,i.setAssetProcedureTypeFieldValuesMany=il,i.setAssetProcedureTypeFields=Md,i.setAssetProcedureTypeFieldsAttachment=Sd,i.setAssetProcedureTypeFieldsAttachments=md,i.setAssetProcedureTypeFieldsMany=vd,i.setAssetProcedureTypes=Bl,i.setAssetProcedures=wl,i.setAssetStage=vo,i.setAssetStageCompletion=fo,i.setAssetStageCompletions=Ao,i.setAssetStages=Eo,i.setAssetType=Ep,i.setAssetTypeAttachment=No,i.setAssetTypeAttachments=Ho,i.setAssetTypeFieldValues=Hh,i.setAssetTypeFieldValuesAttachment=Eh,i.setAssetTypeFieldValuesAttachments=Vh,i.setAssetTypeFieldValuesMany=Gh,i.setAssetTypeFields=Ah,i.setAssetTypeFieldsAttachment=nh,i.setAssetTypeFieldsAttachments=ah,i.setAssetTypeFieldsMany=wh,i.setAssetTypeIdentifier=ap,i.setAssetTypeIdentifierValue=wp,i.setAssetTypeIdentifierValues=Pp,i.setAssetTypeIdentifiers=cp,i.setAssetTypeStatus=Kp,i.setAssetTypeStatuses=Yp,i.setAssetTypes=Vp,i.setAssets=co,i.setClientSDK=zV,i.setClientStore=DV,i.setConversation=Dr,i.setConversations=bk,i.setCurrentUser=UB,i.setCurrentUserProfile=LB,i.setDocument=Fy,i.setDocumentAttachment=uy,i.setDocumentAttachments=oy,i.setDocuments=_y,i.setEmailDomain=qy,i.setEmailDomains=jy,i.setForm=sm,i.setFormIdentifier=tS,i.setFormIdentifierValue=SS,i.setFormIdentifierValues=mS,i.setFormIdentifiers=sS,i.setFormRevision=US,i.setFormRevisionAttachment=MS,i.setFormRevisionAttachments=vS,i.setFormRevisions=LS,i.setFormSubmission=gm,i.setFormSubmissionAttachment=Sm,i.setFormSubmissionAttachments=mm,i.setFormSubmissions=Rm,i.setForms=im,i.setGeoImage=jm,i.setGeoImages=$m,i.setIssue=nA,i.setIssueAssociation=ef,i.setIssueAssociations=xm,i.setIssueAttachment=Af,i.setIssueAttachments=wf,i.setIssueComment=Gf,i.setIssueCommentAttachment=Vf,i.setIssueCommentAttachments=kf,i.setIssueComments=Kf,i.setIssueType=rP,i.setIssueTypeAttachment=AA,i.setIssueTypeAttachments=wA,i.setIssueTypeFieldValues=GA,i.setIssueTypeFieldValuesAttachment=ww,i.setIssueTypeFieldValuesAttachments=Pw,i.setIssueTypeFieldValuesMany=KA,i.setIssueTypeFields=cw,i.setIssueTypeFieldsAttachment=VA,i.setIssueTypeFieldsAttachments=kA,i.setIssueTypeFieldsMany=rw,i.setIssueTypeIdentifier=kw,i.setIssueTypeIdentifierValue=Kw,i.setIssueTypeIdentifierValues=Yw,i.setIssueTypeIdentifiers=Bw,i.setIssueTypeStatus=OP,i.setIssueTypeStatuses=TP,i.setIssueTypes=dP,i.setIssueUpdate=VP,i.setIssueUpdates=kP,i.setIssues=aA,i.setLoggedIn=ny,i.setOrganization=yO,i.setOrganizationAccess=tO,i.setOrganizationAccesses=sO,i.setOrganizations=pO,i.setProcedure=zT,i.setProcedureFieldValues=hR,i.setProcedureFieldValuesAttachment=Xg,i.setProcedureFieldValuesAttachments=xg,i.setProcedureFieldValuesMany=pR,i.setProcedureStep=J_,i.setProcedureStepAssignee=ZT,i.setProcedureStepAssignees=XT,i.setProcedureStepComment=oI,i.setProcedureStepComments=hI,i.setProcedureStepDefaultAssignee=_I,i.setProcedureStepDefaultAssignees=gI,i.setProcedureStepDefaultReviewer=jI,i.setProcedureStepDefaultReviewers=$I,i.setProcedureStepEvent=xI,i.setProcedureStepEvents=eF,i.setProcedureStepFieldValues=XF,i.setProcedureStepFieldValuesAttachment=qF,i.setProcedureStepFieldValuesAttachments=jF,i.setProcedureStepFieldValuesMany=xF,i.setProcedureStepFieldValuesReview=F_,i.setProcedureStepFieldValuesReviewRequest=o_,i.setProcedureStepFieldValuesReviewRequests=h_,i.setProcedureStepFieldValuesReviews=__,i.setProcedureStepFields=gF,i.setProcedureStepFieldsAttachment=hF,i.setProcedureStepFieldsAttachments=pF,i.setProcedureStepFieldsMany=RF,i.setProcedureStepReviewer=q_,i.setProcedureStepReviewers=j_,i.setProcedureSteps=Z_,i.setProcedureType=gR,i.setProcedureTypeAttachment=og,i.setProcedureTypeAttachments=hg,i.setProcedureTypeFields=jg,i.setProcedureTypeFieldsAttachment=_g,i.setProcedureTypeFieldsAttachments=gg,i.setProcedureTypeFieldsMany=$g,i.setProcedureTypes=RR,i.setProcedures=qT,i.setProject=IT,i.setProjectAccess=WO,i.setProjectAccesses=zO,i.setProjectAttachment=QO,i.setProjectAttachments=JO,i.setProjectFile=rT,i.setProjectFiles=dT,i.setProjects=TT,i.setRehydrated=$D,i.setTeam=tb,i.setTeamMembership=CR,i.setTeamMemberships=UR,i.setTeams=sb,i.setTokens=uB,i.setUploadUrl=wB,i.setUser=LP,i.setUsers=UP,i.setWorkflow=fb,i.setWorkflowIssueLink=vb,i.setWorkflowIssueLinks=Eb,i.setWorkflowStep=YE,i.setWorkflowStepAssignee=Gb,i.setWorkflowStepAssignees=Kb,i.setWorkflowStepComment=cM,i.setWorkflowStepComments=rM,i.setWorkflowStepDefaultAssignee=PM,i.setWorkflowStepDefaultAssignees=OM,i.setWorkflowStepDefaultReviewer=BM,i.setWorkflowStepDefaultReviewers=DM,i.setWorkflowStepEvent=YM,i.setWorkflowStepEvents=QM,i.setWorkflowStepFieldValues=Yv,i.setWorkflowStepFieldValuesAttachment=Bv,i.setWorkflowStepFieldValuesAttachments=Dv,i.setWorkflowStepFieldValuesMany=Qv,i.setWorkflowStepFieldValuesReview=PE,i.setWorkflowStepFieldValuesReviewRequest=rE,i.setWorkflowStepFieldValuesReviewRequests=dE,i.setWorkflowStepFieldValuesReviews=OE,i.setWorkflowStepFields=Ov,i.setWorkflowStepFieldsAttachment=rv,i.setWorkflowStepFieldsAttachments=dv,i.setWorkflowStepFieldsMany=Tv,i.setWorkflowStepReviewer=BE,i.setWorkflowStepReviewers=DE,i.setWorkflowSteps=QE,i.setWorkflowType=dV,i.setWorkflowTypes=lV,i.setWorkflows=Ab,i.shallowEqual=ck,i.slugify=Ok,i.spacesToDashesLower=Pk,i.teamMembershipReducer=KR,i.teamMembershipSlice=Oc,i.teamReducer=ub,i.teamSlice=Tc,i.toFileNameSafeString=wk,i.toUuidArray=E,i.toUuidIdRecord=Ak,i.truncate=Tk,i.updateAsset=so,i.updateAssetAttachment=Lr,i.updateAssetAttachments=Nr,i.updateAssetProcedure=Sl,i.updateAssetProcedureStep=Hu,i.updateAssetProcedureStepFieldValues=Eu,i.updateAssetProcedureStepFieldValuesAttachment=fu,i.updateAssetProcedureStepFieldValuesAttachments=Au,i.updateAssetProcedureStepFieldValuesMany=Vu,i.updateAssetProcedureStepFields=au,i.updateAssetProcedureStepFieldsAttachment=Hl,i.updateAssetProcedureStepFieldsAttachments=Gl,i.updateAssetProcedureStepFieldsMany=cu,i.updateAssetProcedureSteps=Gu,i.updateAssetProcedureType=Ml,i.updateAssetProcedureTypeAttachment=id,i.updateAssetProcedureTypeAttachments=nd,i.updateAssetProcedureTypeFieldValues=nl,i.updateAssetProcedureTypeFieldValuesAttachment=Nd,i.updateAssetProcedureTypeFieldValuesAttachments=Hd,i.updateAssetProcedureTypeFieldValuesMany=al,i.updateAssetProcedureTypeFields=Ed,i.updateAssetProcedureTypeFieldsAttachment=fd,i.updateAssetProcedureTypeFieldsAttachments=Ad,i.updateAssetProcedureTypeFieldsMany=Vd,i.updateAssetProcedureTypes=vl,i.updateAssetProcedures=ml,i.updateAssetStage=Bo,i.updateAssetStageCompletion=wo,i.updateAssetStageCompletions=Po,i.updateAssetStages=Do,i.updateAssetType=Dp,i.updateAssetTypeAttachment=Go,i.updateAssetTypeAttachments=Ko,i.updateAssetTypeFieldValues=Kh,i.updateAssetTypeFieldValuesAttachment=kh,i.updateAssetTypeFieldValuesAttachments=Bh,i.updateAssetTypeFieldValuesMany=Yh,i.updateAssetTypeFields=Ph,i.updateAssetTypeFieldsAttachment=ch,i.updateAssetTypeFieldsAttachments=rh,i.updateAssetTypeFieldsMany=Oh,i.updateAssetTypeIdentifier=rp,i.updateAssetTypeIdentifierValue=Op,i.updateAssetTypeIdentifierValues=Tp,i.updateAssetTypeIdentifiers=dp,i.updateAssetTypeStatus=Qp,i.updateAssetTypeStatuses=Jp,i.updateAssetTypes=Wp,i.updateAssets=io,i.updateConversation=Wr,i.updateConversations=Mk,i.updateDocument=gy,i.updateDocumentAttachment=hy,i.updateDocumentAttachments=py,i.updateDocuments=Ry,i.updateEmailDomain=$y,i.updateEmailDomains=Cy,i.updateForm=nm,i.updateFormIdentifier=iS,i.updateFormIdentifierValue=fS,i.updateFormIdentifierValues=AS,i.updateFormIdentifiers=nS,i.updateFormRevision=NS,i.updateFormRevisionAttachment=ES,i.updateFormRevisionAttachments=VS,i.updateFormRevisions=HS,i.updateFormSubmission=Mm,i.updateFormSubmissionAttachment=fm,i.updateFormSubmissionAttachments=Am,i.updateFormSubmissions=vm,i.updateForms=am,i.updateGeoImage=Lm,i.updateGeoImages=Nm,i.updateIssue=cA,i.updateIssueAssociation=tf,i.updateIssueAssociations=sf,i.updateIssueAttachment=Pf,i.updateIssueAttachments=Of,i.updateIssueComment=Yf,i.updateIssueCommentAttachment=Bf,i.updateIssueCommentAttachments=Df,i.updateIssueComments=Qf,i.updateIssueType=lP,i.updateIssueTypeAttachment=PA,i.updateIssueTypeAttachments=OA,i.updateIssueTypeFieldValues=YA,i.updateIssueTypeFieldValuesAttachment=Ow,i.updateIssueTypeFieldValuesAttachments=Tw,i.updateIssueTypeFieldValuesMany=QA,i.updateIssueTypeFields=dw,i.updateIssueTypeFieldsAttachment=BA,i.updateIssueTypeFieldsAttachments=DA,i.updateIssueTypeFieldsMany=lw,i.updateIssueTypeIdentifier=Dw,i.updateIssueTypeIdentifierValue=Qw,i.updateIssueTypeIdentifierValues=Jw,i.updateIssueTypeIdentifiers=Ww,i.updateIssueTypeStatus=IP,i.updateIssueTypeStatuses=FP,i.updateIssueTypes=uP,i.updateIssueUpdate=BP,i.updateIssueUpdates=DP,i.updateIssues=rA,i.updateOrganization=AO,i.updateOrganizationAccess=iO,i.updateOrganizationAccesses=nO,i.updateOrganizations=fO,i.updateProcedure=jT,i.updateProcedureFieldValues=yR,i.updateProcedureFieldValuesAttachment=eR,i.updateProcedureFieldValuesAttachments=tR,i.updateProcedureFieldValuesMany=SR,i.updateProcedureStep=eg,i.updateProcedureStepAssignee=xT,i.updateProcedureStepAssignees=eI,i.updateProcedureStepComment=pI,i.updateProcedureStepComments=yI,i.updateProcedureStepDefaultAssignee=RI,i.updateProcedureStepDefaultAssignees=bI,i.updateProcedureStepDefaultReviewer=CI,i.updateProcedureStepDefaultReviewers=UI,i.updateProcedureStepEvent=tF,i.updateProcedureStepEvents=sF,i.updateProcedureStepFieldValues=e_,i.updateProcedureStepFieldValuesAttachment=$F,i.updateProcedureStepFieldValuesAttachments=CF,i.updateProcedureStepFieldValuesMany=t_,i.updateProcedureStepFieldValuesReview=g_,i.updateProcedureStepFieldValuesReviewRequest=p_,i.updateProcedureStepFieldValuesReviewRequests=y_,i.updateProcedureStepFieldValuesReviews=R_,i.updateProcedureStepFields=bF,i.updateProcedureStepFieldsAttachment=yF,i.updateProcedureStepFieldsAttachments=SF,i.updateProcedureStepFieldsMany=MF,i.updateProcedureStepReviewer=$_,i.updateProcedureStepReviewers=C_,i.updateProcedureSteps=tg,i.updateProcedureType=bR,i.updateProcedureTypeAttachment=pg,i.updateProcedureTypeAttachments=yg,i.updateProcedureTypeFields=Cg,i.updateProcedureTypeFieldsAttachment=Rg,i.updateProcedureTypeFieldsAttachments=bg,i.updateProcedureTypeFieldsMany=Ug,i.updateProcedureTypes=MR,i.updateProcedures=$T,i.updateProject=RT,i.updateProjectAccess=qO,i.updateProjectAccesses=jO,i.updateProjectAttachment=ZO,i.updateProjectAttachments=XO,i.updateProjectFile=oT,i.updateProjectFiles=hT,i.updateProjects=gT,i.updateTeam=ib,i.updateTeamMembership=LR,i.updateTeamMemberships=NR,i.updateTeams=nb,i.updateUser=GP,i.updateUsers=HP,i.updateWorkflow=wb,i.updateWorkflowIssueLink=Vb,i.updateWorkflowIssueLinks=kb,i.updateWorkflowStep=JE,i.updateWorkflowStepAssignee=Yb,i.updateWorkflowStepAssignees=Qb,i.updateWorkflowStepComment=dM,i.updateWorkflowStepComments=lM,i.updateWorkflowStepDefaultAssignee=TM,i.updateWorkflowStepDefaultAssignees=IM,i.updateWorkflowStepDefaultReviewer=WM,i.updateWorkflowStepDefaultReviewers=zM,i.updateWorkflowStepEvent=JM,i.updateWorkflowStepEvents=ZM,i.updateWorkflowStepFieldValues=Jv,i.updateWorkflowStepFieldValuesAttachment=Wv,i.updateWorkflowStepFieldValuesAttachments=zv,i.updateWorkflowStepFieldValuesMany=Zv,i.updateWorkflowStepFieldValuesReview=TE,i.updateWorkflowStepFieldValuesReviewRequest=lE,i.updateWorkflowStepFieldValuesReviewRequests=uE,i.updateWorkflowStepFieldValuesReviews=IE,i.updateWorkflowStepFields=Iv,i.updateWorkflowStepFieldsAttachment=lv,i.updateWorkflowStepFieldsAttachments=uv,i.updateWorkflowStepFieldsMany=Fv,i.updateWorkflowStepReviewer=WE,i.updateWorkflowStepReviewers=zE,i.updateWorkflowSteps=ZE,i.updateWorkflowType=uV,i.updateWorkflowTypes=oV,i.updateWorkflows=Pb,i.useSelectorBuilder=ak,i.userReducer=YP,i.userSlice=Aa,i.uuidObj=P,i.uuidObjSortFn=ti,i.uuidSortFn=Ts,i.versioningReducer=hb,i.versioningSlice=ob,i.workflowIssueLinkReducer=Cb,i.workflowIssueLinkSlice=_c,i.workflowReducer=gb,i.workflowSlice=Fc,i.workflowStepAssigneeReducer=tM,i.workflowStepAssigneeSlice=gc,i.workflowStepCommentReducer=SM,i.workflowStepCommentSlice=Rc,i.workflowStepDefaultAssigneeReducer=MM,i.workflowStepDefaultAssigneeSlice=bc,i.workflowStepDefaultReviewerReducer=LM,i.workflowStepDefaultReviewerSlice=vc,i.workflowStepEventReducer=iv,i.workflowStepEventSlice=Vc,i.workflowStepFieldValuesAttachmentReducer=Lv,i.workflowStepFieldValuesAttachmentSlice=qc,i.workflowStepFieldValuesReducer=iE,i.workflowStepFieldValuesReviewReducer=ME,i.workflowStepFieldValuesReviewRequestReducer=mE,i.workflowStepFieldValuesReviewRequestSlice=Lc,i.workflowStepFieldValuesReviewSlice=Gc,i.workflowStepFieldValuesSlice=Uc,i.workflowStepFieldsAttachmentReducer=mv,i.workflowStepFieldsAttachmentSlice=kc,i.workflowStepFieldsReducer=vv,i.workflowStepFieldsSlice=zc,i.workflowStepReducer=iV,i.workflowStepReviewerReducer=LE,i.workflowStepReviewerSlice=Qc,i.workflowStepSlice=Jc,i.workflowTypeReducer=fV,i.workflowTypeSlice=Xc,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});