@overmap-ai/core 1.0.78-workflows-2.13 → 1.0.78-workflows-2.14
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,Ot,ht,Dg,jg,za,Lt,$g,qa,Cg,Ug,Pk,bk,Lg,Ng,Gg){"use strict";var _k=Object.defineProperty;var gk=(i,U,o)=>U in i?_k(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var m=(i,U,o)=>gk(i,typeof U!="symbol"?U+"":U,o);var zg;const Da=Object.freeze([]),ja=Object.freeze({});var $a=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))($a||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Ca=(t=>(t[t.PLANNED=0]="PLANNED",t[t.ACTIVE=1]="ACTIVE",t[t.MAINTENANCE=2]="MAINTENANCE",t[t.INACTIVE=3]="INACTIVE",t[t.RETIRED=4]="RETIRED",t[t.DISPOSED=5]="DISPOSED",t))(Ca||{}),Ua=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Ua||{}),ys=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))(ys||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),La=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.PLANNED=1]="PLANNED",t[t.IN_PROGRESS=2]="IN_PROGRESS",t[t.COMPLETED=3]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(La||{}),Na=(t=>(t[t.ADD_ASSIGNEE=0]="ADD_ASSIGNEE",t[t.REMOVE_ASSIGNEE=2]="REMOVE_ASSIGNEE",t[t.ADD_REVIEWER=4]="ADD_REVIEWER",t[t.REMOVE_REVIEWER=6]="REMOVE_REVIEWER",t[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(Na||{}),Rt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Rt||{}),Mt=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(Mt||{});const Hg=ys.MEDIUM,Ga=6e4,Kg=[Mt.APPROVED,Mt.REJECTED,Mt.CHANGES_REQUESTED],Yg=[Rt.ACTIVE,Rt.COMPLETED,Rt.CANCELLED];function F(t){return{addOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},addMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},setOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},setMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},updateOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},updateMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const f of y.payload)delete p.instances[f]},initialize:(p,y)=>{p.instances={};const f=new Set;for(const T of y.payload){const P=t(T);f.add(P),p.instances[P]=T}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function Jg(){return{initializeSelection:(l,u)=>{l.selection=Array.from(new Set(u.payload))},selectOne:(l,u)=>{new Set(l.selection).has(u.payload)||l.selection.push(u.payload)},selectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)||p.add(y);l.selection=Array.from(p)},unselectOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)&&(p.delete(u.payload),l.selection=Array.from(p))},unselectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)&&p.delete(y);l.selection=Array.from(p)},toggleOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)?p.delete(u.payload):p.add(u.payload),l.selection=Array.from(p)},toggleMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)?p.delete(y):p.add(y);l.selection=Array.from(p)},getInitialState:l=>({...l,selection:[]})}}const kt="versioning",I=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),_=o.createAction("RESET_ORGANIZATION_STATE");function Zg(t,s){return Dg.useMemo(t,s)}zg=Symbol.toStringTag;class fs{constructor(){m(this,zg,"Promise");m(this,"_promise");m(this,"_resolve");m(this,"_reject");m(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let Ss=!1;["true","1"].includes("".toLowerCase())&&(Ss=!0);function Qg(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),a=e.length;if(a!==n.length)return!1;for(let c=0;c<a;c++){const r=e[c];if(!Object.prototype.hasOwnProperty.call(s,r)||t[r]!==s[r])return!1}return!0}function As(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Ss&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Ss&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function Xg(t,s){if(t.length!==s.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==s[e])return!1;return!0}const A=t=>t.length===0?Da:t,Nt=t=>Object.keys(t).length===0?ja:t,Ha=As(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===ws.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),xg=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),eP=1e3*86400,ws=new Date,tP=t=>new Date(t).toDateString()===ws.toDateString(),sP=As((t,s,e)=>{const n=Math.round((new Date(t).getTime()-ws.getTime())/eP);return n<s||n>e?Ha(t):xg.format(n,"days")});function iP(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Gt(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const a=n.result;if(!a){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",a).then(c=>{const r=iP(c);s(r)})},n.readAsArrayBuffer(t)})}const nP=(t,s)=>`${t}${s?`.${s}`:""}`;function aP(t,s){return new File([t],s,{type:t.type})}function Ka(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Ya=async t=>(await fetch(t)).blob(),Ja=async(t,s)=>{const e=await Ya(t);return new File([e],s,{type:e.type})};function cP(t){const s=new Blob([t]);jg.saveAs(s,t.name)}function Za(t){return typeof t=="string"&&t.startsWith("blob:")}function rP(t){return t.type.startsWith("image/")}const Qa={};function dP(t,s,e,...n){const a=Qa[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Qa[t]={[s]:!0},c=!0),c&&console[e](...n)}const Xa=["created_at","updated_at","index","revision"];function O(t){return{...t,uuid:ht.v4()}}function lP(t){const s={};for(const e of t)s[e.uuid]=e;return s}function V(t){return t.map(({uuid:s})=>s)}function Ht(t,s){return t.localeCompare(s)}function Ts(t,s){return Ht(t.uuid,s.uuid)}function uP(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const c=t.split(".");c.length>1&&(s=c[c.length-1])}s&&!s.startsWith(".")&&(s="."+s);const a=s?s.length:0;return n.length+a>e&&(n=n.slice(0,e-a)+(s||"")),n}function oP(t){return t.toLowerCase().replace(" ","-")}function hP(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function pP(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const mP=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[...Xa,"created_by"])e in s&&delete s[e];return s}const xa=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return za(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},yP=t=>{const{roots:s}=xa(t);return s.map(e=>new Lt.Tree(e))},ec=(t,s)=>{const{nodes:e}=xa(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Lt.Tree(n)},tc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,sc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,ic=t=>za(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),fP=t=>{const{roots:s}=ic(t);return s.map(e=>new Lt.Tree(e))},nc=(t,s)=>{const{nodes:e}=ic(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Lt.Tree(n)};class SP{constructor(s){m(this,"operations",[]);m(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return o.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return o.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return o.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return o.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return o.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return o.createSelector([this.getData],s=>A(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),N=F(t=>t.uuid),ac={instances:{}},Is=o.createSlice({name:"agents",initialState:ac,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ac)),reducers:{initializeConversations:N.initialize,addConversation:N.addOne,addConversations:N.addMany,setConversation:N.setOne,setConversations:N.setMany,updateConversation:N.updateOne,updateConversations:N.updateMany,deleteConversation:N.deleteOne,deleteConversations:N.deleteMany}}),{initializeConversations:cc,addConversation:rc,addConversations:AP,setConversation:dc,setConversations:wP,updateConversation:lc,updateConversations:TP,deleteConversation:IP,deleteConversations:OP}=Is.actions,Os=t=>t.agentsReducer.instances,FP=o.createSelector([Os],t=>Object.values(t)),_P=S(o.createSelector([Os,(t,s)=>s],(t,s)=>t[s])),uc=Is.reducer,G=F(t=>t.uuid),oc={instances:{}},Fs=o.createSlice({name:"assetAttachments",initialState:oc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,oc)),reducers:{initializeAssetAttachments:G.initialize,addAssetAttachment:G.addOne,addAssetAttachments:G.addMany,setAssetAttachment:G.setOne,setAssetAttachments:G.setMany,updateAssetAttachment:G.updateOne,updateAssetAttachments:G.updateMany,deleteAssetAttachment:G.deleteOne,deleteAssetAttachments:G.deleteMany}}),{initializeAssetAttachments:hc,addAssetAttachment:pc,addAssetAttachments:_s,setAssetAttachment:mc,setAssetAttachments:yc,updateAssetAttachment:fc,updateAssetAttachments:Sc,deleteAssetAttachment:Ac,deleteAssetAttachments:gs}=Fs.actions,wc=t=>t.assetAttachmentReducer.instances,Ps=o.createSelector([wc],t=>Object.values(t)),Tc=t=>s=>s.assetAttachmentReducer.instances[t],Ic=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Oc=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Fc=Fs.reducer,H=F(({uuid:t})=>t),_c={instances:{}},bs=o.createSlice({name:"assetProcedureTypeAttachments",initialState:_c,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,_c)),reducers:{initializeAssetProcedureTypeAttachments:H.initialize,addAssetProcedureTypeAttachment:H.addOne,addAssetProcedureTypeAttachments:H.addMany,setAssetProcedureTypeAttachment:H.setOne,setAssetProcedureTypeAttachments:H.setMany,updateAssetProcedureTypeAttachment:H.updateOne,updateAssetProcedureTypeAttachments:H.updateMany,deleteAssetProcedureTypeAttachment:H.deleteOne,deleteAssetProcedureTypeAttachments:H.deleteMany}}),{initializeAssetProcedureTypeAttachments:gc,addAssetProcedureTypeAttachment:Pc,addAssetProcedureTypeAttachments:bc,setAssetProcedureTypeAttachment:Rc,setAssetProcedureTypeAttachments:Mc,updateAssetProcedureTypeAttachment:kc,updateAssetProcedureTypeAttachments:Ec,deleteAssetProcedureTypeAttachment:vc,deleteAssetProcedureTypeAttachments:Vc}=bs.actions,Bc=bs.reducer,Wc=t=>t.assetProcedureTypeAttachmentReducer.instances,Rs=o.createSelector([Wc],t=>Object.values(t)),zc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],qc=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gP=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),K=F(({uuid:t})=>t),Dc={instances:{}},Ms=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Dc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Dc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:K.initialize,addAssetProcedureTypeFieldsAttachment:K.addOne,addAssetProcedureTypeFieldsAttachments:K.addMany,setAssetProcedureTypeFieldsAttachment:K.setOne,setAssetProcedureTypeFieldsAttachments:K.setMany,updateAssetProcedureTypeFieldsAttachment:K.updateOne,updateAssetProcedureTypeFieldsAttachments:K.updateMany,deleteAssetProcedureTypeFieldsAttachment:K.deleteOne,deleteAssetProcedureTypeFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:jc,addAssetProcedureTypeFieldsAttachment:$c,addAssetProcedureTypeFieldsAttachments:Cc,setAssetProcedureTypeFieldsAttachment:Uc,setAssetProcedureTypeFieldsAttachments:Lc,updateAssetProcedureTypeFieldsAttachment:Nc,updateAssetProcedureTypeFieldsAttachments:Gc,deleteAssetProcedureTypeFieldsAttachment:Hc,deleteAssetProcedureTypeFieldsAttachments:Kc}=Ms.actions,Yc=Ms.reducer,Jc=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,ks=o.createSelector([Jc],t=>Object.values(t)),PP=S(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Zc=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Qc=S(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Y=F(({uuid:t})=>t),Xc={instances:{}},Es=o.createSlice({name:"assetProcedureTypeFields",initialState:Xc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Xc)),reducers:{initializeAssetProcedureTypeFields:Y.initialize,addAssetProcedureTypeFields:Y.addOne,addAssetProcedureTypeFieldsMany:Y.addMany,setAssetProcedureTypeFields:Y.setOne,setAssetProcedureTypeFieldsMany:Y.setMany,updateAssetProcedureTypeFields:Y.updateOne,updateAssetProcedureTypeFieldsMany:Y.updateMany,deleteAssetProcedureTypeFields:Y.deleteOne,deleteAssetProcedureTypeFieldsMany:Y.deleteMany}}),{initializeAssetProcedureTypeFields:xc,addAssetProcedureTypeFields:er,addAssetProcedureTypeFieldsMany:tr,setAssetProcedureTypeFields:sr,setAssetProcedureTypeFieldsMany:ir,updateAssetProcedureTypeFields:nr,updateAssetProcedureTypeFieldsMany:ar,deleteAssetProcedureTypeFields:cr,deleteAssetProcedureTypeFieldsMany:rr}=Es.actions,dr=Es.reducer,lr=t=>t.assetProcedureTypeFieldsReducer.instances,Kt=o.createSelector([lr],t=>Object.values(t)),bP=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),RP=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),ur=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],or=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=F(({uuid:t})=>t),hr={instances:{}},vs=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:hr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,hr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:J.initialize,addAssetProcedureTypeFieldValuesAttachment:J.addOne,addAssetProcedureTypeFieldValuesAttachments:J.addMany,setAssetProcedureTypeFieldValuesAttachment:J.setOne,setAssetProcedureTypeFieldValuesAttachments:J.setMany,updateAssetProcedureTypeFieldValuesAttachment:J.updateOne,updateAssetProcedureTypeFieldValuesAttachments:J.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:J.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:pr,addAssetProcedureTypeFieldValuesAttachment:mr,addAssetProcedureTypeFieldValuesAttachments:Vs,setAssetProcedureTypeFieldValuesAttachment:yr,setAssetProcedureTypeFieldValuesAttachments:fr,updateAssetProcedureTypeFieldValuesAttachment:Sr,updateAssetProcedureTypeFieldValuesAttachments:Ar,deleteAssetProcedureTypeFieldValuesAttachment:wr,deleteAssetProcedureTypeFieldValuesAttachments:Bs}=vs.actions,Tr=vs.reducer,Ir=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Ws=o.createSelector([Ir],t=>Object.values(t)),Or=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Fr=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_r=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Z=F(({uuid:t})=>t),gr={instances:{}},zs=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:gr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,gr)),reducers:{initializeAssetProcedureTypeFieldValues:Z.initialize,addAssetProcedureTypeFieldValues:Z.addOne,addAssetProcedureTypeFieldValuesMany:Z.addMany,setAssetProcedureTypeFieldValues:Z.setOne,setAssetProcedureTypeFieldValuesMany:Z.setMany,updateAssetProcedureTypeFieldValues:Z.updateOne,updateAssetProcedureTypeFieldValuesMany:Z.updateMany,deleteAssetProcedureTypeFieldValues:Z.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Pr,addAssetProcedureTypeFieldValues:br,addAssetProcedureTypeFieldValuesMany:Rr,setAssetProcedureTypeFieldValues:Mr,setAssetProcedureTypeFieldValuesMany:kr,updateAssetProcedureTypeFieldValues:Er,updateAssetProcedureTypeFieldValuesMany:vr,deleteAssetProcedureTypeFieldValues:Vr,deleteAssetProcedureTypeFieldValuesMany:Br}=zs.actions,Wr=zs.reducer,zr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Yt=o.createSelector([zr],t=>Object.values(t)),MP=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),kP=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),qr=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Dr=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Q=F(({uuid:t})=>t),jr={instances:{}},qs=o.createSlice({name:"assetProcedures",initialState:jr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,jr)),reducers:{initializeAssetProcedures:Q.initialize,addAssetProcedure:Q.addOne,addAssetProcedures:Q.addMany,setAssetProcedure:Q.setOne,setAssetProcedures:Q.setMany,updateAssetProcedure:Q.updateOne,updateAssetProcedures:Q.updateMany,deleteAssetProcedure:Q.deleteOne,deleteAssetProcedures:Q.deleteMany}}),{initializeAssetProcedures:$r,addAssetProcedure:Cr,addAssetProcedures:Ds,updateAssetProcedure:Ur,updateAssetProcedures:Lr,deleteAssetProcedure:Nr,deleteAssetProcedures:js,setAssetProcedure:Gr,setAssetProcedures:Hr}=qs.actions,Kr=qs.reducer,Yr=t=>t.assetProcedureReducer.instances,Jt=o.createSelector([Yr],t=>Object.values(t)),Jr=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),EP=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Zr=t=>s=>s.assetProcedureReducer.instances[t],Qr=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),X=F(t=>t.uuid),Xr={instances:{}},$s=o.createSlice({name:"assetProcedureTypes",initialState:Xr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Xr)),reducers:{initializeAssetProcedureTypes:X.initialize,addAssetProcedureType:X.addOne,addAssetProcedureTypes:X.addMany,setAssetProcedureType:X.setOne,setAssetProcedureTypes:X.setMany,updateAssetProcedureType:X.updateOne,updateAssetProcedureTypes:X.updateMany,deleteAssetProcedureType:X.deleteOne,deleteAssetProcedureTypes:X.deleteMany}}),{initializeAssetProcedureTypes:xr,addAssetProcedureType:ed,addAssetProcedureTypes:td,updateAssetProcedureType:sd,updateAssetProcedureTypes:id,deleteAssetProcedureType:nd,deleteAssetProcedureTypes:ad,setAssetProcedureType:cd,setAssetProcedureTypes:rd}=$s.actions,dd=$s.reducer,ld=t=>t.assetProcedureTypeReducer.instances,Cs=o.createSelector([ld],t=>Object.values(t)),ud=t=>s=>s.assetProcedureTypeReducer.instances[t],od=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vP=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),x=F(t=>t.uuid),hd={instances:{}},Us=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:hd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,hd)),reducers:{initializeAssetProcedureStepFieldsAttachments:x.initialize,addAssetProcedureStepFieldsAttachment:x.addOne,addAssetProcedureStepFieldsAttachments:x.addMany,setAssetProcedureStepFieldsAttachment:x.setOne,setAssetProcedureStepFieldsAttachments:x.setMany,updateAssetProcedureStepFieldsAttachment:x.updateOne,updateAssetProcedureStepFieldsAttachments:x.updateMany,deleteAssetProcedureStepFieldsAttachment:x.deleteOne,deleteAssetProcedureStepFieldsAttachments:x.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:pd,addAssetProcedureStepFieldsAttachment:md,addAssetProcedureStepFieldsAttachments:yd,setAssetProcedureStepFieldsAttachment:fd,setAssetProcedureStepFieldsAttachments:Sd,updateAssetProcedureStepFieldsAttachment:Ad,updateAssetProcedureStepFieldsAttachments:wd,deleteAssetProcedureStepFieldsAttachment:Td,deleteAssetProcedureStepFieldsAttachments:Id}=Us.actions,Od=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Ls=o.createSelector([Od],t=>Object.values(t)),VP=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Fd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],_d=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gd=Us.reducer,ee=F(t=>t.uuid),Pd={instances:{}},Ns=o.createSlice({name:"assetProcedureStepFields",initialState:Pd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Pd)),reducers:{initializeAssetProcedureStepFields:ee.initialize,addAssetProcedureStepFields:ee.addOne,addAssetProcedureStepFieldsMany:ee.addMany,setAssetProcedureStepFields:ee.setOne,setAssetProcedureStepFieldsMany:ee.setMany,updateAssetProcedureStepFields:ee.updateOne,updateAssetProcedureStepFieldsMany:ee.updateMany,deleteAssetProcedureStepFields:ee.deleteOne,deleteAssetProcedureStepFieldsMany:ee.deleteMany}}),{initializeAssetProcedureStepFields:bd,addAssetProcedureStepFields:Rd,addAssetProcedureStepFieldsMany:Md,setAssetProcedureStepFields:kd,setAssetProcedureStepFieldsMany:Ed,updateAssetProcedureStepFields:vd,updateAssetProcedureStepFieldsMany:Vd,deleteAssetProcedureStepFields:Bd,deleteAssetProcedureStepFieldsMany:Wd}=Ns.actions,Gs=t=>t.assetProcedureStepFieldsReducer.instances,Zt=o.createSelector([Gs],t=>Object.values(t)),BP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),WP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),zP=o.createSelector([Gs],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),zd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],qd=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Dd=Ns.reducer,te=F(t=>t.uuid),jd={instances:{}},Hs=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:jd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,jd)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:te.initialize,addAssetProcedureStepFieldValuesAttachment:te.addOne,addAssetProcedureStepFieldValuesAttachments:te.addMany,setAssetProcedureStepFieldValuesAttachment:te.setOne,setAssetProcedureStepFieldValuesAttachments:te.setMany,updateAssetProcedureStepFieldValuesAttachment:te.updateOne,updateAssetProcedureStepFieldValuesAttachments:te.updateMany,deleteAssetProcedureStepFieldValuesAttachment:te.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:$d,addAssetProcedureStepFieldValuesAttachment:Cd,addAssetProcedureStepFieldValuesAttachments:Ks,setAssetProcedureStepFieldValuesAttachment:Ud,setAssetProcedureStepFieldValuesAttachments:Ld,updateAssetProcedureStepFieldValuesAttachment:Nd,updateAssetProcedureStepFieldValuesAttachments:Gd,deleteAssetProcedureStepFieldValuesAttachment:Hd,deleteAssetProcedureStepFieldValuesAttachments:Ys}=Hs.actions,Kd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Js=o.createSelector([Kd],t=>Object.values(t)),Yd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Jd=S(o.createSelector([Js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zd=S(o.createSelector([Js,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Qd=Hs.reducer,se=F(t=>t.uuid),Xd={instances:{}},Zs=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Xd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Xd)),reducers:{initializeAssetProcedureStepFieldValues:se.initialize,addAssetProcedureStepFieldValues:se.addOne,addAssetProcedureStepFieldValuesMany:se.addMany,setAssetProcedureStepFieldValues:se.setOne,setAssetProcedureStepFieldValuesMany:se.setMany,updateAssetProcedureStepFieldValues:se.updateOne,updateAssetProcedureStepFieldValuesMany:se.updateMany,deleteAssetProcedureStepFieldValues:se.deleteOne,deleteAssetProcedureStepFieldValuesMany:se.deleteMany}}),{initializeAssetProcedureStepFieldValues:xd,addAssetProcedureStepFieldValues:el,addAssetProcedureStepFieldValuesMany:tl,setAssetProcedureStepFieldValues:sl,setAssetProcedureStepFieldValuesMany:il,updateAssetProcedureStepFieldValues:nl,updateAssetProcedureStepFieldValuesMany:al,deleteAssetProcedureStepFieldValues:cl,deleteAssetProcedureStepFieldValuesMany:rl}=Zs.actions,dl=t=>t.assetProcedureStepFieldValuesReducer.instances,Et=o.createSelector([dl],t=>Object.values(t)),qP=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),DP=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),jP=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),ll=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],ul=S(o.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ol=Zs.reducer,ie=F(t=>t.uuid),hl={instances:{}},Qs=o.createSlice({name:"assetProcedureSteps",initialState:hl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,hl)),reducers:{initializeAssetProcedureSteps:ie.initialize,setAssetProcedureStep:ie.setOne,setAssetProcedureSteps:ie.setMany,addAssetProcedureStep:ie.addOne,addAssetProcedureSteps:ie.addMany,updateAssetProcedureStep:ie.updateOne,updateAssetProcedureSteps:ie.updateMany,deleteAssetProcedureStep:ie.deleteOne,deleteAssetProcedureSteps:ie.deleteMany}}),{initializeAssetProcedureSteps:pl,setAssetProcedureStep:ml,setAssetProcedureSteps:yl,addAssetProcedureStep:fl,addAssetProcedureSteps:Sl,updateAssetProcedureStep:Al,updateAssetProcedureSteps:wl,deleteAssetProcedureStep:Tl,deleteAssetProcedureSteps:Il}=Qs.actions,Ol=Qs.reducer,Qt=t=>t.assetProcedureStepReducer.instances,Fl=t=>s=>s.assetProcedureStepReducer.instances[t],Xs=o.createSelector([Qt],t=>Object.values(t)),$P=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return Nt(e)})),CP=S(o.createSelector([Xs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),_l=S(o.createSelector([Xs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gl=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=ec(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ne=F(t=>t.uuid),Pl={instances:{}},xs=o.createSlice({name:"assets",initialState:Pl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Pl)),reducers:{initializeAssets:ne.initialize,addAsset:ne.addOne,addAssets:ne.addMany,setAsset:ne.setOne,setAssets:ne.setMany,updateAsset:ne.updateOne,updateAssets:ne.updateMany,deleteAsset:ne.deleteOne,deleteAssets:ne.deleteMany}}),{initializeAssets:bl,addAsset:Rl,addAssets:ei,updateAsset:Ml,updateAssets:kl,deleteAsset:El,deleteAssets:ti,setAsset:vl,setAssets:Vl}=xs.actions,Bl=t=>t.assetReducer.instances,Xt=o.createSelector([Bl],t=>A(Object.values(t))),UP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),Wl=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),zl=t=>s=>s.assetReducer.instances[t],ql=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Dl=xs.reducer,ae=F(t=>t.uuid),jl={instances:{}},si=o.createSlice({name:"assetStageCompletions",initialState:jl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,jl)),reducers:{initializeAssetStageCompletions:ae.initialize,addAssetStageCompletion:ae.addOne,addAssetStageCompletions:ae.addMany,setAssetStageCompletion:ae.setOne,setAssetStageCompletions:ae.setMany,updateAssetStageCompletion:ae.updateOne,updateAssetStageCompletions:ae.updateMany,deleteAssetStageCompletion:ae.deleteOne,deleteAssetStageCompletions:ae.deleteMany}}),{initializeAssetStageCompletions:$l,addAssetStageCompletion:Cl,addAssetStageCompletions:Ul,setAssetStageCompletion:Ll,setAssetStageCompletions:Nl,updateAssetStageCompletion:Gl,updateAssetStageCompletions:Hl,deleteAssetStageCompletion:Kl,deleteAssetStageCompletions:Yl}=si.actions,Jl=si.reducer,Zl=t=>t.assetStageCompletionReducer.instances,Ql=o.createSelector([Zl],t=>Object.values(t)),Xl=t=>s=>s.assetStageCompletionReducer.instances[t],xl=S(o.createSelector([Ql,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ce=F(t=>t.uuid),eu={instances:{}},ii=o.createSlice({name:"assetStages",initialState:eu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,eu)),reducers:{initializeAssetStages:ce.initialize,setAssetStage:ce.setOne,setAssetStages:ce.setMany,addAssetStage:ce.addOne,addAssetStages:ce.addMany,updateAssetStage:ce.updateOne,updateAssetStages:ce.updateMany,deleteAssetStage:ce.deleteOne,deleteAssetStages:ce.deleteMany}}),{initializeAssetStages:tu,setAssetStage:su,setAssetStages:iu,addAssetStage:nu,addAssetStages:au,updateAssetStage:cu,updateAssetStages:ru,deleteAssetStage:du,deleteAssetStages:lu}=ii.actions,uu=ii.reducer,ni=t=>t.assetStageReducer.instances,ou=t=>s=>s.assetStageReducer.instances[t],ai=o.createSelector([ni],t=>Object.values(t)),LP=S(o.createSelector([ni,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return Nt(e)})),NP=S(o.createSelector([ai,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),hu=S(o.createSelector([ai,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),re=F(t=>t.uuid),pu={instances:{}},ci=o.createSlice({name:"assetTypeAttachments",initialState:pu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,pu)),reducers:{initializeAssetTypeAttachments:re.initialize,addAssetTypeAttachment:re.addOne,addAssetTypeAttachments:re.addMany,setAssetTypeAttachment:re.setOne,setAssetTypeAttachments:re.setMany,updateAssetTypeAttachment:re.updateOne,updateAssetTypeAttachments:re.updateMany,deleteAssetTypeAttachment:re.deleteOne,deleteAssetTypeAttachments:re.deleteMany}}),{initializeAssetTypeAttachments:mu,addAssetTypeAttachment:yu,addAssetTypeAttachments:ri,setAssetTypeAttachment:fu,setAssetTypeAttachments:Su,updateAssetTypeAttachment:Au,updateAssetTypeAttachments:wu,deleteAssetTypeAttachment:Tu,deleteAssetTypeAttachments:di}=ci.actions,Iu=t=>t.assetTypeAttachmentReducer.instances,li=o.createSelector([Iu],t=>Object.values(t)),Ou=t=>s=>s.assetTypeAttachmentReducer.instances[t],Fu=S(o.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_u=S(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),gu=ci.reducer,de=F(t=>t.uuid),Pu={instances:{}},ui=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Pu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Pu)),reducers:{initializeAssetTypeFieldsAttachments:de.initialize,addAssetTypeFieldsAttachment:de.addOne,addAssetTypeFieldsAttachments:de.addMany,setAssetTypeFieldsAttachment:de.setOne,setAssetTypeFieldsAttachments:de.setMany,updateAssetTypeFieldsAttachment:de.updateOne,updateAssetTypeFieldsAttachments:de.updateMany,deleteAssetTypeFieldsAttachment:de.deleteOne,deleteAssetTypeFieldsAttachments:de.deleteMany}}),{initializeAssetTypeFieldsAttachments:bu,addAssetTypeFieldsAttachment:Ru,addAssetTypeFieldsAttachments:Mu,setAssetTypeFieldsAttachment:ku,setAssetTypeFieldsAttachments:Eu,updateAssetTypeFieldsAttachment:vu,updateAssetTypeFieldsAttachments:Vu,deleteAssetTypeFieldsAttachment:Bu,deleteAssetTypeFieldsAttachments:Wu}=ui.actions,zu=t=>t.assetTypeFieldsAttachmentReducer.instances,oi=o.createSelector([zu],t=>Object.values(t)),GP=S(o.createSelector([oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),qu=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Du=S(o.createSelector([oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ju=ui.reducer,le=F(t=>t.uuid),$u={instances:{}},hi=o.createSlice({name:"assetTypeFields",initialState:$u,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,$u)),reducers:{initializeAssetTypeFields:le.initialize,addAssetTypeFields:le.addOne,addAssetTypeFieldsMany:le.addMany,setAssetTypeFields:le.setOne,setAssetTypeFieldsMany:le.setMany,updateAssetTypeFields:le.updateOne,updateAssetTypeFieldsMany:le.updateMany,deleteAssetTypeFields:le.deleteOne,deleteAssetTypeFieldsMany:le.deleteMany}}),{initializeAssetTypeFields:Cu,addAssetTypeFields:Uu,addAssetTypeFieldsMany:Lu,setAssetTypeFields:Nu,setAssetTypeFieldsMany:Gu,updateAssetTypeFields:Hu,updateAssetTypeFieldsMany:Ku,deleteAssetTypeFields:Yu,deleteAssetTypeFieldsMany:Ju}=hi.actions,Zu=t=>t.assetTypeFieldsReducer.instances,vt=o.createSelector([Zu],t=>Object.values(t)),HP=S(o.createSelector([vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),KP=S(o.createSelector([vt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Qu=t=>s=>s.assetTypeFieldsReducer.instances[t],Xu=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xu=hi.reducer,ue=F(t=>t.uuid),eo={instances:{}},pi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:eo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,eo)),reducers:{initializeAssetTypeFieldValuesAttachments:ue.initialize,addAssetTypeFieldValuesAttachment:ue.addOne,addAssetTypeFieldValuesAttachments:ue.addMany,setAssetTypeFieldValuesAttachment:ue.setOne,setAssetTypeFieldValuesAttachments:ue.setMany,updateAssetTypeFieldValuesAttachment:ue.updateOne,updateAssetTypeFieldValuesAttachments:ue.updateMany,deleteAssetTypeFieldValuesAttachment:ue.deleteOne,deleteAssetTypeFieldValuesAttachments:ue.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:to,addAssetTypeFieldValuesAttachment:so,addAssetTypeFieldValuesAttachments:mi,setAssetTypeFieldValuesAttachment:io,setAssetTypeFieldValuesAttachments:no,updateAssetTypeFieldValuesAttachment:ao,updateAssetTypeFieldValuesAttachments:co,deleteAssetTypeFieldValuesAttachment:ro,deleteAssetTypeFieldValuesAttachments:yi}=pi.actions,lo=t=>t.assetTypeFieldValuesAttachmentReducer.instances,fi=o.createSelector([lo],t=>Object.values(t)),uo=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],oo=S(o.createSelector([fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ho=S(o.createSelector([fi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),po=pi.reducer,oe=F(t=>t.uuid),mo={instances:{}},Si=o.createSlice({name:"assetTypeFieldValues",initialState:mo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,mo)),reducers:{initializeAssetTypeFieldValues:oe.initialize,addAssetTypeFieldValues:oe.addOne,addAssetTypeFieldValuesMany:oe.addMany,setAssetTypeFieldValues:oe.setOne,setAssetTypeFieldValuesMany:oe.setMany,updateAssetTypeFieldValues:oe.updateOne,updateAssetTypeFieldValuesMany:oe.updateMany,deleteAssetTypeFieldValues:oe.deleteOne,deleteAssetTypeFieldValuesMany:oe.deleteMany}}),{initializeAssetTypeFieldValues:yo,addAssetTypeFieldValues:fo,addAssetTypeFieldValuesMany:So,setAssetTypeFieldValues:Ao,setAssetTypeFieldValuesMany:wo,updateAssetTypeFieldValues:To,updateAssetTypeFieldValuesMany:Io,deleteAssetTypeFieldValues:Oo,deleteAssetTypeFieldValuesMany:Fo}=Si.actions,_o=t=>t.assetTypeFieldValuesReducer.instances,xt=o.createSelector([_o],t=>Object.values(t)),YP=S(o.createSelector([xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),JP=S(o.createSelector([vt,xt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),go=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Po=S(o.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bo=Si.reducer,he=F(t=>t.uuid),Ro={instances:{}},Ai=o.createSlice({name:"assetTypeIdentifiers",initialState:Ro,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ro)),reducers:{initializeAssetTypeIdentifiers:he.initialize,addAssetTypeIdentifier:he.addOne,addAssetTypeIdentifiers:he.addMany,setAssetTypeIdentifier:he.setOne,setAssetTypeIdentifiers:he.setMany,updateAssetTypeIdentifier:he.updateOne,updateAssetTypeIdentifiers:he.updateMany,deleteAssetTypeIdentifier:he.deleteOne,deleteAssetTypeIdentifiers:he.deleteMany}}),{initializeAssetTypeIdentifiers:Mo,addAssetTypeIdentifier:ko,addAssetTypeIdentifiers:Eo,setAssetTypeIdentifier:vo,setAssetTypeIdentifiers:Vo,updateAssetTypeIdentifier:Bo,updateAssetTypeIdentifiers:Wo,deleteAssetTypeIdentifier:zo,deleteAssetTypeIdentifiers:qo}=Ai.actions,Do=t=>t.assetTypeIdentifierReducer.instances,wi=o.createSelector([Do],t=>Object.values(t)),jo=t=>s=>s.assetTypeIdentifierReducer.instances[t],$o=S(o.createSelector([wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ZP=S(o.createSelector([wi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Co=Ai.reducer,pe=F(t=>t.uuid),Uo={instances:{}},Ti=o.createSlice({name:"assetTypeIdentifierValues",initialState:Uo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Uo)),reducers:{initializeAssetTypeIdentifierValues:pe.initialize,addAssetTypeIdentifierValue:pe.addOne,addAssetTypeIdentifierValues:pe.addMany,setAssetTypeIdentifierValue:pe.setOne,setAssetTypeIdentifierValues:pe.setMany,updateAssetTypeIdentifierValue:pe.updateOne,updateAssetTypeIdentifierValues:pe.updateMany,deleteAssetTypeIdentifierValue:pe.deleteOne,deleteAssetTypeIdentifierValues:pe.deleteMany}}),{initializeAssetTypeIdentifierValues:Lo,addAssetTypeIdentifierValue:No,addAssetTypeIdentifierValues:Go,setAssetTypeIdentifierValue:Ho,setAssetTypeIdentifierValues:Ko,updateAssetTypeIdentifierValue:Yo,updateAssetTypeIdentifierValues:Jo,deleteAssetTypeIdentifierValue:Zo,deleteAssetTypeIdentifierValues:Qo}=Ti.actions,Xo=t=>t.assetTypeIdentifierValueReducer.instances,es=o.createSelector([Xo],t=>Object.values(t)),xo=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],eh=S(o.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QP=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),XP=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),th=Ti.reducer,me=F(t=>t.uuid),sh={instances:{}},Ii=o.createSlice({name:"assetTypes",initialState:sh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,sh)),reducers:{initializeAssetTypes:me.initialize,setAssetType:me.setOne,setAssetTypes:me.setMany,addAssetType:me.addOne,addAssetTypes:me.addMany,updateAssetType:me.updateOne,updateAssetTypes:me.updateMany,deleteAssetType:me.deleteOne,deleteAssetTypes:me.deleteMany}}),{initializeAssetTypes:ih,setAssetType:nh,setAssetTypes:ah,addAssetType:ch,addAssetTypes:rh,updateAssetType:dh,updateAssetTypes:lh,deleteAssetType:uh,deleteAssetTypes:oh}=Ii.actions,hh=t=>t.assetTypeReducer.instances,Oi=o.createSelector([hh],t=>Object.values(t)),ph=t=>s=>s.assetTypeReducer.instances[t],mh=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xP=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),yh=Ii.reducer,ye=F(t=>t.uuid),fh={instances:{}},Fi=o.createSlice({name:"assetTypeStatuses",initialState:fh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,fh)),reducers:{initializeAssetTypeStatuses:ye.initialize,addAssetTypeStatus:ye.addOne,addAssetTypeStatuses:ye.addMany,setAssetTypeStatus:ye.setOne,setAssetTypeStatuses:ye.setMany,updateAssetTypeStatus:ye.updateOne,updateAssetTypeStatuses:ye.updateMany,deleteAssetTypeStatus:ye.deleteOne,deleteAssetTypeStatuses:ye.deleteMany}}),{initializeAssetTypeStatuses:Sh,addAssetTypeStatus:Ah,addAssetTypeStatuses:wh,setAssetTypeStatus:Th,setAssetTypeStatuses:Ih,updateAssetTypeStatus:Oh,updateAssetTypeStatuses:Fh,deleteAssetTypeStatus:_h,deleteAssetTypeStatuses:gh}=Fi.actions,Ph=t=>t.assetTypeStatusReducer.instances,_i=o.createSelector([Ph],t=>A(Object.values(t).toSorted(tc))),bh=t=>s=>s.assetTypeStatusReducer.instances[t],Rh=S(o.createSelector([_i,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eb=S(o.createSelector([_i,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Mh=Fi.reducer,kh={accessToken:"",refreshToken:"",isLoggedIn:!1},ts=o.createSlice({name:"auth",initialState:kh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,kh)),reducers:{setTokens:(t,s)=>{t.accessToken=s.payload.accessToken,t.refreshToken=s.payload.refreshToken},clearTokens:t=>{t.accessToken="",t.refreshToken=""},setLoggedIn:(t,s)=>{s.payload||ts.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:tb,clearTokens:sb,setLoggedIn:Eh}=ts.actions,ib=t=>t.authReducer.accessToken,nb=t=>t.authReducer.isLoggedIn,vh=ts.reducer,fe=F(t=>t.uuid),Vh={instances:{}},gi=o.createSlice({name:"documentAttachments",initialState:Vh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Vh)),reducers:{initializeDocumentAttachments:fe.initialize,addDocumentAttachment:fe.addOne,addDocumentAttachments:fe.addMany,setDocumentAttachment:fe.setOne,setDocumentAttachments:fe.setMany,updateDocumentAttachment:fe.updateOne,updateDocumentAttachments:fe.updateMany,deleteDocumentAttachment:fe.deleteOne,deleteDocumentAttachments:fe.deleteMany}}),{initializeDocumentAttachments:Bh,addDocumentAttachment:Wh,addDocumentAttachments:zh,setDocumentAttachment:qh,setDocumentAttachments:Dh,updateDocumentAttachment:jh,updateDocumentAttachments:$h,deleteDocumentAttachment:Ch,deleteDocumentAttachments:Uh}=gi.actions,Lh=t=>t.documentAttachmentReducer.instances,Pi=o.createSelector([Lh],t=>Object.values(t)),Nh=t=>s=>s.documentAttachmentReducer.instances[t],Gh=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ab=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),Hh=gi.reducer,Se=F(({uuid:t})=>t),Kh={instances:{}},bi=o.createSlice({name:"documents",initialState:Kh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>{Object.assign(s,Kh)}),reducers:{initializeDocuments:Se.initialize,addDocument:Se.addOne,addDocuments:Se.addMany,setDocument:Se.setOne,setDocuments:Se.setMany,updateDocument:Se.updateOne,updateDocuments:Se.updateMany,deleteDocument:Se.deleteOne,deleteDocuments:Se.deleteMany}}),{initializeDocuments:Yh,addDocument:Jh,addDocuments:Zh,setDocument:Qh,setDocuments:Xh,updateDocument:xh,updateDocuments:ep,deleteDocument:tp,deleteDocuments:sp}=bi.actions,ip=bi.reducer,Ri=t=>t.documentsReducer.instances,ss=o.createSelector([Ri],t=>Object.values(t)),np=t=>s=>s.documentsReducer.instances[t],ap=S(o.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cb=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),rb=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),cp=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=nc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Ae=F(t=>t.uuid),rp={instances:{}},Mi=o.createSlice({name:"emailDomains",initialState:rp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,rp)),reducers:{initializeEmailDomains:Ae.initialize,addEmailDomain:Ae.addOne,addEmailDomains:Ae.addMany,setEmailDomain:Ae.setOne,setEmailDomains:Ae.setMany,updateEmailDomain:Ae.updateOne,updateEmailDomains:Ae.updateMany,deleteEmailDomain:Ae.deleteOne,deleteEmailDomains:Ae.deleteMany}}),{initializeEmailDomains:dp,addEmailDomain:lp,addEmailDomains:up,setEmailDomain:op,setEmailDomains:hp,updateEmailDomain:pp,updateEmailDomains:mp,deleteEmailDomain:yp,deleteEmailDomains:fp}=Mi.actions,Sp=t=>t.emailDomainsReducer.instances,ki=o.createSelector([Sp],t=>Object.values(t)),Ap=t=>s=>s.emailDomainsReducer.instances[t],wp=S(o.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),db=S(o.createSelector([ki,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Tp=Mi.reducer,Ip={s3Urls:{}},Op=1e3*60*60,lb=Op*24*7,Ei=o.createSlice({name:"file",initialState:Ip,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Ip)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+lb);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:ub}=Ei.actions,ob=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Op))return e},Fp=Ei.reducer,we=F(t=>t.uuid),_p={instances:{}},vi=o.createSlice({name:"formIdentifiers",initialState:_p,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,_p)),reducers:{initializeFormIdentifiers:we.initialize,addFormIdentifier:we.addOne,addFormIdentifiers:we.addMany,setFormIdentifier:we.setOne,setFormIdentifiers:we.setMany,updateFormIdentifier:we.updateOne,updateFormIdentifiers:we.updateMany,deleteFormIdentifier:we.deleteOne,deleteFormIdentifiers:we.deleteMany}}),{initializeFormIdentifiers:gp,addFormIdentifier:Pp,addFormIdentifiers:bp,setFormIdentifier:Rp,setFormIdentifiers:Mp,updateFormIdentifier:kp,updateFormIdentifiers:Ep,deleteFormIdentifier:vp,deleteFormIdentifiers:Vp}=vi.actions,Bp=t=>t.formIdentifierReducer.instances,Vi=o.createSelector([Bp],t=>Object.values(t)),Wp=t=>s=>s.formIdentifierReducer.instances[t],zp=S(o.createSelector([Vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hb=S(o.createSelector([Vi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),qp=vi.reducer,Te=F(t=>t.uuid),Dp={instances:{}},Bi=o.createSlice({name:"formIdentifierValues",initialState:Dp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Dp)),reducers:{initializeFormIdentifierValues:Te.initialize,addFormIdentifierValue:Te.addOne,addFormIdentifierValues:Te.addMany,setFormIdentifierValue:Te.setOne,setFormIdentifierValues:Te.setMany,updateFormIdentifierValue:Te.updateOne,updateFormIdentifierValues:Te.updateMany,deleteFormIdentifierValue:Te.deleteOne,deleteFormIdentifierValues:Te.deleteMany}}),{initializeFormIdentifierValues:jp,addFormIdentifierValue:$p,addFormIdentifierValues:Cp,setFormIdentifierValue:Up,setFormIdentifierValues:Lp,updateFormIdentifierValue:Np,updateFormIdentifierValues:Gp,deleteFormIdentifierValue:Hp,deleteFormIdentifierValues:Kp}=Bi.actions,Yp=t=>t.formIdentifierValueReducer.instances,is=o.createSelector([Yp],t=>Object.values(t)),Jp=t=>s=>s.formIdentifierValueReducer.instances[t],Zp=S(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pb=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),mb=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),Qp=Bi.reducer,Ie=F(t=>t.uuid),Xp={instances:{}},Wi=o.createSlice({name:"formRevisionAttachments",initialState:Xp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Xp)),reducers:{initializeFormRevisionAttachments:Ie.initialize,addFormRevisionAttachment:Ie.addOne,addFormRevisionAttachments:Ie.addMany,setFormRevisionAttachment:Ie.setOne,setFormRevisionAttachments:Ie.setMany,updateFormRevisionAttachment:Ie.updateOne,updateFormRevisionAttachments:Ie.updateMany,deleteFormRevisionAttachment:Ie.deleteOne,deleteFormRevisionAttachments:Ie.deleteMany}}),{initializeFormRevisionAttachments:xp,addFormRevisionAttachment:em,addFormRevisionAttachments:tm,setFormRevisionAttachment:sm,setFormRevisionAttachments:im,updateFormRevisionAttachment:nm,updateFormRevisionAttachments:am,deleteFormRevisionAttachment:cm,deleteFormRevisionAttachments:rm}=Wi.actions,ns=t=>t.formRevisionAttachmentReducer.instances,dm=o.createSelector([ns],t=>Object.values(t)),lm=S(o.createSelector([ns,(t,s)=>s],(t,s)=>t[s])),um=S(o.createSelector([dm,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),om=Wi.reducer,Oe=F(t=>t.uuid),hm={instances:{}},zi=o.createSlice({name:"formRevisions",initialState:hm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,hm)),reducers:{initializeFormRevisions:Oe.initialize,addFormRevision:Oe.addOne,addFormRevisions:Oe.addMany,setFormRevision:Oe.setOne,setFormRevisions:Oe.setMany,updateFormRevision:Oe.updateOne,updateFormRevisions:Oe.updateMany,deleteFormRevision:Oe.deleteOne,deleteFormRevisions:Oe.deleteMany}}),{initializeFormRevisions:pm,addFormRevision:qi,addFormRevisions:Di,setFormRevision:mm,setFormRevisions:ym,updateFormRevision:fm,updateFormRevisions:Sm,deleteFormRevision:ji,deleteFormRevisions:$i}=zi.actions,Ci=t=>t.formRevisionReducer.instances,as=o.createSelector([Ci],t=>Object.values(t)),Am=t=>s=>s.formRevisionReducer.instances[t],wm=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fb=S(o.createSelector([as,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Tm=S(o.createSelector([as,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Im=zi.reducer,Fe=F(t=>t.uuid),Om={instances:{}},Ui=o.createSlice({name:"forms",initialState:Om,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Om)),reducers:{initializeForms:Fe.initialize,addForm:Fe.addOne,addForms:Fe.addMany,setForm:Fe.setOne,setForms:Fe.setMany,updateForm:Fe.updateOne,updateForms:Fe.updateMany,deleteForm:Fe.deleteOne,deleteForms:Fe.deleteMany}}),{initializeForms:Fm,addForm:_m,addForms:gm,setForm:Pm,setForms:bm,updateForm:Rm,updateForms:Mm,deleteForm:km,deleteForms:Em}=Ui.actions,vm=Ui.reducer,Vm=t=>t.formReducer.instances,Li=o.createSelector([Vm],t=>Object.values(t)),Bm=t=>s=>s.formReducer.instances[t],Wm=S(o.createSelector([Li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Sb=S(o.createSelector([Li,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),_e=F(t=>t.uuid),zm={instances:{}},Ni=o.createSlice({name:"formSubmissionAttachments",initialState:zm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,zm)),reducers:{initializeFormSubmissionAttachments:_e.initialize,addFormSubmissionAttachment:_e.addOne,addFormSubmissionAttachments:_e.addMany,setFormSubmissionAttachment:_e.setOne,setFormSubmissionAttachments:_e.setMany,updateFormSubmissionAttachment:_e.updateOne,updateFormSubmissionAttachments:_e.updateMany,deleteFormSubmissionAttachment:_e.deleteOne,deleteFormSubmissionAttachments:_e.deleteMany}}),{initializeFormSubmissionAttachments:qm,addFormSubmissionAttachment:Dm,addFormSubmissionAttachments:Gi,setFormSubmissionAttachment:jm,setFormSubmissionAttachments:$m,updateFormSubmissionAttachment:Cm,updateFormSubmissionAttachments:Um,deleteFormSubmissionAttachment:Lm,deleteFormSubmissionAttachments:Hi}=Ni.actions,Ki=t=>t.formSubmissionAttachmentReducer.instances,Yi=o.createSelector([Ki],t=>Object.values(t)),Nm=S(o.createSelector([Ki,(t,s)=>s],(t,s)=>t[s])),Ji=S(o.createSelector([Yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Gm=Ji,Hm=S(o.createSelector([Yi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Km=Ni.reducer,ge=F(t=>t.uuid),Ym={instances:{}},Zi=o.createSlice({name:"formSubmissions",initialState:Ym,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ym)),reducers:{initializeFormSubmissions:ge.initialize,setFormSubmission:ge.setOne,setFormSubmissions:ge.setMany,addFormSubmission:ge.addOne,addFormSubmissions:ge.addMany,updateFormSubmission:ge.updateOne,updateFormSubmissions:ge.updateMany,deleteFormSubmission:ge.deleteOne,deleteFormSubmissions:ge.deleteMany}}),{initializeFormSubmissions:Jm,setFormSubmission:Zm,setFormSubmissions:Qm,addFormSubmission:Xm,addFormSubmissions:Qi,updateFormSubmission:xm,updateFormSubmissions:ey,deleteFormSubmission:ty,deleteFormSubmissions:Xi}=Zi.actions,xi=t=>t.formSubmissionReducer.instances,sy=o.createSelector([xi],t=>Object.values(t)),iy=t=>s=>s.formSubmissionReducer.instances[t],ny=S(o.createSelector([sy,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ay=S(o.createSelector([xi,Ci,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),cy=Zi.reducer,Pe=F(t=>t.uuid),ry={instances:{}},en=o.createSlice({name:"geoImages",initialState:ry,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ry)),reducers:{initializeGeoImages:Pe.initialize,setGeoImage:Pe.setOne,setGeoImages:Pe.setMany,addGeoImage:Pe.addOne,addGeoImages:Pe.addMany,updateGeoImage:Pe.updateOne,updateGeoImages:Pe.updateMany,deleteGeoImage:Pe.deleteOne,deleteGeoImages:Pe.deleteMany}}),{initializeGeoImages:dy,setGeoImage:ly,setGeoImages:uy,addGeoImage:oy,addGeoImages:hy,updateGeoImage:py,updateGeoImages:my,deleteGeoImage:yy,deleteGeoImages:fy}=en.actions,Sy=t=>t.geoImageReducer.instances,tn=o.createSelector([Sy],t=>Object.values(t)),Ay=t=>s=>s.geoImageReducer.instances[t],wy=S(o.createSelector([tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ab=S(o.createSelector([tn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Ty=en.reducer,be=F(t=>t.uuid),Iy={instances:{}},sn=o.createSlice({name:"issueAssociations",initialState:Iy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Iy)),reducers:{initializeIssueAssociations:be.initialize,addIssueAssociation:be.addOne,addIssueAssociations:be.addMany,setIssueAssociation:be.setOne,setIssueAssociations:be.setMany,updateIssueAssociation:be.updateOne,updateIssueAssociations:be.updateMany,deleteIssueAssociation:be.deleteOne,deleteIssueAssociations:be.deleteMany}}),{initializeIssueAssociations:Oy,setIssueAssociations:Fy,setIssueAssociation:_y,updateIssueAssociation:gy,updateIssueAssociations:Py,addIssueAssociation:by,addIssueAssociations:ft,deleteIssueAssociation:Ry,deleteIssueAssociations:St}=sn.actions,My=t=>t.issueAssociationReducer.instances,At=o.createSelector([My],t=>Object.values(t)),ky=t=>s=>s.issueAssociationReducer.instances[t],Ey=S(o.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vy=S(o.createSelector([At,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),Vy=S(o.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),By=S(o.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),Wy=S(o.createSelector([At,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),zy=S(o.createSelector([At,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),qy=sn.reducer,Re=F(t=>t.uuid),Dy={instances:{}},nn=o.createSlice({name:"issueAttachments",initialState:Dy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Dy)),reducers:{initializeIssueAttachments:Re.initialize,addIssueAttachment:Re.addOne,addIssueAttachments:Re.addMany,setIssueAttachment:Re.setOne,setIssueAttachments:Re.setMany,updateIssueAttachment:Re.updateOne,updateIssueAttachments:Re.updateMany,deleteIssueAttachment:Re.deleteOne,deleteIssueAttachments:Re.deleteMany}}),{initializeIssueAttachments:jy,addIssueAttachment:$y,addIssueAttachments:an,setIssueAttachment:Cy,setIssueAttachments:Uy,updateIssueAttachment:Ly,updateIssueAttachments:Ny,deleteIssueAttachment:Gy,deleteIssueAttachments:cn}=nn.actions,Hy=t=>t.issueAttachmentReducer.instances,rn=o.createSelector([Hy],t=>Object.values(t)),Ky=S(o.createSelector([rn,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Yy=t=>s=>s.issueAttachmentReducer.instances[t],Jy=S(o.createSelector([rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zy=nn.reducer,Me=F(t=>t.uuid),Qy={instances:{}},dn=o.createSlice({name:"issueCommentAttachments",initialState:Qy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Qy)),reducers:{initializeIssueCommentAttachments:Me.initialize,addIssueCommentAttachment:Me.addOne,addIssueCommentAttachments:Me.addMany,setIssueCommentAttachment:Me.setOne,setIssueCommentAttachments:Me.setMany,updateIssueCommentAttachment:Me.updateOne,updateIssueCommentAttachments:Me.updateMany,deleteIssueCommentAttachment:Me.deleteOne,deleteIssueCommentAttachments:Me.deleteMany}}),{initializeIssueCommentAttachments:Xy,addIssueCommentAttachment:xy,addIssueCommentAttachments:ef,setIssueCommentAttachment:tf,setIssueCommentAttachments:sf,updateIssueCommentAttachment:nf,updateIssueCommentAttachments:af,deleteIssueCommentAttachment:cf,deleteIssueCommentAttachments:rf}=dn.actions,df=t=>t.issueCommentAttachmentReducer.instances,ln=o.createSelector([df],t=>Object.values(t)),lf=t=>s=>s.issueCommentAttachmentReducer.instances[t],uf=S(o.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wb=S(o.createSelector([ln,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),of=dn.reducer,ke=F(t=>t.uuid),hf={instances:{}},un=o.createSlice({name:"issueComments",initialState:hf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,hf)),reducers:{initializeIssueComments:ke.initialize,addIssueComment:ke.addOne,addIssueComments:ke.addMany,setIssueComment:ke.setOne,setIssueComments:ke.setMany,updateIssueComment:ke.updateOne,updateIssueComments:ke.updateMany,deleteIssueComment:ke.deleteOne,deleteIssueComments:ke.deleteMany}}),{initializeIssueComments:pf,addIssueComment:mf,addIssueComments:yf,setIssueComment:ff,setIssueComments:Sf,updateIssueComment:Af,updateIssueComments:wf,deleteIssueComment:Tf,deleteIssueComments:If}=un.actions,on=t=>t.issueCommentReducer.instances,Of=t=>s=>s.issueCommentReducer.instances[t],Ff=S(o.createSelector([on,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),Tb=S(o.createSelector([on,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),_f=un.reducer,Ee=F(t=>t.uuid),gf={instances:{}},hn=o.createSlice({name:"issues",initialState:gf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,gf)),reducers:{initializeIssues:Ee.initialize,addIssue:Ee.addOne,addIssues:Ee.addMany,setIssue:Ee.setOne,setIssues:Ee.setMany,updateIssue:Ee.updateOne,updateIssues:Ee.updateMany,deleteIssue:Ee.deleteOne,deleteIssues:Ee.deleteMany}}),{initializeIssues:Pf,addIssue:bf,addIssues:pn,setIssue:Rf,setIssues:Mf,updateIssue:kf,updateIssues:Ef,deleteIssue:vf,deleteIssues:mn}=hn.actions,Vf=t=>t.issueReducer.instances,Vt=o.createSelector([Vf],t=>Object.values(t)),Bf=t=>s=>s.issueReducer.instances[t],Wf=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ib=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),zf=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),qf=hn.reducer,ve=F(t=>t.uuid),Df={instances:{}},yn=o.createSlice({name:"issueTypeAttachments",initialState:Df,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Df)),reducers:{initializeIssueTypeAttachments:ve.initialize,addIssueTypeAttachment:ve.addOne,addIssueTypeAttachments:ve.addMany,setIssueTypeAttachment:ve.setOne,setIssueTypeAttachments:ve.setMany,updateIssueTypeAttachment:ve.updateOne,updateIssueTypeAttachments:ve.updateMany,deleteIssueTypeAttachment:ve.deleteOne,deleteIssueTypeAttachments:ve.deleteMany}}),{initializeIssueTypeAttachments:jf,addIssueTypeAttachment:$f,addIssueTypeAttachments:Cf,setIssueTypeAttachment:Uf,setIssueTypeAttachments:Lf,updateIssueTypeAttachment:Nf,updateIssueTypeAttachments:Gf,deleteIssueTypeAttachment:Hf,deleteIssueTypeAttachments:Kf}=yn.actions,Yf=t=>t.issueTypeAttachmentReducer.instances,fn=o.createSelector([Yf],t=>Object.values(t)),Jf=t=>s=>s.issueTypeAttachmentReducer.instances[t],Zf=S(o.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ob=S(o.createSelector([fn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),Qf=yn.reducer,Ve=F(t=>t.uuid),Xf={instances:{}},Sn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:Xf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Xf)),reducers:{initializeIssueTypeFieldsAttachments:Ve.initialize,addIssueTypeFieldsAttachment:Ve.addOne,addIssueTypeFieldsAttachments:Ve.addMany,setIssueTypeFieldsAttachment:Ve.setOne,setIssueTypeFieldsAttachments:Ve.setMany,updateIssueTypeFieldsAttachment:Ve.updateOne,updateIssueTypeFieldsAttachments:Ve.updateMany,deleteIssueTypeFieldsAttachment:Ve.deleteOne,deleteIssueTypeFieldsAttachments:Ve.deleteMany}}),{initializeIssueTypeFieldsAttachments:xf,addIssueTypeFieldsAttachment:eS,addIssueTypeFieldsAttachments:tS,setIssueTypeFieldsAttachment:sS,setIssueTypeFieldsAttachments:iS,updateIssueTypeFieldsAttachment:nS,updateIssueTypeFieldsAttachments:aS,deleteIssueTypeFieldsAttachment:cS,deleteIssueTypeFieldsAttachments:rS}=Sn.actions,dS=t=>t.issueTypeFieldsAttachmentReducer.instances,An=o.createSelector([dS],t=>Object.values(t)),Fb=S(o.createSelector([An,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),lS=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],uS=S(o.createSelector([An,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),oS=Sn.reducer,Be=F(t=>t.uuid),hS={instances:{}},wn=o.createSlice({name:"issueTypeFieldValues",initialState:hS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,hS)),reducers:{initializeIssueTypeFieldValues:Be.initialize,addIssueTypeFieldValues:Be.addOne,addIssueTypeFieldValuesMany:Be.addMany,setIssueTypeFieldValues:Be.setOne,setIssueTypeFieldValuesMany:Be.setMany,updateIssueTypeFieldValues:Be.updateOne,updateIssueTypeFieldValuesMany:Be.updateMany,deleteIssueTypeFieldValues:Be.deleteOne,deleteIssueTypeFieldValuesMany:Be.deleteMany}}),{initializeIssueTypeFieldValues:pS,addIssueTypeFieldValues:mS,addIssueTypeFieldValuesMany:yS,setIssueTypeFieldValues:fS,setIssueTypeFieldValuesMany:SS,updateIssueTypeFieldValues:AS,updateIssueTypeFieldValuesMany:wS,deleteIssueTypeFieldValues:TS,deleteIssueTypeFieldValuesMany:IS}=wn.actions,OS=t=>t.issueTypeFieldValuesReducer.instances,cs=o.createSelector([OS],t=>Object.values(t)),_b=S(o.createSelector([cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),FS=t=>s=>s.issueTypeFieldValuesReducer.instances[t],_S=S(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gS=wn.reducer,We=F(t=>t.uuid),PS={instances:{}},Tn=o.createSlice({name:"issueTypeFields",initialState:PS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,PS)),reducers:{initializeIssueTypeFields:We.initialize,addIssueTypeFields:We.addOne,addIssueTypeFieldsMany:We.addMany,setIssueTypeFields:We.setOne,setIssueTypeFieldsMany:We.setMany,updateIssueTypeFields:We.updateOne,updateIssueTypeFieldsMany:We.updateMany,deleteIssueTypeFields:We.deleteOne,deleteIssueTypeFieldsMany:We.deleteMany}}),{initializeIssueTypeFields:bS,addIssueTypeFields:RS,addIssueTypeFieldsMany:MS,setIssueTypeFields:kS,setIssueTypeFieldsMany:ES,updateIssueTypeFields:vS,updateIssueTypeFieldsMany:VS,deleteIssueTypeFields:BS,deleteIssueTypeFieldsMany:WS}=Tn.actions,zS=t=>t.issueTypeFieldsReducer.instances,Bt=o.createSelector([zS],t=>Object.values(t)),gb=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),Pb=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),bb=S(o.createSelector([Bt,cs,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),qS=t=>s=>s.issueTypeFieldsReducer.instances[t],DS=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),jS=Tn.reducer,ze=F(t=>t.uuid),$S={instances:{}},In=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:$S,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,$S)),reducers:{initializeIssueTypeFieldValuesAttachments:ze.initialize,addIssueTypeFieldValuesAttachment:ze.addOne,addIssueTypeFieldValuesAttachments:ze.addMany,setIssueTypeFieldValuesAttachment:ze.setOne,setIssueTypeFieldValuesAttachments:ze.setMany,updateIssueTypeFieldValuesAttachment:ze.updateOne,updateIssueTypeFieldValuesAttachments:ze.updateMany,deleteIssueTypeFieldValuesAttachment:ze.deleteOne,deleteIssueTypeFieldValuesAttachments:ze.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:CS,addIssueTypeFieldValuesAttachment:US,addIssueTypeFieldValuesAttachments:On,setIssueTypeFieldValuesAttachment:LS,setIssueTypeFieldValuesAttachments:NS,updateIssueTypeFieldValuesAttachment:GS,updateIssueTypeFieldValuesAttachments:HS,deleteIssueTypeFieldValuesAttachment:KS,deleteIssueTypeFieldValuesAttachments:Fn}=In.actions,YS=t=>t.issueTypeFieldValuesAttachmentReducer.instances,_n=o.createSelector([YS],t=>Object.values(t)),JS=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],ZS=S(o.createSelector([_n,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QS=S(o.createSelector([_n,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),XS=In.reducer,qe=F(t=>t.uuid),xS={instances:{}},gn=o.createSlice({name:"issueTypeIdentifiers",initialState:xS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,xS)),reducers:{initializeIssueTypeIdentifiers:qe.initialize,addIssueTypeIdentifier:qe.addOne,addIssueTypeIdentifiers:qe.addMany,setIssueTypeIdentifier:qe.setOne,setIssueTypeIdentifiers:qe.setMany,updateIssueTypeIdentifier:qe.updateOne,updateIssueTypeIdentifiers:qe.updateMany,deleteIssueTypeIdentifier:qe.deleteOne,deleteIssueTypeIdentifiers:qe.deleteMany}}),{initializeIssueTypeIdentifiers:eA,addIssueTypeIdentifier:tA,addIssueTypeIdentifiers:sA,setIssueTypeIdentifier:iA,setIssueTypeIdentifiers:nA,updateIssueTypeIdentifier:aA,updateIssueTypeIdentifiers:cA,deleteIssueTypeIdentifier:rA,deleteIssueTypeIdentifiers:dA}=gn.actions,lA=t=>t.issueTypeIdentifierReducer.instances,Pn=o.createSelector([lA],t=>Object.values(t)),uA=t=>s=>s.issueTypeIdentifierReducer.instances[t],oA=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Rb=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),hA=gn.reducer,De=F(t=>t.uuid),pA={instances:{}},bn=o.createSlice({name:"issueTypeIdentifierValues",initialState:pA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,pA)),reducers:{initializeIssueTypeIdentifierValues:De.initialize,addIssueTypeIdentifierValue:De.addOne,addIssueTypeIdentifierValues:De.addMany,setIssueTypeIdentifierValue:De.setOne,setIssueTypeIdentifierValues:De.setMany,updateIssueTypeIdentifierValue:De.updateOne,updateIssueTypeIdentifierValues:De.updateMany,deleteIssueTypeIdentifierValue:De.deleteOne,deleteIssueTypeIdentifierValues:De.deleteMany}}),{initializeIssueTypeIdentifierValues:mA,addIssueTypeIdentifierValue:yA,addIssueTypeIdentifierValues:fA,setIssueTypeIdentifierValue:SA,setIssueTypeIdentifierValues:AA,updateIssueTypeIdentifierValue:wA,updateIssueTypeIdentifierValues:TA,deleteIssueTypeIdentifierValue:IA,deleteIssueTypeIdentifierValues:OA}=bn.actions,FA=t=>t.issueTypeIdentifierValueReducer.instances,rs=o.createSelector([FA],t=>Object.values(t)),_A=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],gA=S(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mb=S(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),kb=S(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),PA=bn.reducer,je=F(t=>t.uuid),bA={instances:{}},Rn=o.createSlice({name:"issueTypes",initialState:bA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,bA)),reducers:{initializeIssueTypes:je.initialize,addIssueType:je.addOne,addIssueTypes:je.addMany,setIssueType:je.setOne,setIssueTypes:je.setMany,updateIssueType:je.updateOne,updateIssueTypes:je.updateMany,deleteIssueType:je.deleteOne,deleteIssueTypes:je.deleteMany}}),{initializeIssueTypes:RA,addIssueType:MA,addIssueTypes:kA,setIssueType:EA,setIssueTypes:vA,updateIssueType:VA,updateIssueTypes:BA,deleteIssueType:WA,deleteIssueTypes:zA}=Rn.actions,qA=t=>t.issueTypeReducer.instances,Mn=o.createSelector(qA,t=>Object.values(t)),DA=t=>s=>s.issueTypeReducer.instances[t],jA=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Eb=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),$A=Rn.reducer,$e=F(t=>t.uuid),CA={instances:{}},kn=o.createSlice({name:"issueTypeStatuses",initialState:CA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,CA)),reducers:{initializeIssueTypeStatuses:$e.initialize,addIssueTypeStatus:$e.addOne,addIssueTypeStatuses:$e.addMany,setIssueTypeStatus:$e.setOne,setIssueTypeStatuses:$e.setMany,updateIssueTypeStatus:$e.updateOne,updateIssueTypeStatuses:$e.updateMany,deleteIssueTypeStatus:$e.deleteOne,deleteIssueTypeStatuses:$e.deleteMany}}),{initializeIssueTypeStatuses:UA,addIssueTypeStatus:LA,addIssueTypeStatuses:NA,setIssueTypeStatus:GA,setIssueTypeStatuses:HA,updateIssueTypeStatus:KA,updateIssueTypeStatuses:YA,deleteIssueTypeStatus:JA,deleteIssueTypeStatuses:ZA}=kn.actions,QA=t=>t.issueTypeStatusReducer.instances,En=o.createSelector([QA],t=>A(Object.values(t).toSorted(sc))),vn=t=>s=>s.issueTypeStatusReducer.instances[t],XA=S(o.createSelector([En,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vb=S(o.createSelector([En,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),xA=kn.reducer,Ce=F(t=>t.uuid),ew={instances:{}},Vn=o.createSlice({name:"issueUpdates",initialState:ew,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ew)),reducers:{initializeIssueUpdates:Ce.initialize,addIssueUpdate:Ce.addOne,addIssueUpdates:Ce.addMany,setIssueUpdate:Ce.setOne,setIssueUpdates:Ce.setMany,updateIssueUpdate:Ce.updateOne,updateIssueUpdates:Ce.updateMany,deleteIssueUpdate:Ce.deleteOne,deleteIssueUpdates:Ce.deleteMany}}),{initializeIssueUpdates:tw,addIssueUpdate:Bn,addIssueUpdates:Wn,setIssueUpdate:sw,setIssueUpdates:iw,updateIssueUpdate:nw,updateIssueUpdates:aw,deleteIssueUpdate:zn,deleteIssueUpdates:qn}=Vn.actions,Dn=t=>t.issueUpdateReducer.instances,jn=o.createSelector([Dn],t=>Object.values(t)),cw=S(o.createSelector([Dn,(t,s)=>s],(t,s)=>t[s])),rw=S(o.createSelector([jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dw=S(o.createSelector([jn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),lw=Vn.reducer,Ue=F(t=>t.id),uw={instances:{},currentUser:null},$n=o.createSlice({name:"users",initialState:uw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,uw)).addCase(_,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ue.initialize,setUsers:Ue.setMany,setUser:Ue.setOne,addUsers:Ue.addMany,addUser:Ue.addOne,updateUsers:Ue.updateMany,updateUser:Ue.updateOne,deleteUser:Ue.deleteOne,deleteUsers:Ue.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setCurrentUserProfile:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile=s.payload;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile=s.payload}}}),{initializeUsers:ow,setUsers:hw,setUser:pw,addUsers:mw,addUser:Cn,updateUsers:yw,updateUser:fw,deleteUser:Un,deleteUsers:Sw,setCurrentUser:Vb,setCurrentUserProfile:Bb}=$n.actions,Aw=$n.reducer,ww=t=>t.userReducer.currentUser,Ln=t=>t.userReducer.instances,ds=o.createSelector([Ln],t=>Object.values(t)),ls=t=>s=>s.userReducer.instances[t],Tw=S(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),Le=F(t=>t.uuid),Iw={instances:{}},Nn=o.createSlice({name:"organizationAccess",initialState:Iw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Iw)),reducers:{initializeOrganizationAccesses:Le.initialize,addOrganizationAccess:Le.addOne,addOrganizationAccesses:Le.addMany,setOrganizationAccess:Le.setOne,setOrganizationAccesses:Le.setMany,updateOrganizationAccess:Le.updateOne,updateOrganizationAccesses:Le.updateMany,deleteOrganizationAccess:Le.deleteOne,deleteOrganizationAccesses:Le.deleteMany}}),{initializeOrganizationAccesses:Ow,addOrganizationAccess:Fw,addOrganizationAccesses:_w,setOrganizationAccess:gw,setOrganizationAccesses:Pw,updateOrganizationAccess:bw,updateOrganizationAccesses:Rw,deleteOrganizationAccess:Mw,deleteOrganizationAccesses:kw}=Nn.actions,Ew=Nn.reducer,us=t=>t.organizationAccessReducer.instances,vw=t=>s=>s.organizationAccessReducer.instances[t],Vw=S(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),Wb=o.createSelector([ww,us],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),Bw=o.createSelector([us],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return Nt(s)}),zb=S(o.createSelector([Ln,Bw,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ne=F(t=>t.uuid),Ww={instances:{}},Gn=o.createSlice({name:"organizations",initialState:Ww,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ww)),reducers:{initializeOrganizations:Ne.initialize,setOrganizations:Ne.setMany,setOrganization:Ne.setOne,addOrganizations:Ne.addMany,addOrganization:Ne.addOne,updateOrganizations:Ne.updateMany,updateOrganization:Ne.updateOne,deleteOrganization:Ne.deleteOne,deleteOrganizations:Ne.deleteMany}}),{initializeOrganizations:zw,setOrganizations:qw,setOrganization:Dw,addOrganizations:jw,addOrganization:$w,updateOrganizations:Cw,updateOrganization:Uw,deleteOrganization:Lw,deleteOrganizations:Nw}=Gn.actions,Gw=t=>t.organizationReducer.instances,Hw=o.createSelector([Gw],t=>Object.values(t)),Kw=t=>s=>s.organizationReducer.instances[t],Yw=S(o.createSelector([Hw,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Jw=Gn.reducer,Zw=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:ht.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},Qw={deletedRequests:[],latestRetryTime:0},Hn=o.createSlice({name:"outbox",initialState:Qw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Qw)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t.url);const{BASE_URL:s,serviceName:e,...n}=t;return Zw(n,s,e)}},markForDeletion(t,s){t.deletedRequests.push(s.payload)},markAsDeleted(t,s){const e=t.deletedRequests.indexOf(s.payload);e!==-1&&t.deletedRequests.splice(e,1)},_setLatestRetryTime:(t,s)=>{t.latestRetryTime=s.payload}}}),qb=t=>t.outboxReducer.deletedRequests,Db=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Xw,markForDeletion:jb,markAsDeleted:xw,_setLatestRetryTime:eT}=Hn.actions,tT=Hn.reducer,Ge=F(t=>t.uuid),sT={instances:{}},Kn=o.createSlice({name:"projectAccess",initialState:sT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,sT)),reducers:{initializeProjectAccesses:Ge.initialize,addProjectAccess:Ge.addOne,addProjectAccesses:Ge.addMany,setProjectAccess:Ge.setOne,setProjectAccesses:Ge.setMany,updateProjectAccess:Ge.updateOne,updateProjectAccesses:Ge.updateMany,deleteProjectAccess:Ge.deleteOne,deleteProjectAccesses:Ge.deleteMany}}),{initializeProjectAccesses:iT,addProjectAccess:nT,addProjectAccesses:aT,setProjectAccess:cT,setProjectAccesses:rT,updateProjectAccess:dT,updateProjectAccesses:lT,deleteProjectAccess:uT,deleteProjectAccesses:oT}=Kn.actions,hT=Kn.reducer,Yn=t=>t.projectAccessReducer.instances,Wt=o.createSelector(Yn,t=>Object.values(t)),pT=t=>s=>s.projectAccessReducer.instances[t],mT=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$b=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),Cb=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),Ub=S(o.createSelector([ds,Wt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),He=F(t=>t.uuid),yT={instances:{}},Jn=o.createSlice({name:"projectAttachments",initialState:yT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,yT)),reducers:{initializeProjectAttachments:He.initialize,addProjectAttachment:He.addOne,addProjectAttachments:He.addMany,setProjectAttachment:He.setOne,setProjectAttachments:He.setMany,updateProjectAttachment:He.updateOne,updateProjectAttachments:He.updateMany,deleteProjectAttachment:He.deleteOne,deleteProjectAttachments:He.deleteMany}}),{initializeProjectAttachments:fT,addProjectAttachment:ST,addProjectAttachments:AT,setProjectAttachment:wT,setProjectAttachments:TT,updateProjectAttachment:IT,updateProjectAttachments:OT,deleteProjectAttachment:FT,deleteProjectAttachments:_T}=Jn.actions,gT=t=>t.projectAttachmentReducer.instances,Zn=o.createSelector([gT],t=>Object.values(t)),PT=t=>s=>s.projectAttachmentReducer.instances[t],bT=S(o.createSelector([Zn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Lb=S(o.createSelector([Zn,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),RT=Jn.reducer,Ke=F(t=>t.uuid),MT={instances:{}},Qn=o.createSlice({name:"projectFiles",initialState:MT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,MT)),reducers:{initializeProjectFiles:Ke.initialize,setProjectFile:Ke.setOne,setProjectFiles:Ke.setMany,addProjectFile:Ke.addOne,addProjectFiles:Ke.addMany,updateProjectFile:Ke.updateOne,updateProjectFiles:Ke.updateMany,deleteProjectFile:Ke.deleteOne,deleteProjectFiles:Ke.deleteMany}}),{initializeProjectFiles:kT,setProjectFile:ET,setProjectFiles:vT,addProjectFile:VT,addProjectFiles:BT,updateProjectFile:WT,updateProjectFiles:zT,deleteProjectFile:qT,deleteProjectFiles:DT}=Qn.actions,jT=t=>t.projectFileReducer.instances,$T=o.createSelector([jT],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),CT=t=>s=>s.projectFileReducer.instances[t],UT=S(o.createSelector([$T,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LT=Qn.reducer,Ye=F(t=>t.uuid),NT={instances:{}},Xn=o.createSlice({name:"projects",initialState:NT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,NT)),reducers:{initializeProjects:Ye.initialize,setProjects:Ye.setMany,setProject:Ye.setOne,addProjects:Ye.addMany,addProject:Ye.addOne,updateProjects:Ye.updateMany,updateProject:Ye.updateOne,deleteProject:Ye.deleteOne,deleteProjects:Ye.deleteMany}}),{initializeProjects:GT,setProjects:HT,setProject:KT,addProjects:YT,addProject:JT,updateProjects:ZT,updateProject:QT,deleteProject:XT,deleteProjects:xT}=Xn.actions,eI=Xn.reducer,tI=t=>t.projectReducer.instances,os=o.createSelector([tI],t=>Object.values(t)),sI=t=>s=>s.projectReducer.instances[t],iI=S(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nb=S(o.createSelector([os,Wt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return A(t.filter(a=>n.has(a.uuid)))})),Gb=S(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Hb={isRehydrated:!1},xn=o.createSlice({name:"rehydrated",initialState:Hb,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:Kb}=xn.actions,Yb=t=>t.rehydratedReducer.isRehydrated,nI=xn.reducer,Je=F(t=>t.uuid),aI={instances:{}},ea=o.createSlice({name:"teamMemberships",initialState:aI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,aI)),reducers:{initializeTeamMemberships:Je.initialize,addTeamMembership:Je.addOne,addTeamMemberships:Je.addMany,setTeamMembership:Je.setOne,setTeamMemberships:Je.setMany,updateTeamMembership:Je.updateOne,updateTeamMemberships:Je.updateMany,deleteTeamMembership:Je.deleteOne,deleteTeamMemberships:Je.deleteMany}}),{initializeTeamMemberships:cI,addTeamMembership:rI,addTeamMemberships:dI,setTeamMembership:lI,setTeamMemberships:uI,updateTeamMembership:oI,updateTeamMemberships:hI,deleteTeamMembership:pI,deleteTeamMemberships:mI}=ea.actions,yI=ea.reducer,fI=t=>t.teamMembershipReducer.instances,hs=o.createSelector([fI],t=>Object.values(t)),SI=t=>s=>s.teamMembershipReducer.instances[t],AI=S(o.createSelector([hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Jb=S(o.createSelector([hs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),Zb=S(o.createSelector([ds,hs,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),Ze=F(t=>t.uuid),wI={instances:{}},ta=o.createSlice({name:"teams",initialState:wI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,wI)),reducers:{initializeTeams:Ze.initialize,addTeam:Ze.addOne,addTeams:Ze.addMany,setTeam:Ze.setOne,setTeams:Ze.setMany,updateTeam:Ze.updateOne,updateTeams:Ze.updateMany,deleteTeam:Ze.deleteOne,deleteTeams:Ze.deleteMany}}),{initializeTeams:TI,addTeam:II,addTeams:OI,setTeam:FI,setTeams:_I,updateTeam:gI,updateTeams:PI,deleteTeam:bI,deleteTeams:RI}=ta.actions,MI=t=>t.teamReducer.instances,sa=o.createSelector([MI],t=>Object.values(t)),kI=t=>s=>s.teamReducer.instances[t],EI=S(o.createSelector([sa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Qb=S(o.createSelector([sa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),vI=ta.reducer,Xb={version:0},VI=o.createSlice({name:"versioning",initialState:Xb,reducers:{}}),BI=VI.reducer,Qe=F(t=>t.uuid),WI={instances:{}},ia=o.createSlice({name:"workflows",initialState:WI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,WI)),reducers:{initializeWorkflows:Qe.initialize,addWorkflow:Qe.addOne,addWorkflows:Qe.addMany,setWorkflow:Qe.setOne,setWorkflows:Qe.setMany,updateWorkflow:Qe.updateOne,updateWorkflows:Qe.updateMany,deleteWorkflow:Qe.deleteOne,deleteWorkflows:Qe.deleteMany}}),{initializeWorkflows:zI,addWorkflow:qI,addWorkflows:DI,setWorkflow:jI,setWorkflows:$I,updateWorkflow:CI,updateWorkflows:UI,deleteWorkflow:LI,deleteWorkflows:NI}=ia.actions,GI=t=>t.workflowReducer.instances,zt=o.createSelector([GI],t=>Object.values(t)),HI=t=>s=>s.workflowReducer.instances[t],KI=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xb=S(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),eR=S(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),YI=ia.reducer,Xe=F(t=>t.uuid),JI={instances:{}},na=o.createSlice({name:"workflowIssueLinks",initialState:JI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,JI)),reducers:{initializeWorkflowIssueLinks:Xe.initialize,addWorkflowIssueLink:Xe.addOne,addWorkflowIssueLinks:Xe.addMany,setWorkflowIssueLink:Xe.setOne,setWorkflowIssueLinks:Xe.setMany,updateWorkflowIssueLink:Xe.updateOne,updateWorkflowIssueLinks:Xe.updateMany,deleteWorkflowIssueLink:Xe.deleteOne,deleteWorkflowIssueLinks:Xe.deleteMany}}),{initializeWorkflowIssueLinks:ZI,addWorkflowIssueLink:QI,addWorkflowIssueLinks:XI,setWorkflowIssueLink:xI,setWorkflowIssueLinks:eO,updateWorkflowIssueLink:tO,updateWorkflowIssueLinks:sO,deleteWorkflowIssueLink:iO,deleteWorkflowIssueLinks:nO}=na.actions,aO=t=>t.workflowIssueLinkReducer.instances,pt=o.createSelector([aO],t=>Object.values(t)),cO=t=>s=>s.workflowIssueLinkReducer.instances[t],rO=S(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),sR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),iR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),nR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),aR=S(o.createSelector([pt,Vt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(({workflow:a})=>a===e).map(({issue:a})=>a));return A(s.filter(({uuid:a})=>n.has(a)))})),cR=S(o.createSelector([pt,zt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(({issue:a})=>a===e).map(({workflow:a})=>a));return A(s.filter(({uuid:a})=>n.has(a)))})),dO=na.reducer,xe=F(t=>t.uuid),lO={instances:{}},aa=o.createSlice({name:"workflowStepAssignees",initialState:lO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lO)),reducers:{initializeWorkflowStepAssignees:xe.initialize,addWorkflowStepAssignee:xe.addOne,addWorkflowStepAssignees:xe.addMany,setWorkflowStepAssignee:xe.setOne,setWorkflowStepAssignees:xe.setMany,updateWorkflowStepAssignee:xe.updateOne,updateWorkflowStepAssignees:xe.updateMany,deleteWorkflowStepAssignee:xe.deleteOne,deleteWorkflowStepAssignees:xe.deleteMany}}),{initializeWorkflowStepAssignees:uO,addWorkflowStepAssignee:oO,addWorkflowStepAssignees:hO,setWorkflowStepAssignee:pO,setWorkflowStepAssignees:mO,updateWorkflowStepAssignee:yO,updateWorkflowStepAssignees:fO,deleteWorkflowStepAssignee:SO,deleteWorkflowStepAssignees:AO}=aa.actions,wO=t=>t.workflowStepAssigneeReducer.instances,qt=o.createSelector([wO],t=>Object.values(t)),TO=t=>s=>s.workflowStepAssigneeReducer.instances[t],IO=S(o.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),dR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),lR=S(o.createSelector([qt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),OO=aa.reducer,et=F(t=>t.uuid),FO={instances:{}},ca=o.createSlice({name:"workflowStepComments",initialState:FO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,FO)),reducers:{initializeWorkflowStepComments:et.initialize,addWorkflowStepComment:et.addOne,addWorkflowStepComments:et.addMany,setWorkflowStepComment:et.setOne,setWorkflowStepComments:et.setMany,updateWorkflowStepComment:et.updateOne,updateWorkflowStepComments:et.updateMany,deleteWorkflowStepComment:et.deleteOne,deleteWorkflowStepComments:et.deleteMany}}),{initializeWorkflowStepComments:_O,addWorkflowStepComment:gO,addWorkflowStepComments:PO,setWorkflowStepComment:bO,setWorkflowStepComments:RO,updateWorkflowStepComment:MO,updateWorkflowStepComments:kO,deleteWorkflowStepComment:EO,deleteWorkflowStepComments:vO}=ca.actions,VO=t=>t.workflowStepCommentReducer.instances,Dt=o.createSelector([VO],t=>Object.values(t)),BO=t=>s=>s.workflowStepCommentReducer.instances[t],WO=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uR=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),oR=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),hR=S(o.createSelector([Dt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),zO=ca.reducer,tt=F(t=>t.uuid),qO={instances:{}},ra=o.createSlice({name:"workflowStepEvents",initialState:qO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,qO)),reducers:{initializeWorkflowStepEvents:tt.initialize,addWorkflowStepEvent:tt.addOne,addWorkflowStepEvents:tt.addMany,setWorkflowStepEvent:tt.setOne,setWorkflowStepEvents:tt.setMany,updateWorkflowStepEvent:tt.updateOne,updateWorkflowStepEvents:tt.updateMany,deleteWorkflowStepEvent:tt.deleteOne,deleteWorkflowStepEvents:tt.deleteMany}}),{initializeWorkflowStepEvents:DO,addWorkflowStepEvent:jO,addWorkflowStepEvents:$O,setWorkflowStepEvent:CO,setWorkflowStepEvents:UO,updateWorkflowStepEvent:LO,updateWorkflowStepEvents:NO,deleteWorkflowStepEvent:GO,deleteWorkflowStepEvents:HO}=ra.actions,KO=t=>t.workflowStepEventReducer.instances,jt=o.createSelector([KO],t=>Object.values(t)),YO=t=>s=>s.workflowStepEventReducer.instances[t],JO=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pR=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),mR=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),yR=S(o.createSelector([jt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),ZO=ra.reducer,st=F(t=>t.uuid),QO={instances:{}},da=o.createSlice({name:"workflowStepFieldsAttachments",initialState:QO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,QO)),reducers:{initializeWorkflowStepFieldsAttachments:st.initialize,addWorkflowStepFieldsAttachment:st.addOne,addWorkflowStepFieldsAttachments:st.addMany,setWorkflowStepFieldsAttachment:st.setOne,setWorkflowStepFieldsAttachments:st.setMany,updateWorkflowStepFieldsAttachment:st.updateOne,updateWorkflowStepFieldsAttachments:st.updateMany,deleteWorkflowStepFieldsAttachment:st.deleteOne,deleteWorkflowStepFieldsAttachments:st.deleteMany}}),{initializeWorkflowStepFieldsAttachments:XO,addWorkflowStepFieldsAttachment:xO,addWorkflowStepFieldsAttachments:la,setWorkflowStepFieldsAttachment:eF,setWorkflowStepFieldsAttachments:tF,updateWorkflowStepFieldsAttachment:sF,updateWorkflowStepFieldsAttachments:iF,deleteWorkflowStepFieldsAttachment:nF,deleteWorkflowStepFieldsAttachments:ua}=da.actions,aF=t=>t.workflowStepFieldsAttachmentReducer.instances,oa=o.createSelector([aF],t=>Object.values(t)),cF=S(o.createSelector([oa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),rF=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],dF=S(o.createSelector([oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lF=da.reducer,it=F(t=>t.uuid),uF={instances:{}},ha=o.createSlice({name:"workflowStepFields",initialState:uF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,uF)),reducers:{initializeWorkflowStepFields:it.initialize,addWorkflowStepFields:it.addOne,addWorkflowStepFieldsMany:it.addMany,setWorkflowStepFields:it.setOne,setWorkflowStepFieldsMany:it.setMany,updateWorkflowStepFields:it.updateOne,updateWorkflowStepFieldsMany:it.updateMany,deleteWorkflowStepFields:it.deleteOne,deleteWorkflowStepFieldsMany:it.deleteMany}}),{initializeWorkflowStepFields:oF,addWorkflowStepFields:hF,addWorkflowStepFieldsMany:pF,setWorkflowStepFields:mF,setWorkflowStepFieldsMany:yF,updateWorkflowStepFields:fF,updateWorkflowStepFieldsMany:SF,deleteWorkflowStepFields:AF,deleteWorkflowStepFieldsMany:wF}=ha.actions,TF=t=>t.workflowStepFieldsReducer.instances,ps=o.createSelector([TF],t=>Object.values(t)),fR=S(o.createSelector([ps,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),SR=S(o.createSelector([ps,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),IF=t=>s=>s.workflowStepFieldsReducer.instances[t],OF=S(o.createSelector([ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FF=ha.reducer,nt=F(t=>t.uuid),_F={instances:{}},pa=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:_F,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,_F)),reducers:{initializeWorkflowStepFieldValuesAttachments:nt.initialize,addWorkflowStepFieldValuesAttachment:nt.addOne,addWorkflowStepFieldValuesAttachments:nt.addMany,setWorkflowStepFieldValuesAttachment:nt.setOne,setWorkflowStepFieldValuesAttachments:nt.setMany,updateWorkflowStepFieldValuesAttachment:nt.updateOne,updateWorkflowStepFieldValuesAttachments:nt.updateMany,deleteWorkflowStepFieldValuesAttachment:nt.deleteOne,deleteWorkflowStepFieldValuesAttachments:nt.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:gF,addWorkflowStepFieldValuesAttachment:PF,addWorkflowStepFieldValuesAttachments:ma,setWorkflowStepFieldValuesAttachment:bF,setWorkflowStepFieldValuesAttachments:RF,updateWorkflowStepFieldValuesAttachment:MF,updateWorkflowStepFieldValuesAttachments:kF,deleteWorkflowStepFieldValuesAttachment:EF,deleteWorkflowStepFieldValuesAttachments:ya}=pa.actions,vF=t=>t.workflowStepFieldValuesAttachmentReducer.instances,fa=o.createSelector([vF],t=>Object.values(t)),VF=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],BF=S(o.createSelector([fa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WF=S(o.createSelector([fa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),zF=pa.reducer,at=F(t=>t.uuid),qF={instances:{}},Sa=o.createSlice({name:"workflowStepFieldValues",initialState:qF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,qF)),reducers:{initializeWorkflowStepFieldValues:at.initialize,addWorkflowStepFieldValues:at.addOne,addWorkflowStepFieldValuesMany:at.addMany,setWorkflowStepFieldValues:at.setOne,setWorkflowStepFieldValuesMany:at.setMany,updateWorkflowStepFieldValues:at.updateOne,updateWorkflowStepFieldValuesMany:at.updateMany,deleteWorkflowStepFieldValues:at.deleteOne,deleteWorkflowStepFieldValuesMany:at.deleteMany}}),{initializeWorkflowStepFieldValues:DF,addWorkflowStepFieldValues:jF,addWorkflowStepFieldValuesMany:$F,setWorkflowStepFieldValues:CF,setWorkflowStepFieldValuesMany:UF,updateWorkflowStepFieldValues:LF,updateWorkflowStepFieldValuesMany:NF,deleteWorkflowStepFieldValues:GF,deleteWorkflowStepFieldValuesMany:HF}=Sa.actions,KF=t=>t.workflowStepFieldValuesReducer.instances,mt=o.createSelector([KF],t=>Object.values(t)),AR=S(o.createSelector([mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),wR=S(o.createSelector([mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),YF=t=>s=>s.workflowStepFieldValuesReducer.instances[t],JF=S(o.createSelector([mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),TR=S(o.createSelector([mt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),IR=S(o.createSelector([mt,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{workflow:a,workflow_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),ZF=Sa.reducer,ct=F(t=>t.uuid),QF={instances:{}},Aa=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:QF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,QF)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:ct.initialize,addWorkflowStepFieldValuesReviewRequest:ct.addOne,addWorkflowStepFieldValuesReviewRequests:ct.addMany,setWorkflowStepFieldValuesReviewRequest:ct.setOne,setWorkflowStepFieldValuesReviewRequests:ct.setMany,updateWorkflowStepFieldValuesReviewRequest:ct.updateOne,updateWorkflowStepFieldValuesReviewRequests:ct.updateMany,deleteWorkflowStepFieldValuesReviewRequest:ct.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:ct.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:XF,addWorkflowStepFieldValuesReviewRequest:xF,addWorkflowStepFieldValuesReviewRequests:wa,setWorkflowStepFieldValuesReviewRequest:e_,setWorkflowStepFieldValuesReviewRequests:t_,updateWorkflowStepFieldValuesReviewRequest:s_,updateWorkflowStepFieldValuesReviewRequests:i_,deleteWorkflowStepFieldValuesReviewRequest:n_,deleteWorkflowStepFieldValuesReviewRequests:Ta}=Aa.actions,a_=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,$t=o.createSelector([a_],t=>Object.values(t)),c_=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],r_=S(o.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),d_=S(o.createSelector([$t,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),OR=S(o.createSelector([$t,(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})),FR=S(o.createSelector([mt,$t,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),l_=Aa.reducer,rt=F(t=>t.uuid),u_={instances:{}},Ia=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:u_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,u_)),reducers:{initializeWorkflowStepFieldValuesReviews:rt.initialize,addWorkflowStepFieldValuesReview:rt.addOne,addWorkflowStepFieldValuesReviews:rt.addMany,setWorkflowStepFieldValuesReview:rt.setOne,setWorkflowStepFieldValuesReviews:rt.setMany,updateWorkflowStepFieldValuesReview:rt.updateOne,updateWorkflowStepFieldValuesReviews:rt.updateMany,deleteWorkflowStepFieldValuesReview:rt.deleteOne,deleteWorkflowStepFieldValuesReviews:rt.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:o_,addWorkflowStepFieldValuesReview:h_,addWorkflowStepFieldValuesReviews:Oa,setWorkflowStepFieldValuesReview:p_,setWorkflowStepFieldValuesReviews:m_,updateWorkflowStepFieldValuesReview:y_,updateWorkflowStepFieldValuesReviews:f_,deleteWorkflowStepFieldValuesReview:S_,deleteWorkflowStepFieldValuesReviews:Fa}=Ia.actions,A_=t=>t.workflowStepFieldValuesReviewReducer.instances,Ft=o.createSelector([A_],t=>Object.values(t)),w_=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],T_=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),I_=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),_R=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),gR=S(o.createSelector([mt,Ft,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),PR=o.createSelector([Ft],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),O_=Ia.reducer,dt=F(t=>t.uuid),F_={instances:{}},_a=o.createSlice({name:"workflowStepReviewers",initialState:F_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,F_)),reducers:{initializeWorkflowStepReviewers:dt.initialize,addWorkflowStepReviewer:dt.addOne,addWorkflowStepReviewers:dt.addMany,setWorkflowStepReviewer:dt.setOne,setWorkflowStepReviewers:dt.setMany,updateWorkflowStepReviewer:dt.updateOne,updateWorkflowStepReviewers:dt.updateMany,deleteWorkflowStepReviewer:dt.deleteOne,deleteWorkflowStepReviewers:dt.deleteMany}}),{initializeWorkflowStepReviewers:__,addWorkflowStepReviewer:g_,addWorkflowStepReviewers:P_,setWorkflowStepReviewer:b_,setWorkflowStepReviewers:R_,updateWorkflowStepReviewer:M_,updateWorkflowStepReviewers:k_,deleteWorkflowStepReviewer:E_,deleteWorkflowStepReviewers:v_}=_a.actions,V_=t=>t.workflowStepReviewerReducer.instances,Ct=o.createSelector([V_],t=>Object.values(t)),B_=t=>s=>s.workflowStepReviewerReducer.instances[t],W_=S(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bR=S(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),RR=S(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),MR=S(o.createSelector([Ct,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),z_=_a.reducer,lt=F(t=>t.uuid),q_={instances:{}},ga=o.createSlice({name:"workflowSteps",initialState:q_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,q_)),reducers:{initializeWorkflowSteps:lt.initialize,addWorkflowStep:lt.addOne,addWorkflowSteps:lt.addMany,setWorkflowStep:lt.setOne,setWorkflowSteps:lt.setMany,updateWorkflowStep:lt.updateOne,updateWorkflowSteps:lt.updateMany,deleteWorkflowStep:lt.deleteOne,deleteWorkflowSteps:lt.deleteMany}}),{initializeWorkflowSteps:D_,addWorkflowStep:j_,addWorkflowSteps:$_,setWorkflowStep:C_,setWorkflowSteps:U_,updateWorkflowStep:L_,updateWorkflowSteps:N_,deleteWorkflowStep:G_,deleteWorkflowSteps:H_}=ga.actions,K_=t=>t.workflowStepReducer.instances,Pa=o.createSelector([K_],t=>Object.values(t)),Y_=t=>s=>s.workflowStepReducer.instances[t],J_=S(o.createSelector([Pa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kR=S(o.createSelector([Pa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),Z_=ga.reducer,ut=F(t=>t.uuid),Q_={instances:{}},ba=o.createSlice({name:"workflowTypes",initialState:Q_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Q_)),reducers:{initializeWorkflowTypes:ut.initialize,addWorkflowType:ut.addOne,addWorkflowTypes:ut.addMany,setWorkflowType:ut.setOne,setWorkflowTypes:ut.setMany,updateWorkflowType:ut.updateOne,updateWorkflowTypes:ut.updateMany,deleteWorkflowType:ut.deleteOne,deleteWorkflowTypes:ut.deleteMany}}),{initializeWorkflowTypes:X_,addWorkflowType:x_,addWorkflowTypes:eg,setWorkflowType:tg,setWorkflowTypes:sg,updateWorkflowType:ig,updateWorkflowTypes:ng,deleteWorkflowType:ag,deleteWorkflowTypes:cg}=ba.actions,rg=t=>t.workflowTypeReducer.instances,Ra=o.createSelector([rg],t=>Object.values(t)),dg=t=>s=>s.workflowTypeReducer.instances[t],lg=S(o.createSelector([Ra,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ER=S(o.createSelector([Ra,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ug=ba.reducer,Ma={outboxReducer:tT,fileReducer:Fp,authReducer:vh},vR=o.combineReducers(Ma),og={...Ma,[kt]:BI,assetReducer:Dl,assetAttachmentReducer:Fc,assetStageCompletionReducer:Jl,assetStageReducer:uu,assetTypeReducer:yh,assetTypeAttachmentReducer:gu,issueReducer:qf,issueAttachmentReducer:Zy,issueTypeReducer:$A,issueTypeAttachmentReducer:Qf,organizationReducer:Jw,projectReducer:eI,projectAttachmentReducer:RT,projectAccessReducer:hT,organizationAccessReducer:Ew,projectFileReducer:LT,rehydratedReducer:nI,formReducer:vm,formRevisionReducer:Im,formRevisionAttachmentReducer:om,formSubmissionAttachmentReducer:Km,formSubmissionReducer:cy,formIdentifierReducer:qp,formIdentifierValueReducer:Qp,userReducer:Aw,emailDomainsReducer:Tp,documentsReducer:ip,documentAttachmentReducer:Hh,teamReducer:vI,agentsReducer:uc,issueCommentReducer:_f,issueCommentAttachmentReducer:of,issueUpdateReducer:lw,geoImageReducer:Ty,issueAssociationReducer:qy,issueTypeFieldsReducer:jS,issueTypeFieldValuesReducer:gS,issueTypeFieldsAttachmentReducer:oS,issueTypeFieldValuesAttachmentReducer:XS,issueTypeIdentifierReducer:hA,issueTypeIdentifierValueReducer:PA,issueTypeStatusReducer:xA,assetTypeFieldsReducer:xu,assetTypeFieldValuesReducer:bo,assetTypeFieldsAttachmentReducer:ju,assetTypeFieldValuesAttachmentReducer:po,assetTypeIdentifierReducer:Co,assetTypeIdentifierValueReducer:th,assetTypeStatusReducer:Mh,assetProcedureTypeReducer:dd,assetProcedureReducer:Kr,assetProcedureTypeFieldsReducer:dr,assetProcedureTypeFieldValuesReducer:Wr,assetProcedureTypeFieldsAttachmentReducer:Yc,assetProcedureTypeFieldValuesAttachmentReducer:Tr,assetProcedureTypeAttachmentReducer:Bc,assetProcedureStepFieldsAttachmentReducer:gd,assetProcedureStepFieldsReducer:Dd,assetProcedureStepFieldValuesAttachmentReducer:Qd,assetProcedureStepFieldValuesReducer:ol,assetProcedureStepReducer:Ol,teamMembershipReducer:yI,workflowTypeReducer:ug,workflowStepReducer:Z_,workflowStepFieldsReducer:FF,workflowStepFieldsAttachmentReducer:lF,workflowReducer:YI,workflowIssueLinkReducer:dO,workflowStepAssigneeReducer:OO,workflowStepCommentReducer:zO,workflowStepEventReducer:ZO,workflowStepFieldValuesReducer:ZF,workflowStepFieldValuesAttachmentReducer:zF,workflowStepFieldValuesReviewReducer:O_,workflowStepFieldValuesReviewRequestReducer:l_,workflowStepReviewerReducer:z_},VR=o.combineReducers(og),hg=1e4,pg=200,ka=[400,409,403,404,405,500],ot=1e4,mg={};class yg{constructor(s){m(this,"client");m(this,"pageSize",hg);mg[this.constructor.name]=this,this.client=s}async performRequest(s,e){return this.client.performRequest(this.host,s,this,e)}async enqueueRequest(s){return this.client.enqueueRequest(s,this.host,this.constructor.name)}async performPagination(s,e){return this.client.performPagination(this.host,s,this.pageSize,this,e)}dispatch(s){this.client.store.dispatch(s)}}const fg=()=>wg.length-1,Sg=t=>(t[kt]={version:fg()},t),Ag=()=>Sg({}),BR=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),WR=t=>s=>{var e;return s===void 0&&(s={}),((e=s[kt])==null?void 0:e.version)===fg()?s:t(s)},wg=[Sg,Ag,Ag,BR],zR=Object.fromEntries(wg.map((t,s)=>[s,WR(t)])),qR=t=>{if(t)throw t;const s=Pt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},Tg=(t,s,e)=>{const n=It();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},Ig=(t,s,e)=>{const n=It();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=s.meta.offlineAction.payload.uuid;return n.remove(c),n.getQueue()};async function DR(t,s){if(!s.payload)throw new Error("Received empty payload");return Bg(s)}const jR={...qa,effect:DR,discard:Fg,returnPromises:!0,persistCallback:qR,retry:LR,persistOptions:{storage:Cg},queue:{...qa.queue,enqueue:Tg,dequeue:Ig,peek:(...t)=>UR(...t)}},$R=Ug(zR,kt),CR=o.compose($g.offline(jR),$R);async function Og(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=mg[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return va(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function Fg(t,s,e=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
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,It,ht,Cg,Ug,Da,Lt,Lg,ja,Ng,Gg,gk,Pk,Hg,Kg,Yg){"use strict";var Fk=Object.defineProperty;var _k=(i,U,o)=>U in i?Fk(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var m=(i,U,o)=>_k(i,typeof U!="symbol"?U+"":U,o);var jg;const $a=Object.freeze([]),Ca=Object.freeze({});var Ua=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(Ua||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),La=(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))(La||{}),Na=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Na||{}),Ss=(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))(Ss||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),Ga=(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))(Ga||{}),Ha=(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))(Ha||{}),Ot=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Ot||{}),Mt=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(Mt||{});const Jg=Ss.MEDIUM,Ka=6e4,Zg=[Mt.APPROVED,Mt.REJECTED,Mt.CHANGES_REQUESTED],Qg=[Ot.ACTIVE,Ot.COMPLETED,Ot.CANCELLED],Xg=Ot.ACTIVE;function F(t){return{addOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},addMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},setOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},setMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},updateOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},updateMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const f of y.payload)delete p.instances[f]},initialize:(p,y)=>{p.instances={};const f=new Set;for(const T of y.payload){const P=t(T);f.add(P),p.instances[P]=T}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function xg(){return{initializeSelection:(l,u)=>{l.selection=Array.from(new Set(u.payload))},selectOne:(l,u)=>{new Set(l.selection).has(u.payload)||l.selection.push(u.payload)},selectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)||p.add(y);l.selection=Array.from(p)},unselectOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)&&(p.delete(u.payload),l.selection=Array.from(p))},unselectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)&&p.delete(y);l.selection=Array.from(p)},toggleOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)?p.delete(u.payload):p.add(u.payload),l.selection=Array.from(p)},toggleMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)?p.delete(y):p.add(y);l.selection=Array.from(p)},getInitialState:l=>({...l,selection:[]})}}const kt="versioning",I=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),_=o.createAction("RESET_ORGANIZATION_STATE");function eP(t,s){return Cg.useMemo(t,s)}jg=Symbol.toStringTag;class As{constructor(){m(this,jg,"Promise");m(this,"_promise");m(this,"_resolve");m(this,"_reject");m(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let ws=!1;["true","1"].includes("".toLowerCase())&&(ws=!0);function tP(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 Ts(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ws&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ws&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function sP(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?$a:t,Nt=t=>Object.keys(t).length===0?Ca:t,Ya=Ts(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Is.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),iP=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),nP=1e3*86400,Is=new Date,aP=t=>new Date(t).toDateString()===Is.toDateString(),cP=Ts((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Is.getTime())/nP);return n<s||n>e?Ya(t):iP.format(n,"days")});function rP(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Gt(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=rP(c);s(r)})},n.readAsArrayBuffer(t)})}const dP=(t,s)=>`${t}${s?`.${s}`:""}`;function lP(t,s){return new File([t],s,{type:t.type})}function Ja(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Za=async t=>(await fetch(t)).blob(),Qa=async(t,s)=>{const e=await Za(t);return new File([e],s,{type:e.type})};function uP(t){const s=new Blob([t]);Ug.saveAs(s,t.name)}function Xa(t){return typeof t=="string"&&t.startsWith("blob:")}function oP(t){return t.type.startsWith("image/")}const xa={};function hP(t,s,e,...n){const a=xa[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(xa[t]={[s]:!0},c=!0),c&&console[e](...n)}const ec=["created_at","updated_at","index","revision"];function O(t){return{...t,uuid:ht.v4()}}function pP(t){const s={};for(const e of t)s[e.uuid]=e;return s}function v(t){return t.map(({uuid:s})=>s)}function Ht(t,s){return t.localeCompare(s)}function Os(t,s){return Ht(t.uuid,s.uuid)}function mP(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 yP(t){return t.toLowerCase().replace(" ","-")}function fP(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function SP(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const AP=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[...ec,"created_by"])e in s&&delete s[e];return s}const tc=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Da(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},wP=t=>{const{roots:s}=tc(t);return s.map(e=>new Lt.Tree(e))},sc=(t,s)=>{const{nodes:e}=tc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Lt.Tree(n)},ic=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,nc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,ac=t=>Da(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),TP=t=>{const{roots:s}=ac(t);return s.map(e=>new Lt.Tree(e))},cc=(t,s)=>{const{nodes:e}=ac(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Lt.Tree(n)};class IP{constructor(s){m(this,"operations",[]);m(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return o.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return o.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return o.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return o.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return o.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return o.createSelector([this.getData],s=>A(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),N=F(t=>t.uuid),rc={instances:{}},Fs=o.createSlice({name:"agents",initialState:rc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,rc)),reducers:{initializeConversations:N.initialize,addConversation:N.addOne,addConversations:N.addMany,setConversation:N.setOne,setConversations:N.setMany,updateConversation:N.updateOne,updateConversations:N.updateMany,deleteConversation:N.deleteOne,deleteConversations:N.deleteMany}}),{initializeConversations:dc,addConversation:lc,addConversations:OP,setConversation:uc,setConversations:FP,updateConversation:oc,updateConversations:_P,deleteConversation:gP,deleteConversations:PP}=Fs.actions,_s=t=>t.agentsReducer.instances,bP=o.createSelector([_s],t=>Object.values(t)),RP=S(o.createSelector([_s,(t,s)=>s],(t,s)=>t[s])),hc=Fs.reducer,G=F(t=>t.uuid),pc={instances:{}},gs=o.createSlice({name:"assetAttachments",initialState:pc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,pc)),reducers:{initializeAssetAttachments:G.initialize,addAssetAttachment:G.addOne,addAssetAttachments:G.addMany,setAssetAttachment:G.setOne,setAssetAttachments:G.setMany,updateAssetAttachment:G.updateOne,updateAssetAttachments:G.updateMany,deleteAssetAttachment:G.deleteOne,deleteAssetAttachments:G.deleteMany}}),{initializeAssetAttachments:mc,addAssetAttachment:yc,addAssetAttachments:Ps,setAssetAttachment:fc,setAssetAttachments:Sc,updateAssetAttachment:Ac,updateAssetAttachments:wc,deleteAssetAttachment:Tc,deleteAssetAttachments:bs}=gs.actions,Ic=t=>t.assetAttachmentReducer.instances,Rs=o.createSelector([Ic],t=>Object.values(t)),Oc=t=>s=>s.assetAttachmentReducer.instances[t],Fc=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_c=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),gc=gs.reducer,H=F(({uuid:t})=>t),Pc={instances:{}},Ms=o.createSlice({name:"assetProcedureTypeAttachments",initialState:Pc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Pc)),reducers:{initializeAssetProcedureTypeAttachments:H.initialize,addAssetProcedureTypeAttachment:H.addOne,addAssetProcedureTypeAttachments:H.addMany,setAssetProcedureTypeAttachment:H.setOne,setAssetProcedureTypeAttachments:H.setMany,updateAssetProcedureTypeAttachment:H.updateOne,updateAssetProcedureTypeAttachments:H.updateMany,deleteAssetProcedureTypeAttachment:H.deleteOne,deleteAssetProcedureTypeAttachments:H.deleteMany}}),{initializeAssetProcedureTypeAttachments:bc,addAssetProcedureTypeAttachment:Rc,addAssetProcedureTypeAttachments:Mc,setAssetProcedureTypeAttachment:kc,setAssetProcedureTypeAttachments:Ec,updateAssetProcedureTypeAttachment:vc,updateAssetProcedureTypeAttachments:Vc,deleteAssetProcedureTypeAttachment:Bc,deleteAssetProcedureTypeAttachments:Wc}=Ms.actions,zc=Ms.reducer,qc=t=>t.assetProcedureTypeAttachmentReducer.instances,ks=o.createSelector([qc],t=>Object.values(t)),Dc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],jc=S(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),MP=S(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),K=F(({uuid:t})=>t),$c={instances:{}},Es=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:$c,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,$c)),reducers:{initializeAssetProcedureTypeFieldsAttachments:K.initialize,addAssetProcedureTypeFieldsAttachment:K.addOne,addAssetProcedureTypeFieldsAttachments:K.addMany,setAssetProcedureTypeFieldsAttachment:K.setOne,setAssetProcedureTypeFieldsAttachments:K.setMany,updateAssetProcedureTypeFieldsAttachment:K.updateOne,updateAssetProcedureTypeFieldsAttachments:K.updateMany,deleteAssetProcedureTypeFieldsAttachment:K.deleteOne,deleteAssetProcedureTypeFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:Cc,addAssetProcedureTypeFieldsAttachment:Uc,addAssetProcedureTypeFieldsAttachments:Lc,setAssetProcedureTypeFieldsAttachment:Nc,setAssetProcedureTypeFieldsAttachments:Gc,updateAssetProcedureTypeFieldsAttachment:Hc,updateAssetProcedureTypeFieldsAttachments:Kc,deleteAssetProcedureTypeFieldsAttachment:Yc,deleteAssetProcedureTypeFieldsAttachments:Jc}=Es.actions,Zc=Es.reducer,Qc=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,vs=o.createSelector([Qc],t=>Object.values(t)),kP=S(o.createSelector([vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Xc=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],xc=S(o.createSelector([vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Y=F(({uuid:t})=>t),er={instances:{}},Vs=o.createSlice({name:"assetProcedureTypeFields",initialState:er,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,er)),reducers:{initializeAssetProcedureTypeFields:Y.initialize,addAssetProcedureTypeFields:Y.addOne,addAssetProcedureTypeFieldsMany:Y.addMany,setAssetProcedureTypeFields:Y.setOne,setAssetProcedureTypeFieldsMany:Y.setMany,updateAssetProcedureTypeFields:Y.updateOne,updateAssetProcedureTypeFieldsMany:Y.updateMany,deleteAssetProcedureTypeFields:Y.deleteOne,deleteAssetProcedureTypeFieldsMany:Y.deleteMany}}),{initializeAssetProcedureTypeFields:tr,addAssetProcedureTypeFields:sr,addAssetProcedureTypeFieldsMany:ir,setAssetProcedureTypeFields:nr,setAssetProcedureTypeFieldsMany:ar,updateAssetProcedureTypeFields:cr,updateAssetProcedureTypeFieldsMany:rr,deleteAssetProcedureTypeFields:dr,deleteAssetProcedureTypeFieldsMany:lr}=Vs.actions,ur=Vs.reducer,or=t=>t.assetProcedureTypeFieldsReducer.instances,Kt=o.createSelector([or],t=>Object.values(t)),EP=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),vP=S(o.createSelector([Kt,(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])),hr=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],pr=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=F(({uuid:t})=>t),mr={instances:{}},Bs=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:mr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,mr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:J.initialize,addAssetProcedureTypeFieldValuesAttachment:J.addOne,addAssetProcedureTypeFieldValuesAttachments:J.addMany,setAssetProcedureTypeFieldValuesAttachment:J.setOne,setAssetProcedureTypeFieldValuesAttachments:J.setMany,updateAssetProcedureTypeFieldValuesAttachment:J.updateOne,updateAssetProcedureTypeFieldValuesAttachments:J.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:J.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:yr,addAssetProcedureTypeFieldValuesAttachment:fr,addAssetProcedureTypeFieldValuesAttachments:Ws,setAssetProcedureTypeFieldValuesAttachment:Sr,setAssetProcedureTypeFieldValuesAttachments:Ar,updateAssetProcedureTypeFieldValuesAttachment:wr,updateAssetProcedureTypeFieldValuesAttachments:Tr,deleteAssetProcedureTypeFieldValuesAttachment:Ir,deleteAssetProcedureTypeFieldValuesAttachments:zs}=Bs.actions,Or=Bs.reducer,Fr=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,qs=o.createSelector([Fr],t=>Object.values(t)),_r=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],gr=S(o.createSelector([qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Pr=S(o.createSelector([qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Z=F(({uuid:t})=>t),br={instances:{}},Ds=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:br,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,br)),reducers:{initializeAssetProcedureTypeFieldValues:Z.initialize,addAssetProcedureTypeFieldValues:Z.addOne,addAssetProcedureTypeFieldValuesMany:Z.addMany,setAssetProcedureTypeFieldValues:Z.setOne,setAssetProcedureTypeFieldValuesMany:Z.setMany,updateAssetProcedureTypeFieldValues:Z.updateOne,updateAssetProcedureTypeFieldValuesMany:Z.updateMany,deleteAssetProcedureTypeFieldValues:Z.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Rr,addAssetProcedureTypeFieldValues:Mr,addAssetProcedureTypeFieldValuesMany:kr,setAssetProcedureTypeFieldValues:Er,setAssetProcedureTypeFieldValuesMany:vr,updateAssetProcedureTypeFieldValues:Vr,updateAssetProcedureTypeFieldValuesMany:Br,deleteAssetProcedureTypeFieldValues:Wr,deleteAssetProcedureTypeFieldValuesMany:zr}=Ds.actions,qr=Ds.reducer,Dr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Yt=o.createSelector([Dr],t=>Object.values(t)),VP=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),BP=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),jr=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],$r=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Q=F(({uuid:t})=>t),Cr={instances:{}},js=o.createSlice({name:"assetProcedures",initialState:Cr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Cr)),reducers:{initializeAssetProcedures:Q.initialize,addAssetProcedure:Q.addOne,addAssetProcedures:Q.addMany,setAssetProcedure:Q.setOne,setAssetProcedures:Q.setMany,updateAssetProcedure:Q.updateOne,updateAssetProcedures:Q.updateMany,deleteAssetProcedure:Q.deleteOne,deleteAssetProcedures:Q.deleteMany}}),{initializeAssetProcedures:Ur,addAssetProcedure:Lr,addAssetProcedures:$s,updateAssetProcedure:Nr,updateAssetProcedures:Gr,deleteAssetProcedure:Hr,deleteAssetProcedures:Cs,setAssetProcedure:Kr,setAssetProcedures:Yr}=js.actions,Jr=js.reducer,Zr=t=>t.assetProcedureReducer.instances,Jt=o.createSelector([Zr],t=>Object.values(t)),Qr=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),WP=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Xr=t=>s=>s.assetProcedureReducer.instances[t],xr=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),X=F(t=>t.uuid),ed={instances:{}},Us=o.createSlice({name:"assetProcedureTypes",initialState:ed,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ed)),reducers:{initializeAssetProcedureTypes:X.initialize,addAssetProcedureType:X.addOne,addAssetProcedureTypes:X.addMany,setAssetProcedureType:X.setOne,setAssetProcedureTypes:X.setMany,updateAssetProcedureType:X.updateOne,updateAssetProcedureTypes:X.updateMany,deleteAssetProcedureType:X.deleteOne,deleteAssetProcedureTypes:X.deleteMany}}),{initializeAssetProcedureTypes:td,addAssetProcedureType:sd,addAssetProcedureTypes:id,updateAssetProcedureType:nd,updateAssetProcedureTypes:ad,deleteAssetProcedureType:cd,deleteAssetProcedureTypes:rd,setAssetProcedureType:dd,setAssetProcedureTypes:ld}=Us.actions,ud=Us.reducer,od=t=>t.assetProcedureTypeReducer.instances,Ls=o.createSelector([od],t=>Object.values(t)),hd=t=>s=>s.assetProcedureTypeReducer.instances[t],pd=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zP=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),x=F(t=>t.uuid),md={instances:{}},Ns=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:md,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,md)),reducers:{initializeAssetProcedureStepFieldsAttachments:x.initialize,addAssetProcedureStepFieldsAttachment:x.addOne,addAssetProcedureStepFieldsAttachments:x.addMany,setAssetProcedureStepFieldsAttachment:x.setOne,setAssetProcedureStepFieldsAttachments:x.setMany,updateAssetProcedureStepFieldsAttachment:x.updateOne,updateAssetProcedureStepFieldsAttachments:x.updateMany,deleteAssetProcedureStepFieldsAttachment:x.deleteOne,deleteAssetProcedureStepFieldsAttachments:x.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:yd,addAssetProcedureStepFieldsAttachment:fd,addAssetProcedureStepFieldsAttachments:Sd,setAssetProcedureStepFieldsAttachment:Ad,setAssetProcedureStepFieldsAttachments:wd,updateAssetProcedureStepFieldsAttachment:Td,updateAssetProcedureStepFieldsAttachments:Id,deleteAssetProcedureStepFieldsAttachment:Od,deleteAssetProcedureStepFieldsAttachments:Fd}=Ns.actions,_d=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Gs=o.createSelector([_d],t=>Object.values(t)),qP=S(o.createSelector([Gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),gd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Pd=S(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bd=Ns.reducer,ee=F(t=>t.uuid),Rd={instances:{}},Hs=o.createSlice({name:"assetProcedureStepFields",initialState:Rd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Rd)),reducers:{initializeAssetProcedureStepFields:ee.initialize,addAssetProcedureStepFields:ee.addOne,addAssetProcedureStepFieldsMany:ee.addMany,setAssetProcedureStepFields:ee.setOne,setAssetProcedureStepFieldsMany:ee.setMany,updateAssetProcedureStepFields:ee.updateOne,updateAssetProcedureStepFieldsMany:ee.updateMany,deleteAssetProcedureStepFields:ee.deleteOne,deleteAssetProcedureStepFieldsMany:ee.deleteMany}}),{initializeAssetProcedureStepFields:Md,addAssetProcedureStepFields:kd,addAssetProcedureStepFieldsMany:Ed,setAssetProcedureStepFields:vd,setAssetProcedureStepFieldsMany:Vd,updateAssetProcedureStepFields:Bd,updateAssetProcedureStepFieldsMany:Wd,deleteAssetProcedureStepFields:zd,deleteAssetProcedureStepFieldsMany:qd}=Hs.actions,Ks=t=>t.assetProcedureStepFieldsReducer.instances,Zt=o.createSelector([Ks],t=>Object.values(t)),DP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),jP=S(o.createSelector([Zt,(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])),$P=o.createSelector([Ks],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),Dd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],jd=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$d=Hs.reducer,te=F(t=>t.uuid),Cd={instances:{}},Ys=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Cd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Cd)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:te.initialize,addAssetProcedureStepFieldValuesAttachment:te.addOne,addAssetProcedureStepFieldValuesAttachments:te.addMany,setAssetProcedureStepFieldValuesAttachment:te.setOne,setAssetProcedureStepFieldValuesAttachments:te.setMany,updateAssetProcedureStepFieldValuesAttachment:te.updateOne,updateAssetProcedureStepFieldValuesAttachments:te.updateMany,deleteAssetProcedureStepFieldValuesAttachment:te.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Ud,addAssetProcedureStepFieldValuesAttachment:Ld,addAssetProcedureStepFieldValuesAttachments:Js,setAssetProcedureStepFieldValuesAttachment:Nd,setAssetProcedureStepFieldValuesAttachments:Gd,updateAssetProcedureStepFieldValuesAttachment:Hd,updateAssetProcedureStepFieldValuesAttachments:Kd,deleteAssetProcedureStepFieldValuesAttachment:Yd,deleteAssetProcedureStepFieldValuesAttachments:Zs}=Ys.actions,Jd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Qs=o.createSelector([Jd],t=>Object.values(t)),Zd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Qd=S(o.createSelector([Qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Xd=S(o.createSelector([Qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),xd=Ys.reducer,se=F(t=>t.uuid),el={instances:{}},Xs=o.createSlice({name:"assetProcedureStepFieldValues",initialState:el,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,el)),reducers:{initializeAssetProcedureStepFieldValues:se.initialize,addAssetProcedureStepFieldValues:se.addOne,addAssetProcedureStepFieldValuesMany:se.addMany,setAssetProcedureStepFieldValues:se.setOne,setAssetProcedureStepFieldValuesMany:se.setMany,updateAssetProcedureStepFieldValues:se.updateOne,updateAssetProcedureStepFieldValuesMany:se.updateMany,deleteAssetProcedureStepFieldValues:se.deleteOne,deleteAssetProcedureStepFieldValuesMany:se.deleteMany}}),{initializeAssetProcedureStepFieldValues:tl,addAssetProcedureStepFieldValues:sl,addAssetProcedureStepFieldValuesMany:il,setAssetProcedureStepFieldValues:nl,setAssetProcedureStepFieldValuesMany:al,updateAssetProcedureStepFieldValues:cl,updateAssetProcedureStepFieldValuesMany:rl,deleteAssetProcedureStepFieldValues:dl,deleteAssetProcedureStepFieldValuesMany:ll}=Xs.actions,ul=t=>t.assetProcedureStepFieldValuesReducer.instances,Et=o.createSelector([ul],t=>Object.values(t)),CP=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),UP=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),LP=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),ol=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],hl=S(o.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pl=Xs.reducer,ie=F(t=>t.uuid),ml={instances:{}},xs=o.createSlice({name:"assetProcedureSteps",initialState:ml,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ml)),reducers:{initializeAssetProcedureSteps:ie.initialize,setAssetProcedureStep:ie.setOne,setAssetProcedureSteps:ie.setMany,addAssetProcedureStep:ie.addOne,addAssetProcedureSteps:ie.addMany,updateAssetProcedureStep:ie.updateOne,updateAssetProcedureSteps:ie.updateMany,deleteAssetProcedureStep:ie.deleteOne,deleteAssetProcedureSteps:ie.deleteMany}}),{initializeAssetProcedureSteps:yl,setAssetProcedureStep:fl,setAssetProcedureSteps:Sl,addAssetProcedureStep:Al,addAssetProcedureSteps:wl,updateAssetProcedureStep:Tl,updateAssetProcedureSteps:Il,deleteAssetProcedureStep:Ol,deleteAssetProcedureSteps:Fl}=xs.actions,_l=xs.reducer,Qt=t=>t.assetProcedureStepReducer.instances,gl=t=>s=>s.assetProcedureStepReducer.instances[t],ei=o.createSelector([Qt],t=>Object.values(t)),NP=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return Nt(e)})),GP=S(o.createSelector([ei,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Pl=S(o.createSelector([ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bl=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=sc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ne=F(t=>t.uuid),Rl={instances:{}},ti=o.createSlice({name:"assets",initialState:Rl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Rl)),reducers:{initializeAssets:ne.initialize,addAsset:ne.addOne,addAssets:ne.addMany,setAsset:ne.setOne,setAssets:ne.setMany,updateAsset:ne.updateOne,updateAssets:ne.updateMany,deleteAsset:ne.deleteOne,deleteAssets:ne.deleteMany}}),{initializeAssets:Ml,addAsset:kl,addAssets:si,updateAsset:El,updateAssets:vl,deleteAsset:Vl,deleteAssets:ii,setAsset:Bl,setAssets:Wl}=ti.actions,zl=t=>t.assetReducer.instances,Xt=o.createSelector([zl],t=>A(Object.values(t))),HP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),ql=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Dl=t=>s=>s.assetReducer.instances[t],jl=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$l=ti.reducer,ae=F(t=>t.uuid),Cl={instances:{}},ni=o.createSlice({name:"assetStageCompletions",initialState:Cl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Cl)),reducers:{initializeAssetStageCompletions:ae.initialize,addAssetStageCompletion:ae.addOne,addAssetStageCompletions:ae.addMany,setAssetStageCompletion:ae.setOne,setAssetStageCompletions:ae.setMany,updateAssetStageCompletion:ae.updateOne,updateAssetStageCompletions:ae.updateMany,deleteAssetStageCompletion:ae.deleteOne,deleteAssetStageCompletions:ae.deleteMany}}),{initializeAssetStageCompletions:Ul,addAssetStageCompletion:Ll,addAssetStageCompletions:Nl,setAssetStageCompletion:Gl,setAssetStageCompletions:Hl,updateAssetStageCompletion:Kl,updateAssetStageCompletions:Yl,deleteAssetStageCompletion:Jl,deleteAssetStageCompletions:Zl}=ni.actions,Ql=ni.reducer,Xl=t=>t.assetStageCompletionReducer.instances,xl=o.createSelector([Xl],t=>Object.values(t)),eu=t=>s=>s.assetStageCompletionReducer.instances[t],tu=S(o.createSelector([xl,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ce=F(t=>t.uuid),su={instances:{}},ai=o.createSlice({name:"assetStages",initialState:su,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,su)),reducers:{initializeAssetStages:ce.initialize,setAssetStage:ce.setOne,setAssetStages:ce.setMany,addAssetStage:ce.addOne,addAssetStages:ce.addMany,updateAssetStage:ce.updateOne,updateAssetStages:ce.updateMany,deleteAssetStage:ce.deleteOne,deleteAssetStages:ce.deleteMany}}),{initializeAssetStages:iu,setAssetStage:nu,setAssetStages:au,addAssetStage:cu,addAssetStages:ru,updateAssetStage:du,updateAssetStages:lu,deleteAssetStage:uu,deleteAssetStages:ou}=ai.actions,hu=ai.reducer,ci=t=>t.assetStageReducer.instances,pu=t=>s=>s.assetStageReducer.instances[t],ri=o.createSelector([ci],t=>Object.values(t)),KP=S(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 Nt(e)})),YP=S(o.createSelector([ri,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),mu=S(o.createSelector([ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),re=F(t=>t.uuid),yu={instances:{}},di=o.createSlice({name:"assetTypeAttachments",initialState:yu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,yu)),reducers:{initializeAssetTypeAttachments:re.initialize,addAssetTypeAttachment:re.addOne,addAssetTypeAttachments:re.addMany,setAssetTypeAttachment:re.setOne,setAssetTypeAttachments:re.setMany,updateAssetTypeAttachment:re.updateOne,updateAssetTypeAttachments:re.updateMany,deleteAssetTypeAttachment:re.deleteOne,deleteAssetTypeAttachments:re.deleteMany}}),{initializeAssetTypeAttachments:fu,addAssetTypeAttachment:Su,addAssetTypeAttachments:li,setAssetTypeAttachment:Au,setAssetTypeAttachments:wu,updateAssetTypeAttachment:Tu,updateAssetTypeAttachments:Iu,deleteAssetTypeAttachment:Ou,deleteAssetTypeAttachments:ui}=di.actions,Fu=t=>t.assetTypeAttachmentReducer.instances,oi=o.createSelector([Fu],t=>Object.values(t)),_u=t=>s=>s.assetTypeAttachmentReducer.instances[t],gu=S(o.createSelector([oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Pu=S(o.createSelector([oi,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),bu=di.reducer,de=F(t=>t.uuid),Ru={instances:{}},hi=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Ru,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ru)),reducers:{initializeAssetTypeFieldsAttachments:de.initialize,addAssetTypeFieldsAttachment:de.addOne,addAssetTypeFieldsAttachments:de.addMany,setAssetTypeFieldsAttachment:de.setOne,setAssetTypeFieldsAttachments:de.setMany,updateAssetTypeFieldsAttachment:de.updateOne,updateAssetTypeFieldsAttachments:de.updateMany,deleteAssetTypeFieldsAttachment:de.deleteOne,deleteAssetTypeFieldsAttachments:de.deleteMany}}),{initializeAssetTypeFieldsAttachments:Mu,addAssetTypeFieldsAttachment:ku,addAssetTypeFieldsAttachments:Eu,setAssetTypeFieldsAttachment:vu,setAssetTypeFieldsAttachments:Vu,updateAssetTypeFieldsAttachment:Bu,updateAssetTypeFieldsAttachments:Wu,deleteAssetTypeFieldsAttachment:zu,deleteAssetTypeFieldsAttachments:qu}=hi.actions,Du=t=>t.assetTypeFieldsAttachmentReducer.instances,pi=o.createSelector([Du],t=>Object.values(t)),JP=S(o.createSelector([pi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),ju=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],$u=S(o.createSelector([pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Cu=hi.reducer,le=F(t=>t.uuid),Uu={instances:{}},mi=o.createSlice({name:"assetTypeFields",initialState:Uu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Uu)),reducers:{initializeAssetTypeFields:le.initialize,addAssetTypeFields:le.addOne,addAssetTypeFieldsMany:le.addMany,setAssetTypeFields:le.setOne,setAssetTypeFieldsMany:le.setMany,updateAssetTypeFields:le.updateOne,updateAssetTypeFieldsMany:le.updateMany,deleteAssetTypeFields:le.deleteOne,deleteAssetTypeFieldsMany:le.deleteMany}}),{initializeAssetTypeFields:Lu,addAssetTypeFields:Nu,addAssetTypeFieldsMany:Gu,setAssetTypeFields:Hu,setAssetTypeFieldsMany:Ku,updateAssetTypeFields:Yu,updateAssetTypeFieldsMany:Ju,deleteAssetTypeFields:Zu,deleteAssetTypeFieldsMany:Qu}=mi.actions,Xu=t=>t.assetTypeFieldsReducer.instances,vt=o.createSelector([Xu],t=>Object.values(t)),ZP=S(o.createSelector([vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),QP=S(o.createSelector([vt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),xu=t=>s=>s.assetTypeFieldsReducer.instances[t],eo=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),to=mi.reducer,ue=F(t=>t.uuid),so={instances:{}},yi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:so,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,so)),reducers:{initializeAssetTypeFieldValuesAttachments:ue.initialize,addAssetTypeFieldValuesAttachment:ue.addOne,addAssetTypeFieldValuesAttachments:ue.addMany,setAssetTypeFieldValuesAttachment:ue.setOne,setAssetTypeFieldValuesAttachments:ue.setMany,updateAssetTypeFieldValuesAttachment:ue.updateOne,updateAssetTypeFieldValuesAttachments:ue.updateMany,deleteAssetTypeFieldValuesAttachment:ue.deleteOne,deleteAssetTypeFieldValuesAttachments:ue.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:io,addAssetTypeFieldValuesAttachment:no,addAssetTypeFieldValuesAttachments:fi,setAssetTypeFieldValuesAttachment:ao,setAssetTypeFieldValuesAttachments:co,updateAssetTypeFieldValuesAttachment:ro,updateAssetTypeFieldValuesAttachments:lo,deleteAssetTypeFieldValuesAttachment:uo,deleteAssetTypeFieldValuesAttachments:Si}=yi.actions,oo=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Ai=o.createSelector([oo],t=>Object.values(t)),ho=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],po=S(o.createSelector([Ai,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mo=S(o.createSelector([Ai,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),yo=yi.reducer,oe=F(t=>t.uuid),fo={instances:{}},wi=o.createSlice({name:"assetTypeFieldValues",initialState:fo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,fo)),reducers:{initializeAssetTypeFieldValues:oe.initialize,addAssetTypeFieldValues:oe.addOne,addAssetTypeFieldValuesMany:oe.addMany,setAssetTypeFieldValues:oe.setOne,setAssetTypeFieldValuesMany:oe.setMany,updateAssetTypeFieldValues:oe.updateOne,updateAssetTypeFieldValuesMany:oe.updateMany,deleteAssetTypeFieldValues:oe.deleteOne,deleteAssetTypeFieldValuesMany:oe.deleteMany}}),{initializeAssetTypeFieldValues:So,addAssetTypeFieldValues:Ao,addAssetTypeFieldValuesMany:wo,setAssetTypeFieldValues:To,setAssetTypeFieldValuesMany:Io,updateAssetTypeFieldValues:Oo,updateAssetTypeFieldValuesMany:Fo,deleteAssetTypeFieldValues:_o,deleteAssetTypeFieldValuesMany:go}=wi.actions,Po=t=>t.assetTypeFieldValuesReducer.instances,xt=o.createSelector([Po],t=>Object.values(t)),XP=S(o.createSelector([xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),xP=S(o.createSelector([vt,xt,(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)))})),bo=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Ro=S(o.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mo=wi.reducer,he=F(t=>t.uuid),ko={instances:{}},Ti=o.createSlice({name:"assetTypeIdentifiers",initialState:ko,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ko)),reducers:{initializeAssetTypeIdentifiers:he.initialize,addAssetTypeIdentifier:he.addOne,addAssetTypeIdentifiers:he.addMany,setAssetTypeIdentifier:he.setOne,setAssetTypeIdentifiers:he.setMany,updateAssetTypeIdentifier:he.updateOne,updateAssetTypeIdentifiers:he.updateMany,deleteAssetTypeIdentifier:he.deleteOne,deleteAssetTypeIdentifiers:he.deleteMany}}),{initializeAssetTypeIdentifiers:Eo,addAssetTypeIdentifier:vo,addAssetTypeIdentifiers:Vo,setAssetTypeIdentifier:Bo,setAssetTypeIdentifiers:Wo,updateAssetTypeIdentifier:zo,updateAssetTypeIdentifiers:qo,deleteAssetTypeIdentifier:Do,deleteAssetTypeIdentifiers:jo}=Ti.actions,$o=t=>t.assetTypeIdentifierReducer.instances,Ii=o.createSelector([$o],t=>Object.values(t)),Co=t=>s=>s.assetTypeIdentifierReducer.instances[t],Uo=S(o.createSelector([Ii,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eb=S(o.createSelector([Ii,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Lo=Ti.reducer,pe=F(t=>t.uuid),No={instances:{}},Oi=o.createSlice({name:"assetTypeIdentifierValues",initialState:No,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,No)),reducers:{initializeAssetTypeIdentifierValues:pe.initialize,addAssetTypeIdentifierValue:pe.addOne,addAssetTypeIdentifierValues:pe.addMany,setAssetTypeIdentifierValue:pe.setOne,setAssetTypeIdentifierValues:pe.setMany,updateAssetTypeIdentifierValue:pe.updateOne,updateAssetTypeIdentifierValues:pe.updateMany,deleteAssetTypeIdentifierValue:pe.deleteOne,deleteAssetTypeIdentifierValues:pe.deleteMany}}),{initializeAssetTypeIdentifierValues:Go,addAssetTypeIdentifierValue:Ho,addAssetTypeIdentifierValues:Ko,setAssetTypeIdentifierValue:Yo,setAssetTypeIdentifierValues:Jo,updateAssetTypeIdentifierValue:Zo,updateAssetTypeIdentifierValues:Qo,deleteAssetTypeIdentifierValue:Xo,deleteAssetTypeIdentifierValues:xo}=Oi.actions,eh=t=>t.assetTypeIdentifierValueReducer.instances,es=o.createSelector([eh],t=>Object.values(t)),th=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],sh=S(o.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tb=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),sb=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),ih=Oi.reducer,me=F(t=>t.uuid),nh={instances:{}},Fi=o.createSlice({name:"assetTypes",initialState:nh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,nh)),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:ah,setAssetType:ch,setAssetTypes:rh,addAssetType:dh,addAssetTypes:lh,updateAssetType:uh,updateAssetTypes:oh,deleteAssetType:hh,deleteAssetTypes:ph}=Fi.actions,mh=t=>t.assetTypeReducer.instances,_i=o.createSelector([mh],t=>Object.values(t)),yh=t=>s=>s.assetTypeReducer.instances[t],fh=S(o.createSelector([_i,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ib=S(o.createSelector([_i,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Sh=Fi.reducer,ye=F(t=>t.uuid),Ah={instances:{}},gi=o.createSlice({name:"assetTypeStatuses",initialState:Ah,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ah)),reducers:{initializeAssetTypeStatuses:ye.initialize,addAssetTypeStatus:ye.addOne,addAssetTypeStatuses:ye.addMany,setAssetTypeStatus:ye.setOne,setAssetTypeStatuses:ye.setMany,updateAssetTypeStatus:ye.updateOne,updateAssetTypeStatuses:ye.updateMany,deleteAssetTypeStatus:ye.deleteOne,deleteAssetTypeStatuses:ye.deleteMany}}),{initializeAssetTypeStatuses:wh,addAssetTypeStatus:Th,addAssetTypeStatuses:Ih,setAssetTypeStatus:Oh,setAssetTypeStatuses:Fh,updateAssetTypeStatus:_h,updateAssetTypeStatuses:gh,deleteAssetTypeStatus:Ph,deleteAssetTypeStatuses:bh}=gi.actions,Rh=t=>t.assetTypeStatusReducer.instances,Pi=o.createSelector([Rh],t=>A(Object.values(t).toSorted(ic))),Mh=t=>s=>s.assetTypeStatusReducer.instances[t],kh=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nb=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Eh=gi.reducer,vh={accessToken:"",refreshToken:"",isLoggedIn:!1},ts=o.createSlice({name:"auth",initialState:vh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,vh)),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||ts.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:ab,clearTokens:cb,setLoggedIn:Vh}=ts.actions,rb=t=>t.authReducer.accessToken,db=t=>t.authReducer.isLoggedIn,Bh=ts.reducer,fe=F(t=>t.uuid),Wh={instances:{}},bi=o.createSlice({name:"documentAttachments",initialState:Wh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Wh)),reducers:{initializeDocumentAttachments:fe.initialize,addDocumentAttachment:fe.addOne,addDocumentAttachments:fe.addMany,setDocumentAttachment:fe.setOne,setDocumentAttachments:fe.setMany,updateDocumentAttachment:fe.updateOne,updateDocumentAttachments:fe.updateMany,deleteDocumentAttachment:fe.deleteOne,deleteDocumentAttachments:fe.deleteMany}}),{initializeDocumentAttachments:zh,addDocumentAttachment:qh,addDocumentAttachments:Dh,setDocumentAttachment:jh,setDocumentAttachments:$h,updateDocumentAttachment:Ch,updateDocumentAttachments:Uh,deleteDocumentAttachment:Lh,deleteDocumentAttachments:Nh}=bi.actions,Gh=t=>t.documentAttachmentReducer.instances,Ri=o.createSelector([Gh],t=>Object.values(t)),Hh=t=>s=>s.documentAttachmentReducer.instances[t],Kh=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lb=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),Yh=bi.reducer,Se=F(({uuid:t})=>t),Jh={instances:{}},Mi=o.createSlice({name:"documents",initialState:Jh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>{Object.assign(s,Jh)}),reducers:{initializeDocuments:Se.initialize,addDocument:Se.addOne,addDocuments:Se.addMany,setDocument:Se.setOne,setDocuments:Se.setMany,updateDocument:Se.updateOne,updateDocuments:Se.updateMany,deleteDocument:Se.deleteOne,deleteDocuments:Se.deleteMany}}),{initializeDocuments:Zh,addDocument:Qh,addDocuments:Xh,setDocument:xh,setDocuments:ep,updateDocument:tp,updateDocuments:sp,deleteDocument:ip,deleteDocuments:np}=Mi.actions,ap=Mi.reducer,ki=t=>t.documentsReducer.instances,ss=o.createSelector([ki],t=>Object.values(t)),cp=t=>s=>s.documentsReducer.instances[t],rp=S(o.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ub=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),ob=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),dp=S(o.createSelector([ki,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=cc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Ae=F(t=>t.uuid),lp={instances:{}},Ei=o.createSlice({name:"emailDomains",initialState:lp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,lp)),reducers:{initializeEmailDomains:Ae.initialize,addEmailDomain:Ae.addOne,addEmailDomains:Ae.addMany,setEmailDomain:Ae.setOne,setEmailDomains:Ae.setMany,updateEmailDomain:Ae.updateOne,updateEmailDomains:Ae.updateMany,deleteEmailDomain:Ae.deleteOne,deleteEmailDomains:Ae.deleteMany}}),{initializeEmailDomains:up,addEmailDomain:op,addEmailDomains:hp,setEmailDomain:pp,setEmailDomains:mp,updateEmailDomain:yp,updateEmailDomains:fp,deleteEmailDomain:Sp,deleteEmailDomains:Ap}=Ei.actions,wp=t=>t.emailDomainsReducer.instances,vi=o.createSelector([wp],t=>Object.values(t)),Tp=t=>s=>s.emailDomainsReducer.instances[t],Ip=S(o.createSelector([vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hb=S(o.createSelector([vi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Op=Ei.reducer,Fp={s3Urls:{}},_p=1e3*60*60,pb=_p*24*7,Vi=o.createSlice({name:"file",initialState:Fp,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Fp)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+pb);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:mb}=Vi.actions,yb=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<_p))return e},gp=Vi.reducer,we=F(t=>t.uuid),Pp={instances:{}},Bi=o.createSlice({name:"formIdentifiers",initialState:Pp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Pp)),reducers:{initializeFormIdentifiers:we.initialize,addFormIdentifier:we.addOne,addFormIdentifiers:we.addMany,setFormIdentifier:we.setOne,setFormIdentifiers:we.setMany,updateFormIdentifier:we.updateOne,updateFormIdentifiers:we.updateMany,deleteFormIdentifier:we.deleteOne,deleteFormIdentifiers:we.deleteMany}}),{initializeFormIdentifiers:bp,addFormIdentifier:Rp,addFormIdentifiers:Mp,setFormIdentifier:kp,setFormIdentifiers:Ep,updateFormIdentifier:vp,updateFormIdentifiers:Vp,deleteFormIdentifier:Bp,deleteFormIdentifiers:Wp}=Bi.actions,zp=t=>t.formIdentifierReducer.instances,Wi=o.createSelector([zp],t=>Object.values(t)),qp=t=>s=>s.formIdentifierReducer.instances[t],Dp=S(o.createSelector([Wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fb=S(o.createSelector([Wi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),jp=Bi.reducer,Te=F(t=>t.uuid),$p={instances:{}},zi=o.createSlice({name:"formIdentifierValues",initialState:$p,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,$p)),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:Cp,addFormIdentifierValue:Up,addFormIdentifierValues:Lp,setFormIdentifierValue:Np,setFormIdentifierValues:Gp,updateFormIdentifierValue:Hp,updateFormIdentifierValues:Kp,deleteFormIdentifierValue:Yp,deleteFormIdentifierValues:Jp}=zi.actions,Zp=t=>t.formIdentifierValueReducer.instances,is=o.createSelector([Zp],t=>Object.values(t)),Qp=t=>s=>s.formIdentifierValueReducer.instances[t],Xp=S(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Sb=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Ab=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),xp=zi.reducer,Ie=F(t=>t.uuid),em={instances:{}},qi=o.createSlice({name:"formRevisionAttachments",initialState:em,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,em)),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:tm,addFormRevisionAttachment:sm,addFormRevisionAttachments:im,setFormRevisionAttachment:nm,setFormRevisionAttachments:am,updateFormRevisionAttachment:cm,updateFormRevisionAttachments:rm,deleteFormRevisionAttachment:dm,deleteFormRevisionAttachments:lm}=qi.actions,ns=t=>t.formRevisionAttachmentReducer.instances,um=o.createSelector([ns],t=>Object.values(t)),om=S(o.createSelector([ns,(t,s)=>s],(t,s)=>t[s])),hm=S(o.createSelector([um,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),pm=qi.reducer,Oe=F(t=>t.uuid),mm={instances:{}},Di=o.createSlice({name:"formRevisions",initialState:mm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,mm)),reducers:{initializeFormRevisions:Oe.initialize,addFormRevision:Oe.addOne,addFormRevisions:Oe.addMany,setFormRevision:Oe.setOne,setFormRevisions:Oe.setMany,updateFormRevision:Oe.updateOne,updateFormRevisions:Oe.updateMany,deleteFormRevision:Oe.deleteOne,deleteFormRevisions:Oe.deleteMany}}),{initializeFormRevisions:ym,addFormRevision:ji,addFormRevisions:$i,setFormRevision:fm,setFormRevisions:Sm,updateFormRevision:Am,updateFormRevisions:wm,deleteFormRevision:Ci,deleteFormRevisions:Ui}=Di.actions,Li=t=>t.formRevisionReducer.instances,as=o.createSelector([Li],t=>Object.values(t)),Tm=t=>s=>s.formRevisionReducer.instances[t],Im=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Tb=S(o.createSelector([as,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Om=S(o.createSelector([as,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Fm=Di.reducer,Fe=F(t=>t.uuid),_m={instances:{}},Ni=o.createSlice({name:"forms",initialState:_m,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,_m)),reducers:{initializeForms:Fe.initialize,addForm:Fe.addOne,addForms:Fe.addMany,setForm:Fe.setOne,setForms:Fe.setMany,updateForm:Fe.updateOne,updateForms:Fe.updateMany,deleteForm:Fe.deleteOne,deleteForms:Fe.deleteMany}}),{initializeForms:gm,addForm:Pm,addForms:bm,setForm:Rm,setForms:Mm,updateForm:km,updateForms:Em,deleteForm:vm,deleteForms:Vm}=Ni.actions,Bm=Ni.reducer,Wm=t=>t.formReducer.instances,Gi=o.createSelector([Wm],t=>Object.values(t)),zm=t=>s=>s.formReducer.instances[t],qm=S(o.createSelector([Gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ib=S(o.createSelector([Gi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),_e=F(t=>t.uuid),Dm={instances:{}},Hi=o.createSlice({name:"formSubmissionAttachments",initialState:Dm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Dm)),reducers:{initializeFormSubmissionAttachments:_e.initialize,addFormSubmissionAttachment:_e.addOne,addFormSubmissionAttachments:_e.addMany,setFormSubmissionAttachment:_e.setOne,setFormSubmissionAttachments:_e.setMany,updateFormSubmissionAttachment:_e.updateOne,updateFormSubmissionAttachments:_e.updateMany,deleteFormSubmissionAttachment:_e.deleteOne,deleteFormSubmissionAttachments:_e.deleteMany}}),{initializeFormSubmissionAttachments:jm,addFormSubmissionAttachment:$m,addFormSubmissionAttachments:Ki,setFormSubmissionAttachment:Cm,setFormSubmissionAttachments:Um,updateFormSubmissionAttachment:Lm,updateFormSubmissionAttachments:Nm,deleteFormSubmissionAttachment:Gm,deleteFormSubmissionAttachments:Yi}=Hi.actions,Ji=t=>t.formSubmissionAttachmentReducer.instances,Zi=o.createSelector([Ji],t=>Object.values(t)),Hm=S(o.createSelector([Ji,(t,s)=>s],(t,s)=>t[s])),Qi=S(o.createSelector([Zi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Km=Qi,Ym=S(o.createSelector([Zi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Jm=Hi.reducer,ge=F(t=>t.uuid),Zm={instances:{}},Xi=o.createSlice({name:"formSubmissions",initialState:Zm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Zm)),reducers:{initializeFormSubmissions:ge.initialize,setFormSubmission:ge.setOne,setFormSubmissions:ge.setMany,addFormSubmission:ge.addOne,addFormSubmissions:ge.addMany,updateFormSubmission:ge.updateOne,updateFormSubmissions:ge.updateMany,deleteFormSubmission:ge.deleteOne,deleteFormSubmissions:ge.deleteMany}}),{initializeFormSubmissions:Qm,setFormSubmission:Xm,setFormSubmissions:xm,addFormSubmission:ey,addFormSubmissions:xi,updateFormSubmission:ty,updateFormSubmissions:sy,deleteFormSubmission:iy,deleteFormSubmissions:en}=Xi.actions,tn=t=>t.formSubmissionReducer.instances,ny=o.createSelector([tn],t=>Object.values(t)),ay=t=>s=>s.formSubmissionReducer.instances[t],cy=S(o.createSelector([ny,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ry=S(o.createSelector([tn,Li,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),dy=Xi.reducer,Pe=F(t=>t.uuid),ly={instances:{}},sn=o.createSlice({name:"geoImages",initialState:ly,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ly)),reducers:{initializeGeoImages:Pe.initialize,setGeoImage:Pe.setOne,setGeoImages:Pe.setMany,addGeoImage:Pe.addOne,addGeoImages:Pe.addMany,updateGeoImage:Pe.updateOne,updateGeoImages:Pe.updateMany,deleteGeoImage:Pe.deleteOne,deleteGeoImages:Pe.deleteMany}}),{initializeGeoImages:uy,setGeoImage:oy,setGeoImages:hy,addGeoImage:py,addGeoImages:my,updateGeoImage:yy,updateGeoImages:fy,deleteGeoImage:Sy,deleteGeoImages:Ay}=sn.actions,wy=t=>t.geoImageReducer.instances,nn=o.createSelector([wy],t=>Object.values(t)),Ty=t=>s=>s.geoImageReducer.instances[t],Iy=S(o.createSelector([nn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ob=S(o.createSelector([nn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Oy=sn.reducer,be=F(t=>t.uuid),Fy={instances:{}},an=o.createSlice({name:"issueAssociations",initialState:Fy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Fy)),reducers:{initializeIssueAssociations:be.initialize,addIssueAssociation:be.addOne,addIssueAssociations:be.addMany,setIssueAssociation:be.setOne,setIssueAssociations:be.setMany,updateIssueAssociation:be.updateOne,updateIssueAssociations:be.updateMany,deleteIssueAssociation:be.deleteOne,deleteIssueAssociations:be.deleteMany}}),{initializeIssueAssociations:_y,setIssueAssociations:gy,setIssueAssociation:Py,updateIssueAssociation:by,updateIssueAssociations:Ry,addIssueAssociation:My,addIssueAssociations:yt,deleteIssueAssociation:ky,deleteIssueAssociations:ft}=an.actions,Ey=t=>t.issueAssociationReducer.instances,St=o.createSelector([Ey],t=>Object.values(t)),vy=t=>s=>s.issueAssociationReducer.instances[t],Vy=S(o.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),By=S(o.createSelector([St,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),Wy=S(o.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),zy=S(o.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),qy=S(o.createSelector([St,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),Dy=S(o.createSelector([St,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),jy=an.reducer,Re=F(t=>t.uuid),$y={instances:{}},cn=o.createSlice({name:"issueAttachments",initialState:$y,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,$y)),reducers:{initializeIssueAttachments:Re.initialize,addIssueAttachment:Re.addOne,addIssueAttachments:Re.addMany,setIssueAttachment:Re.setOne,setIssueAttachments:Re.setMany,updateIssueAttachment:Re.updateOne,updateIssueAttachments:Re.updateMany,deleteIssueAttachment:Re.deleteOne,deleteIssueAttachments:Re.deleteMany}}),{initializeIssueAttachments:Cy,addIssueAttachment:Uy,addIssueAttachments:rn,setIssueAttachment:Ly,setIssueAttachments:Ny,updateIssueAttachment:Gy,updateIssueAttachments:Hy,deleteIssueAttachment:Ky,deleteIssueAttachments:dn}=cn.actions,Yy=t=>t.issueAttachmentReducer.instances,ln=o.createSelector([Yy],t=>Object.values(t)),Jy=S(o.createSelector([ln,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Zy=t=>s=>s.issueAttachmentReducer.instances[t],Qy=S(o.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Xy=cn.reducer,Me=F(t=>t.uuid),xy={instances:{}},un=o.createSlice({name:"issueCommentAttachments",initialState:xy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,xy)),reducers:{initializeIssueCommentAttachments:Me.initialize,addIssueCommentAttachment:Me.addOne,addIssueCommentAttachments:Me.addMany,setIssueCommentAttachment:Me.setOne,setIssueCommentAttachments:Me.setMany,updateIssueCommentAttachment:Me.updateOne,updateIssueCommentAttachments:Me.updateMany,deleteIssueCommentAttachment:Me.deleteOne,deleteIssueCommentAttachments:Me.deleteMany}}),{initializeIssueCommentAttachments:ef,addIssueCommentAttachment:tf,addIssueCommentAttachments:sf,setIssueCommentAttachment:nf,setIssueCommentAttachments:af,updateIssueCommentAttachment:cf,updateIssueCommentAttachments:rf,deleteIssueCommentAttachment:df,deleteIssueCommentAttachments:lf}=un.actions,uf=t=>t.issueCommentAttachmentReducer.instances,on=o.createSelector([uf],t=>Object.values(t)),of=t=>s=>s.issueCommentAttachmentReducer.instances[t],hf=S(o.createSelector([on,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Fb=S(o.createSelector([on,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),pf=un.reducer,ke=F(t=>t.uuid),mf={instances:{}},hn=o.createSlice({name:"issueComments",initialState:mf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,mf)),reducers:{initializeIssueComments:ke.initialize,addIssueComment:ke.addOne,addIssueComments:ke.addMany,setIssueComment:ke.setOne,setIssueComments:ke.setMany,updateIssueComment:ke.updateOne,updateIssueComments:ke.updateMany,deleteIssueComment:ke.deleteOne,deleteIssueComments:ke.deleteMany}}),{initializeIssueComments:yf,addIssueComment:ff,addIssueComments:Sf,setIssueComment:Af,setIssueComments:wf,updateIssueComment:Tf,updateIssueComments:If,deleteIssueComment:Of,deleteIssueComments:Ff}=hn.actions,pn=t=>t.issueCommentReducer.instances,_f=t=>s=>s.issueCommentReducer.instances[t],gf=S(o.createSelector([pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),_b=S(o.createSelector([pn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),Pf=hn.reducer,Ee=F(t=>t.uuid),bf={instances:{}},mn=o.createSlice({name:"issues",initialState:bf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,bf)),reducers:{initializeIssues:Ee.initialize,addIssue:Ee.addOne,addIssues:Ee.addMany,setIssue:Ee.setOne,setIssues:Ee.setMany,updateIssue:Ee.updateOne,updateIssues:Ee.updateMany,deleteIssue:Ee.deleteOne,deleteIssues:Ee.deleteMany}}),{initializeIssues:Rf,addIssue:Mf,addIssues:yn,setIssue:kf,setIssues:Ef,updateIssue:vf,updateIssues:Vf,deleteIssue:Bf,deleteIssues:fn}=mn.actions,Wf=t=>t.issueReducer.instances,cs=o.createSelector([Wf],t=>Object.values(t)),zf=t=>s=>s.issueReducer.instances[t],qf=S(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gb=S(o.createSelector([cs,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Df=S(o.createSelector([cs,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),jf=mn.reducer,ve=F(t=>t.uuid),$f={instances:{}},Sn=o.createSlice({name:"issueTypeAttachments",initialState:$f,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,$f)),reducers:{initializeIssueTypeAttachments:ve.initialize,addIssueTypeAttachment:ve.addOne,addIssueTypeAttachments:ve.addMany,setIssueTypeAttachment:ve.setOne,setIssueTypeAttachments:ve.setMany,updateIssueTypeAttachment:ve.updateOne,updateIssueTypeAttachments:ve.updateMany,deleteIssueTypeAttachment:ve.deleteOne,deleteIssueTypeAttachments:ve.deleteMany}}),{initializeIssueTypeAttachments:Cf,addIssueTypeAttachment:Uf,addIssueTypeAttachments:Lf,setIssueTypeAttachment:Nf,setIssueTypeAttachments:Gf,updateIssueTypeAttachment:Hf,updateIssueTypeAttachments:Kf,deleteIssueTypeAttachment:Yf,deleteIssueTypeAttachments:Jf}=Sn.actions,Zf=t=>t.issueTypeAttachmentReducer.instances,An=o.createSelector([Zf],t=>Object.values(t)),Qf=t=>s=>s.issueTypeAttachmentReducer.instances[t],Xf=S(o.createSelector([An,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Pb=S(o.createSelector([An,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),xf=Sn.reducer,Ve=F(t=>t.uuid),eS={instances:{}},wn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:eS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,eS)),reducers:{initializeIssueTypeFieldsAttachments:Ve.initialize,addIssueTypeFieldsAttachment:Ve.addOne,addIssueTypeFieldsAttachments:Ve.addMany,setIssueTypeFieldsAttachment:Ve.setOne,setIssueTypeFieldsAttachments:Ve.setMany,updateIssueTypeFieldsAttachment:Ve.updateOne,updateIssueTypeFieldsAttachments:Ve.updateMany,deleteIssueTypeFieldsAttachment:Ve.deleteOne,deleteIssueTypeFieldsAttachments:Ve.deleteMany}}),{initializeIssueTypeFieldsAttachments:tS,addIssueTypeFieldsAttachment:sS,addIssueTypeFieldsAttachments:iS,setIssueTypeFieldsAttachment:nS,setIssueTypeFieldsAttachments:aS,updateIssueTypeFieldsAttachment:cS,updateIssueTypeFieldsAttachments:rS,deleteIssueTypeFieldsAttachment:dS,deleteIssueTypeFieldsAttachments:lS}=wn.actions,uS=t=>t.issueTypeFieldsAttachmentReducer.instances,Tn=o.createSelector([uS],t=>Object.values(t)),bb=S(o.createSelector([Tn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),oS=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],hS=S(o.createSelector([Tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pS=wn.reducer,Be=F(t=>t.uuid),mS={instances:{}},In=o.createSlice({name:"issueTypeFieldValues",initialState:mS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,mS)),reducers:{initializeIssueTypeFieldValues:Be.initialize,addIssueTypeFieldValues:Be.addOne,addIssueTypeFieldValuesMany:Be.addMany,setIssueTypeFieldValues:Be.setOne,setIssueTypeFieldValuesMany:Be.setMany,updateIssueTypeFieldValues:Be.updateOne,updateIssueTypeFieldValuesMany:Be.updateMany,deleteIssueTypeFieldValues:Be.deleteOne,deleteIssueTypeFieldValuesMany:Be.deleteMany}}),{initializeIssueTypeFieldValues:yS,addIssueTypeFieldValues:fS,addIssueTypeFieldValuesMany:SS,setIssueTypeFieldValues:AS,setIssueTypeFieldValuesMany:wS,updateIssueTypeFieldValues:TS,updateIssueTypeFieldValuesMany:IS,deleteIssueTypeFieldValues:OS,deleteIssueTypeFieldValuesMany:FS}=In.actions,_S=t=>t.issueTypeFieldValuesReducer.instances,rs=o.createSelector([_S],t=>Object.values(t)),Rb=S(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),gS=t=>s=>s.issueTypeFieldValuesReducer.instances[t],PS=S(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bS=In.reducer,We=F(t=>t.uuid),RS={instances:{}},On=o.createSlice({name:"issueTypeFields",initialState:RS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,RS)),reducers:{initializeIssueTypeFields:We.initialize,addIssueTypeFields:We.addOne,addIssueTypeFieldsMany:We.addMany,setIssueTypeFields:We.setOne,setIssueTypeFieldsMany:We.setMany,updateIssueTypeFields:We.updateOne,updateIssueTypeFieldsMany:We.updateMany,deleteIssueTypeFields:We.deleteOne,deleteIssueTypeFieldsMany:We.deleteMany}}),{initializeIssueTypeFields:MS,addIssueTypeFields:kS,addIssueTypeFieldsMany:ES,setIssueTypeFields:vS,setIssueTypeFieldsMany:VS,updateIssueTypeFields:BS,updateIssueTypeFieldsMany:WS,deleteIssueTypeFields:zS,deleteIssueTypeFieldsMany:qS}=On.actions,DS=t=>t.issueTypeFieldsReducer.instances,Vt=o.createSelector([DS],t=>Object.values(t)),Mb=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),kb=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Eb=S(o.createSelector([Vt,rs,(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)))})),jS=t=>s=>s.issueTypeFieldsReducer.instances[t],$S=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CS=On.reducer,ze=F(t=>t.uuid),US={instances:{}},Fn=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:US,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,US)),reducers:{initializeIssueTypeFieldValuesAttachments:ze.initialize,addIssueTypeFieldValuesAttachment:ze.addOne,addIssueTypeFieldValuesAttachments:ze.addMany,setIssueTypeFieldValuesAttachment:ze.setOne,setIssueTypeFieldValuesAttachments:ze.setMany,updateIssueTypeFieldValuesAttachment:ze.updateOne,updateIssueTypeFieldValuesAttachments:ze.updateMany,deleteIssueTypeFieldValuesAttachment:ze.deleteOne,deleteIssueTypeFieldValuesAttachments:ze.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:LS,addIssueTypeFieldValuesAttachment:NS,addIssueTypeFieldValuesAttachments:_n,setIssueTypeFieldValuesAttachment:GS,setIssueTypeFieldValuesAttachments:HS,updateIssueTypeFieldValuesAttachment:KS,updateIssueTypeFieldValuesAttachments:YS,deleteIssueTypeFieldValuesAttachment:JS,deleteIssueTypeFieldValuesAttachments:gn}=Fn.actions,ZS=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Pn=o.createSelector([ZS],t=>Object.values(t)),QS=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],XS=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xS=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),eA=Fn.reducer,qe=F(t=>t.uuid),tA={instances:{}},bn=o.createSlice({name:"issueTypeIdentifiers",initialState:tA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,tA)),reducers:{initializeIssueTypeIdentifiers:qe.initialize,addIssueTypeIdentifier:qe.addOne,addIssueTypeIdentifiers:qe.addMany,setIssueTypeIdentifier:qe.setOne,setIssueTypeIdentifiers:qe.setMany,updateIssueTypeIdentifier:qe.updateOne,updateIssueTypeIdentifiers:qe.updateMany,deleteIssueTypeIdentifier:qe.deleteOne,deleteIssueTypeIdentifiers:qe.deleteMany}}),{initializeIssueTypeIdentifiers:sA,addIssueTypeIdentifier:iA,addIssueTypeIdentifiers:nA,setIssueTypeIdentifier:aA,setIssueTypeIdentifiers:cA,updateIssueTypeIdentifier:rA,updateIssueTypeIdentifiers:dA,deleteIssueTypeIdentifier:lA,deleteIssueTypeIdentifiers:uA}=bn.actions,oA=t=>t.issueTypeIdentifierReducer.instances,Rn=o.createSelector([oA],t=>Object.values(t)),hA=t=>s=>s.issueTypeIdentifierReducer.instances[t],pA=S(o.createSelector([Rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vb=S(o.createSelector([Rn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),mA=bn.reducer,De=F(t=>t.uuid),yA={instances:{}},Mn=o.createSlice({name:"issueTypeIdentifierValues",initialState:yA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,yA)),reducers:{initializeIssueTypeIdentifierValues:De.initialize,addIssueTypeIdentifierValue:De.addOne,addIssueTypeIdentifierValues:De.addMany,setIssueTypeIdentifierValue:De.setOne,setIssueTypeIdentifierValues:De.setMany,updateIssueTypeIdentifierValue:De.updateOne,updateIssueTypeIdentifierValues:De.updateMany,deleteIssueTypeIdentifierValue:De.deleteOne,deleteIssueTypeIdentifierValues:De.deleteMany}}),{initializeIssueTypeIdentifierValues:fA,addIssueTypeIdentifierValue:SA,addIssueTypeIdentifierValues:AA,setIssueTypeIdentifierValue:wA,setIssueTypeIdentifierValues:TA,updateIssueTypeIdentifierValue:IA,updateIssueTypeIdentifierValues:OA,deleteIssueTypeIdentifierValue:FA,deleteIssueTypeIdentifierValues:_A}=Mn.actions,gA=t=>t.issueTypeIdentifierValueReducer.instances,ds=o.createSelector([gA],t=>Object.values(t)),PA=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],bA=S(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Vb=S(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),Bb=S(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),RA=Mn.reducer,je=F(t=>t.uuid),MA={instances:{}},kn=o.createSlice({name:"issueTypes",initialState:MA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,MA)),reducers:{initializeIssueTypes:je.initialize,addIssueType:je.addOne,addIssueTypes:je.addMany,setIssueType:je.setOne,setIssueTypes:je.setMany,updateIssueType:je.updateOne,updateIssueTypes:je.updateMany,deleteIssueType:je.deleteOne,deleteIssueTypes:je.deleteMany}}),{initializeIssueTypes:kA,addIssueType:EA,addIssueTypes:vA,setIssueType:VA,setIssueTypes:BA,updateIssueType:WA,updateIssueTypes:zA,deleteIssueType:qA,deleteIssueTypes:DA}=kn.actions,jA=t=>t.issueTypeReducer.instances,En=o.createSelector(jA,t=>Object.values(t)),$A=t=>s=>s.issueTypeReducer.instances[t],CA=S(o.createSelector([En,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Wb=S(o.createSelector([En,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),UA=kn.reducer,$e=F(t=>t.uuid),LA={instances:{}},vn=o.createSlice({name:"issueTypeStatuses",initialState:LA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,LA)),reducers:{initializeIssueTypeStatuses:$e.initialize,addIssueTypeStatus:$e.addOne,addIssueTypeStatuses:$e.addMany,setIssueTypeStatus:$e.setOne,setIssueTypeStatuses:$e.setMany,updateIssueTypeStatus:$e.updateOne,updateIssueTypeStatuses:$e.updateMany,deleteIssueTypeStatus:$e.deleteOne,deleteIssueTypeStatuses:$e.deleteMany}}),{initializeIssueTypeStatuses:NA,addIssueTypeStatus:GA,addIssueTypeStatuses:HA,setIssueTypeStatus:KA,setIssueTypeStatuses:YA,updateIssueTypeStatus:JA,updateIssueTypeStatuses:ZA,deleteIssueTypeStatus:QA,deleteIssueTypeStatuses:XA}=vn.actions,xA=t=>t.issueTypeStatusReducer.instances,Vn=o.createSelector([xA],t=>A(Object.values(t).toSorted(nc))),Bn=t=>s=>s.issueTypeStatusReducer.instances[t],ew=S(o.createSelector([Vn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zb=S(o.createSelector([Vn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),tw=vn.reducer,Ce=F(t=>t.uuid),sw={instances:{}},Wn=o.createSlice({name:"issueUpdates",initialState:sw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,sw)),reducers:{initializeIssueUpdates:Ce.initialize,addIssueUpdate:Ce.addOne,addIssueUpdates:Ce.addMany,setIssueUpdate:Ce.setOne,setIssueUpdates:Ce.setMany,updateIssueUpdate:Ce.updateOne,updateIssueUpdates:Ce.updateMany,deleteIssueUpdate:Ce.deleteOne,deleteIssueUpdates:Ce.deleteMany}}),{initializeIssueUpdates:iw,addIssueUpdate:zn,addIssueUpdates:qn,setIssueUpdate:nw,setIssueUpdates:aw,updateIssueUpdate:cw,updateIssueUpdates:rw,deleteIssueUpdate:Dn,deleteIssueUpdates:jn}=Wn.actions,$n=t=>t.issueUpdateReducer.instances,Cn=o.createSelector([$n],t=>Object.values(t)),dw=S(o.createSelector([$n,(t,s)=>s],(t,s)=>t[s])),lw=S(o.createSelector([Cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uw=S(o.createSelector([Cn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),ow=Wn.reducer,Ue=F(t=>t.id),hw={instances:{},currentUser:null},Un=o.createSlice({name:"users",initialState:hw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,hw)).addCase(_,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ue.initialize,setUsers:Ue.setMany,setUser:Ue.setOne,addUsers:Ue.addMany,addUser:Ue.addOne,updateUsers:Ue.updateMany,updateUser:Ue.updateOne,deleteUser:Ue.deleteOne,deleteUsers:Ue.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setCurrentUserProfile:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile=s.payload;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile=s.payload}}}),{initializeUsers:pw,setUsers:mw,setUser:yw,addUsers:fw,addUser:Ln,updateUsers:Sw,updateUser:Aw,deleteUser:Nn,deleteUsers:ww,setCurrentUser:qb,setCurrentUserProfile:Db}=Un.actions,Tw=Un.reducer,Iw=t=>t.userReducer.currentUser,Gn=t=>t.userReducer.instances,ls=o.createSelector([Gn],t=>Object.values(t)),us=t=>s=>s.userReducer.instances[t],Ow=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),Le=F(t=>t.uuid),Fw={instances:{}},Hn=o.createSlice({name:"organizationAccess",initialState:Fw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Fw)),reducers:{initializeOrganizationAccesses:Le.initialize,addOrganizationAccess:Le.addOne,addOrganizationAccesses:Le.addMany,setOrganizationAccess:Le.setOne,setOrganizationAccesses:Le.setMany,updateOrganizationAccess:Le.updateOne,updateOrganizationAccesses:Le.updateMany,deleteOrganizationAccess:Le.deleteOne,deleteOrganizationAccesses:Le.deleteMany}}),{initializeOrganizationAccesses:_w,addOrganizationAccess:gw,addOrganizationAccesses:Pw,setOrganizationAccess:bw,setOrganizationAccesses:Rw,updateOrganizationAccess:Mw,updateOrganizationAccesses:kw,deleteOrganizationAccess:Ew,deleteOrganizationAccesses:vw}=Hn.actions,Vw=Hn.reducer,os=t=>t.organizationAccessReducer.instances,Bw=t=>s=>s.organizationAccessReducer.instances[t],Ww=S(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),jb=o.createSelector([Iw,os],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),zw=o.createSelector([os],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return Nt(s)}),$b=S(o.createSelector([Gn,zw,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ne=F(t=>t.uuid),qw={instances:{}},Kn=o.createSlice({name:"organizations",initialState:qw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,qw)),reducers:{initializeOrganizations:Ne.initialize,setOrganizations:Ne.setMany,setOrganization:Ne.setOne,addOrganizations:Ne.addMany,addOrganization:Ne.addOne,updateOrganizations:Ne.updateMany,updateOrganization:Ne.updateOne,deleteOrganization:Ne.deleteOne,deleteOrganizations:Ne.deleteMany}}),{initializeOrganizations:Dw,setOrganizations:jw,setOrganization:$w,addOrganizations:Cw,addOrganization:Uw,updateOrganizations:Lw,updateOrganization:Nw,deleteOrganization:Gw,deleteOrganizations:Hw}=Kn.actions,Kw=t=>t.organizationReducer.instances,Yw=o.createSelector([Kw],t=>Object.values(t)),Jw=t=>s=>s.organizationReducer.instances[t],Zw=S(o.createSelector([Yw,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Qw=Kn.reducer,Xw=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:ht.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},xw={deletedRequests:[],latestRetryTime:0},Yn=o.createSlice({name:"outbox",initialState:xw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,xw)),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 Xw(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}}}),Cb=t=>t.outboxReducer.deletedRequests,Ub=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:eT,markForDeletion:Lb,markAsDeleted:tT,_setLatestRetryTime:sT}=Yn.actions,iT=Yn.reducer,Ge=F(t=>t.uuid),nT={instances:{}},Jn=o.createSlice({name:"projectAccess",initialState:nT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,nT)),reducers:{initializeProjectAccesses:Ge.initialize,addProjectAccess:Ge.addOne,addProjectAccesses:Ge.addMany,setProjectAccess:Ge.setOne,setProjectAccesses:Ge.setMany,updateProjectAccess:Ge.updateOne,updateProjectAccesses:Ge.updateMany,deleteProjectAccess:Ge.deleteOne,deleteProjectAccesses:Ge.deleteMany}}),{initializeProjectAccesses:aT,addProjectAccess:cT,addProjectAccesses:rT,setProjectAccess:dT,setProjectAccesses:lT,updateProjectAccess:uT,updateProjectAccesses:oT,deleteProjectAccess:hT,deleteProjectAccesses:pT}=Jn.actions,mT=Jn.reducer,Zn=t=>t.projectAccessReducer.instances,Bt=o.createSelector(Zn,t=>Object.values(t)),yT=t=>s=>s.projectAccessReducer.instances[t],fT=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nb=S(o.createSelector([Zn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),Gb=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),Hb=S(o.createSelector([ls,Bt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),He=F(t=>t.uuid),ST={instances:{}},Qn=o.createSlice({name:"projectAttachments",initialState:ST,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ST)),reducers:{initializeProjectAttachments:He.initialize,addProjectAttachment:He.addOne,addProjectAttachments:He.addMany,setProjectAttachment:He.setOne,setProjectAttachments:He.setMany,updateProjectAttachment:He.updateOne,updateProjectAttachments:He.updateMany,deleteProjectAttachment:He.deleteOne,deleteProjectAttachments:He.deleteMany}}),{initializeProjectAttachments:AT,addProjectAttachment:wT,addProjectAttachments:TT,setProjectAttachment:IT,setProjectAttachments:OT,updateProjectAttachment:FT,updateProjectAttachments:_T,deleteProjectAttachment:gT,deleteProjectAttachments:PT}=Qn.actions,bT=t=>t.projectAttachmentReducer.instances,Xn=o.createSelector([bT],t=>Object.values(t)),RT=t=>s=>s.projectAttachmentReducer.instances[t],MT=S(o.createSelector([Xn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Kb=S(o.createSelector([Xn,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),kT=Qn.reducer,Ke=F(t=>t.uuid),ET={instances:{}},xn=o.createSlice({name:"projectFiles",initialState:ET,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ET)),reducers:{initializeProjectFiles:Ke.initialize,setProjectFile:Ke.setOne,setProjectFiles:Ke.setMany,addProjectFile:Ke.addOne,addProjectFiles:Ke.addMany,updateProjectFile:Ke.updateOne,updateProjectFiles:Ke.updateMany,deleteProjectFile:Ke.deleteOne,deleteProjectFiles:Ke.deleteMany}}),{initializeProjectFiles:vT,setProjectFile:VT,setProjectFiles:BT,addProjectFile:WT,addProjectFiles:zT,updateProjectFile:qT,updateProjectFiles:DT,deleteProjectFile:jT,deleteProjectFiles:$T}=xn.actions,CT=t=>t.projectFileReducer.instances,UT=o.createSelector([CT],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),LT=t=>s=>s.projectFileReducer.instances[t],NT=S(o.createSelector([UT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GT=xn.reducer,Ye=F(t=>t.uuid),HT={instances:{}},ea=o.createSlice({name:"projects",initialState:HT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,HT)),reducers:{initializeProjects:Ye.initialize,setProjects:Ye.setMany,setProject:Ye.setOne,addProjects:Ye.addMany,addProject:Ye.addOne,updateProjects:Ye.updateMany,updateProject:Ye.updateOne,deleteProject:Ye.deleteOne,deleteProjects:Ye.deleteMany}}),{initializeProjects:KT,setProjects:YT,setProject:JT,addProjects:ZT,addProject:QT,updateProjects:XT,updateProject:xT,deleteProject:eI,deleteProjects:tI}=ea.actions,sI=ea.reducer,iI=t=>t.projectReducer.instances,hs=o.createSelector([iI],t=>Object.values(t)),nI=t=>s=>s.projectReducer.instances[t],aI=S(o.createSelector([hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Yb=S(o.createSelector([hs,Bt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return A(t.filter(a=>n.has(a.uuid)))})),Jb=S(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Zb={isRehydrated:!1},ta=o.createSlice({name:"rehydrated",initialState:Zb,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:Qb}=ta.actions,Xb=t=>t.rehydratedReducer.isRehydrated,cI=ta.reducer,Je=F(t=>t.uuid),rI={instances:{}},sa=o.createSlice({name:"teamMemberships",initialState:rI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,rI)),reducers:{initializeTeamMemberships:Je.initialize,addTeamMembership:Je.addOne,addTeamMemberships:Je.addMany,setTeamMembership:Je.setOne,setTeamMemberships:Je.setMany,updateTeamMembership:Je.updateOne,updateTeamMemberships:Je.updateMany,deleteTeamMembership:Je.deleteOne,deleteTeamMemberships:Je.deleteMany}}),{initializeTeamMemberships:dI,addTeamMembership:lI,addTeamMemberships:uI,setTeamMembership:oI,setTeamMemberships:hI,updateTeamMembership:pI,updateTeamMemberships:mI,deleteTeamMembership:yI,deleteTeamMemberships:fI}=sa.actions,SI=sa.reducer,AI=t=>t.teamMembershipReducer.instances,ps=o.createSelector([AI],t=>Object.values(t)),wI=t=>s=>s.teamMembershipReducer.instances[t],TI=S(o.createSelector([ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xb=S(o.createSelector([ps,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),eR=S(o.createSelector([ls,ps,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),Ze=F(t=>t.uuid),II={instances:{}},ia=o.createSlice({name:"teams",initialState:II,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,II)),reducers:{initializeTeams:Ze.initialize,addTeam:Ze.addOne,addTeams:Ze.addMany,setTeam:Ze.setOne,setTeams:Ze.setMany,updateTeam:Ze.updateOne,updateTeams:Ze.updateMany,deleteTeam:Ze.deleteOne,deleteTeams:Ze.deleteMany}}),{initializeTeams:OI,addTeam:FI,addTeams:_I,setTeam:gI,setTeams:PI,updateTeam:bI,updateTeams:RI,deleteTeam:MI,deleteTeams:kI}=ia.actions,EI=t=>t.teamReducer.instances,na=o.createSelector([EI],t=>Object.values(t)),vI=t=>s=>s.teamReducer.instances[t],VI=S(o.createSelector([na,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tR=S(o.createSelector([na,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),BI=ia.reducer,sR={version:0},WI=o.createSlice({name:"versioning",initialState:sR,reducers:{}}),zI=WI.reducer,Qe=F(t=>t.uuid),qI={instances:{}},aa=o.createSlice({name:"workflows",initialState:qI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,qI)),reducers:{initializeWorkflows:Qe.initialize,addWorkflow:Qe.addOne,addWorkflows:Qe.addMany,setWorkflow:Qe.setOne,setWorkflows:Qe.setMany,updateWorkflow:Qe.updateOne,updateWorkflows:Qe.updateMany,deleteWorkflow:Qe.deleteOne,deleteWorkflows:Qe.deleteMany}}),{initializeWorkflows:DI,addWorkflow:jI,addWorkflows:$I,setWorkflow:CI,setWorkflows:UI,updateWorkflow:LI,updateWorkflows:NI,deleteWorkflow:GI,deleteWorkflows:HI}=aa.actions,KI=t=>t.workflowReducer.instances,ms=o.createSelector([KI],t=>Object.values(t)),YI=t=>s=>s.workflowReducer.instances[t],JI=S(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iR=S(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),nR=S(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),ZI=aa.reducer,Xe=F(t=>t.uuid),QI={instances:{}},ca=o.createSlice({name:"workflowIssueLinks",initialState:QI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,QI)),reducers:{initializeWorkflowIssueLinks:Xe.initialize,addWorkflowIssueLink:Xe.addOne,addWorkflowIssueLinks:Xe.addMany,setWorkflowIssueLink:Xe.setOne,setWorkflowIssueLinks:Xe.setMany,updateWorkflowIssueLink:Xe.updateOne,updateWorkflowIssueLinks:Xe.updateMany,deleteWorkflowIssueLink:Xe.deleteOne,deleteWorkflowIssueLinks:Xe.deleteMany}}),{initializeWorkflowIssueLinks:XI,addWorkflowIssueLink:xI,addWorkflowIssueLinks:Wt,setWorkflowIssueLink:eO,setWorkflowIssueLinks:tO,updateWorkflowIssueLink:sO,updateWorkflowIssueLinks:iO,deleteWorkflowIssueLink:nO,deleteWorkflowIssueLinks:zt}=ca.actions,aO=t=>t.workflowIssueLinkReducer.instances,Ft=o.createSelector([aO],t=>Object.values(t)),cO=t=>s=>s.workflowIssueLinkReducer.instances[t],rO=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dO=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),lO=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),uO=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),aR=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),oO=ca.reducer,xe=F(t=>t.uuid),hO={instances:{}},ra=o.createSlice({name:"workflowStepAssignees",initialState:hO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,hO)),reducers:{initializeWorkflowStepAssignees:xe.initialize,addWorkflowStepAssignee:xe.addOne,addWorkflowStepAssignees:xe.addMany,setWorkflowStepAssignee:xe.setOne,setWorkflowStepAssignees:xe.setMany,updateWorkflowStepAssignee:xe.updateOne,updateWorkflowStepAssignees:xe.updateMany,deleteWorkflowStepAssignee:xe.deleteOne,deleteWorkflowStepAssignees:xe.deleteMany}}),{initializeWorkflowStepAssignees:pO,addWorkflowStepAssignee:mO,addWorkflowStepAssignees:yO,setWorkflowStepAssignee:fO,setWorkflowStepAssignees:SO,updateWorkflowStepAssignee:AO,updateWorkflowStepAssignees:wO,deleteWorkflowStepAssignee:TO,deleteWorkflowStepAssignees:IO}=ra.actions,OO=t=>t.workflowStepAssigneeReducer.instances,qt=o.createSelector([OO],t=>Object.values(t)),FO=t=>s=>s.workflowStepAssigneeReducer.instances[t],_O=S(o.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),rR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),dR=S(o.createSelector([qt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),gO=ra.reducer,et=F(t=>t.uuid),PO={instances:{}},da=o.createSlice({name:"workflowStepComments",initialState:PO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,PO)),reducers:{initializeWorkflowStepComments:et.initialize,addWorkflowStepComment:et.addOne,addWorkflowStepComments:et.addMany,setWorkflowStepComment:et.setOne,setWorkflowStepComments:et.setMany,updateWorkflowStepComment:et.updateOne,updateWorkflowStepComments:et.updateMany,deleteWorkflowStepComment:et.deleteOne,deleteWorkflowStepComments:et.deleteMany}}),{initializeWorkflowStepComments:bO,addWorkflowStepComment:RO,addWorkflowStepComments:MO,setWorkflowStepComment:kO,setWorkflowStepComments:EO,updateWorkflowStepComment:vO,updateWorkflowStepComments:VO,deleteWorkflowStepComment:BO,deleteWorkflowStepComments:WO}=da.actions,zO=t=>t.workflowStepCommentReducer.instances,Dt=o.createSelector([zO],t=>Object.values(t)),qO=t=>s=>s.workflowStepCommentReducer.instances[t],DO=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lR=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),uR=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),oR=S(o.createSelector([Dt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),jO=da.reducer,tt=F(t=>t.uuid),$O={instances:{}},la=o.createSlice({name:"workflowStepEvents",initialState:$O,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,$O)),reducers:{initializeWorkflowStepEvents:tt.initialize,addWorkflowStepEvent:tt.addOne,addWorkflowStepEvents:tt.addMany,setWorkflowStepEvent:tt.setOne,setWorkflowStepEvents:tt.setMany,updateWorkflowStepEvent:tt.updateOne,updateWorkflowStepEvents:tt.updateMany,deleteWorkflowStepEvent:tt.deleteOne,deleteWorkflowStepEvents:tt.deleteMany}}),{initializeWorkflowStepEvents:CO,addWorkflowStepEvent:UO,addWorkflowStepEvents:LO,setWorkflowStepEvent:NO,setWorkflowStepEvents:GO,updateWorkflowStepEvent:HO,updateWorkflowStepEvents:KO,deleteWorkflowStepEvent:YO,deleteWorkflowStepEvents:JO}=la.actions,ZO=t=>t.workflowStepEventReducer.instances,jt=o.createSelector([ZO],t=>Object.values(t)),QO=t=>s=>s.workflowStepEventReducer.instances[t],XO=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hR=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),pR=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),mR=S(o.createSelector([jt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),xO=la.reducer,st=F(t=>t.uuid),eF={instances:{}},ua=o.createSlice({name:"workflowStepFieldsAttachments",initialState:eF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,eF)),reducers:{initializeWorkflowStepFieldsAttachments:st.initialize,addWorkflowStepFieldsAttachment:st.addOne,addWorkflowStepFieldsAttachments:st.addMany,setWorkflowStepFieldsAttachment:st.setOne,setWorkflowStepFieldsAttachments:st.setMany,updateWorkflowStepFieldsAttachment:st.updateOne,updateWorkflowStepFieldsAttachments:st.updateMany,deleteWorkflowStepFieldsAttachment:st.deleteOne,deleteWorkflowStepFieldsAttachments:st.deleteMany}}),{initializeWorkflowStepFieldsAttachments:tF,addWorkflowStepFieldsAttachment:sF,addWorkflowStepFieldsAttachments:oa,setWorkflowStepFieldsAttachment:iF,setWorkflowStepFieldsAttachments:nF,updateWorkflowStepFieldsAttachment:aF,updateWorkflowStepFieldsAttachments:cF,deleteWorkflowStepFieldsAttachment:rF,deleteWorkflowStepFieldsAttachments:ha}=ua.actions,dF=t=>t.workflowStepFieldsAttachmentReducer.instances,pa=o.createSelector([dF],t=>Object.values(t)),lF=S(o.createSelector([pa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),uF=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],oF=S(o.createSelector([pa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hF=ua.reducer,it=F(t=>t.uuid),pF={instances:{}},ma=o.createSlice({name:"workflowStepFields",initialState:pF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,pF)),reducers:{initializeWorkflowStepFields:it.initialize,addWorkflowStepFields:it.addOne,addWorkflowStepFieldsMany:it.addMany,setWorkflowStepFields:it.setOne,setWorkflowStepFieldsMany:it.setMany,updateWorkflowStepFields:it.updateOne,updateWorkflowStepFieldsMany:it.updateMany,deleteWorkflowStepFields:it.deleteOne,deleteWorkflowStepFieldsMany:it.deleteMany}}),{initializeWorkflowStepFields:mF,addWorkflowStepFields:yF,addWorkflowStepFieldsMany:fF,setWorkflowStepFields:SF,setWorkflowStepFieldsMany:AF,updateWorkflowStepFields:wF,updateWorkflowStepFieldsMany:TF,deleteWorkflowStepFields:IF,deleteWorkflowStepFieldsMany:OF}=ma.actions,FF=t=>t.workflowStepFieldsReducer.instances,ys=o.createSelector([FF],t=>Object.values(t)),yR=S(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),fR=S(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])),_F=t=>s=>s.workflowStepFieldsReducer.instances[t],gF=S(o.createSelector([ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),PF=ma.reducer,nt=F(t=>t.uuid),bF={instances:{}},ya=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:bF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,bF)),reducers:{initializeWorkflowStepFieldValuesAttachments:nt.initialize,addWorkflowStepFieldValuesAttachment:nt.addOne,addWorkflowStepFieldValuesAttachments:nt.addMany,setWorkflowStepFieldValuesAttachment:nt.setOne,setWorkflowStepFieldValuesAttachments:nt.setMany,updateWorkflowStepFieldValuesAttachment:nt.updateOne,updateWorkflowStepFieldValuesAttachments:nt.updateMany,deleteWorkflowStepFieldValuesAttachment:nt.deleteOne,deleteWorkflowStepFieldValuesAttachments:nt.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:RF,addWorkflowStepFieldValuesAttachment:MF,addWorkflowStepFieldValuesAttachments:fa,setWorkflowStepFieldValuesAttachment:kF,setWorkflowStepFieldValuesAttachments:EF,updateWorkflowStepFieldValuesAttachment:vF,updateWorkflowStepFieldValuesAttachments:VF,deleteWorkflowStepFieldValuesAttachment:BF,deleteWorkflowStepFieldValuesAttachments:Sa}=ya.actions,WF=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Aa=o.createSelector([WF],t=>Object.values(t)),zF=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],qF=S(o.createSelector([Aa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),DF=S(o.createSelector([Aa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),jF=ya.reducer,at=F(t=>t.uuid),$F={instances:{}},wa=o.createSlice({name:"workflowStepFieldValues",initialState:$F,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,$F)),reducers:{initializeWorkflowStepFieldValues:at.initialize,addWorkflowStepFieldValues:at.addOne,addWorkflowStepFieldValuesMany:at.addMany,setWorkflowStepFieldValues:at.setOne,setWorkflowStepFieldValuesMany:at.setMany,updateWorkflowStepFieldValues:at.updateOne,updateWorkflowStepFieldValuesMany:at.updateMany,deleteWorkflowStepFieldValues:at.deleteOne,deleteWorkflowStepFieldValuesMany:at.deleteMany}}),{initializeWorkflowStepFieldValues:CF,addWorkflowStepFieldValues:UF,addWorkflowStepFieldValuesMany:LF,setWorkflowStepFieldValues:NF,setWorkflowStepFieldValuesMany:GF,updateWorkflowStepFieldValues:HF,updateWorkflowStepFieldValuesMany:KF,deleteWorkflowStepFieldValues:YF,deleteWorkflowStepFieldValuesMany:JF}=wa.actions,ZF=t=>t.workflowStepFieldValuesReducer.instances,pt=o.createSelector([ZF],t=>Object.values(t)),SR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),AR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),QF=t=>s=>s.workflowStepFieldValuesReducer.instances[t],XF=S(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wR=S(o.createSelector([pt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),TR=S(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{workflow:a,workflow_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),xF=wa.reducer,ct=F(t=>t.uuid),e_={instances:{}},Ta=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:e_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,e_)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:ct.initialize,addWorkflowStepFieldValuesReviewRequest:ct.addOne,addWorkflowStepFieldValuesReviewRequests:ct.addMany,setWorkflowStepFieldValuesReviewRequest:ct.setOne,setWorkflowStepFieldValuesReviewRequests:ct.setMany,updateWorkflowStepFieldValuesReviewRequest:ct.updateOne,updateWorkflowStepFieldValuesReviewRequests:ct.updateMany,deleteWorkflowStepFieldValuesReviewRequest:ct.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:ct.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:t_,addWorkflowStepFieldValuesReviewRequest:s_,addWorkflowStepFieldValuesReviewRequests:Ia,setWorkflowStepFieldValuesReviewRequest:i_,setWorkflowStepFieldValuesReviewRequests:n_,updateWorkflowStepFieldValuesReviewRequest:a_,updateWorkflowStepFieldValuesReviewRequests:c_,deleteWorkflowStepFieldValuesReviewRequest:r_,deleteWorkflowStepFieldValuesReviewRequests:Oa}=Ta.actions,d_=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,$t=o.createSelector([d_],t=>Object.values(t)),l_=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],u_=S(o.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),o_=S(o.createSelector([$t,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),IR=S(o.createSelector([$t,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),OR=S(o.createSelector([pt,$t,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(v(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),h_=Ta.reducer,rt=F(t=>t.uuid),p_={instances:{}},Fa=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:p_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,p_)),reducers:{initializeWorkflowStepFieldValuesReviews:rt.initialize,addWorkflowStepFieldValuesReview:rt.addOne,addWorkflowStepFieldValuesReviews:rt.addMany,setWorkflowStepFieldValuesReview:rt.setOne,setWorkflowStepFieldValuesReviews:rt.setMany,updateWorkflowStepFieldValuesReview:rt.updateOne,updateWorkflowStepFieldValuesReviews:rt.updateMany,deleteWorkflowStepFieldValuesReview:rt.deleteOne,deleteWorkflowStepFieldValuesReviews:rt.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:m_,addWorkflowStepFieldValuesReview:y_,addWorkflowStepFieldValuesReviews:_a,setWorkflowStepFieldValuesReview:f_,setWorkflowStepFieldValuesReviews:S_,updateWorkflowStepFieldValuesReview:A_,updateWorkflowStepFieldValuesReviews:w_,deleteWorkflowStepFieldValuesReview:T_,deleteWorkflowStepFieldValuesReviews:ga}=Fa.actions,I_=t=>t.workflowStepFieldValuesReviewReducer.instances,_t=o.createSelector([I_],t=>Object.values(t)),O_=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],F_=S(o.createSelector([_t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),__=S(o.createSelector([_t,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),FR=S(o.createSelector([_t,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),_R=S(o.createSelector([pt,_t,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(v(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),gR=o.createSelector([_t],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}),g_=Fa.reducer,dt=F(t=>t.uuid),P_={instances:{}},Pa=o.createSlice({name:"workflowStepReviewers",initialState:P_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,P_)),reducers:{initializeWorkflowStepReviewers:dt.initialize,addWorkflowStepReviewer:dt.addOne,addWorkflowStepReviewers:dt.addMany,setWorkflowStepReviewer:dt.setOne,setWorkflowStepReviewers:dt.setMany,updateWorkflowStepReviewer:dt.updateOne,updateWorkflowStepReviewers:dt.updateMany,deleteWorkflowStepReviewer:dt.deleteOne,deleteWorkflowStepReviewers:dt.deleteMany}}),{initializeWorkflowStepReviewers:b_,addWorkflowStepReviewer:R_,addWorkflowStepReviewers:M_,setWorkflowStepReviewer:k_,setWorkflowStepReviewers:E_,updateWorkflowStepReviewer:v_,updateWorkflowStepReviewers:V_,deleteWorkflowStepReviewer:B_,deleteWorkflowStepReviewers:W_}=Pa.actions,z_=t=>t.workflowStepReviewerReducer.instances,Ct=o.createSelector([z_],t=>Object.values(t)),q_=t=>s=>s.workflowStepReviewerReducer.instances[t],D_=S(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),PR=S(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),bR=S(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),RR=S(o.createSelector([Ct,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),j_=Pa.reducer,lt=F(t=>t.uuid),$_={instances:{}},ba=o.createSlice({name:"workflowSteps",initialState:$_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,$_)),reducers:{initializeWorkflowSteps:lt.initialize,addWorkflowStep:lt.addOne,addWorkflowSteps:lt.addMany,setWorkflowStep:lt.setOne,setWorkflowSteps:lt.setMany,updateWorkflowStep:lt.updateOne,updateWorkflowSteps:lt.updateMany,deleteWorkflowStep:lt.deleteOne,deleteWorkflowSteps:lt.deleteMany}}),{initializeWorkflowSteps:C_,addWorkflowStep:U_,addWorkflowSteps:L_,setWorkflowStep:N_,setWorkflowSteps:G_,updateWorkflowStep:H_,updateWorkflowSteps:K_,deleteWorkflowStep:Y_,deleteWorkflowSteps:J_}=ba.actions,Z_=t=>t.workflowStepReducer.instances,Ra=o.createSelector([Z_],t=>Object.values(t)),Q_=t=>s=>s.workflowStepReducer.instances[t],X_=S(o.createSelector([Ra,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),MR=S(o.createSelector([Ra,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),x_=ba.reducer,ut=F(t=>t.uuid),eg={instances:{}},Ma=o.createSlice({name:"workflowTypes",initialState:eg,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,eg)),reducers:{initializeWorkflowTypes:ut.initialize,addWorkflowType:ut.addOne,addWorkflowTypes:ut.addMany,setWorkflowType:ut.setOne,setWorkflowTypes:ut.setMany,updateWorkflowType:ut.updateOne,updateWorkflowTypes:ut.updateMany,deleteWorkflowType:ut.deleteOne,deleteWorkflowTypes:ut.deleteMany}}),{initializeWorkflowTypes:tg,addWorkflowType:sg,addWorkflowTypes:ig,setWorkflowType:ng,setWorkflowTypes:ag,updateWorkflowType:cg,updateWorkflowTypes:rg,deleteWorkflowType:dg,deleteWorkflowTypes:lg}=Ma.actions,ug=t=>t.workflowTypeReducer.instances,ka=o.createSelector([ug],t=>Object.values(t)),og=t=>s=>s.workflowTypeReducer.instances[t],hg=S(o.createSelector([ka,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kR=S(o.createSelector([ka,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),pg=Ma.reducer,Ea={outboxReducer:iT,fileReducer:gp,authReducer:Bh},ER=o.combineReducers(Ea),mg={...Ea,[kt]:zI,assetReducer:$l,assetAttachmentReducer:gc,assetStageCompletionReducer:Ql,assetStageReducer:hu,assetTypeReducer:Sh,assetTypeAttachmentReducer:bu,issueReducer:jf,issueAttachmentReducer:Xy,issueTypeReducer:UA,issueTypeAttachmentReducer:xf,organizationReducer:Qw,projectReducer:sI,projectAttachmentReducer:kT,projectAccessReducer:mT,organizationAccessReducer:Vw,projectFileReducer:GT,rehydratedReducer:cI,formReducer:Bm,formRevisionReducer:Fm,formRevisionAttachmentReducer:pm,formSubmissionAttachmentReducer:Jm,formSubmissionReducer:dy,formIdentifierReducer:jp,formIdentifierValueReducer:xp,userReducer:Tw,emailDomainsReducer:Op,documentsReducer:ap,documentAttachmentReducer:Yh,teamReducer:BI,agentsReducer:hc,issueCommentReducer:Pf,issueCommentAttachmentReducer:pf,issueUpdateReducer:ow,geoImageReducer:Oy,issueAssociationReducer:jy,issueTypeFieldsReducer:CS,issueTypeFieldValuesReducer:bS,issueTypeFieldsAttachmentReducer:pS,issueTypeFieldValuesAttachmentReducer:eA,issueTypeIdentifierReducer:mA,issueTypeIdentifierValueReducer:RA,issueTypeStatusReducer:tw,assetTypeFieldsReducer:to,assetTypeFieldValuesReducer:Mo,assetTypeFieldsAttachmentReducer:Cu,assetTypeFieldValuesAttachmentReducer:yo,assetTypeIdentifierReducer:Lo,assetTypeIdentifierValueReducer:ih,assetTypeStatusReducer:Eh,assetProcedureTypeReducer:ud,assetProcedureReducer:Jr,assetProcedureTypeFieldsReducer:ur,assetProcedureTypeFieldValuesReducer:qr,assetProcedureTypeFieldsAttachmentReducer:Zc,assetProcedureTypeFieldValuesAttachmentReducer:Or,assetProcedureTypeAttachmentReducer:zc,assetProcedureStepFieldsAttachmentReducer:bd,assetProcedureStepFieldsReducer:$d,assetProcedureStepFieldValuesAttachmentReducer:xd,assetProcedureStepFieldValuesReducer:pl,assetProcedureStepReducer:_l,teamMembershipReducer:SI,workflowTypeReducer:pg,workflowStepReducer:x_,workflowStepFieldsReducer:PF,workflowStepFieldsAttachmentReducer:hF,workflowReducer:ZI,workflowIssueLinkReducer:oO,workflowStepAssigneeReducer:gO,workflowStepCommentReducer:jO,workflowStepEventReducer:xO,workflowStepFieldValuesReducer:xF,workflowStepFieldValuesAttachmentReducer:jF,workflowStepFieldValuesReviewReducer:g_,workflowStepFieldValuesReviewRequestReducer:h_,workflowStepReviewerReducer:j_},vR=o.combineReducers(mg),yg=1e4,fg=200,va=[400,409,403,404,405,500],ot=1e4,Sg={};class Ag{constructor(s){m(this,"client");m(this,"pageSize",yg);Sg[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 wg=()=>Og.length-1,Tg=t=>(t[kt]={version:wg()},t),Ig=()=>Tg({}),VR=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),BR=t=>s=>{var e;return s===void 0&&(s={}),((e=s[kt])==null?void 0:e.version)===wg()?s:t(s)},Og=[Tg,Ig,Ig,VR],WR=Object.fromEntries(Og.map((t,s)=>[s,BR(t)])),zR=t=>{if(t)throw t;const s=bt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},Fg=(t,s,e)=>{const n=Tt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},_g=(t,s,e)=>{const n=Tt();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=s.meta.offlineAction.payload.uuid;return n.remove(c),n.getQueue()};async function qR(t,s){if(!s.payload)throw new Error("Received empty payload");return qg(s)}const DR={...ja,effect:qR,discard:Pg,returnPromises:!0,persistCallback:zR,retry:UR,persistOptions:{storage:Ng},queue:{...ja.queue,enqueue:Fg,dequeue:_g,peek:(...t)=>CR(...t)}},jR=Gg(WR,kt),$R=o.compose(Lg.offline(DR),jR);async function gg(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=Sg[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Ba(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function Pg(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=
|
|
4
|
-
Action:`,s);const y=
|
|
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=bt(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(tT(r));const p=Tt();if(!p)throw new Error("Outbox coordinator not set");p.remove(s.payload.uuid);const y=s.meta.offline.rollback;throw y&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(y)),t}if(t instanceof C&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),d()),c.includes(r)&&(console.debug("Discarding request due to deletion:",s.payload.url),d()),t instanceof C){const p=t.status||((u=t.response)==null?void 0:u.status);if(p||console.warn("Error has no status code:",t),p!==void 0&&va.includes(p)){console.warn("Discarding request due to error:",t,`
|
|
4
|
+
Action:`,s);const y=Tt();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=Tt();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function CR(t,s,e){var n;return(n=Tt())==null?void 0:n.peek()}function UR(t,s){return bt().dispatch(sT(new Date().getTime())),Ka}const gt="An unknown error occurred",LR=500,bg=["non_field_errors","detail"];function NR(t,s){let e;if(t!=null&&t.body)if(typeof t.body=="object"){const n=t.body;if(typeof n.error=="string")e=n.error;else if(typeof n.message=="string")e=n.message;else try{e=Object.entries(n).map(([a,c])=>typeof c=="string"?bg.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?bg.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>NR?_t:e}class C extends Error{constructor(e){super(_t);m(this,"status");m(this,"response");m(this,"message");m(this,"options");const{response:n,innerError:a}=e;this.message=e.message??GR(n,a)??_t,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function gg(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(a=>a in e)}if(s(t))return t;if(typeof t=="object"&&t!==null){const e=t;if(s(e.response))return e.response;if(e.response&&s(e.response.response))return e.response.response}}class HR extends yg{constructor(s){super(s)}}class wt extends yg{constructor(e,n){super(e);m(this,"auth");this.auth=n}}class KR extends wt{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(rc(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(lc(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(dc(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:h.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(cc(n)),n}}function yt(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case h.GET:return`Get ${n}`;case h.POST:return`Create ${n}`;case h.PATCH:return`Update ${n}`;case h.PUT:return`Update ${n}`;case h.DELETE:return`Delete ${n}`}}class M extends wt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class q extends M{constructor(){super(...arguments);m(this,"pageSize",pg)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:P,...E}=e;d=await this.client.files.getFilePayload(P),l=URL.createObjectURL(P),r={...E,file_sha1:d.sha1,file_type:d.file_type,file_name:P.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),p=this.buildPayload(u);this.dispatch(n(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...p,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});y.then(({instance:P})=>{this.dispatch(a(P))}).catch(P=>{throw this.dispatch(c(this.getId(u))),P}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=y.then(({instance:P})=>P),T=y.then(async({instance:P,presigned_url:E})=>{try{return E&&await this.client.files.processPresignedUrl(P.file_sha1,E),P.file_sha1}catch(g){throw console.error("Upload to s3 using presigned url failed.",g),g}});return[u,f,T]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,p=yt(e,Math.min(n??e.length,ot)),y=[];for(const E of p){const g=[],k={},b=[],z=[];for(const W of E){let D;if("file"in W){const{file:Wa,...Fk}=W,bt=await this.client.files.getFilePayload(Wa);bt.sha1 in k||(k[bt.sha1]=bt);const qg=URL.createObjectURL(Wa);u.add(qg),D={...Fk,file_sha1:bt.sha1,file_type:bt.file_type,file_name:Wa.name,file_extension:bt.extension,file_url:qg}}else D=W;const v=this.buildModel(D);l.push(v);const L=this.buildBulkPayload(v);g.push(L);const ms=this.getBlockers(v);b.push(...ms);const Ok=this.getBlocks(v);z.push(...Ok)}const j={payloads:g,submittedAt:d,files:Object.values(k),blockers:b,blocks:z};y.push(j)}this.dispatch(a(l));const f=y.map(E=>{const{submittedAt:g,files:k,payloads:b,blocks:z,blockers:j}=E;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:g,files:k,payloads:b},blockers:j,blocks:z})});Promise.all(f).then(E=>{const g=E.flatMap(k=>k.instances);this.dispatch(c(g))}).catch(E=>{throw this.dispatch(r(l.map(g=>this.getId(g)))),console.error(E),E}).finally(()=>{for(const E of u)URL.revokeObjectURL(E)});const T=Promise.all(f).then(E=>E.flatMap(({instances:g})=>g)),P=Promise.all(f).then(async E=>{const g=[];for(const{presigned_urls:k}of E){const b=this.client.files.processPresignedUrls(k);for(const[z,j]of Object.entries(b))try{await j,g.push(z)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return g});return[l,T,P]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(d)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(d)),l}}}class YR extends q{constructor(){super(...arguments);m(this,"name","Asset attachment");m(this,"url","/asset-attachments");m(this,"actions",{addOne:pc,addMany:_s,setOne:mc,setMany:yc,updateOne:fc,updateMany:Sc,deleteOne:Ac,deleteMany:gs,initialize:hc});m(this,"selectors",{selectById:Tc,selectByIds:Ic})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class JR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Attachment");m(this,"url","/asset-procedure-type-attachments");m(this,"actions",{addOne:Pc,addMany:bc,setOne:Rc,setMany:Mc,updateOne:kc,updateMany:Ec,deleteOne:vc,deleteMany:Vc,initialize:gc});m(this,"selectors",{selectById:zc,selectByIds:qc})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,p=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,y=new Date().toISOString();return O({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:p,submitted_at:y,asset_procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class ZR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields Attachment");m(this,"url","/asset-procedure-type-fields-attachments");m(this,"actions",{addOne:$c,addMany:Cc,setOne:Uc,setMany:Lc,updateOne:Nc,updateMany:Gc,deleteOne:Hc,deleteMany:Kc,initialize:jc});m(this,"selectors",{selectById:Zc,selectByIds:Qc})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class QR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields");m(this,"url","/asset-procedure-type-fields");m(this,"actions",{addOne:er,addMany:tr,setOne:sr,setMany:ir,updateOne:nr,updateMany:ar,deleteOne:cr,deleteMany:rr,initialize:xc});m(this,"selectors",{selectById:ur,selectByIds:or})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class XR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values Attachment");m(this,"url","/asset-procedure-type-field-values-attachments");m(this,"actions",{addOne:mr,addMany:Vs,setOne:yr,setMany:fr,updateOne:Sr,updateMany:Ar,deleteOne:wr,deleteMany:Bs,initialize:pr});m(this,"selectors",{selectById:Or,selectByIds:Fr})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class xR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values");m(this,"url","/asset-procedure-type-field-values");m(this,"actions",{addOne:br,addMany:Rr,setOne:Mr,setMany:kr,updateOne:Er,updateMany:vr,deleteOne:Vr,deleteMany:Br,initialize:Pr});m(this,"selectors",{selectById:qr,selectByIds:Dr})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=yt(c,Math.min(n??c.length,ot)),T=[];for(const g of f){const k=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),k.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:a,field_values:k})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:k}=g,b=k.map(({asset:v})=>v),z=k.map(({fields_revision:v})=>v),j=k.map(({asset_procedure:v})=>v),W=k.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=_r(e)(d);this.dispatch(a(e)),this.dispatch(Bs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Vs(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class eM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure");m(this,"url","/asset-procedures");m(this,"actions",{addOne:Cr,addMany:Ds,setOne:Gr,setMany:Hr,updateOne:Ur,updateMany:Lr,deleteOne:Nr,deleteMany:js,initialize:$r});m(this,"selectors",{selectById:Zr,selectByIds:Qr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class tM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type");m(this,"url","/asset-procedure-types");m(this,"actions",{addOne:ed,addMany:td,setOne:cd,setMany:rd,updateOne:sd,updateMany:id,deleteOne:nd,deleteMany:ad,initialize:xr});m(this,"selectors",{selectById:ud,selectByIds:od})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=Jr(e)(d);this.dispatch(a(e)),this.dispatch(js(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ds(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class sM extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields Attachment");m(this,"url","/asset-procedure-step-fields-attachments");m(this,"actions",{addOne:md,addMany:yd,setOne:fd,setMany:Sd,updateOne:Ad,updateMany:wd,deleteOne:Td,deleteMany:Id,initialize:pd});m(this,"selectors",{selectById:Fd,selectByIds:_d})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}buildBulkPayload(e){return{uuid:e.uuid,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_step__organization:e}},n);return this.dispatch(a(c)),c}}class iM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields");m(this,"url","/asset-procedure-step-fields");m(this,"actions",{addOne:Rd,addMany:Md,setOne:kd,setMany:Ed,updateOne:vd,updateMany:Vd,deleteOne:Bd,deleteMany:Wd,initialize:bd});m(this,"selectors",{selectById:zd,selectByIds:qd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const r={...c,...e};this.dispatch(a(r));const d=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[r,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,r=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!r)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(r)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class nM extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values Attachment");m(this,"url","/asset-procedure-step-field-values-attachments");m(this,"actions",{addOne:Cd,addMany:Ks,setOne:Ud,setMany:Ld,updateOne:Nd,updateMany:Gd,deleteOne:Hd,deleteMany:Ys,initialize:$d});m(this,"selectors",{selectById:Yd,selectByIds:Jd})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class aM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values");m(this,"url","/asset-procedure-step-field-values");m(this,"actions",{addOne:el,addMany:tl,setOne:sl,setMany:il,updateOne:nl,updateMany:al,deleteOne:cl,deleteMany:rl,initialize:xd});m(this,"selectors",{selectById:ll,selectByIds:ul})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=yt(a,Math.min(n??a.length,ot)),T=[];for(const g of f){const k=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),k.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,asset_procedure_step:b.asset_procedure_step,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:c,field_values:k})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:k}=g,b=k.map(({asset:v})=>v),z=k.map(({fields_revision:v})=>v),j=k.map(({asset_procedure:v})=>v),W=k.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Zd(e)(d);this.dispatch(a(e)),this.dispatch(Ys(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ks(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class cM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step");m(this,"url","/asset-procedure-steps");m(this,"actions",{addOne:fl,addMany:Sl,setOne:ml,setMany:yl,updateOne:Al,updateMany:wl,deleteOne:Tl,deleteMany:Il,initialize:pl});m(this,"selectors",{selectById:Fl,selectByIds:_l})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const y=gl(e)(u);this.dispatch(d(e)),this.dispatch(a(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(p)),this.dispatch(c(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class rM extends M{constructor(){super(...arguments);m(this,"url","/assets");m(this,"name","Asset");m(this,"actions",{addOne:Rl,addMany:ei,setOne:vl,setMany:Vl,updateOne:Ml,updateMany:kl,deleteOne:El,deleteMany:ti,initialize:bl});m(this,"selectors",{selectById:zl,selectByIds:ql})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const u=Oc(e)(d),p=zy(e)(d);this.dispatch(c(e)),this.dispatch(gs(V(u))),this.dispatch(St(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(_s(u)),this.dispatch(ft(p)),y}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=ht.v4(),d=yt(e,Math.min(n??e.length,ot)).map(p=>{const y=p.map(f=>O(f));return{batchId:ht.v4(),payload:{transaction_id:r,submitted_at:c,assets:y}}}),l=[];let u=null;for(const p of d){const{batchId:y,payload:f}=p,T=f.assets.map(({uuid:b})=>b),P=f.assets.map(({asset_type:b})=>b),E=f.assets.map(({project:b})=>b),g=f.assets.map(({status:b})=>b),k=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(P).concat(E).concat(g),blocks:[y].concat(T)});u=p.batchId,l.push(k)}return Promise.all(l).then(p=>{const y=p.flat();this.dispatch(a(y))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Ht);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(Ts);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} assets that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=yt(e,Math.min(n??e.length,ot)),y=[];let f=null;for(const T of p){const P=ht.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(k),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(a(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class dM extends M{constructor(){super(...arguments);m(this,"name","Asset Stage Completion");m(this,"url","/asset-stage-completions");m(this,"actions",{addOne:Cl,addMany:Ul,setOne:Ll,setMany:Nl,updateOne:Gl,updateMany:Hl,deleteOne:Kl,deleteMany:Yl,initialize:$l});m(this,"selectors",{selectById:Xl,selectByIds:xl})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}bulkAdd(e){var T;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((T=n.getState().userReducer.currentUser)==null?void 0:T.id)??null,u=e.map(P=>O(P)),p=u.map(P=>({...P,created_by:l,submitted_at:d})),y=p.map(({uuid:P})=>P);this.dispatch(a(p));const f=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:u},blockers:[...e.map(P=>P.asset_procedure),...e.map(P=>P.asset_stage),...e.map(P=>P.asset)],blocks:y});return f.then(P=>{this.dispatch(c(P))}).catch(()=>{this.dispatch(r(y))}),[p,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class lM extends M{constructor(){super(...arguments);m(this,"name","Asset Stage");m(this,"url","/asset-stages");m(this,"actions",{addOne:nu,addMany:au,setOne:su,setMany:iu,updateOne:cu,updateMany:ru,deleteOne:du,deleteMany:lu,initialize:tu});m(this,"selectors",{selectById:ou,selectByIds:hu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class uM extends q{constructor(){super(...arguments);m(this,"name","Asset Type Attachment");m(this,"url","/asset-type-attachments");m(this,"actions",{addOne:yu,addMany:ri,setOne:fu,setMany:Su,updateOne:Au,updateMany:wu,deleteOne:Tu,deleteMany:di,initialize:mu});m(this,"selectors",{selectById:Ou,selectByIds:Fu})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class oM extends q{constructor(){super(...arguments);m(this,"name","Asset Type Fields Attachment");m(this,"url","/asset-type-fields-attachments");m(this,"actions",{addOne:Ru,addMany:Mu,setOne:ku,setMany:Eu,updateOne:vu,updateMany:Vu,deleteOne:Bu,deleteMany:Wu,initialize:bu});m(this,"selectors",{selectById:qu,selectByIds:Du})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class hM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Fields");m(this,"url","/asset-type-fields");m(this,"actions",{addOne:Uu,addMany:Lu,setOne:Nu,setMany:Gu,updateOne:Hu,updateMany:Ku,deleteOne:Yu,deleteMany:Ju,initialize:Cu});m(this,"selectors",{selectById:Qu,selectByIds:Xu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class pM extends q{constructor(){super(...arguments);m(this,"name","Asset Type Field Values Attachment");m(this,"url","/asset-type-field-values-attachments");m(this,"actions",{addOne:so,addMany:mi,setOne:io,setMany:no,updateOne:ao,updateMany:co,deleteOne:ro,deleteMany:yi,initialize:to});m(this,"selectors",{selectById:uo,selectByIds:oo})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class mM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Field Values");m(this,"url","/asset-type-field-values");m(this,"actions",{addOne:fo,addMany:So,setOne:Ao,setMany:wo,updateOne:To,updateMany:Io,deleteOne:Oo,deleteMany:Fo,initialize:yo});m(this,"selectors",{selectById:go,selectByIds:Po})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=[],y=yt(a,Math.min(n??a.length,ot)),f=[];for(const E of y){const g=[];for(const k of E){const b=O({...k,values:k.values,created_by:((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,submitted_at:u});p.push(b),g.push({uuid:b.uuid,asset:k.asset,fields_revision:k.fields_revision,published_at:k.published_at,values:b.values})}f.push({submitted_at:u,values:c,field_values:g})}this.dispatch(r(p));const T=[];for(const E of f){const{field_values:g}=E,k=g.map(({asset:W})=>W),b=g.map(({fields_revision:W})=>W),z=g.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:E,blockers:k.concat(b),blocks:z});T.push(j)}return Promise.all(T).then(E=>{this.dispatch(d(E.flat()))}).catch(()=>{this.dispatch(l(V(p)))}),[p,T]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=ho(e)(d);this.dispatch(a(e)),this.dispatch(yi(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(mi(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class yM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier");m(this,"url","/asset-type-identifiers");m(this,"actions",{addOne:ko,addMany:Eo,setOne:vo,setMany:Vo,updateOne:Bo,updateMany:Wo,deleteOne:zo,deleteMany:qo,initialize:Mo});m(this,"selectors",{selectById:jo,selectByIds:$o})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class fM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier Value");m(this,"url","/asset-type-identifier-values");m(this,"actions",{addOne:No,addMany:Go,setOne:Ho,setMany:Ko,updateOne:Yo,updateMany:Jo,deleteOne:Zo,deleteMany:Qo,initialize:Lo});m(this,"selectors",{selectById:xo,selectByIds:eh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}bulkAdd(e,n){var E;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((E=a.getState().userReducer.currentUser)==null?void 0:E.id)??null,p=yt(e,Math.min(n??e.length,ot)),y=[],f=[];for(const g of p){const k=[],b=[],z=[];for(const W of g){const D=O({...W,submitted_at:l,created_by:u});f.push(D);const v={uuid:D.uuid,asset:D.asset,asset_type_identifier:D.asset_type_identifier,value:D.value};k.push(v),b.push(D.asset),b.push(D.asset_type_identifier),z.push(D.uuid)}const j={payloads:k,submitted_at:l,blockers:b,blocks:z};y.push(j)}this.dispatch(c(f));const T=y.map(g=>{const{payloads:k,submitted_at:b,blockers:z,blocks:j}=g;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:k},blockers:z,blocks:j})});Promise.all(T).then(g=>{this.dispatch(r(g.flat()))}).catch(g=>{throw this.dispatch(d(V(f))),g});const P=Promise.all(T).then(g=>g.flat());return[f,P]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class SM extends M{constructor(){super(...arguments);m(this,"name","Asset Type");m(this,"url","/asset-types");m(this,"actions",{addOne:ch,addMany:rh,setOne:nh,setMany:ah,updateOne:dh,updateMany:lh,deleteOne:uh,deleteMany:oh,initialize:ih});m(this,"selectors",{selectById:ph,selectByIds:mh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=Wl(e)(d),p=_u(e)(d);this.dispatch(a(e)),this.dispatch(ti(V(u))),this.dispatch(di(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(ei(u)),this.dispatch(ri(p)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class AM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Status");m(this,"url","/asset-type-statuses");m(this,"actions",{addOne:Ah,addMany:wh,setOne:Th,setMany:Ih,updateOne:Oh,updateMany:Fh,deleteOne:_h,deleteMany:gh,initialize:Sh});m(this,"selectors",{selectById:bh,selectByIds:Rh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class wM extends q{constructor(){super(...arguments);m(this,"name","Document Attachment");m(this,"url","/document-attachments");m(this,"actions",{addOne:Wh,addMany:zh,setOne:qh,setMany:Dh,updateOne:jh,updateMany:$h,deleteOne:Ch,deleteMany:Uh,initialize:Bh});m(this,"selectors",{selectById:Nh,selectByIds:Gh})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}async bulkAdd(e,n){const[a,c,r]=await super.bulkAdd(e,n),d={};for(const{file_sha1:l,uuid:u}of a)l in d||(d[l]=[]),d[l].push(u);return r.then(l=>{const u=l.flatMap(p=>d[p]??[]);for(const p of u)this.makeReadable(p)}),[a,c,r]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.PATCH,url:`${this.url}/${e}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",e],blocks:["index-document-attachment"]})}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{document__project__organization:e}},n),r=this.list({queryParams:{document__organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class TM extends M{constructor(){super(...arguments);m(this,"name","Document");m(this,"url","/documents");m(this,"actions",{addOne:Jh,addMany:Zh,setOne:Qh,setMany:Xh,updateOne:xh,updateMany:ep,deleteOne:tp,deleteMany:sp,initialize:Yh});m(this,"selectors",{selectById:np,selectByIds:ap})}add(e){var y;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const y=cp(e)(u);this.dispatch(a(e)),this.dispatch(d(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(p)),this.dispatch(r(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class Tt extends wt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class IM extends Tt{constructor(){super(...arguments);m(this,"name","Email Domains");m(this,"url","/organization-email-domains");m(this,"actions",{addOne:lp,addMany:up,setOne:op,setMany:hp,updateOne:pp,updateMany:mp,deleteOne:yp,deleteMany:fp,initialize:dp});m(this,"selectors",{selectById:Ap,selectByIds:wp})}async add(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(c){throw this.dispatch(a(e)),c}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class OM extends wt{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const Ut={},Ea=new Set;class FM extends wt{constructor(){super(...arguments);m(this,"host");m(this,"dbPromise",Lg.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async getDB(){return await this.dbPromise}async addCache(e){if(!e.name)throw new Error(`Cant add a file without a name to cache: ${e.name}`);if(!e.type)throw new Error(`Cant add a file without a type to cache: ${e.name}`);if(!e.size)throw new Error(`Cant add an empty file to cache: ${e.name}`);const n=await Gt(e);if(Ea.has(n))return;const a=await this.getDB();!!await a.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await a.put("files",e,n),Ea.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),Ea.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,a=n){const c=e.split("?")[0]??e,r=await this.fetchCache(n);if(r)return r;let d;c in Ut?d=Ut[c]:Za(e)?(d=Ja(e,a),Ut[c]=d):(d=new Promise(p=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(y=>{const f=new File([y],a,{type:y.type});p(f)})}),Ut[c]=d);let l;try{l=await d}catch(p){throw p instanceof C&&delete Ut[c],p}const u=await Gt(l);if(u!==n){const p=`The hash of the file returned from the server (${u}) does not match the
|
|
7
|
+
`)}catch(a){console.error("Failed to extract error message from response body",a)}}else typeof t.body=="string"&&(e=t.body);else t!=null&&t.text?e=t.text:s instanceof Error&&(e=s.message);return!e||e.length>LR?gt:e}class C extends Error{constructor(e){super(gt);m(this,"status");m(this,"response");m(this,"message");m(this,"options");const{response:n,innerError:a}=e;this.message=e.message??NR(n,a)??gt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function Rg(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(a=>a in e)}if(s(t))return t;if(typeof t=="object"&&t!==null){const e=t;if(s(e.response))return e.response;if(e.response&&s(e.response.response))return e.response.response}}class GR extends Ag{constructor(s){super(s)}}class At extends Ag{constructor(e,n){super(e);m(this,"auth");this.auth=n}}class HR extends At{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(lc(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(oc(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(uc(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(dc(n)),n}}function mt(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case h.GET:return`Get ${n}`;case h.POST:return`Create ${n}`;case h.PATCH:return`Update ${n}`;case h.PUT:return`Update ${n}`;case h.DELETE:return`Delete ${n}`}}class M extends At{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class q extends M{constructor(){super(...arguments);m(this,"pageSize",fg)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:P,...E}=e;d=await this.client.files.getFilePayload(P),l=URL.createObjectURL(P),r={...E,file_sha1:d.sha1,file_type:d.file_type,file_name:P.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),p=this.buildPayload(u);this.dispatch(n(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...p,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});y.then(({instance:P})=>{this.dispatch(a(P))}).catch(P=>{throw this.dispatch(c(this.getId(u))),P}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=y.then(({instance:P})=>P),T=y.then(async({instance:P,presigned_url:E})=>{try{return E&&await this.client.files.processPresignedUrl(P.file_sha1,E),P.file_sha1}catch(g){throw console.error("Upload to s3 using presigned url failed.",g),g}});return[u,f,T]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,p=mt(e,Math.min(n??e.length,ot)),y=[];for(const E of p){const g=[],k={},b=[],z=[];for(const W of E){let D;if("file"in W){const{file:qa,...Ok}=W,Rt=await this.client.files.getFilePayload(qa);Rt.sha1 in k||(k[Rt.sha1]=Rt);const $g=URL.createObjectURL(qa);u.add($g),D={...Ok,file_sha1:Rt.sha1,file_type:Rt.file_type,file_name:qa.name,file_extension:Rt.extension,file_url:$g}}else D=W;const V=this.buildModel(D);l.push(V);const L=this.buildBulkPayload(V);g.push(L);const fs=this.getBlockers(V);b.push(...fs);const Ik=this.getBlocks(V);z.push(...Ik)}const j={payloads:g,submittedAt:d,files:Object.values(k),blockers:b,blocks:z};y.push(j)}this.dispatch(a(l));const f=y.map(E=>{const{submittedAt:g,files:k,payloads:b,blocks:z,blockers:j}=E;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:g,files:k,payloads:b},blockers:j,blocks:z})});Promise.all(f).then(E=>{const g=E.flatMap(k=>k.instances);this.dispatch(c(g))}).catch(E=>{throw this.dispatch(r(l.map(g=>this.getId(g)))),console.error(E),E}).finally(()=>{for(const E of u)URL.revokeObjectURL(E)});const T=Promise.all(f).then(E=>E.flatMap(({instances:g})=>g)),P=Promise.all(f).then(async E=>{const g=[];for(const{presigned_urls:k}of E){const b=this.client.files.processPresignedUrls(k);for(const[z,j]of Object.entries(b))try{await j,g.push(z)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return g});return[l,T,P]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(d)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(d)),l}}}class KR extends q{constructor(){super(...arguments);m(this,"name","Asset attachment");m(this,"url","/asset-attachments");m(this,"actions",{addOne:yc,addMany:Ps,setOne:fc,setMany:Sc,updateOne:Ac,updateMany:wc,deleteOne:Tc,deleteMany:bs,initialize:mc});m(this,"selectors",{selectById:Oc,selectByIds:Fc})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class YR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Attachment");m(this,"url","/asset-procedure-type-attachments");m(this,"actions",{addOne:Rc,addMany:Mc,setOne:kc,setMany:Ec,updateOne:vc,updateMany:Vc,deleteOne:Bc,deleteMany:Wc,initialize:bc});m(this,"selectors",{selectById:Dc,selectByIds:jc})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,p=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,y=new Date().toISOString();return O({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:p,submitted_at:y,asset_procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class JR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields Attachment");m(this,"url","/asset-procedure-type-fields-attachments");m(this,"actions",{addOne:Uc,addMany:Lc,setOne:Nc,setMany:Gc,updateOne:Hc,updateMany:Kc,deleteOne:Yc,deleteMany:Jc,initialize:Cc});m(this,"selectors",{selectById:Xc,selectByIds:xc})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class ZR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields");m(this,"url","/asset-procedure-type-fields");m(this,"actions",{addOne:sr,addMany:ir,setOne:nr,setMany:ar,updateOne:cr,updateMany:rr,deleteOne:dr,deleteMany:lr,initialize:tr});m(this,"selectors",{selectById:hr,selectByIds:pr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class QR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values Attachment");m(this,"url","/asset-procedure-type-field-values-attachments");m(this,"actions",{addOne:fr,addMany:Ws,setOne:Sr,setMany:Ar,updateOne:wr,updateMany:Tr,deleteOne:Ir,deleteMany:zs,initialize:yr});m(this,"selectors",{selectById:_r,selectByIds:gr})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class XR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values");m(this,"url","/asset-procedure-type-field-values");m(this,"actions",{addOne:Mr,addMany:kr,setOne:Er,setMany:vr,updateOne:Vr,updateMany:Br,deleteOne:Wr,deleteMany:zr,initialize:Rr});m(this,"selectors",{selectById:jr,selectByIds:$r})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=mt(c,Math.min(n??c.length,ot)),T=[];for(const g of f){const k=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),k.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:a,field_values:k})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:k}=g,b=k.map(({asset:V})=>V),z=k.map(({fields_revision:V})=>V),j=k.map(({asset_procedure:V})=>V),W=k.map(({uuid:V})=>V),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(v(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Pr(e)(d);this.dispatch(a(e)),this.dispatch(zs(v(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ws(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class xR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure");m(this,"url","/asset-procedures");m(this,"actions",{addOne:Lr,addMany:$s,setOne:Kr,setMany:Yr,updateOne:Nr,updateMany:Gr,deleteOne:Hr,deleteMany:Cs,initialize:Ur});m(this,"selectors",{selectById:Xr,selectByIds:xr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class eM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type");m(this,"url","/asset-procedure-types");m(this,"actions",{addOne:sd,addMany:id,setOne:dd,setMany:ld,updateOne:nd,updateMany:ad,deleteOne:cd,deleteMany:rd,initialize:td});m(this,"selectors",{selectById:hd,selectByIds:pd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=Qr(e)(d);this.dispatch(a(e)),this.dispatch(Cs(v(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch($s(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class tM extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields Attachment");m(this,"url","/asset-procedure-step-fields-attachments");m(this,"actions",{addOne:fd,addMany:Sd,setOne:Ad,setMany:wd,updateOne:Td,updateMany:Id,deleteOne:Od,deleteMany:Fd,initialize:yd});m(this,"selectors",{selectById:gd,selectByIds:Pd})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}buildBulkPayload(e){return{uuid:e.uuid,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_step__organization:e}},n);return this.dispatch(a(c)),c}}class sM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields");m(this,"url","/asset-procedure-step-fields");m(this,"actions",{addOne:kd,addMany:Ed,setOne:vd,setMany:Vd,updateOne:Bd,updateMany:Wd,deleteOne:zd,deleteMany:qd,initialize:Md});m(this,"selectors",{selectById:Dd,selectByIds:jd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const r={...c,...e};this.dispatch(a(r));const d=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[r,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,r=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!r)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(r)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class iM extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values Attachment");m(this,"url","/asset-procedure-step-field-values-attachments");m(this,"actions",{addOne:Ld,addMany:Js,setOne:Nd,setMany:Gd,updateOne:Hd,updateMany:Kd,deleteOne:Yd,deleteMany:Zs,initialize:Ud});m(this,"selectors",{selectById:Zd,selectByIds:Qd})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class nM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values");m(this,"url","/asset-procedure-step-field-values");m(this,"actions",{addOne:sl,addMany:il,setOne:nl,setMany:al,updateOne:cl,updateMany:rl,deleteOne:dl,deleteMany:ll,initialize:tl});m(this,"selectors",{selectById:ol,selectByIds:hl})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=mt(a,Math.min(n??a.length,ot)),T=[];for(const g of f){const k=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),k.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,asset_procedure_step:b.asset_procedure_step,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:c,field_values:k})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:k}=g,b=k.map(({asset:V})=>V),z=k.map(({fields_revision:V})=>V),j=k.map(({asset_procedure:V})=>V),W=k.map(({uuid:V})=>V),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(v(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Xd(e)(d);this.dispatch(a(e)),this.dispatch(Zs(v(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Js(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class aM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step");m(this,"url","/asset-procedure-steps");m(this,"actions",{addOne:Al,addMany:wl,setOne:fl,setMany:Sl,updateOne:Tl,updateMany:Il,deleteOne:Ol,deleteMany:Fl,initialize:yl});m(this,"selectors",{selectById:gl,selectByIds:Pl})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const y=bl(e)(u);this.dispatch(d(e)),this.dispatch(a(v(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(p)),this.dispatch(c(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class cM extends M{constructor(){super(...arguments);m(this,"url","/assets");m(this,"name","Asset");m(this,"actions",{addOne:kl,addMany:si,setOne:Bl,setMany:Wl,updateOne:El,updateMany:vl,deleteOne:Vl,deleteMany:ii,initialize:Ml});m(this,"selectors",{selectById:Dl,selectByIds:jl})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const u=_c(e)(d),p=Dy(e)(d);this.dispatch(c(e)),this.dispatch(bs(v(u))),this.dispatch(ft(v(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(Ps(u)),this.dispatch(yt(p)),y}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=ht.v4(),d=mt(e,Math.min(n??e.length,ot)).map(p=>{const y=p.map(f=>O(f));return{batchId:ht.v4(),payload:{transaction_id:r,submitted_at:c,assets:y}}}),l=[];let u=null;for(const p of d){const{batchId:y,payload:f}=p,T=f.assets.map(({uuid:b})=>b),P=f.assets.map(({asset_type:b})=>b),E=f.assets.map(({project:b})=>b),g=f.assets.map(({status:b})=>b),k=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(P).concat(E).concat(g),blocks:[y].concat(T)});u=p.batchId,l.push(k)}return Promise.all(l).then(p=>{const y=p.flat();this.dispatch(a(y))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=v(e).toSorted(Ht);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(Os);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} assets that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=mt(e,Math.min(n??e.length,ot)),y=[];let f=null;for(const T of p){const P=ht.v4(),E=v(T),g=T.map(({status:b})=>b).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(k),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(a(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class rM extends M{constructor(){super(...arguments);m(this,"name","Asset Stage Completion");m(this,"url","/asset-stage-completions");m(this,"actions",{addOne:Ll,addMany:Nl,setOne:Gl,setMany:Hl,updateOne:Kl,updateMany:Yl,deleteOne:Jl,deleteMany:Zl,initialize:Ul});m(this,"selectors",{selectById:eu,selectByIds:tu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}bulkAdd(e){var T;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((T=n.getState().userReducer.currentUser)==null?void 0:T.id)??null,u=e.map(P=>O(P)),p=u.map(P=>({...P,created_by:l,submitted_at:d})),y=p.map(({uuid:P})=>P);this.dispatch(a(p));const f=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:u},blockers:[...e.map(P=>P.asset_procedure),...e.map(P=>P.asset_stage),...e.map(P=>P.asset)],blocks:y});return f.then(P=>{this.dispatch(c(P))}).catch(()=>{this.dispatch(r(y))}),[p,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class dM extends M{constructor(){super(...arguments);m(this,"name","Asset Stage");m(this,"url","/asset-stages");m(this,"actions",{addOne:cu,addMany:ru,setOne:nu,setMany:au,updateOne:du,updateMany:lu,deleteOne:uu,deleteMany:ou,initialize:iu});m(this,"selectors",{selectById:pu,selectByIds:mu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class lM extends q{constructor(){super(...arguments);m(this,"name","Asset Type Attachment");m(this,"url","/asset-type-attachments");m(this,"actions",{addOne:Su,addMany:li,setOne:Au,setMany:wu,updateOne:Tu,updateMany:Iu,deleteOne:Ou,deleteMany:ui,initialize:fu});m(this,"selectors",{selectById:_u,selectByIds:gu})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class uM extends q{constructor(){super(...arguments);m(this,"name","Asset Type Fields Attachment");m(this,"url","/asset-type-fields-attachments");m(this,"actions",{addOne:ku,addMany:Eu,setOne:vu,setMany:Vu,updateOne:Bu,updateMany:Wu,deleteOne:zu,deleteMany:qu,initialize:Mu});m(this,"selectors",{selectById:ju,selectByIds:$u})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class oM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Fields");m(this,"url","/asset-type-fields");m(this,"actions",{addOne:Nu,addMany:Gu,setOne:Hu,setMany:Ku,updateOne:Yu,updateMany:Ju,deleteOne:Zu,deleteMany:Qu,initialize:Lu});m(this,"selectors",{selectById:xu,selectByIds:eo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class hM extends q{constructor(){super(...arguments);m(this,"name","Asset Type Field Values Attachment");m(this,"url","/asset-type-field-values-attachments");m(this,"actions",{addOne:no,addMany:fi,setOne:ao,setMany:co,updateOne:ro,updateMany:lo,deleteOne:uo,deleteMany:Si,initialize:io});m(this,"selectors",{selectById:ho,selectByIds:po})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class pM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Field Values");m(this,"url","/asset-type-field-values");m(this,"actions",{addOne:Ao,addMany:wo,setOne:To,setMany:Io,updateOne:Oo,updateMany:Fo,deleteOne:_o,deleteMany:go,initialize:So});m(this,"selectors",{selectById:bo,selectByIds:Ro})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=[],y=mt(a,Math.min(n??a.length,ot)),f=[];for(const E of y){const g=[];for(const k of E){const b=O({...k,values:k.values,created_by:((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,submitted_at:u});p.push(b),g.push({uuid:b.uuid,asset:k.asset,fields_revision:k.fields_revision,published_at:k.published_at,values:b.values})}f.push({submitted_at:u,values:c,field_values:g})}this.dispatch(r(p));const T=[];for(const E of f){const{field_values:g}=E,k=g.map(({asset:W})=>W),b=g.map(({fields_revision:W})=>W),z=g.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:E,blockers:k.concat(b),blocks:z});T.push(j)}return Promise.all(T).then(E=>{this.dispatch(d(E.flat()))}).catch(()=>{this.dispatch(l(v(p)))}),[p,T]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=mo(e)(d);this.dispatch(a(e)),this.dispatch(Si(v(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(fi(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class mM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier");m(this,"url","/asset-type-identifiers");m(this,"actions",{addOne:vo,addMany:Vo,setOne:Bo,setMany:Wo,updateOne:zo,updateMany:qo,deleteOne:Do,deleteMany:jo,initialize:Eo});m(this,"selectors",{selectById:Co,selectByIds:Uo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class yM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier Value");m(this,"url","/asset-type-identifier-values");m(this,"actions",{addOne:Ho,addMany:Ko,setOne:Yo,setMany:Jo,updateOne:Zo,updateMany:Qo,deleteOne:Xo,deleteMany:xo,initialize:Go});m(this,"selectors",{selectById:th,selectByIds:sh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}bulkAdd(e,n){var E;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((E=a.getState().userReducer.currentUser)==null?void 0:E.id)??null,p=mt(e,Math.min(n??e.length,ot)),y=[],f=[];for(const g of p){const k=[],b=[],z=[];for(const W of g){const D=O({...W,submitted_at:l,created_by:u});f.push(D);const V={uuid:D.uuid,asset:D.asset,asset_type_identifier:D.asset_type_identifier,value:D.value};k.push(V),b.push(D.asset),b.push(D.asset_type_identifier),z.push(D.uuid)}const j={payloads:k,submitted_at:l,blockers:b,blocks:z};y.push(j)}this.dispatch(c(f));const T=y.map(g=>{const{payloads:k,submitted_at:b,blockers:z,blocks:j}=g;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:k},blockers:z,blocks:j})});Promise.all(T).then(g=>{this.dispatch(r(g.flat()))}).catch(g=>{throw this.dispatch(d(v(f))),g});const P=Promise.all(T).then(g=>g.flat());return[f,P]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class fM extends M{constructor(){super(...arguments);m(this,"name","Asset Type");m(this,"url","/asset-types");m(this,"actions",{addOne:dh,addMany:lh,setOne:ch,setMany:rh,updateOne:uh,updateMany:oh,deleteOne:hh,deleteMany:ph,initialize:ah});m(this,"selectors",{selectById:yh,selectByIds:fh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=ql(e)(d),p=Pu(e)(d);this.dispatch(a(e)),this.dispatch(ii(v(u))),this.dispatch(ui(v(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(si(u)),this.dispatch(li(p)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class SM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Status");m(this,"url","/asset-type-statuses");m(this,"actions",{addOne:Th,addMany:Ih,setOne:Oh,setMany:Fh,updateOne:_h,updateMany:gh,deleteOne:Ph,deleteMany:bh,initialize:wh});m(this,"selectors",{selectById:Mh,selectByIds:kh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class AM extends q{constructor(){super(...arguments);m(this,"name","Document Attachment");m(this,"url","/document-attachments");m(this,"actions",{addOne:qh,addMany:Dh,setOne:jh,setMany:$h,updateOne:Ch,updateMany:Uh,deleteOne:Lh,deleteMany:Nh,initialize:zh});m(this,"selectors",{selectById:Hh,selectByIds:Kh})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}async bulkAdd(e,n){const[a,c,r]=await super.bulkAdd(e,n),d={};for(const{file_sha1:l,uuid:u}of a)l in d||(d[l]=[]),d[l].push(u);return r.then(l=>{const u=l.flatMap(p=>d[p]??[]);for(const p of u)this.makeReadable(p)}),[a,c,r]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.PATCH,url:`${this.url}/${e}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",e],blocks:["index-document-attachment"]})}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{document__project__organization:e}},n),r=this.list({queryParams:{document__organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class wM extends M{constructor(){super(...arguments);m(this,"name","Document");m(this,"url","/documents");m(this,"actions",{addOne:Qh,addMany:Xh,setOne:xh,setMany:ep,updateOne:tp,updateMany:sp,deleteOne:ip,deleteMany:np,initialize:Zh});m(this,"selectors",{selectById:cp,selectByIds:rp})}add(e){var y;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const y=dp(e)(u);this.dispatch(a(e)),this.dispatch(d(v(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(p)),this.dispatch(r(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class wt extends At{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class TM extends wt{constructor(){super(...arguments);m(this,"name","Email Domains");m(this,"url","/organization-email-domains");m(this,"actions",{addOne:op,addMany:hp,setOne:pp,setMany:mp,updateOne:yp,updateMany:fp,deleteOne:Sp,deleteMany:Ap,initialize:up});m(this,"selectors",{selectById:Tp,selectByIds:Ip})}async add(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(c){throw this.dispatch(a(e)),c}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class IM extends At{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 Ut={},Va=new Set;class OM extends At{constructor(){super(...arguments);m(this,"host");m(this,"dbPromise",Hg.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 Gt(e);if(Va.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),Va.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),Va.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 Ut?d=Ut[c]:Xa(e)?(d=Qa(e,a),Ut[c]=d):(d=new Promise(p=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(y=>{const f=new File([y],a,{type:y.type});p(f)})}),Ut[c]=d);let l;try{l=await d}catch(p){throw p instanceof C&&delete Ut[c],p}const u=await Gt(l);if(u!==n){const p=`The hash of the file returned from the server (${u}) does not match the
|
|
8
8
|
expected hash (${n}). This can happen if you're using a local development server and the
|
|
9
9
|
isExternalUrl flag in the request details is set to true, because instead of requesting the local
|
|
10
10
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
11
11
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
12
12
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
13
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(p)}return await this.addCache(l),l}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.processPresignedUrl(a,c);return n}async getFilePayload(e){const a={sha1:await Gt(e),file_type:e.type,extension:Ka(e),size:e.size};return await this.client.files.addCache(e),a}}class _M extends M{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:Pp,addMany:bp,setOne:Rp,setMany:Mp,updateOne:kp,updateMany:Ep,deleteOne:vp,deleteMany:Vp,initialize:gp});m(this,"selectors",{selectById:Wp,selectByIds:zp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.form],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class gM extends M{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:$p,addMany:Cp,setOne:Up,setMany:Lp,updateOne:Np,updateMany:Gp,deleteOne:Hp,deleteMany:Kp,initialize:jp});m(this,"selectors",{selectById:Jp,selectByIds:Zp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class PM extends q{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:em,addMany:tm,setOne:sm,setMany:im,updateOne:nm,updateMany:am,deleteOne:cm,deleteMany:rm,initialize:xp});m(this,"selectors",{selectById:lm,selectByIds:um})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class bM extends M{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:qi,addMany:Di,setOne:mm,setMany:ym,updateOne:fm,updateMany:Sm,deleteOne:ji,deleteMany:$i,initialize:pm});m(this,"selectors",{selectById:Am,selectByIds:wm})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class RM extends M{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:_m,addMany:gm,setOne:Pm,setMany:bm,updateOne:Rm,updateMany:Mm,deleteOne:km,deleteMany:Em,initialize:Fm});m(this,"selectors",{selectById:Bm,selectByIds:Wm})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=O({...e,submitted_at:d,created_by:l}),p=O({...n,form:u.uuid,submitted_at:d,created_by:l});this.dispatch(c(u)),this.dispatch(qi(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...R(u),initial_revision:{uuid:p.uuid,submitted_at:p.submitted_at,title:p.title,description:p.description,fields:p.fields}},blockers:[],blocks:[u.uuid,p.uuid]});return y.catch(T=>{throw this.dispatch(r(u.uuid)),this.dispatch(ji(p.uuid)),T}),[u,p,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error("Expected form to exist");const u=ay(e)(d),p=Tm(e)(d);this.dispatch(a(e)),this.dispatch(Xi(V(u))),this.dispatch($i(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Di(p)),this.dispatch(Qi(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class MM extends q{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:Dm,addMany:Gi,setOne:jm,setMany:$m,updateOne:Cm,updateMany:Um,deleteOne:Lm,deleteMany:Hi,initialize:qm});m(this,"selectors",{selectById:Nm,selectByIds:Gm})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=Ji(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class kM extends M{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:Xm,addMany:Qi,setOne:Zm,setMany:Qm,updateOne:xm,updateMany:ey,deleteOne:ty,deleteMany:Xi,initialize:Jm});m(this,"selectors",{selectById:iy,selectByIds:ny})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Hm(e)(d);this.dispatch(a(e)),this.dispatch(Hi(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Gi(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(r)),r}}class EM extends q{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:oy,addMany:hy,setOne:ly,setMany:uy,updateOne:py,updateMany:my,deleteOne:yy,deleteMany:fy,initialize:dy});m(this,"selectors",{selectById:Ay,selectByIds:wy})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class vM extends M{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:by,addMany:ft,setOne:_y,setMany:Fy,updateOne:gy,updateMany:Py,deleteOne:Ry,deleteMany:St,initialize:Oy});m(this,"selectors",{selectById:ky,selectByIds:Ey})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class VM extends q{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:$y,addMany:an,setOne:Cy,setMany:Uy,updateOne:Ly,updateMany:Ny,deleteOne:Gy,deleteMany:cn,initialize:jy});m(this,"selectors",{selectById:Yy,selectByIds:Jy})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class BM extends q{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:xy,addMany:ef,setOne:tf,setMany:sf,updateOne:nf,updateMany:af,deleteOne:cf,deleteMany:rf,initialize:Xy});m(this,"selectors",{selectById:lf,selectByIds:uf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class WM extends M{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:mf,addMany:yf,setOne:ff,setMany:Sf,updateOne:Af,updateMany:wf,deleteOne:Tf,deleteMany:If,initialize:pf});m(this,"selectors",{selectById:Of,selectByIds:Ff})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue],blocks:[d.uuid]});return l.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class zM extends M{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:bf,addMany:pn,setOne:Rf,setMany:Mf,updateOne:kf,updateMany:Ef,deleteOne:vf,deleteMany:mn,initialize:Pf});m(this,"selectors",{selectById:Bf,selectByIds:Wf})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=new Date().toISOString(),u=((f=d.userReducer.currentUser)==null?void 0:f.id)??null,p=O({...e,submitted_at:l,created_by:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[p.project,p.issue_type,p.status],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(T=>{throw this.dispatch(r(p.uuid)),T}),[p,y]}update(e){var y;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const d={...r,...e};this.dispatch(n(d));const l={};for(const f of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(f in e&&e[f]!==r[f])switch(f){case $.PRIORITY:l[f]=e[f];break;case $.DUE_DATE:l[f]=e[f];break;case $.DESCRIPTION:l[f]=e[f];break;case $.TITLE:l[f]=e[f];break;case $.STATUS:{const T=e[f],P=vn(T)(c);if(!P)throw new Error(`Trying to update issue type status with ${T} which does not exist in store`);l[f]={name:P.name,color:P.color,uuid:P.uuid};break}case $.ASSIGNED_TO:{const T=e[f];if(T===null)l[f]=null;else{const P=ls(T)(c);if(!P)throw new Error(`Trying to update assigned to with ${T} which does not exist in store.`);l[f]={full_name:P.username,id:P.id}}break}}const u=O({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(Bn(u));const p=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(zn(u.uuid))}),[d,p]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Ht);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(Ts);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} issues that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=yt(e,Math.min(n??e.length,ot)),y=[];let f=null;for(const T of p){const P=ht.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(k),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const u=vy(e)(d),p=Wy(e)(d),y=Ky(e)(d),f=dw(e)(d);this.dispatch(a(e)),this.dispatch(cn(V(y))),this.dispatch(qn(V(f))),this.dispatch(St(V(u))),this.dispatch(St(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(T){throw this.dispatch(c(l)),this.dispatch(an(y)),this.dispatch(Wn(f)),this.dispatch(ft(u)),this.dispatch(ft(p)),T}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d),u=Vy(e)(d),p=By(e)(d);this.dispatch(c(e)),this.dispatch(St(V(u))),this.dispatch(St(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(ft(u)),this.dispatch(ft(p)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class qM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:$f,addMany:Cf,setOne:Uf,setMany:Lf,updateOne:Nf,updateMany:Gf,deleteOne:Hf,deleteMany:Kf,initialize:jf});m(this,"selectors",{selectById:Jf,selectByIds:Zf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class DM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:eS,addMany:tS,setOne:sS,setMany:iS,updateOne:nS,updateMany:aS,deleteOne:cS,deleteMany:rS,initialize:xf});m(this,"selectors",{selectById:lS,selectByIds:uS})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class jM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:RS,addMany:MS,setOne:kS,setMany:ES,updateOne:vS,updateMany:VS,deleteOne:BS,deleteMany:WS,initialize:bS});m(this,"selectors",{selectById:qS,selectByIds:DS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class $M extends q{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:US,addMany:On,setOne:LS,setMany:NS,updateOne:GS,updateMany:HS,deleteOne:KS,deleteMany:Fn,initialize:CS});m(this,"selectors",{selectById:JS,selectByIds:ZS})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class CM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:mS,addMany:yS,setOne:fS,setMany:SS,updateOne:AS,updateMany:wS,deleteOne:TS,deleteMany:IS,initialize:pS});m(this,"selectors",{selectById:FS,selectByIds:_S})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.issue,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=QS(e)(d);this.dispatch(a(e)),this.dispatch(Fn(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(On(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class UM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:tA,addMany:sA,setOne:iA,setMany:nA,updateOne:aA,updateMany:cA,deleteOne:rA,deleteMany:dA,initialize:eA});m(this,"selectors",{selectById:uA,selectByIds:oA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class LM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:yA,addMany:fA,setOne:SA,setMany:AA,updateOne:wA,updateMany:TA,deleteOne:IA,deleteMany:OA,initialize:mA});m(this,"selectors",{selectById:_A,selectByIds:gA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class NM extends M{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:MA,addMany:kA,setOne:EA,setMany:vA,updateOne:VA,updateMany:BA,deleteOne:WA,deleteMany:zA,initialize:RA});m(this,"selectors",{selectById:DA,selectByIds:jA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,submitted_at:u,created_by:l});this.dispatch(a(p));const y=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=zf(e)(d);this.dispatch(a(e)),this.dispatch(mn(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(pn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class GM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:LA,addMany:NA,setOne:GA,setMany:HA,updateOne:KA,updateMany:YA,deleteOne:JA,deleteMany:ZA,initialize:UA});m(this,"selectors",{selectById:vn,selectByIds:XA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class HM extends M{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:Bn,addMany:Wn,setOne:sw,setMany:iw,updateOne:nw,updateMany:aw,deleteOne:zn,deleteMany:qn,initialize:tw});m(this,"selectors",{selectById:cw,selectByIds:rw})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}const KM=1800;function YM(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 JM extends HR{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:h.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Eh(!1)),this.clearTokens(),this.dispatch(I()),this.dispatch(I())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=Ng(e).exp??n}catch{a=n}return a-n<KM}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof C&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??_t).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new C({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new C({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=ht.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:h.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(YM(a))})}}class ZM extends Tt{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:Fw,addMany:_w,setOne:gw,setMany:Pw,updateOne:bw,updateMany:Rw,deleteOne:Mw,deleteMany:kw,initialize:Ow});m(this,"selectors",{selectById:vw,selectByIds:Vw})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d),u=ls(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch(Un(l.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Cn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class QM extends Tt{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:$w,addMany:jw,setOne:Dw,setMany:qw,updateOne:Uw,updateMany:Cw,deleteOne:Lw,deleteMany:Nw,initialize:zw});m(this,"selectors",{selectById:Kw,selectByIds:Yw})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class XM extends M{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:nT,addMany:aT,setOne:cT,setMany:rT,updateOne:dT,updateMany:lT,deleteOne:uT,deleteMany:oT,initialize:iT});m(this,"selectors",{selectById:pT,selectByIds:mT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.organization_access,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(p=>{throw this.dispatch(r(d.uuid)),p}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>R(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(r(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class xM extends q{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:ST,addMany:AT,setOne:wT,setMany:TT,updateOne:IT,updateMany:OT,deleteOne:FT,deleteMany:_T,initialize:fT});m(this,"selectors",{selectById:PT,selectByIds:bT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class ek extends q{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:VT,addMany:BT,setOne:ET,setMany:vT,updateOne:WT,updateMany:zT,deleteOne:qT,deleteMany:DT,initialize:kT});m(this,"selectors",{selectById:CT,selectByIds:UT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class tk extends Tt{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:JT,addMany:YT,setOne:KT,setMany:HT,updateOne:QT,updateMany:ZT,deleteOne:XT,deleteMany:xT,initialize:GT});m(this,"selectors",{selectById:sI,selectByIds:iI})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class sk extends M{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:rI,addMany:dI,setOne:lI,setMany:uI,updateOne:oI,updateMany:hI,deleteOne:pI,deleteMany:mI,initialize:cI});m(this,"selectors",{selectById:SI,selectByIds:AI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.team],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>R(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.map(y=>y.uuid)))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class ik extends M{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:II,addMany:OI,setOne:FI,setMany:_I,updateOne:gI,updateMany:PI,deleteOne:bI,deleteMany:RI,initialize:TI});m(this,"selectors",{selectById:kI,selectByIds:EI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class nk extends Tt{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:Cn,addMany:mw,setOne:pw,setMany:hw,updateOne:fw,updateMany:yw,deleteOne:Un,deleteMany:Sw,initialize:ow});m(this,"selectors",{selectById:ls,selectByIds:Tw})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:h.GET,url:r,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class ak extends M{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:qI,addMany:DI,setOne:jI,setMany:$I,updateOne:CI,updateMany:UI,deleteOne:LI,deleteMany:NI,initialize:zI});m(this,"selectors",{selectById:HI,selectByIds:KI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type,d.project],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class ck extends M{constructor(){super(...arguments);m(this,"name","Workflow Issue Link");m(this,"url","/workflow-issue-links");m(this,"actions",{addOne:QI,addMany:XI,setOne:xI,setMany:eO,updateOne:tO,updateMany:sO,deleteOne:iO,deleteMany:nO,initialize:ZI});m(this,"selectors",{selectById:cO,selectByIds:rO})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.workflow,e.issue],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow issue link with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class rk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:oO,addMany:hO,setOne:pO,setMany:mO,updateOne:yO,updateMany:fO,deleteOne:SO,deleteMany:AO,initialize:uO});m(this,"selectors",{selectById:TO,selectByIds:IO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(V(u)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class dk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:gO,addMany:PO,setOne:bO,setMany:RO,updateOne:MO,updateMany:kO,deleteOne:EO,deleteMany:vO,initialize:_O});m(this,"selectors",{selectById:BO,selectByIds:WO})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class lk extends Tt{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:jO,addMany:$O,setOne:CO,setMany:UO,updateOne:LO,updateMany:NO,deleteOne:GO,deleteMany:HO,initialize:DO});m(this,"selectors",{selectById:YO,selectByIds:JO})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class uk extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:xO,addMany:la,setOne:eF,setMany:tF,updateOne:sF,updateMany:iF,deleteOne:nF,deleteMany:ua,initialize:XO});m(this,"selectors",{selectById:rF,selectByIds:dF})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class ok extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:hF,addMany:pF,setOne:mF,setMany:yF,updateOne:fF,updateMany:SF,deleteOne:AF,deleteMany:wF,initialize:oF});m(this,"selectors",{selectById:IF,selectByIds:OF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const u=cF(e)(d);this.dispatch(a(e)),this.dispatch(ua(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(la(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class hk extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:PF,addMany:ma,setOne:bF,setMany:RF,updateOne:MF,updateMany:kF,deleteOne:EF,deleteMany:ya,initialize:gF});m(this,"selectors",{selectById:VF,selectByIds:BF})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class pk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review Request");m(this,"url","/workflow-step-field-values-review-requests");m(this,"actions",{addOne:xF,addMany:wa,setOne:e_,setMany:t_,updateOne:s_,updateMany:i_,deleteOne:n_,deleteMany:Ta,initialize:XF});m(this,"selectors",{selectById:c_,selectByIds:r_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class mk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review");m(this,"url","/workflow-step-field-values-reviews");m(this,"actions",{addOne:h_,addMany:Oa,setOne:p_,setMany:m_,updateOne:y_,updateMany:f_,deleteOne:S_,deleteMany:Fa,initialize:o_});m(this,"selectors",{selectById:w_,selectByIds:T_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class yk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:jF,addMany:$F,setOne:CF,setMany:UF,updateOne:LF,updateMany:NF,deleteOne:GF,deleteMany:HF,initialize:DF});m(this,"selectors",{selectById:YF,selectByIds:JF})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()}),u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.workflow,l.workflow_step,l.fields_revision],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const u=WF(e)(d),p=I_(e)(d),y=d_(e)(d);this.dispatch(a(e)),this.dispatch(ya(V(u))),this.dispatch(Fa(V(p))),this.dispatch(Ta(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(ma(u)),this.dispatch(Oa(p)),this.dispatch(wa(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class fk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:g_,addMany:P_,setOne:b_,setMany:R_,updateOne:M_,updateMany:k_,deleteOne:E_,deleteMany:v_,initialize:__});m(this,"selectors",{selectById:B_,selectByIds:W_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Sk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:j_,addMany:$_,setOne:C_,setMany:U_,updateOne:L_,updateMany:N_,deleteOne:G_,deleteMany:H_,initialize:D_});m(this,"selectors",{selectById:Y_,selectByIds:J_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Ak extends M{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:x_,addMany:eg,setOne:tg,setMany:sg,updateOne:ig,updateMany:ng,deleteOne:ag,deleteMany:cg,initialize:X_});m(this,"selectors",{selectById:dg,selectByIds:lg})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function va(t,s,e,n,a){const c=n instanceof wt;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:p,queryParams:y,attachmentHash:f,isExternalUrl:T,isAuthNeeded:P,isResponseBlob:E}={...r,...s};let g=s.url;const k=f?await e.files.fetchCache(f):void 0;if(f&&!k)throw new Error(`Cannot upload file ${f} because it's not cached.`);!T&&!g.startsWith("http")&&(!g.startsWith("/")&&!g.startsWith("blob:")&&(g="/"+g),g=t+g);const b=v=>{if(f){if(!d)throw new Error(`No S3 URL for file ${f}`);if("warning"in d)throw new Error(`S3 URL warning for file ${f}`);if(!k)throw new Error(`No file for file ${f}`);const L=d.fields["x-amz-checksum-sha1"];if(!L)throw new Error(`No checksum for file ${f}`);return v.set("x-amz-checksum-sha1",L).field({...l,...d.fields}).attach("file",k)}return v.send(l)},j={[h.GET]:()=>E?Ot.get(g.toString()).responseType("blob"):Ot.get(g.toString()),[h.POST]:()=>{const v=Ot.post(g.toString());return b(v)},[h.PATCH]:()=>{const v=Ot.patch(g.toString());return b(v)},[h.PUT]:()=>{const v=Ot.put(g.toString());return b(v)},[h.DELETE]:()=>{const v=Ot.delete(g.toString());return b(v)}}[p];let W=j();const D=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",D),P&&c){const v=n.auth.getAuthHeader();W=W.set("Authorization",v)}u&&(W=W.set(u));try{return await W.query(y)}catch(v){const L=gg(v),ms=L==null?void 0:L.status;if(c&&ms===401)return await n.auth.handleUnauthorized(W,L),W.query(y);throw new C({response:L,innerError:v,discard:ka.includes(ms)})}finally{a==null||a.removeEventListener("abort",D)}}class wk{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new fs,r={...e,uuid:e.uuid??ht.v4()};return va(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??_t).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof C)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof C)throw a;return a})}_enqueueRequest(s,e,n){const a=new fs,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(Xw(c)),d=u=>{if(u)a.resolve(u.body);else{const p=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(p)}},l=u=>{u instanceof C?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
|
|
14
|
-
Converting error to APIError and discarding.`),u=new C({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return r.then(d,l),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,l=[];let u=await this.performRequest(s,r,a,c);for(l.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:d},a,c),l.push(u.results);return l}}class gt{constructor(){m(this,"graph");m(this,"requestAttemptCounter");this.graph=new Gg.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new gt;for(let n=0;n<s.length;n++){const a=s[n];if(!a){console.error("Outbox item was undefined");continue}e.sneakRequest(a);for(let c=0;c<n;c++){const r=s[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==a.payload.uuid&&r.payload.blocks.some(d=>a.payload.blockers.includes(d))&>._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){gt._addDependency(s,e,this.graph)}static _addDependency(s,e,n){if(s===e)throw new Error(`Tried to add dependency from node to itself: ${s}`);if(!n.hasNode(s))throw new Error(`Tried to add dependency from non-existent node: ${s} (to node: ${e})`);if(!n.hasNode(e))throw new Error(`Tried to add dependency to non-existent node: ${e} (from node: ${s})`);n.addDependency(s,e)}addRequest(s){if(this.graph.addNode(s.payload.uuid,s),!(s.payload.blockers.length===0||this.graph.size()===1))for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&this._addDependency(s.payload.uuid,e)}}insertRequest(s){this.graph.addNode(s.payload.uuid,s);for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let Pg;function bg(t){Pg=t}function Pt(){return Pg}let Rg;function Mg(t){Rg=t}function kg(){return Rg}let Va=null;function It(){const t=Pt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Va)return Va;const s=t.getState().offline.outbox,e=gt._fromOutbox(s);return Va=e,e}const Tk=(t,s)=>{const e=new s(t);return Mg(e),bg(t),e};class Ik{constructor(s){m(this,"_all");m(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class Ba{constructor(){m(this,"next");this.next=null}then(s){return new Ik(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Pt())throw new Error("Client store not set");const n=kg();if(!n)throw new Error("Client SDK not set");return Og(s,n)}}}class Eg extends Ba{async run(s){return super.run(s)}}class vg extends Ba{async run(s){return super.run(s)}}const Vg=new Eg().then(new vg).compile();function Bg(t){var s;return(s=Vg[0])==null?void 0:s.run(t)}var Wg=(t=>(t[t.USER_REGISTRATION=0]="USER_REGISTRATION",t[t.APPLICATION_INVITE=2]="APPLICATION_INVITE",t[t.PROJECT_INVITE=4]="PROJECT_INVITE",t[t.ORGANIZATION_INVITE=6]="ORGANIZATION_INVITE",t[t.ADD_EMAIL_DOMAIN=8]="ADD_EMAIL_DOMAIN",t[t.RESET_PASSWORD=10]="RESET_PASSWORD",t))(Wg||{});i.ALL_MIDDLEWARE=Vg,i.APIError=C,i.AgentService=KR,i.AssetAttachmentService=YR,i.AssetProcedureService=eM,i.AssetProcedureStepFieldValuesAttachmentService=nM,i.AssetProcedureStepFieldValuesService=aM,i.AssetProcedureStepFieldsAttachmentService=sM,i.AssetProcedureStepFieldsService=iM,i.AssetProcedureStepService=cM,i.AssetProcedureTypeAttachmentService=JR,i.AssetProcedureTypeFieldValuesAttachmentService=XR,i.AssetProcedureTypeFieldValuesService=xR,i.AssetProcedureTypeFieldsAttachmentService=ZR,i.AssetProcedureTypeFieldsService=QR,i.AssetProcedureTypeService=tM,i.AssetService=rM,i.AssetStageCompletionService=dM,i.AssetStageService=lM,i.AssetStatusType=Ca,i.AssetTypeAttachmentService=uM,i.AssetTypeFieldValuesAttachmentService=pM,i.AssetTypeFieldValuesService=mM,i.AssetTypeFieldsAttachmentService=oM,i.AssetTypeFieldsService=hM,i.AssetTypeIdentifierService=yM,i.AssetTypeIdentifierValueService=fM,i.AssetTypeService=SM,i.AssetTypeStatusService=AM,i.AttachmentModel=Ua,i.BaseApiService=wt,i.BaseModelApiService=Tt,i.BaseOfflineFileModelApiService=q,i.BaseOfflineModelApiService=M,i.BaseSDK=wk,i.COMMON_AUTO_FIELDS=Xa,i.DEFAULT_ISSUE_PRIORITY=Hg,i.DEFAULT_PAGE_SIZE=hg,i.DISCARD_HTTP_STATUSES=ka,i.DeferredPromise=fs,i.DocumentAttachmentService=wM,i.DocumentService=TM,i.EMPTY_ARRAY=Da,i.EMPTY_OBJECT=ja,i.EmailDomainsService=IM,i.EmailVerificationService=OM,i.FILE_MODEL_DEFAULT_PAGE_SIZE=pg,i.FileService=FM,i.FormIdentifierService=_M,i.FormIdentifierValueService=gM,i.FormRevisionAttachmentService=PM,i.FormRevisionService=bM,i.FormService=RM,i.FormSubmissionAttachmentService=MM,i.FormSubmissionService=kM,i.GeoImageService=EM,i.HttpMethod=h,i.IssueAssociationService=vM,i.IssueAttachmentService=VM,i.IssueCommentAttachmentService=BM,i.IssueCommentService=WM,i.IssuePriority=ys,i.IssueService=zM,i.IssueStatusType=La,i.IssueTypeAttachmentService=qM,i.IssueTypeFieldValuesAttachmentService=$M,i.IssueTypeFieldValuesService=CM,i.IssueTypeFieldsAttachmentService=DM,i.IssueTypeFieldsService=jM,i.IssueTypeIdentifierService=UM,i.IssueTypeIdentifierValueService=LM,i.IssueTypeService=NM,i.IssueTypeStatusService=GM,i.IssueUpdateChange=$,i.IssueUpdateService=HM,i.JWTService=JM,i.MAX_SERVICE_BATCH_SIZE=ot,i.OUTBOX_RETRY_DELAY=Ga,i.OfflineAnalyticsMiddleware=Eg,i.OfflineMiddleware=Ba,i.OrganizationAccessLevel=$a,i.OrganizationAccessService=ZM,i.OrganizationService=QM,i.OutboxCoordinator=gt,i.ProjectAccessService=XM,i.ProjectAttachmentService=xM,i.ProjectFileService=ek,i.ProjectService=tk,i.RESET_ORGANIZATION_STATE=_,i.RESET_PROJECT_STATE=B,i.RESET_STATE=I,i.RateLimitingMiddleware=vg,i.SelectorBuilder=SP,i.TeamMembershipService=sk,i.TeamService=ik,i.UNKNOWN_ERROR_MESSAGE=_t,i.UserService=nk,i.VERSION_REDUCER_KEY=kt,i.VerificationCodeType=Wg,i.WORKFLOW_STATUSES=Yg,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=Kg,i.WorkflowIssueLinkService=ck,i.WorkflowService=ak,i.WorkflowStatus=Rt,i.WorkflowStepAssigneeService=rk,i.WorkflowStepCommentService=dk,i.WorkflowStepEventService=lk,i.WorkflowStepEventType=Na,i.WorkflowStepFieldValuesAttachmentService=hk,i.WorkflowStepFieldValuesReviewRequestService=pk,i.WorkflowStepFieldValuesReviewService=mk,i.WorkflowStepFieldValuesReviewType=Mt,i.WorkflowStepFieldValuesService=yk,i.WorkflowStepFieldsAttachmentService=uk,i.WorkflowStepFieldsService=ok,i.WorkflowStepReviewerService=fk,i.WorkflowStepService=Sk,i.WorkflowTypeService=Ak,i._setLatestRetryTime=eT,i.addAsset=Rl,i.addAssetAttachment=pc,i.addAssetAttachments=_s,i.addAssetProcedure=Cr,i.addAssetProcedureStep=fl,i.addAssetProcedureStepFieldValues=el,i.addAssetProcedureStepFieldValuesAttachment=Cd,i.addAssetProcedureStepFieldValuesAttachments=Ks,i.addAssetProcedureStepFieldValuesMany=tl,i.addAssetProcedureStepFields=Rd,i.addAssetProcedureStepFieldsAttachment=md,i.addAssetProcedureStepFieldsAttachments=yd,i.addAssetProcedureStepFieldsMany=Md,i.addAssetProcedureSteps=Sl,i.addAssetProcedureType=ed,i.addAssetProcedureTypeAttachment=Pc,i.addAssetProcedureTypeAttachments=bc,i.addAssetProcedureTypeFieldValues=br,i.addAssetProcedureTypeFieldValuesAttachment=mr,i.addAssetProcedureTypeFieldValuesAttachments=Vs,i.addAssetProcedureTypeFieldValuesMany=Rr,i.addAssetProcedureTypeFields=er,i.addAssetProcedureTypeFieldsAttachment=$c,i.addAssetProcedureTypeFieldsAttachments=Cc,i.addAssetProcedureTypeFieldsMany=tr,i.addAssetProcedureTypes=td,i.addAssetProcedures=Ds,i.addAssetStage=nu,i.addAssetStageCompletion=Cl,i.addAssetStageCompletions=Ul,i.addAssetStages=au,i.addAssetType=ch,i.addAssetTypeAttachment=yu,i.addAssetTypeAttachments=ri,i.addAssetTypeFieldValues=fo,i.addAssetTypeFieldValuesAttachment=so,i.addAssetTypeFieldValuesAttachments=mi,i.addAssetTypeFieldValuesMany=So,i.addAssetTypeFields=Uu,i.addAssetTypeFieldsAttachment=Ru,i.addAssetTypeFieldsAttachments=Mu,i.addAssetTypeFieldsMany=Lu,i.addAssetTypeIdentifier=ko,i.addAssetTypeIdentifierValue=No,i.addAssetTypeIdentifierValues=Go,i.addAssetTypeIdentifiers=Eo,i.addAssetTypeStatus=Ah,i.addAssetTypeStatuses=wh,i.addAssetTypes=rh,i.addAssets=ei,i.addConversation=rc,i.addConversations=AP,i.addDocument=Jh,i.addDocumentAttachment=Wh,i.addDocumentAttachments=zh,i.addDocuments=Zh,i.addEmailDomain=lp,i.addEmailDomains=up,i.addForm=_m,i.addFormIdentifier=Pp,i.addFormIdentifierValue=$p,i.addFormIdentifierValues=Cp,i.addFormIdentifiers=bp,i.addFormRevision=qi,i.addFormRevisionAttachment=em,i.addFormRevisionAttachments=tm,i.addFormRevisions=Di,i.addFormSubmission=Xm,i.addFormSubmissionAttachment=Dm,i.addFormSubmissionAttachments=Gi,i.addFormSubmissions=Qi,i.addForms=gm,i.addGeoImage=oy,i.addGeoImages=hy,i.addIssue=bf,i.addIssueAssociation=by,i.addIssueAssociations=ft,i.addIssueAttachment=$y,i.addIssueAttachments=an,i.addIssueComment=mf,i.addIssueCommentAttachment=xy,i.addIssueCommentAttachments=ef,i.addIssueComments=yf,i.addIssueType=MA,i.addIssueTypeAttachment=$f,i.addIssueTypeAttachments=Cf,i.addIssueTypeFieldValues=mS,i.addIssueTypeFieldValuesAttachment=US,i.addIssueTypeFieldValuesAttachments=On,i.addIssueTypeFieldValuesMany=yS,i.addIssueTypeFields=RS,i.addIssueTypeFieldsAttachment=eS,i.addIssueTypeFieldsAttachments=tS,i.addIssueTypeFieldsMany=MS,i.addIssueTypeIdentifier=tA,i.addIssueTypeIdentifierValue=yA,i.addIssueTypeIdentifierValues=fA,i.addIssueTypeIdentifiers=sA,i.addIssueTypeStatus=LA,i.addIssueTypeStatuses=NA,i.addIssueTypes=kA,i.addIssueUpdate=Bn,i.addIssueUpdates=Wn,i.addIssues=pn,i.addOrganization=$w,i.addOrganizationAccess=Fw,i.addOrganizationAccesses=_w,i.addOrganizations=jw,i.addProject=JT,i.addProjectAccess=nT,i.addProjectAccesses=aT,i.addProjectAttachment=ST,i.addProjectAttachments=AT,i.addProjectFile=VT,i.addProjectFiles=BT,i.addProjects=YT,i.addTeam=II,i.addTeamMembership=rI,i.addTeamMemberships=dI,i.addTeams=OI,i.addUser=Cn,i.addUsers=mw,i.addWorkflow=qI,i.addWorkflowIssueLink=QI,i.addWorkflowIssueLinks=XI,i.addWorkflowStep=j_,i.addWorkflowStepAssignee=oO,i.addWorkflowStepAssignees=hO,i.addWorkflowStepComment=gO,i.addWorkflowStepComments=PO,i.addWorkflowStepEvent=jO,i.addWorkflowStepEvents=$O,i.addWorkflowStepFieldValues=jF,i.addWorkflowStepFieldValuesAttachment=PF,i.addWorkflowStepFieldValuesAttachments=ma,i.addWorkflowStepFieldValuesMany=$F,i.addWorkflowStepFieldValuesReview=h_,i.addWorkflowStepFieldValuesReviewRequest=xF,i.addWorkflowStepFieldValuesReviewRequests=wa,i.addWorkflowStepFieldValuesReviews=Oa,i.addWorkflowStepFields=hF,i.addWorkflowStepFieldsAttachment=xO,i.addWorkflowStepFieldsAttachments=la,i.addWorkflowStepFieldsMany=pF,i.addWorkflowStepReviewer=g_,i.addWorkflowStepReviewers=P_,i.addWorkflowSteps=$_,i.addWorkflowType=x_,i.addWorkflowTypes=eg,i.addWorkflows=DI,i.agentsReducer=uc,i.agentsSlice=Is,i.areArraysEqual=Xg,i.assetAttachmentReducer=Fc,i.assetAttachmentSlice=Fs,i.assetProcedureReducer=Kr,i.assetProcedureSlice=qs,i.assetProcedureStepFieldValuesAttachmentReducer=Qd,i.assetProcedureStepFieldValuesAttachmentSlice=Hs,i.assetProcedureStepFieldValuesReducer=ol,i.assetProcedureStepFieldValuesSlice=Zs,i.assetProcedureStepFieldsAttachmentReducer=gd,i.assetProcedureStepFieldsAttachmentSlice=Us,i.assetProcedureStepFieldsReducer=Dd,i.assetProcedureStepFieldsSlice=Ns,i.assetProcedureStepReducer=Ol,i.assetProcedureStepSlice=Qs,i.assetProcedureTypeAttachmentReducer=Bc,i.assetProcedureTypeAttachmentSlice=bs,i.assetProcedureTypeFieldValuesAttachmentReducer=Tr,i.assetProcedureTypeFieldValuesAttachmentSlice=vs,i.assetProcedureTypeFieldValuesReducer=Wr,i.assetProcedureTypeFieldValuesSlice=zs,i.assetProcedureTypeFieldsAttachmentReducer=Yc,i.assetProcedureTypeFieldsAttachmentSlice=Ms,i.assetProcedureTypeFieldsReducer=dr,i.assetProcedureTypeFieldsSlice=Es,i.assetProcedureTypeReducer=dd,i.assetProcedureTypeSlice=$s,i.assetReducer=Dl,i.assetSlice=xs,i.assetStageCompletionReducer=Jl,i.assetStageCompletionSlice=si,i.assetStageReducer=uu,i.assetStageSlice=ii,i.assetTypeAttachmentReducer=gu,i.assetTypeAttachmentSlice=ci,i.assetTypeFieldValuesAttachmentReducer=po,i.assetTypeFieldValuesAttachmentSlice=pi,i.assetTypeFieldValuesReducer=bo,i.assetTypeFieldValuesSlice=Si,i.assetTypeFieldsAttachmentReducer=ju,i.assetTypeFieldsAttachmentSlice=ui,i.assetTypeFieldsReducer=xu,i.assetTypeFieldsSlice=hi,i.assetTypeIdentifierReducer=Co,i.assetTypeIdentifierSlice=Ai,i.assetTypeIdentifierValueReducer=th,i.assetTypeIdentifierValueSlice=Ti,i.assetTypeReducer=yh,i.assetTypeSlice=Ii,i.assetTypeStatusReducer=Mh,i.assetTypeStatusSlice=Fi,i.assetTypeStatusSortFn=tc,i.authReducer=vh,i.authSlice=ts,i.baseReducer=vR,i.baseReducers=Ma,i.clearTokens=sb,i.createModelAdapter=F,i.createOfflineAction=Zw,i.createPayload=R,i.createSelectionAdapter=Jg,i.deleteAsset=El,i.deleteAssetAttachment=Ac,i.deleteAssetAttachments=gs,i.deleteAssetProcedure=Nr,i.deleteAssetProcedureStep=Tl,i.deleteAssetProcedureStepFieldValues=cl,i.deleteAssetProcedureStepFieldValuesAttachment=Hd,i.deleteAssetProcedureStepFieldValuesAttachments=Ys,i.deleteAssetProcedureStepFieldValuesMany=rl,i.deleteAssetProcedureStepFields=Bd,i.deleteAssetProcedureStepFieldsAttachment=Td,i.deleteAssetProcedureStepFieldsAttachments=Id,i.deleteAssetProcedureStepFieldsMany=Wd,i.deleteAssetProcedureSteps=Il,i.deleteAssetProcedureType=nd,i.deleteAssetProcedureTypeAttachment=vc,i.deleteAssetProcedureTypeAttachments=Vc,i.deleteAssetProcedureTypeFieldValues=Vr,i.deleteAssetProcedureTypeFieldValuesAttachment=wr,i.deleteAssetProcedureTypeFieldValuesAttachments=Bs,i.deleteAssetProcedureTypeFieldValuesMany=Br,i.deleteAssetProcedureTypeFields=cr,i.deleteAssetProcedureTypeFieldsAttachment=Hc,i.deleteAssetProcedureTypeFieldsAttachments=Kc,i.deleteAssetProcedureTypeFieldsMany=rr,i.deleteAssetProcedureTypes=ad,i.deleteAssetProcedures=js,i.deleteAssetStage=du,i.deleteAssetStageCompletion=Kl,i.deleteAssetStageCompletions=Yl,i.deleteAssetStages=lu,i.deleteAssetType=uh,i.deleteAssetTypeAttachment=Tu,i.deleteAssetTypeAttachments=di,i.deleteAssetTypeFieldValues=Oo,i.deleteAssetTypeFieldValuesAttachment=ro,i.deleteAssetTypeFieldValuesAttachments=yi,i.deleteAssetTypeFieldValuesMany=Fo,i.deleteAssetTypeFields=Yu,i.deleteAssetTypeFieldsAttachment=Bu,i.deleteAssetTypeFieldsAttachments=Wu,i.deleteAssetTypeFieldsMany=Ju,i.deleteAssetTypeIdentifier=zo,i.deleteAssetTypeIdentifierValue=Zo,i.deleteAssetTypeIdentifierValues=Qo,i.deleteAssetTypeIdentifiers=qo,i.deleteAssetTypeStatus=_h,i.deleteAssetTypeStatuses=gh,i.deleteAssetTypes=oh,i.deleteAssets=ti,i.deleteConversation=IP,i.deleteConversations=OP,i.deleteDocument=tp,i.deleteDocumentAttachment=Ch,i.deleteDocumentAttachments=Uh,i.deleteDocuments=sp,i.deleteEmailDomain=yp,i.deleteEmailDomains=fp,i.deleteForm=km,i.deleteFormIdentifier=vp,i.deleteFormIdentifierValue=Hp,i.deleteFormIdentifierValues=Kp,i.deleteFormIdentifiers=Vp,i.deleteFormRevision=ji,i.deleteFormRevisionAttachment=cm,i.deleteFormRevisionAttachments=rm,i.deleteFormRevisions=$i,i.deleteFormSubmission=ty,i.deleteFormSubmissionAttachment=Lm,i.deleteFormSubmissionAttachments=Hi,i.deleteFormSubmissions=Xi,i.deleteForms=Em,i.deleteGeoImage=yy,i.deleteGeoImages=fy,i.deleteIssue=vf,i.deleteIssueAssociation=Ry,i.deleteIssueAssociations=St,i.deleteIssueAttachment=Gy,i.deleteIssueAttachments=cn,i.deleteIssueComment=Tf,i.deleteIssueCommentAttachment=cf,i.deleteIssueCommentAttachments=rf,i.deleteIssueComments=If,i.deleteIssueType=WA,i.deleteIssueTypeAttachment=Hf,i.deleteIssueTypeAttachments=Kf,i.deleteIssueTypeFieldValues=TS,i.deleteIssueTypeFieldValuesAttachment=KS,i.deleteIssueTypeFieldValuesAttachments=Fn,i.deleteIssueTypeFieldValuesMany=IS,i.deleteIssueTypeFields=BS,i.deleteIssueTypeFieldsAttachment=cS,i.deleteIssueTypeFieldsAttachments=rS,i.deleteIssueTypeFieldsMany=WS,i.deleteIssueTypeIdentifier=rA,i.deleteIssueTypeIdentifierValue=IA,i.deleteIssueTypeIdentifierValues=OA,i.deleteIssueTypeIdentifiers=dA,i.deleteIssueTypeStatus=JA,i.deleteIssueTypeStatuses=ZA,i.deleteIssueTypes=zA,i.deleteIssueUpdate=zn,i.deleteIssueUpdates=qn,i.deleteIssues=mn,i.deleteOrganization=Lw,i.deleteOrganizationAccess=Mw,i.deleteOrganizationAccesses=kw,i.deleteOrganizations=Nw,i.deleteProject=XT,i.deleteProjectAccess=uT,i.deleteProjectAccesses=oT,i.deleteProjectAttachment=FT,i.deleteProjectAttachments=_T,i.deleteProjectFile=qT,i.deleteProjectFiles=DT,i.deleteProjects=xT,i.deleteTeam=bI,i.deleteTeamMembership=pI,i.deleteTeamMemberships=mI,i.deleteTeams=RI,i.deleteUser=Un,i.deleteUsers=Sw,i.deleteWorkflow=LI,i.deleteWorkflowIssueLink=iO,i.deleteWorkflowIssueLinks=nO,i.deleteWorkflowStep=G_,i.deleteWorkflowStepAssignee=SO,i.deleteWorkflowStepAssignees=AO,i.deleteWorkflowStepComment=EO,i.deleteWorkflowStepComments=vO,i.deleteWorkflowStepEvent=GO,i.deleteWorkflowStepEvents=HO,i.deleteWorkflowStepFieldValues=GF,i.deleteWorkflowStepFieldValuesAttachment=EF,i.deleteWorkflowStepFieldValuesAttachments=ya,i.deleteWorkflowStepFieldValuesMany=HF,i.deleteWorkflowStepFieldValuesReview=S_,i.deleteWorkflowStepFieldValuesReviewRequest=n_,i.deleteWorkflowStepFieldValuesReviewRequests=Ta,i.deleteWorkflowStepFieldValuesReviews=Fa,i.deleteWorkflowStepFields=AF,i.deleteWorkflowStepFieldsAttachment=nF,i.deleteWorkflowStepFieldsAttachments=ua,i.deleteWorkflowStepFieldsMany=wF,i.deleteWorkflowStepReviewer=E_,i.deleteWorkflowStepReviewers=v_,i.deleteWorkflowSteps=H_,i.deleteWorkflowType=ag,i.deleteWorkflowTypes=cg,i.deleteWorkflows=NI,i.dequeue=Ig,i.discard=Fg,i.documentAttachmentReducer=Hh,i.documentAttachmentSlice=gi,i.documentSlice=bi,i.documentsReducer=ip,i.downloadFile=cP,i.emailDomainsReducer=Tp,i.emailDomainsSlice=Mi,i.emailRegex=mP,i.enqueue=Tg,i.enqueueRequest=Xw,i.extractResponseFromError=gg,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=Nt,i.fetchBlobFromObjectUrl=Ya,i.fetchFileFromObjectUrl=Ja,i.fileReducer=Fp,i.fileSlice=Ei,i.formIdentifierReducer=qp,i.formIdentifierSlice=vi,i.formIdentifierValueReducer=Qp,i.formIdentifierValueSlice=Bi,i.formReducer=vm,i.formRevisionAttachmentReducer=om,i.formRevisionAttachmentSlice=Wi,i.formRevisionReducer=Im,i.formRevisionsSlice=zi,i.formSlice=Ui,i.formSubmissionAttachmentReducer=Km,i.formSubmissionAttachmentSlice=Ni,i.formSubmissionReducer=cy,i.formSubmissionSlice=Zi,i.geoImageReducer=Ty,i.geoImageSlice=en,i.getAssetProcedureStepSubTree=ec,i.getAssetProcedureStepTrees=yP,i.getClientSDK=kg,i.getClientStore=Pt,i.getDocumentSubTree=nc,i.getDocumentTrees=fP,i.getFileExtension=Ka,i.getLocalDateString=Ha,i.getLocalRelativeDateString=sP,i.getOutboxCoordinator=It,i.getRenamedFile=aP,i.getRequestDescription=w,i.getS3FileKey=nP,i.hashFile=Gt,i.initSDK=Tk,i.initializeAssetAttachments=hc,i.initializeAssetProcedureStepFieldValues=xd,i.initializeAssetProcedureStepFieldValuesAttachments=$d,i.initializeAssetProcedureStepFields=bd,i.initializeAssetProcedureStepFieldsAttachments=pd,i.initializeAssetProcedureSteps=pl,i.initializeAssetProcedureTypeAttachments=gc,i.initializeAssetProcedureTypeFieldValues=Pr,i.initializeAssetProcedureTypeFieldValuesAttachments=pr,i.initializeAssetProcedureTypeFields=xc,i.initializeAssetProcedureTypeFieldsAttachments=jc,i.initializeAssetProcedureTypes=xr,i.initializeAssetProcedures=$r,i.initializeAssetStageCompletions=$l,i.initializeAssetStages=tu,i.initializeAssetTypeAttachments=mu,i.initializeAssetTypeFieldValues=yo,i.initializeAssetTypeFieldValuesAttachments=to,i.initializeAssetTypeFields=Cu,i.initializeAssetTypeFieldsAttachments=bu,i.initializeAssetTypeIdentifierValues=Lo,i.initializeAssetTypeIdentifiers=Mo,i.initializeAssetTypeStatuses=Sh,i.initializeAssetTypes=ih,i.initializeAssets=bl,i.initializeConversations=cc,i.initializeDocumentAttachments=Bh,i.initializeDocuments=Yh,i.initializeEmailDomains=dp,i.initializeFormIdentifierValues=jp,i.initializeFormIdentifiers=gp,i.initializeFormRevisionAttachments=xp,i.initializeFormRevisions=pm,i.initializeFormSubmissionAttachments=qm,i.initializeFormSubmissions=Jm,i.initializeForms=Fm,i.initializeGeoImages=dy,i.initializeIssueAssociations=Oy,i.initializeIssueAttachments=jy,i.initializeIssueCommentAttachments=Xy,i.initializeIssueComments=pf,i.initializeIssueTypeAttachments=jf,i.initializeIssueTypeFieldValues=pS,i.initializeIssueTypeFieldValuesAttachments=CS,i.initializeIssueTypeFields=bS,i.initializeIssueTypeFieldsAttachments=xf,i.initializeIssueTypeIdentifierValues=mA,i.initializeIssueTypeIdentifiers=eA,i.initializeIssueTypeStatuses=UA,i.initializeIssueTypes=RA,i.initializeIssueUpdates=tw,i.initializeIssues=Pf,i.initializeOrganizationAccesses=Ow,i.initializeOrganizations=zw,i.initializeProjectAccesses=iT,i.initializeProjectAttachments=fT,i.initializeProjectFiles=kT,i.initializeProjects=GT,i.initializeTeamMemberships=cI,i.initializeTeams=TI,i.initializeUsers=ow,i.initializeWorkflowIssueLinks=ZI,i.initializeWorkflowStepAssignees=uO,i.initializeWorkflowStepComments=_O,i.initializeWorkflowStepEvents=DO,i.initializeWorkflowStepFieldValues=DF,i.initializeWorkflowStepFieldValuesAttachments=gF,i.initializeWorkflowStepFieldValuesReviewRequests=XF,i.initializeWorkflowStepFieldValuesReviews=o_,i.initializeWorkflowStepFields=oF,i.initializeWorkflowStepFieldsAttachments=XO,i.initializeWorkflowStepReviewers=__,i.initializeWorkflowSteps=D_,i.initializeWorkflowTypes=X_,i.initializeWorkflows=zI,i.isImageFile=rP,i.isObjectUrl=Za,i.isToday=tP,i.issueAssociationReducer=qy,i.issueAssociationSlice=sn,i.issueAttachmentReducer=Zy,i.issueAttachmentSlice=nn,i.issueCommentAttachmentReducer=of,i.issueCommentAttachmentSlice=dn,i.issueCommentReducer=_f,i.issueCommentSlice=un,i.issueReducer=qf,i.issueSlice=hn,i.issueTypeAttachmentReducer=Qf,i.issueTypeAttachmentSlice=yn,i.issueTypeFieldValuesAttachmentReducer=XS,i.issueTypeFieldValuesAttachmentSlice=In,i.issueTypeFieldValuesReducer=gS,i.issueTypeFieldValuesSlice=wn,i.issueTypeFieldsAttachmentReducer=oS,i.issueTypeFieldsAttachmentSlice=Sn,i.issueTypeFieldsReducer=jS,i.issueTypeFieldsSlice=Tn,i.issueTypeIdentifierReducer=hA,i.issueTypeIdentifierSlice=gn,i.issueTypeIdentifierValueReducer=PA,i.issueTypeIdentifierValueSlice=bn,i.issueTypeReducer=$A,i.issueTypeSlice=Rn,i.issueTypeStatusReducer=xA,i.issueTypeStatusSlice=kn,i.issueTypeStatusSortFn=sc,i.issueUpdateReducer=lw,i.issueUpdateSlice=Vn,i.logOnlyOnce=dP,i.markAsDeleted=xw,i.markForDeletion=jb,i.memoize=As,i.organizationAccessReducer=Ew,i.organizationAccessSlice=Nn,i.organizationReducer=Jw,i.organizationSlice=Gn,i.outboxReducer=tT,i.outboxSlice=Hn,i.overmapEnhancer=CR,i.overmapReducer=VR,i.overmapReducers=og,i.performRequest=va,i.performRequestFromAction=Og,i.projectAccessReducer=hT,i.projectAccessSlice=Kn,i.projectAttachmentReducer=RT,i.projectAttachmentSlice=Jn,i.projectFileReducer=LT,i.projectFileSlice=Qn,i.projectReducer=eI,i.projectSlice=Xn,i.rehydratedReducer=nI,i.rehydratedSlice=xn,i.restructureSelectorWithArgs=S,i.runMiddleware=Bg,i.selectAccessToken=ib,i.selectAccessesByUserOfProject=Cb,i.selectAccessibleProjects=Nb,i.selectActiveOrganizationAccess=Wb,i.selectAllDocumentAttachments=Pi,i.selectAssetAttachmentById=Tc,i.selectAssetAttachmentMapping=wc,i.selectAssetAttachments=Ps,i.selectAssetAttachmentsByIds=Ic,i.selectAssetById=zl,i.selectAssetProcedureById=Zr,i.selectAssetProcedureStepById=Fl,i.selectAssetProcedureStepFieldValues=Et,i.selectAssetProcedureStepFieldValuesAttachmentById=Yd,i.selectAssetProcedureStepFieldValuesAttachments=Js,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Jd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Kd,i.selectAssetProcedureStepFieldValuesById=ll,i.selectAssetProcedureStepFieldValuesByIds=ul,i.selectAssetProcedureStepFieldValuesMapping=dl,i.selectAssetProcedureStepFieldValuesOfAsset=qP,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=DP,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=jP,i.selectAssetProcedureStepFields=Zt,i.selectAssetProcedureStepFieldsAttachmentById=Fd,i.selectAssetProcedureStepFieldsAttachments=Ls,i.selectAssetProcedureStepFieldsAttachmentsByIds=_d,i.selectAssetProcedureStepFieldsAttachmentsMapping=Od,i.selectAssetProcedureStepFieldsById=zd,i.selectAssetProcedureStepFieldsByIds=qd,i.selectAssetProcedureStepFieldsMapping=Gs,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=BP,i.selectAssetProcedureStepMapping=Qt,i.selectAssetProcedureSteps=Xs,i.selectAssetProcedureStepsByIds=_l,i.selectAssetProcedureStepsMappingOfAssetProcedureType=$P,i.selectAssetProcedureStepsOfAssetProcedureType=CP,i.selectAssetProcedureTypeAttachmentById=zc,i.selectAssetProcedureTypeAttachmentMapping=Wc,i.selectAssetProcedureTypeAttachments=Rs,i.selectAssetProcedureTypeAttachmentsByIds=qc,i.selectAssetProcedureTypeById=ud,i.selectAssetProcedureTypeFieldValues=Yt,i.selectAssetProcedureTypeFieldValuesAttachmentById=Or,i.selectAssetProcedureTypeFieldValuesAttachments=Ws,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Fr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Ir,i.selectAssetProcedureTypeFieldValuesById=qr,i.selectAssetProcedureTypeFieldValuesByIds=Dr,i.selectAssetProcedureTypeFieldValuesMapping=zr,i.selectAssetProcedureTypeFieldValuesOfAsset=MP,i.selectAssetProcedureTypeFields=Kt,i.selectAssetProcedureTypeFieldsAttachmentById=Zc,i.selectAssetProcedureTypeFieldsAttachments=ks,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Qc,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Jc,i.selectAssetProcedureTypeFieldsById=ur,i.selectAssetProcedureTypeFieldsByIds=or,i.selectAssetProcedureTypeFieldsMapping=lr,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=bP,i.selectAssetProcedureTypes=Cs,i.selectAssetProcedureTypesByIds=od,i.selectAssetProcedureTypesMapping=ld,i.selectAssetProcedureTypesOfOrganization=vP,i.selectAssetProcedures=Jt,i.selectAssetProceduresByIds=Qr,i.selectAssetProceduresMapping=Yr,i.selectAssetProceduresOfAssetProcedureType=Jr,i.selectAssetProceduresOfAssetType=EP,i.selectAssetStageById=ou,i.selectAssetStageCompletionById=Xl,i.selectAssetStageCompletionMapping=Zl,i.selectAssetStageCompletions=Ql,i.selectAssetStageCompletionsByIds=xl,i.selectAssetStages=ai,i.selectAssetStagesByIds=hu,i.selectAssetStagesMappingOfAssetProcedureType=LP,i.selectAssetStagesOfAssetProcedureType=NP,i.selectAssetTypeAttachmentById=Ou,i.selectAssetTypeAttachmentMapping=Iu,i.selectAssetTypeAttachments=li,i.selectAssetTypeAttachmentsByIds=Fu,i.selectAssetTypeById=ph,i.selectAssetTypeFieldValues=xt,i.selectAssetTypeFieldValuesAttachmentById=uo,i.selectAssetTypeFieldValuesAttachments=fi,i.selectAssetTypeFieldValuesAttachmentsByIds=oo,i.selectAssetTypeFieldValuesAttachmentsMapping=lo,i.selectAssetTypeFieldValuesById=go,i.selectAssetTypeFieldValuesByIds=Po,i.selectAssetTypeFieldValuesMapping=_o,i.selectAssetTypeFieldValuesOfAsset=YP,i.selectAssetTypeFields=vt,i.selectAssetTypeFieldsAttachmentById=qu,i.selectAssetTypeFieldsAttachments=oi,i.selectAssetTypeFieldsAttachmentsByIds=Du,i.selectAssetTypeFieldsAttachmentsMapping=zu,i.selectAssetTypeFieldsById=Qu,i.selectAssetTypeFieldsByIds=Xu,i.selectAssetTypeFieldsMapping=Zu,i.selectAssetTypeFieldsOfAssetType=HP,i.selectAssetTypeIdentifierById=jo,i.selectAssetTypeIdentifierMapping=Do,i.selectAssetTypeIdentifierValueById=xo,i.selectAssetTypeIdentifierValueMapping=Xo,i.selectAssetTypeIdentifierValues=es,i.selectAssetTypeIdentifierValuesByIds=eh,i.selectAssetTypeIdentifierValuesOfAsset=QP,i.selectAssetTypeIdentifierValuesOfIdentifier=XP,i.selectAssetTypeIdentifiers=wi,i.selectAssetTypeIdentifiersByIds=$o,i.selectAssetTypeIdentifiersOfAssetType=ZP,i.selectAssetTypeStatusById=bh,i.selectAssetTypeStatusMapping=Ph,i.selectAssetTypeStatuses=_i,i.selectAssetTypeStatusesByIds=Rh,i.selectAssetTypeStatusesOfAssetType=eb,i.selectAssetTypeValuesOfAssetType=JP,i.selectAssetTypes=Oi,i.selectAssetTypesByIds=mh,i.selectAssetTypesMapping=hh,i.selectAssetTypesOfOrganization=xP,i.selectAssets=Xt,i.selectAssetsByIds=ql,i.selectAssetsMapping=Bl,i.selectAssetsOfAssetType=Wl,i.selectAssetsOfProject=UP,i.selectAttachmentsOfAsset=Oc,i.selectAttachmentsOfAssetProcedureStepFieldValues=Zd,i.selectAttachmentsOfAssetProcedureStepFields=VP,i.selectAttachmentsOfAssetProcedureType=gP,i.selectAttachmentsOfAssetProcedureTypeFieldValues=_r,i.selectAttachmentsOfAssetProcedureTypeFields=PP,i.selectAttachmentsOfAssetType=_u,i.selectAttachmentsOfAssetTypeFieldValues=ho,i.selectAttachmentsOfAssetTypeFields=GP,i.selectAttachmentsOfDocument=ab,i.selectAttachmentsOfFormRevision=yb,i.selectAttachmentsOfFormSubmission=Hm,i.selectAttachmentsOfIssue=Ky,i.selectAttachmentsOfIssueComment=wb,i.selectAttachmentsOfIssueType=Ob,i.selectAttachmentsOfIssueTypeFieldValues=QS,i.selectAttachmentsOfIssueTypeFields=Fb,i.selectAttachmentsOfProject=Lb,i.selectAttachmentsOfWorkflowStepFieldValues=WF,i.selectAttachmentsOfWorkflowStepFields=cF,i.selectCommentsOfIssue=Tb,i.selectConversation=_P,i.selectConversationMapping=Os,i.selectConversations=FP,i.selectCurrentUser=ww,i.selectDeletedRequests=qb,i.selectDescendantsOfAssetProcedureStep=gl,i.selectDescendantsOfDocument=cp,i.selectDocumentAttachmentById=Nh,i.selectDocumentAttachmentMapping=Lh,i.selectDocumentAttachmentsByIds=Gh,i.selectDocumentById=np,i.selectDocuments=ss,i.selectDocumentsByIds=ap,i.selectDocumentsMapping=Ri,i.selectEmailDomainById=Ap,i.selectEmailDomains=ki,i.selectEmailDomainsAsMapping=Sp,i.selectEmailDomainsByIds=wp,i.selectEmailDomainsOfOrganization=db,i.selectFieldValuesOfAssetProcedure=kP,i.selectFormById=Bm,i.selectFormIdentifierById=Wp,i.selectFormIdentifierMapping=Bp,i.selectFormIdentifierValueById=Jp,i.selectFormIdentifierValueMapping=Yp,i.selectFormIdentifierValues=is,i.selectFormIdentifierValuesByIds=Zp,i.selectFormIdentifierValuesOfFormSubmission=pb,i.selectFormIdentifierValuesOfIdentifier=mb,i.selectFormIdentifiers=Vi,i.selectFormIdentifiersByIds=zp,i.selectFormIdentifiersOfForm=hb,i.selectFormMapping=Vm,i.selectFormRevisionAttachmentById=lm,i.selectFormRevisionAttachments=dm,i.selectFormRevisionAttachmentsByIds=um,i.selectFormRevisionAttachmentsMapping=ns,i.selectFormRevisionById=Am,i.selectFormRevisionMapping=Ci,i.selectFormRevisions=as,i.selectFormRevisionsByIds=wm,i.selectFormRevisionsOfForm=Tm,i.selectFormSubmissionAttachemntsByIds=Ji,i.selectFormSubmissionAttachmentById=Nm,i.selectFormSubmissionAttachments=Yi,i.selectFormSubmissionAttachmentsByIds=Gm,i.selectFormSubmissionAttachmentsMapping=Ki,i.selectFormSubmissionById=iy,i.selectFormSubmissions=sy,i.selectFormSubmissionsByIds=ny,i.selectFormSubmissionsMapping=xi,i.selectFormSubmissionsOfForm=ay,i.selectForms=Li,i.selectFormsByIds=Wm,i.selectFormsOfOrganization=Sb,i.selectGeoImageById=Ay,i.selectGeoImageMapping=Sy,i.selectGeoImages=tn,i.selectGeoImagesByIds=wy,i.selectGeoImagesOfProject=Ab,i.selectIsLoggedIn=nb,i.selectIssueAssociationById=ky,i.selectIssueAssociationMapping=My,i.selectIssueAssociations=At,i.selectIssueAssociationsByIds=Ey,i.selectIssueAssociationsOfAsset=zy,i.selectIssueAssociationsOfIssue=Wy,i.selectIssueAssociationsOfIssues=By,i.selectIssueAssociationsToIssue=vy,i.selectIssueAssociationsToIssues=Vy,i.selectIssueAttachmentById=Yy,i.selectIssueAttachmentMapping=Hy,i.selectIssueAttachments=rn,i.selectIssueAttachmentsByIds=Jy,i.selectIssueById=Bf,i.selectIssueCommentAttachmentById=lf,i.selectIssueCommentAttachmentMapping=df,i.selectIssueCommentAttachments=ln,i.selectIssueCommentAttachmentsByIds=uf,i.selectIssueCommentById=Of,i.selectIssueCommentMapping=on,i.selectIssueCommentsByIds=Ff,i.selectIssueMapping=Vf,i.selectIssueTypeAttachmentById=Jf,i.selectIssueTypeAttachmentMapping=Yf,i.selectIssueTypeAttachments=fn,i.selectIssueTypeAttachmentsByIds=Zf,i.selectIssueTypeById=DA,i.selectIssueTypeFieldValues=cs,i.selectIssueTypeFieldValuesAttachmentById=JS,i.selectIssueTypeFieldValuesAttachments=_n,i.selectIssueTypeFieldValuesAttachmentsByIds=ZS,i.selectIssueTypeFieldValuesAttachmentsMapping=YS,i.selectIssueTypeFieldValuesById=FS,i.selectIssueTypeFieldValuesByIds=_S,i.selectIssueTypeFieldValuesMapping=OS,i.selectIssueTypeFieldValuesOfIssue=_b,i.selectIssueTypeFields=Bt,i.selectIssueTypeFieldsAttachmentById=lS,i.selectIssueTypeFieldsAttachments=An,i.selectIssueTypeFieldsAttachmentsByIds=uS,i.selectIssueTypeFieldsAttachmentsMapping=dS,i.selectIssueTypeFieldsById=qS,i.selectIssueTypeFieldsByIds=DS,i.selectIssueTypeFieldsMapping=zS,i.selectIssueTypeFieldsOfIssueType=gb,i.selectIssueTypeIdentifierById=uA,i.selectIssueTypeIdentifierMapping=lA,i.selectIssueTypeIdentifierValueById=_A,i.selectIssueTypeIdentifierValueMapping=FA,i.selectIssueTypeIdentifierValues=rs,i.selectIssueTypeIdentifierValuesByIds=gA,i.selectIssueTypeIdentifierValuesOfIdentifier=kb,i.selectIssueTypeIdentifierValuesOfIssue=Mb,i.selectIssueTypeIdentifiers=Pn,i.selectIssueTypeIdentifiersByIds=oA,i.selectIssueTypeIdentifiersOfIssueType=Rb,i.selectIssueTypeMapping=qA,i.selectIssueTypeStatusById=vn,i.selectIssueTypeStatusMapping=QA,i.selectIssueTypeStatuses=En,i.selectIssueTypeStatusesByIds=XA,i.selectIssueTypeStatusesOfIssueType=vb,i.selectIssueTypeValuesOfIssueType=bb,i.selectIssueTypes=Mn,i.selectIssueTypesByIds=jA,i.selectIssueTypesOfOrganization=Eb,i.selectIssueUpdateById=cw,i.selectIssueUpdateMapping=Dn,i.selectIssueUpdates=jn,i.selectIssueUpdatesByIds=rw,i.selectIssueUpdatesOfIssue=dw,i.selectIssues=Vt,i.selectIssuesByIds=Wf,i.selectIssuesLinkedToWorkflow=aR,i.selectIssuesOfIssueType=zf,i.selectIssuesOfProject=Ib,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=WP,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=RP,i.selectLatestAssetTypeFieldsOfAssetType=KP,i.selectLatestFieldsByAssetProcedureStep=zP,i.selectLatestFormRevisionOfForm=fb,i.selectLatestIssueTypeFieldsOfIssueType=Pb,i.selectLatestRetryTime=Db,i.selectLatestReviewOfWorkflowStepFieldValues=_R,i.selectLatestReviewRequestOfWorkflowStepFieldValues=OR,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=IR,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=PR,i.selectLatestWorkflowStepFieldsOfWorkflowStep=SR,i.selectMembershipsByUserOfTeam=Jb,i.selectOrganizationAccessById=vw,i.selectOrganizationAccessMapping=us,i.selectOrganizationAccessUserMapping=Bw,i.selectOrganizationAccessesByIds=Vw,i.selectOrganizationById=Kw,i.selectOrganizationDocuments=rb,i.selectOrganizations=Hw,i.selectOrganizationsByIds=Yw,i.selectOrganizationsMapping=Gw,i.selectProjectAccessById=pT,i.selectProjectAccessMapping=Yn,i.selectProjectAccesses=Wt,i.selectProjectAccessesByIds=mT,i.selectProjectAccessesOfProject=$b,i.selectProjectAttachmentById=PT,i.selectProjectAttachmentMapping=gT,i.selectProjectAttachments=Zn,i.selectProjectAttachmentsByIds=bT,i.selectProjectById=sI,i.selectProjectDocuments=cb,i.selectProjectFileById=CT,i.selectProjectFileMapping=jT,i.selectProjectFiles=$T,i.selectProjectFilesByIds=UT,i.selectProjectMapping=tI,i.selectProjects=os,i.selectProjectsByIds=iI,i.selectProjectsOfOrganization=Gb,i.selectRehydrated=Yb,i.selectReviewRequestsOfWorkflowStepFieldValues=d_,i.selectReviewsOfWorkflowStepFieldValues=I_,i.selectStageMapping=ni,i.selectTeamById=kI,i.selectTeamMembershipById=SI,i.selectTeamMemberships=hs,i.selectTeamMembershipsByIds=AI,i.selectTeamMembershipsMapping=fI,i.selectTeams=sa,i.selectTeamsByIds=EI,i.selectTeamsMapping=MI,i.selectTeamsOfOrganization=Qb,i.selectUploadUrl=ob,i.selectUserById=ls,i.selectUsers=ds,i.selectUsersByIds=Tw,i.selectUsersMapping=Ln,i.selectUsersOfOrganization=zb,i.selectUsersOfProject=Ub,i.selectUsersOfTeam=Zb,i.selectWorkflowById=HI,i.selectWorkflowIssueLinkById=cO,i.selectWorkflowIssueLinks=pt,i.selectWorkflowIssueLinksByIds=rO,i.selectWorkflowIssueLinksMapping=aO,i.selectWorkflowIssueLinksOfIssue=iR,i.selectWorkflowIssueLinksOfIssues=nR,i.selectWorkflowIssueLinksOfWorkflow=tR,i.selectWorkflowIssueLinksOfWorkflows=sR,i.selectWorkflowMapping=GI,i.selectWorkflowStepAssigneeById=TO,i.selectWorkflowStepAssignees=qt,i.selectWorkflowStepAssigneesByIds=IO,i.selectWorkflowStepAssigneesMapping=wO,i.selectWorkflowStepAssigneesOfWorkflow=rR,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=lR,i.selectWorkflowStepAssigneesOfWorkflowStep=dR,i.selectWorkflowStepById=Y_,i.selectWorkflowStepCommentById=BO,i.selectWorkflowStepComments=Dt,i.selectWorkflowStepCommentsByIds=WO,i.selectWorkflowStepCommentsMapping=VO,i.selectWorkflowStepCommentsOfWorkflow=uR,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=hR,i.selectWorkflowStepCommentsOfWorkflowStep=oR,i.selectWorkflowStepEventById=YO,i.selectWorkflowStepEvents=jt,i.selectWorkflowStepEventsByIds=JO,i.selectWorkflowStepEventsMapping=KO,i.selectWorkflowStepEventsOfWorkflow=pR,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=yR,i.selectWorkflowStepEventsOfWorkflowStep=mR,i.selectWorkflowStepFieldValues=mt,i.selectWorkflowStepFieldValuesAttachmentById=VF,i.selectWorkflowStepFieldValuesAttachments=fa,i.selectWorkflowStepFieldValuesAttachmentsByIds=BF,i.selectWorkflowStepFieldValuesAttachmentsMapping=vF,i.selectWorkflowStepFieldValuesById=YF,i.selectWorkflowStepFieldValuesByIds=JF,i.selectWorkflowStepFieldValuesMapping=KF,i.selectWorkflowStepFieldValuesOfWorkflow=AR,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=TR,i.selectWorkflowStepFieldValuesOfWorkflowStep=wR,i.selectWorkflowStepFieldValuesReviewById=w_,i.selectWorkflowStepFieldValuesReviewRequestById=c_,i.selectWorkflowStepFieldValuesReviewRequests=$t,i.selectWorkflowStepFieldValuesReviewRequestsByIds=r_,i.selectWorkflowStepFieldValuesReviewRequestsMapping=a_,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=FR,i.selectWorkflowStepFieldValuesReviews=Ft,i.selectWorkflowStepFieldValuesReviewsByIds=T_,i.selectWorkflowStepFieldValuesReviewsMapping=A_,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=gR,i.selectWorkflowStepFields=ps,i.selectWorkflowStepFieldsAttachmentById=rF,i.selectWorkflowStepFieldsAttachments=oa,i.selectWorkflowStepFieldsAttachmentsByIds=dF,i.selectWorkflowStepFieldsAttachmentsMapping=aF,i.selectWorkflowStepFieldsById=IF,i.selectWorkflowStepFieldsByIds=OF,i.selectWorkflowStepFieldsMapping=TF,i.selectWorkflowStepFieldsOfWorkflowStep=fR,i.selectWorkflowStepReviewerById=B_,i.selectWorkflowStepReviewers=Ct,i.selectWorkflowStepReviewersByIds=W_,i.selectWorkflowStepReviewersMapping=V_,i.selectWorkflowStepReviewersOfWorkflow=bR,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=MR,i.selectWorkflowStepReviewersOfWorkflowStep=RR,i.selectWorkflowSteps=Pa,i.selectWorkflowStepsByIds=J_,i.selectWorkflowStepsMapping=K_,i.selectWorkflowStepsOfWorkflowType=kR,i.selectWorkflowTypeById=dg,i.selectWorkflowTypeMapping=rg,i.selectWorkflowTypes=Ra,i.selectWorkflowTypesByIds=lg,i.selectWorkflowTypesOfOrganization=ER,i.selectWorkflows=zt,i.selectWorkflowsByIds=KI,i.selectWorkflowsLinkedToIssue=cR,i.selectWorkflowsOfProject=xb,i.selectWorkflowsOfWorkflowType=eR,i.setAsset=vl,i.setAssetAttachment=mc,i.setAssetAttachments=yc,i.setAssetProcedure=Gr,i.setAssetProcedureStep=ml,i.setAssetProcedureStepFieldValues=sl,i.setAssetProcedureStepFieldValuesAttachment=Ud,i.setAssetProcedureStepFieldValuesAttachments=Ld,i.setAssetProcedureStepFieldValuesMany=il,i.setAssetProcedureStepFields=kd,i.setAssetProcedureStepFieldsAttachment=fd,i.setAssetProcedureStepFieldsAttachments=Sd,i.setAssetProcedureStepFieldsMany=Ed,i.setAssetProcedureSteps=yl,i.setAssetProcedureType=cd,i.setAssetProcedureTypeAttachment=Rc,i.setAssetProcedureTypeAttachments=Mc,i.setAssetProcedureTypeFieldValues=Mr,i.setAssetProcedureTypeFieldValuesAttachment=yr,i.setAssetProcedureTypeFieldValuesAttachments=fr,i.setAssetProcedureTypeFieldValuesMany=kr,i.setAssetProcedureTypeFields=sr,i.setAssetProcedureTypeFieldsAttachment=Uc,i.setAssetProcedureTypeFieldsAttachments=Lc,i.setAssetProcedureTypeFieldsMany=ir,i.setAssetProcedureTypes=rd,i.setAssetProcedures=Hr,i.setAssetStage=su,i.setAssetStageCompletion=Ll,i.setAssetStageCompletions=Nl,i.setAssetStages=iu,i.setAssetType=nh,i.setAssetTypeAttachment=fu,i.setAssetTypeAttachments=Su,i.setAssetTypeFieldValues=Ao,i.setAssetTypeFieldValuesAttachment=io,i.setAssetTypeFieldValuesAttachments=no,i.setAssetTypeFieldValuesMany=wo,i.setAssetTypeFields=Nu,i.setAssetTypeFieldsAttachment=ku,i.setAssetTypeFieldsAttachments=Eu,i.setAssetTypeFieldsMany=Gu,i.setAssetTypeIdentifier=vo,i.setAssetTypeIdentifierValue=Ho,i.setAssetTypeIdentifierValues=Ko,i.setAssetTypeIdentifiers=Vo,i.setAssetTypeStatus=Th,i.setAssetTypeStatuses=Ih,i.setAssetTypes=ah,i.setAssets=Vl,i.setClientSDK=Mg,i.setClientStore=bg,i.setConversation=dc,i.setConversations=wP,i.setCurrentUser=Vb,i.setCurrentUserProfile=Bb,i.setDocument=Qh,i.setDocumentAttachment=qh,i.setDocumentAttachments=Dh,i.setDocuments=Xh,i.setEmailDomain=op,i.setEmailDomains=hp,i.setForm=Pm,i.setFormIdentifier=Rp,i.setFormIdentifierValue=Up,i.setFormIdentifierValues=Lp,i.setFormIdentifiers=Mp,i.setFormRevision=mm,i.setFormRevisionAttachment=sm,i.setFormRevisionAttachments=im,i.setFormRevisions=ym,i.setFormSubmission=Zm,i.setFormSubmissionAttachment=jm,i.setFormSubmissionAttachments=$m,i.setFormSubmissions=Qm,i.setForms=bm,i.setGeoImage=ly,i.setGeoImages=uy,i.setIssue=Rf,i.setIssueAssociation=_y,i.setIssueAssociations=Fy,i.setIssueAttachment=Cy,i.setIssueAttachments=Uy,i.setIssueComment=ff,i.setIssueCommentAttachment=tf,i.setIssueCommentAttachments=sf,i.setIssueComments=Sf,i.setIssueType=EA,i.setIssueTypeAttachment=Uf,i.setIssueTypeAttachments=Lf,i.setIssueTypeFieldValues=fS,i.setIssueTypeFieldValuesAttachment=LS,i.setIssueTypeFieldValuesAttachments=NS,i.setIssueTypeFieldValuesMany=SS,i.setIssueTypeFields=kS,i.setIssueTypeFieldsAttachment=sS,i.setIssueTypeFieldsAttachments=iS,i.setIssueTypeFieldsMany=ES,i.setIssueTypeIdentifier=iA,i.setIssueTypeIdentifierValue=SA,i.setIssueTypeIdentifierValues=AA,i.setIssueTypeIdentifiers=nA,i.setIssueTypeStatus=GA,i.setIssueTypeStatuses=HA,i.setIssueTypes=vA,i.setIssueUpdate=sw,i.setIssueUpdates=iw,i.setIssues=Mf,i.setLoggedIn=Eh,i.setOrganization=Dw,i.setOrganizationAccess=gw,i.setOrganizationAccesses=Pw,i.setOrganizations=qw,i.setProject=KT,i.setProjectAccess=cT,i.setProjectAccesses=rT,i.setProjectAttachment=wT,i.setProjectAttachments=TT,i.setProjectFile=ET,i.setProjectFiles=vT,i.setProjects=HT,i.setRehydrated=Kb,i.setTeam=FI,i.setTeamMembership=lI,i.setTeamMemberships=uI,i.setTeams=_I,i.setTokens=tb,i.setUploadUrl=ub,i.setUser=pw,i.setUsers=hw,i.setWorkflow=jI,i.setWorkflowIssueLink=xI,i.setWorkflowIssueLinks=eO,i.setWorkflowStep=C_,i.setWorkflowStepAssignee=pO,i.setWorkflowStepAssignees=mO,i.setWorkflowStepComment=bO,i.setWorkflowStepComments=RO,i.setWorkflowStepEvent=CO,i.setWorkflowStepEvents=UO,i.setWorkflowStepFieldValues=CF,i.setWorkflowStepFieldValuesAttachment=bF,i.setWorkflowStepFieldValuesAttachments=RF,i.setWorkflowStepFieldValuesMany=UF,i.setWorkflowStepFieldValuesReview=p_,i.setWorkflowStepFieldValuesReviewRequest=e_,i.setWorkflowStepFieldValuesReviewRequests=t_,i.setWorkflowStepFieldValuesReviews=m_,i.setWorkflowStepFields=mF,i.setWorkflowStepFieldsAttachment=eF,i.setWorkflowStepFieldsAttachments=tF,i.setWorkflowStepFieldsMany=yF,i.setWorkflowStepReviewer=b_,i.setWorkflowStepReviewers=R_,i.setWorkflowSteps=U_,i.setWorkflowType=tg,i.setWorkflowTypes=sg,i.setWorkflows=$I,i.shallowEqual=Qg,i.slugify=hP,i.spacesToDashesLower=oP,i.teamMembershipReducer=yI,i.teamMembershipSlice=ea,i.teamReducer=vI,i.teamSlice=ta,i.toFileNameSafeString=uP,i.toUuidArray=V,i.toUuidIdRecord=lP,i.truncate=pP,i.updateAsset=Ml,i.updateAssetAttachment=fc,i.updateAssetAttachments=Sc,i.updateAssetProcedure=Ur,i.updateAssetProcedureStep=Al,i.updateAssetProcedureStepFieldValues=nl,i.updateAssetProcedureStepFieldValuesAttachment=Nd,i.updateAssetProcedureStepFieldValuesAttachments=Gd,i.updateAssetProcedureStepFieldValuesMany=al,i.updateAssetProcedureStepFields=vd,i.updateAssetProcedureStepFieldsAttachment=Ad,i.updateAssetProcedureStepFieldsAttachments=wd,i.updateAssetProcedureStepFieldsMany=Vd,i.updateAssetProcedureSteps=wl,i.updateAssetProcedureType=sd,i.updateAssetProcedureTypeAttachment=kc,i.updateAssetProcedureTypeAttachments=Ec,i.updateAssetProcedureTypeFieldValues=Er,i.updateAssetProcedureTypeFieldValuesAttachment=Sr,i.updateAssetProcedureTypeFieldValuesAttachments=Ar,i.updateAssetProcedureTypeFieldValuesMany=vr,i.updateAssetProcedureTypeFields=nr,i.updateAssetProcedureTypeFieldsAttachment=Nc,i.updateAssetProcedureTypeFieldsAttachments=Gc,i.updateAssetProcedureTypeFieldsMany=ar,i.updateAssetProcedureTypes=id,i.updateAssetProcedures=Lr,i.updateAssetStage=cu,i.updateAssetStageCompletion=Gl,i.updateAssetStageCompletions=Hl,i.updateAssetStages=ru,i.updateAssetType=dh,i.updateAssetTypeAttachment=Au,i.updateAssetTypeAttachments=wu,i.updateAssetTypeFieldValues=To,i.updateAssetTypeFieldValuesAttachment=ao,i.updateAssetTypeFieldValuesAttachments=co,i.updateAssetTypeFieldValuesMany=Io,i.updateAssetTypeFields=Hu,i.updateAssetTypeFieldsAttachment=vu,i.updateAssetTypeFieldsAttachments=Vu,i.updateAssetTypeFieldsMany=Ku,i.updateAssetTypeIdentifier=Bo,i.updateAssetTypeIdentifierValue=Yo,i.updateAssetTypeIdentifierValues=Jo,i.updateAssetTypeIdentifiers=Wo,i.updateAssetTypeStatus=Oh,i.updateAssetTypeStatuses=Fh,i.updateAssetTypes=lh,i.updateAssets=kl,i.updateConversation=lc,i.updateConversations=TP,i.updateDocument=xh,i.updateDocumentAttachment=jh,i.updateDocumentAttachments=$h,i.updateDocuments=ep,i.updateEmailDomain=pp,i.updateEmailDomains=mp,i.updateForm=Rm,i.updateFormIdentifier=kp,i.updateFormIdentifierValue=Np,i.updateFormIdentifierValues=Gp,i.updateFormIdentifiers=Ep,i.updateFormRevision=fm,i.updateFormRevisionAttachment=nm,i.updateFormRevisionAttachments=am,i.updateFormRevisions=Sm,i.updateFormSubmission=xm,i.updateFormSubmissionAttachment=Cm,i.updateFormSubmissionAttachments=Um,i.updateFormSubmissions=ey,i.updateForms=Mm,i.updateGeoImage=py,i.updateGeoImages=my,i.updateIssue=kf,i.updateIssueAssociation=gy,i.updateIssueAssociations=Py,i.updateIssueAttachment=Ly,i.updateIssueAttachments=Ny,i.updateIssueComment=Af,i.updateIssueCommentAttachment=nf,i.updateIssueCommentAttachments=af,i.updateIssueComments=wf,i.updateIssueType=VA,i.updateIssueTypeAttachment=Nf,i.updateIssueTypeAttachments=Gf,i.updateIssueTypeFieldValues=AS,i.updateIssueTypeFieldValuesAttachment=GS,i.updateIssueTypeFieldValuesAttachments=HS,i.updateIssueTypeFieldValuesMany=wS,i.updateIssueTypeFields=vS,i.updateIssueTypeFieldsAttachment=nS,i.updateIssueTypeFieldsAttachments=aS,i.updateIssueTypeFieldsMany=VS,i.updateIssueTypeIdentifier=aA,i.updateIssueTypeIdentifierValue=wA,i.updateIssueTypeIdentifierValues=TA,i.updateIssueTypeIdentifiers=cA,i.updateIssueTypeStatus=KA,i.updateIssueTypeStatuses=YA,i.updateIssueTypes=BA,i.updateIssueUpdate=nw,i.updateIssueUpdates=aw,i.updateIssues=Ef,i.updateOrganization=Uw,i.updateOrganizationAccess=bw,i.updateOrganizationAccesses=Rw,i.updateOrganizations=Cw,i.updateProject=QT,i.updateProjectAccess=dT,i.updateProjectAccesses=lT,i.updateProjectAttachment=IT,i.updateProjectAttachments=OT,i.updateProjectFile=WT,i.updateProjectFiles=zT,i.updateProjects=ZT,i.updateTeam=gI,i.updateTeamMembership=oI,i.updateTeamMemberships=hI,i.updateTeams=PI,i.updateUser=fw,i.updateUsers=yw,i.updateWorkflow=CI,i.updateWorkflowIssueLink=tO,i.updateWorkflowIssueLinks=sO,i.updateWorkflowStep=L_,i.updateWorkflowStepAssignee=yO,i.updateWorkflowStepAssignees=fO,i.updateWorkflowStepComment=MO,i.updateWorkflowStepComments=kO,i.updateWorkflowStepEvent=LO,i.updateWorkflowStepEvents=NO,i.updateWorkflowStepFieldValues=LF,i.updateWorkflowStepFieldValuesAttachment=MF,i.updateWorkflowStepFieldValuesAttachments=kF,i.updateWorkflowStepFieldValuesMany=NF,i.updateWorkflowStepFieldValuesReview=y_,i.updateWorkflowStepFieldValuesReviewRequest=s_,i.updateWorkflowStepFieldValuesReviewRequests=i_,i.updateWorkflowStepFieldValuesReviews=f_,i.updateWorkflowStepFields=fF,i.updateWorkflowStepFieldsAttachment=sF,i.updateWorkflowStepFieldsAttachments=iF,i.updateWorkflowStepFieldsMany=SF,i.updateWorkflowStepReviewer=M_,i.updateWorkflowStepReviewers=k_,i.updateWorkflowSteps=N_,i.updateWorkflowType=ig,i.updateWorkflowTypes=ng,i.updateWorkflows=UI,i.useSelectorBuilder=Zg,i.userReducer=Aw,i.userSlice=$n,i.uuidObj=O,i.uuidObjSortFn=Ts,i.uuidSortFn=Ht,i.versioningReducer=BI,i.versioningSlice=VI,i.workflowIssueLinkReducer=dO,i.workflowIssueLinkSlice=na,i.workflowReducer=YI,i.workflowSlice=ia,i.workflowStepAssigneeReducer=OO,i.workflowStepAssigneeSlice=aa,i.workflowStepCommentReducer=zO,i.workflowStepCommentSlice=ca,i.workflowStepEventReducer=ZO,i.workflowStepEventSlice=ra,i.workflowStepFieldValuesAttachmentReducer=zF,i.workflowStepFieldValuesAttachmentSlice=pa,i.workflowStepFieldValuesReducer=ZF,i.workflowStepFieldValuesReviewReducer=O_,i.workflowStepFieldValuesReviewRequestReducer=l_,i.workflowStepFieldValuesReviewRequestSlice=Aa,i.workflowStepFieldValuesReviewSlice=Ia,i.workflowStepFieldValuesSlice=Sa,i.workflowStepFieldsAttachmentReducer=lF,i.workflowStepFieldsAttachmentSlice=da,i.workflowStepFieldsReducer=FF,i.workflowStepFieldsSlice=ha,i.workflowStepReducer=Z_,i.workflowStepReviewerReducer=z_,i.workflowStepReviewerSlice=_a,i.workflowStepSlice=ga,i.workflowTypeReducer=ug,i.workflowTypeSlice=ba,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
13
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(p)}return await this.addCache(l),l}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.processPresignedUrl(a,c);return n}async getFilePayload(e){const a={sha1:await Gt(e),file_type:e.type,extension:Ja(e),size:e.size};return await this.client.files.addCache(e),a}}class FM extends M{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:Rp,addMany:Mp,setOne:kp,setMany:Ep,updateOne:vp,updateMany:Vp,deleteOne:Bp,deleteMany:Wp,initialize:bp});m(this,"selectors",{selectById:qp,selectByIds:Dp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.form],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class _M extends M{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:Up,addMany:Lp,setOne:Np,setMany:Gp,updateOne:Hp,updateMany:Kp,deleteOne:Yp,deleteMany:Jp,initialize:Cp});m(this,"selectors",{selectById:Qp,selectByIds:Xp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class gM extends q{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:sm,addMany:im,setOne:nm,setMany:am,updateOne:cm,updateMany:rm,deleteOne:dm,deleteMany:lm,initialize:tm});m(this,"selectors",{selectById:om,selectByIds:hm})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class PM extends M{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:ji,addMany:$i,setOne:fm,setMany:Sm,updateOne:Am,updateMany:wm,deleteOne:Ci,deleteMany:Ui,initialize:ym});m(this,"selectors",{selectById:Tm,selectByIds:Im})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class bM extends M{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:Pm,addMany:bm,setOne:Rm,setMany:Mm,updateOne:km,updateMany:Em,deleteOne:vm,deleteMany:Vm,initialize:gm});m(this,"selectors",{selectById:zm,selectByIds:qm})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=O({...e,submitted_at:d,created_by:l}),p=O({...n,form:u.uuid,submitted_at:d,created_by:l});this.dispatch(c(u)),this.dispatch(ji(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...R(u),initial_revision:{uuid:p.uuid,submitted_at:p.submitted_at,title:p.title,description:p.description,fields:p.fields}},blockers:[],blocks:[u.uuid,p.uuid]});return y.catch(T=>{throw this.dispatch(r(u.uuid)),this.dispatch(Ci(p.uuid)),T}),[u,p,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error("Expected form to exist");const u=ry(e)(d),p=Om(e)(d);this.dispatch(a(e)),this.dispatch(en(v(u))),this.dispatch(Ui(v(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch($i(p)),this.dispatch(xi(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class RM extends q{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:$m,addMany:Ki,setOne:Cm,setMany:Um,updateOne:Lm,updateMany:Nm,deleteOne:Gm,deleteMany:Yi,initialize:jm});m(this,"selectors",{selectById:Hm,selectByIds:Km})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=Qi(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class MM extends M{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:ey,addMany:xi,setOne:Xm,setMany:xm,updateOne:ty,updateMany:sy,deleteOne:iy,deleteMany:en,initialize:Qm});m(this,"selectors",{selectById:ay,selectByIds:cy})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Ym(e)(d);this.dispatch(a(e)),this.dispatch(Yi(v(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ki(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(r)),r}}class kM extends q{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:py,addMany:my,setOne:oy,setMany:hy,updateOne:yy,updateMany:fy,deleteOne:Sy,deleteMany:Ay,initialize:uy});m(this,"selectors",{selectById:Ty,selectByIds:Iy})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class EM extends M{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:My,addMany:yt,setOne:Py,setMany:gy,updateOne:by,updateMany:Ry,deleteOne:ky,deleteMany:ft,initialize:_y});m(this,"selectors",{selectById:vy,selectByIds:Vy})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class vM extends q{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:Uy,addMany:rn,setOne:Ly,setMany:Ny,updateOne:Gy,updateMany:Hy,deleteOne:Ky,deleteMany:dn,initialize:Cy});m(this,"selectors",{selectById:Zy,selectByIds:Qy})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class VM extends q{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:tf,addMany:sf,setOne:nf,setMany:af,updateOne:cf,updateMany:rf,deleteOne:df,deleteMany:lf,initialize:ef});m(this,"selectors",{selectById:of,selectByIds:hf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class BM extends M{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:ff,addMany:Sf,setOne:Af,setMany:wf,updateOne:Tf,updateMany:If,deleteOne:Of,deleteMany:Ff,initialize:yf});m(this,"selectors",{selectById:_f,selectByIds:gf})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue],blocks:[d.uuid]});return l.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class WM extends M{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:Mf,addMany:yn,setOne:kf,setMany:Ef,updateOne:vf,updateMany:Vf,deleteOne:Bf,deleteMany:fn,initialize:Rf});m(this,"selectors",{selectById:zf,selectByIds:qf})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=new Date().toISOString(),u=((f=d.userReducer.currentUser)==null?void 0:f.id)??null,p=O({...e,submitted_at:l,created_by:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[p.project,p.issue_type,p.status],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(T=>{throw this.dispatch(r(p.uuid)),T}),[p,y]}update(e){var y;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const d={...r,...e};this.dispatch(n(d));const l={};for(const f of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(f in e&&e[f]!==r[f])switch(f){case $.PRIORITY:l[f]=e[f];break;case $.DUE_DATE:l[f]=e[f];break;case $.DESCRIPTION:l[f]=e[f];break;case $.TITLE:l[f]=e[f];break;case $.STATUS:{const T=e[f],P=Bn(T)(c);if(!P)throw new Error(`Trying to update issue type status with ${T} which does not exist in store`);l[f]={name:P.name,color:P.color,uuid:P.uuid};break}case $.ASSIGNED_TO:{const T=e[f];if(T===null)l[f]=null;else{const P=us(T)(c);if(!P)throw new Error(`Trying to update assigned to with ${T} which does not exist in store.`);l[f]={full_name:P.username,id:P.id}}break}}const u=O({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(zn(u));const p=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(Dn(u.uuid))}),[d,p]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=v(e).toSorted(Ht);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(Os);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} issues that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=mt(e,Math.min(n??e.length,ot)),y=[];let f=null;for(const T of p){const P=ht.v4(),E=v(T),g=T.map(({status:b})=>b).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(k),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const u=By(e)(d),p=qy(e)(d),y=uO(e)(d),f=Jy(e)(d),T=uw(e)(d);this.dispatch(a(e)),this.dispatch(dn(v(f))),this.dispatch(jn(v(T))),this.dispatch(ft(v(u))),this.dispatch(ft(v(p))),this.dispatch(zt(v(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(P){throw this.dispatch(c(l)),this.dispatch(rn(f)),this.dispatch(qn(T)),this.dispatch(yt(u)),this.dispatch(yt(p)),this.dispatch(Wt(y)),P}}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=Wy(e)(d),p=zy(e)(d),y=lO(e)(d);this.dispatch(c(e)),this.dispatch(ft(v(u))),this.dispatch(ft(v(p))),this.dispatch(zt(v(y)));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(yt(u)),this.dispatch(yt(p)),this.dispatch(Wt(y)),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 zM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:Uf,addMany:Lf,setOne:Nf,setMany:Gf,updateOne:Hf,updateMany:Kf,deleteOne:Yf,deleteMany:Jf,initialize:Cf});m(this,"selectors",{selectById:Qf,selectByIds:Xf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class qM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:sS,addMany:iS,setOne:nS,setMany:aS,updateOne:cS,updateMany:rS,deleteOne:dS,deleteMany:lS,initialize:tS});m(this,"selectors",{selectById:oS,selectByIds:hS})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class DM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:kS,addMany:ES,setOne:vS,setMany:VS,updateOne:BS,updateMany:WS,deleteOne:zS,deleteMany:qS,initialize:MS});m(this,"selectors",{selectById:jS,selectByIds:$S})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class jM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:NS,addMany:_n,setOne:GS,setMany:HS,updateOne:KS,updateMany:YS,deleteOne:JS,deleteMany:gn,initialize:LS});m(this,"selectors",{selectById:QS,selectByIds:XS})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class $M extends M{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:fS,addMany:SS,setOne:AS,setMany:wS,updateOne:TS,updateMany:IS,deleteOne:OS,deleteMany:FS,initialize:yS});m(this,"selectors",{selectById:gS,selectByIds:PS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.issue,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=xS(e)(d);this.dispatch(a(e)),this.dispatch(gn(v(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(_n(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class CM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:iA,addMany:nA,setOne:aA,setMany:cA,updateOne:rA,updateMany:dA,deleteOne:lA,deleteMany:uA,initialize:sA});m(this,"selectors",{selectById:hA,selectByIds:pA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class UM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:SA,addMany:AA,setOne:wA,setMany:TA,updateOne:IA,updateMany:OA,deleteOne:FA,deleteMany:_A,initialize:fA});m(this,"selectors",{selectById:PA,selectByIds:bA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class LM extends M{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:EA,addMany:vA,setOne:VA,setMany:BA,updateOne:WA,updateMany:zA,deleteOne:qA,deleteMany:DA,initialize:kA});m(this,"selectors",{selectById:$A,selectByIds:CA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,submitted_at:u,created_by:l});this.dispatch(a(p));const y=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=Df(e)(d);this.dispatch(a(e)),this.dispatch(fn(v(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(yn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class NM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:GA,addMany:HA,setOne:KA,setMany:YA,updateOne:JA,updateMany:ZA,deleteOne:QA,deleteMany:XA,initialize:NA});m(this,"selectors",{selectById:Bn,selectByIds:ew})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class GM extends M{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:zn,addMany:qn,setOne:nw,setMany:aw,updateOne:cw,updateMany:rw,deleteOne:Dn,deleteMany:jn,initialize:iw});m(this,"selectors",{selectById:dw,selectByIds:lw})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}const HM=1800;function KM(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class YM extends GR{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:h.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Vh(!1)),this.clearTokens(),this.dispatch(I()),this.dispatch(I())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=Kg(e).exp??n}catch{a=n}return a-n<HM}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof C&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??gt).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new C({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new C({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=ht.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:h.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(KM(a))})}}class JM extends wt{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:gw,addMany:Pw,setOne:bw,setMany:Rw,updateOne:Mw,updateMany:kw,deleteOne:Ew,deleteMany:vw,initialize:_w});m(this,"selectors",{selectById:Bw,selectByIds:Ww})}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=us(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch(Nn(l.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ln(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class ZM extends wt{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:Uw,addMany:Cw,setOne:$w,setMany:jw,updateOne:Nw,updateMany:Lw,deleteOne:Gw,deleteMany:Hw,initialize:Dw});m(this,"selectors",{selectById:Jw,selectByIds:Zw})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class QM extends M{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:cT,addMany:rT,setOne:dT,setMany:lT,updateOne:uT,updateMany:oT,deleteOne:hT,deleteMany:pT,initialize:aT});m(this,"selectors",{selectById:yT,selectByIds:fT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.organization_access,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(p=>{throw this.dispatch(r(d.uuid)),p}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>R(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(r(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class XM extends q{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:wT,addMany:TT,setOne:IT,setMany:OT,updateOne:FT,updateMany:_T,deleteOne:gT,deleteMany:PT,initialize:AT});m(this,"selectors",{selectById:RT,selectByIds:MT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class xM extends q{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:WT,addMany:zT,setOne:VT,setMany:BT,updateOne:qT,updateMany:DT,deleteOne:jT,deleteMany:$T,initialize:vT});m(this,"selectors",{selectById:LT,selectByIds:NT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class ek extends wt{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:QT,addMany:ZT,setOne:JT,setMany:YT,updateOne:xT,updateMany:XT,deleteOne:eI,deleteMany:tI,initialize:KT});m(this,"selectors",{selectById:nI,selectByIds:aI})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class tk extends M{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:lI,addMany:uI,setOne:oI,setMany:hI,updateOne:pI,updateMany:mI,deleteOne:yI,deleteMany:fI,initialize:dI});m(this,"selectors",{selectById:wI,selectByIds:TI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.team],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>R(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.map(y=>y.uuid)))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class sk extends M{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:FI,addMany:_I,setOne:gI,setMany:PI,updateOne:bI,updateMany:RI,deleteOne:MI,deleteMany:kI,initialize:OI});m(this,"selectors",{selectById:vI,selectByIds:VI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class ik extends wt{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:Ln,addMany:fw,setOne:yw,setMany:mw,updateOne:Aw,updateMany:Sw,deleteOne:Nn,deleteMany:ww,initialize:pw});m(this,"selectors",{selectById:us,selectByIds:Ow})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:h.GET,url:r,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class nk extends M{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:jI,addMany:$I,setOne:CI,setMany:UI,updateOne:LI,updateMany:NI,deleteOne:GI,deleteMany:HI,initialize:DI});m(this,"selectors",{selectById:YI,selectByIds:JI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type,d.project],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const u=dO(e)(d);this.dispatch(a(e)),this.dispatch(zt(v(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Wt(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class ak extends M{constructor(){super(...arguments);m(this,"name","Workflow Issue Link");m(this,"url","/workflow-issue-links");m(this,"actions",{addOne:xI,addMany:Wt,setOne:eO,setMany:tO,updateOne:sO,updateMany:iO,deleteOne:nO,deleteMany:zt,initialize:XI});m(this,"selectors",{selectById:cO,selectByIds:rO})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.workflow,e.issue],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow issue link with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class ck extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:mO,addMany:yO,setOne:fO,setMany:SO,updateOne:AO,updateMany:wO,deleteOne:TO,deleteMany:IO,initialize:pO});m(this,"selectors",{selectById:FO,selectByIds:_O})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(v(u)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class rk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:RO,addMany:MO,setOne:kO,setMany:EO,updateOne:vO,updateMany:VO,deleteOne:BO,deleteMany:WO,initialize:bO});m(this,"selectors",{selectById:qO,selectByIds:DO})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class dk extends wt{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:UO,addMany:LO,setOne:NO,setMany:GO,updateOne:HO,updateMany:KO,deleteOne:YO,deleteMany:JO,initialize:CO});m(this,"selectors",{selectById:QO,selectByIds:XO})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class lk extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:sF,addMany:oa,setOne:iF,setMany:nF,updateOne:aF,updateMany:cF,deleteOne:rF,deleteMany:ha,initialize:tF});m(this,"selectors",{selectById:uF,selectByIds:oF})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class uk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:yF,addMany:fF,setOne:SF,setMany:AF,updateOne:wF,updateMany:TF,deleteOne:IF,deleteMany:OF,initialize:mF});m(this,"selectors",{selectById:_F,selectByIds:gF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const u=lF(e)(d);this.dispatch(a(e)),this.dispatch(ha(v(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(oa(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class ok extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:MF,addMany:fa,setOne:kF,setMany:EF,updateOne:vF,updateMany:VF,deleteOne:BF,deleteMany:Sa,initialize:RF});m(this,"selectors",{selectById:zF,selectByIds:qF})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class hk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review Request");m(this,"url","/workflow-step-field-values-review-requests");m(this,"actions",{addOne:s_,addMany:Ia,setOne:i_,setMany:n_,updateOne:a_,updateMany:c_,deleteOne:r_,deleteMany:Oa,initialize:t_});m(this,"selectors",{selectById:l_,selectByIds:u_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class pk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review");m(this,"url","/workflow-step-field-values-reviews");m(this,"actions",{addOne:y_,addMany:_a,setOne:f_,setMany:S_,updateOne:A_,updateMany:w_,deleteOne:T_,deleteMany:ga,initialize:m_});m(this,"selectors",{selectById:O_,selectByIds:F_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class mk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:UF,addMany:LF,setOne:NF,setMany:GF,updateOne:HF,updateMany:KF,deleteOne:YF,deleteMany:JF,initialize:CF});m(this,"selectors",{selectById:QF,selectByIds:XF})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()}),u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.workflow,l.workflow_step,l.fields_revision],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const u=DF(e)(d),p=__(e)(d),y=o_(e)(d);this.dispatch(a(e)),this.dispatch(Sa(v(u))),this.dispatch(ga(v(p))),this.dispatch(Oa(v(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(fa(u)),this.dispatch(_a(p)),this.dispatch(Ia(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class yk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:R_,addMany:M_,setOne:k_,setMany:E_,updateOne:v_,updateMany:V_,deleteOne:B_,deleteMany:W_,initialize:b_});m(this,"selectors",{selectById:q_,selectByIds:D_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class fk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:U_,addMany:L_,setOne:N_,setMany:G_,updateOne:H_,updateMany:K_,deleteOne:Y_,deleteMany:J_,initialize:C_});m(this,"selectors",{selectById:Q_,selectByIds:X_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Sk extends M{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:sg,addMany:ig,setOne:ng,setMany:ag,updateOne:cg,updateMany:rg,deleteOne:dg,deleteMany:lg,initialize:tg});m(this,"selectors",{selectById:og,selectByIds:hg})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function Ba(t,s,e,n,a){const c=n instanceof At;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:p,queryParams:y,attachmentHash:f,isExternalUrl:T,isAuthNeeded:P,isResponseBlob:E}={...r,...s};let g=s.url;const k=f?await e.files.fetchCache(f):void 0;if(f&&!k)throw new Error(`Cannot upload file ${f} because it's not cached.`);!T&&!g.startsWith("http")&&(!g.startsWith("/")&&!g.startsWith("blob:")&&(g="/"+g),g=t+g);const b=V=>{if(f){if(!d)throw new Error(`No S3 URL for file ${f}`);if("warning"in d)throw new Error(`S3 URL warning for file ${f}`);if(!k)throw new Error(`No file for file ${f}`);const L=d.fields["x-amz-checksum-sha1"];if(!L)throw new Error(`No checksum for file ${f}`);return V.set("x-amz-checksum-sha1",L).field({...l,...d.fields}).attach("file",k)}return V.send(l)},j={[h.GET]:()=>E?It.get(g.toString()).responseType("blob"):It.get(g.toString()),[h.POST]:()=>{const V=It.post(g.toString());return b(V)},[h.PATCH]:()=>{const V=It.patch(g.toString());return b(V)},[h.PUT]:()=>{const V=It.put(g.toString());return b(V)},[h.DELETE]:()=>{const V=It.delete(g.toString());return b(V)}}[p];let W=j();const D=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",D),P&&c){const V=n.auth.getAuthHeader();W=W.set("Authorization",V)}u&&(W=W.set(u));try{return await W.query(y)}catch(V){const L=Rg(V),fs=L==null?void 0:L.status;if(c&&fs===401)return await n.auth.handleUnauthorized(W,L),W.query(y);throw new C({response:L,innerError:V,discard:va.includes(fs)})}finally{a==null||a.removeEventListener("abort",D)}}class Ak{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new As,r={...e,uuid:e.uuid??ht.v4()};return Ba(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??gt).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 As,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(eT(c)),d=u=>{if(u)a.resolve(u.body);else{const p=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(p)}},l=u=>{u instanceof C?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
|
|
14
|
+
Converting error to APIError and discarding.`),u=new C({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return r.then(d,l),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,l=[];let u=await this.performRequest(s,r,a,c);for(l.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:d},a,c),l.push(u.results);return l}}class Pt{constructor(){m(this,"graph");m(this,"requestAttemptCounter");this.graph=new Yg.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Pt;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))&&Pt._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Pt._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 Mg;function kg(t){Mg=t}function bt(){return Mg}let Eg;function vg(t){Eg=t}function Vg(){return Eg}let Wa=null;function Tt(){const t=bt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Wa)return Wa;const s=t.getState().offline.outbox,e=Pt._fromOutbox(s);return Wa=e,e}const wk=(t,s)=>{const e=new s(t);return vg(e),kg(t),e};class Tk{constructor(s){m(this,"_all");m(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class za{constructor(){m(this,"next");this.next=null}then(s){return new Tk(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!bt())throw new Error("Client store not set");const n=Vg();if(!n)throw new Error("Client SDK not set");return gg(s,n)}}}class Bg extends za{async run(s){return super.run(s)}}class Wg extends za{async run(s){return super.run(s)}}const zg=new Bg().then(new Wg).compile();function qg(t){var s;return(s=zg[0])==null?void 0:s.run(t)}var Dg=(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))(Dg||{});i.ALL_MIDDLEWARE=zg,i.APIError=C,i.AgentService=HR,i.AssetAttachmentService=KR,i.AssetProcedureService=xR,i.AssetProcedureStepFieldValuesAttachmentService=iM,i.AssetProcedureStepFieldValuesService=nM,i.AssetProcedureStepFieldsAttachmentService=tM,i.AssetProcedureStepFieldsService=sM,i.AssetProcedureStepService=aM,i.AssetProcedureTypeAttachmentService=YR,i.AssetProcedureTypeFieldValuesAttachmentService=QR,i.AssetProcedureTypeFieldValuesService=XR,i.AssetProcedureTypeFieldsAttachmentService=JR,i.AssetProcedureTypeFieldsService=ZR,i.AssetProcedureTypeService=eM,i.AssetService=cM,i.AssetStageCompletionService=rM,i.AssetStageService=dM,i.AssetStatusType=La,i.AssetTypeAttachmentService=lM,i.AssetTypeFieldValuesAttachmentService=hM,i.AssetTypeFieldValuesService=pM,i.AssetTypeFieldsAttachmentService=uM,i.AssetTypeFieldsService=oM,i.AssetTypeIdentifierService=mM,i.AssetTypeIdentifierValueService=yM,i.AssetTypeService=fM,i.AssetTypeStatusService=SM,i.AttachmentModel=Na,i.BaseApiService=At,i.BaseModelApiService=wt,i.BaseOfflineFileModelApiService=q,i.BaseOfflineModelApiService=M,i.BaseSDK=Ak,i.COMMON_AUTO_FIELDS=ec,i.DEFAULT_ISSUE_PRIORITY=Jg,i.DEFAULT_PAGE_SIZE=yg,i.DEFAULT_WORKFLOW_STATUS=Xg,i.DISCARD_HTTP_STATUSES=va,i.DeferredPromise=As,i.DocumentAttachmentService=AM,i.DocumentService=wM,i.EMPTY_ARRAY=$a,i.EMPTY_OBJECT=Ca,i.EmailDomainsService=TM,i.EmailVerificationService=IM,i.FILE_MODEL_DEFAULT_PAGE_SIZE=fg,i.FileService=OM,i.FormIdentifierService=FM,i.FormIdentifierValueService=_M,i.FormRevisionAttachmentService=gM,i.FormRevisionService=PM,i.FormService=bM,i.FormSubmissionAttachmentService=RM,i.FormSubmissionService=MM,i.GeoImageService=kM,i.HttpMethod=h,i.IssueAssociationService=EM,i.IssueAttachmentService=vM,i.IssueCommentAttachmentService=VM,i.IssueCommentService=BM,i.IssuePriority=Ss,i.IssueService=WM,i.IssueStatusType=Ga,i.IssueTypeAttachmentService=zM,i.IssueTypeFieldValuesAttachmentService=jM,i.IssueTypeFieldValuesService=$M,i.IssueTypeFieldsAttachmentService=qM,i.IssueTypeFieldsService=DM,i.IssueTypeIdentifierService=CM,i.IssueTypeIdentifierValueService=UM,i.IssueTypeService=LM,i.IssueTypeStatusService=NM,i.IssueUpdateChange=$,i.IssueUpdateService=GM,i.JWTService=YM,i.MAX_SERVICE_BATCH_SIZE=ot,i.OUTBOX_RETRY_DELAY=Ka,i.OfflineAnalyticsMiddleware=Bg,i.OfflineMiddleware=za,i.OrganizationAccessLevel=Ua,i.OrganizationAccessService=JM,i.OrganizationService=ZM,i.OutboxCoordinator=Pt,i.ProjectAccessService=QM,i.ProjectAttachmentService=XM,i.ProjectFileService=xM,i.ProjectService=ek,i.RESET_ORGANIZATION_STATE=_,i.RESET_PROJECT_STATE=B,i.RESET_STATE=I,i.RateLimitingMiddleware=Wg,i.SelectorBuilder=IP,i.TeamMembershipService=tk,i.TeamService=sk,i.UNKNOWN_ERROR_MESSAGE=gt,i.UserService=ik,i.VERSION_REDUCER_KEY=kt,i.VerificationCodeType=Dg,i.WORKFLOW_STATUSES=Qg,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=Zg,i.WorkflowIssueLinkService=ak,i.WorkflowService=nk,i.WorkflowStatus=Ot,i.WorkflowStepAssigneeService=ck,i.WorkflowStepCommentService=rk,i.WorkflowStepEventService=dk,i.WorkflowStepEventType=Ha,i.WorkflowStepFieldValuesAttachmentService=ok,i.WorkflowStepFieldValuesReviewRequestService=hk,i.WorkflowStepFieldValuesReviewService=pk,i.WorkflowStepFieldValuesReviewType=Mt,i.WorkflowStepFieldValuesService=mk,i.WorkflowStepFieldsAttachmentService=lk,i.WorkflowStepFieldsService=uk,i.WorkflowStepReviewerService=yk,i.WorkflowStepService=fk,i.WorkflowTypeService=Sk,i._setLatestRetryTime=sT,i.addAsset=kl,i.addAssetAttachment=yc,i.addAssetAttachments=Ps,i.addAssetProcedure=Lr,i.addAssetProcedureStep=Al,i.addAssetProcedureStepFieldValues=sl,i.addAssetProcedureStepFieldValuesAttachment=Ld,i.addAssetProcedureStepFieldValuesAttachments=Js,i.addAssetProcedureStepFieldValuesMany=il,i.addAssetProcedureStepFields=kd,i.addAssetProcedureStepFieldsAttachment=fd,i.addAssetProcedureStepFieldsAttachments=Sd,i.addAssetProcedureStepFieldsMany=Ed,i.addAssetProcedureSteps=wl,i.addAssetProcedureType=sd,i.addAssetProcedureTypeAttachment=Rc,i.addAssetProcedureTypeAttachments=Mc,i.addAssetProcedureTypeFieldValues=Mr,i.addAssetProcedureTypeFieldValuesAttachment=fr,i.addAssetProcedureTypeFieldValuesAttachments=Ws,i.addAssetProcedureTypeFieldValuesMany=kr,i.addAssetProcedureTypeFields=sr,i.addAssetProcedureTypeFieldsAttachment=Uc,i.addAssetProcedureTypeFieldsAttachments=Lc,i.addAssetProcedureTypeFieldsMany=ir,i.addAssetProcedureTypes=id,i.addAssetProcedures=$s,i.addAssetStage=cu,i.addAssetStageCompletion=Ll,i.addAssetStageCompletions=Nl,i.addAssetStages=ru,i.addAssetType=dh,i.addAssetTypeAttachment=Su,i.addAssetTypeAttachments=li,i.addAssetTypeFieldValues=Ao,i.addAssetTypeFieldValuesAttachment=no,i.addAssetTypeFieldValuesAttachments=fi,i.addAssetTypeFieldValuesMany=wo,i.addAssetTypeFields=Nu,i.addAssetTypeFieldsAttachment=ku,i.addAssetTypeFieldsAttachments=Eu,i.addAssetTypeFieldsMany=Gu,i.addAssetTypeIdentifier=vo,i.addAssetTypeIdentifierValue=Ho,i.addAssetTypeIdentifierValues=Ko,i.addAssetTypeIdentifiers=Vo,i.addAssetTypeStatus=Th,i.addAssetTypeStatuses=Ih,i.addAssetTypes=lh,i.addAssets=si,i.addConversation=lc,i.addConversations=OP,i.addDocument=Qh,i.addDocumentAttachment=qh,i.addDocumentAttachments=Dh,i.addDocuments=Xh,i.addEmailDomain=op,i.addEmailDomains=hp,i.addForm=Pm,i.addFormIdentifier=Rp,i.addFormIdentifierValue=Up,i.addFormIdentifierValues=Lp,i.addFormIdentifiers=Mp,i.addFormRevision=ji,i.addFormRevisionAttachment=sm,i.addFormRevisionAttachments=im,i.addFormRevisions=$i,i.addFormSubmission=ey,i.addFormSubmissionAttachment=$m,i.addFormSubmissionAttachments=Ki,i.addFormSubmissions=xi,i.addForms=bm,i.addGeoImage=py,i.addGeoImages=my,i.addIssue=Mf,i.addIssueAssociation=My,i.addIssueAssociations=yt,i.addIssueAttachment=Uy,i.addIssueAttachments=rn,i.addIssueComment=ff,i.addIssueCommentAttachment=tf,i.addIssueCommentAttachments=sf,i.addIssueComments=Sf,i.addIssueType=EA,i.addIssueTypeAttachment=Uf,i.addIssueTypeAttachments=Lf,i.addIssueTypeFieldValues=fS,i.addIssueTypeFieldValuesAttachment=NS,i.addIssueTypeFieldValuesAttachments=_n,i.addIssueTypeFieldValuesMany=SS,i.addIssueTypeFields=kS,i.addIssueTypeFieldsAttachment=sS,i.addIssueTypeFieldsAttachments=iS,i.addIssueTypeFieldsMany=ES,i.addIssueTypeIdentifier=iA,i.addIssueTypeIdentifierValue=SA,i.addIssueTypeIdentifierValues=AA,i.addIssueTypeIdentifiers=nA,i.addIssueTypeStatus=GA,i.addIssueTypeStatuses=HA,i.addIssueTypes=vA,i.addIssueUpdate=zn,i.addIssueUpdates=qn,i.addIssues=yn,i.addOrganization=Uw,i.addOrganizationAccess=gw,i.addOrganizationAccesses=Pw,i.addOrganizations=Cw,i.addProject=QT,i.addProjectAccess=cT,i.addProjectAccesses=rT,i.addProjectAttachment=wT,i.addProjectAttachments=TT,i.addProjectFile=WT,i.addProjectFiles=zT,i.addProjects=ZT,i.addTeam=FI,i.addTeamMembership=lI,i.addTeamMemberships=uI,i.addTeams=_I,i.addUser=Ln,i.addUsers=fw,i.addWorkflow=jI,i.addWorkflowIssueLink=xI,i.addWorkflowIssueLinks=Wt,i.addWorkflowStep=U_,i.addWorkflowStepAssignee=mO,i.addWorkflowStepAssignees=yO,i.addWorkflowStepComment=RO,i.addWorkflowStepComments=MO,i.addWorkflowStepEvent=UO,i.addWorkflowStepEvents=LO,i.addWorkflowStepFieldValues=UF,i.addWorkflowStepFieldValuesAttachment=MF,i.addWorkflowStepFieldValuesAttachments=fa,i.addWorkflowStepFieldValuesMany=LF,i.addWorkflowStepFieldValuesReview=y_,i.addWorkflowStepFieldValuesReviewRequest=s_,i.addWorkflowStepFieldValuesReviewRequests=Ia,i.addWorkflowStepFieldValuesReviews=_a,i.addWorkflowStepFields=yF,i.addWorkflowStepFieldsAttachment=sF,i.addWorkflowStepFieldsAttachments=oa,i.addWorkflowStepFieldsMany=fF,i.addWorkflowStepReviewer=R_,i.addWorkflowStepReviewers=M_,i.addWorkflowSteps=L_,i.addWorkflowType=sg,i.addWorkflowTypes=ig,i.addWorkflows=$I,i.agentsReducer=hc,i.agentsSlice=Fs,i.areArraysEqual=sP,i.assetAttachmentReducer=gc,i.assetAttachmentSlice=gs,i.assetProcedureReducer=Jr,i.assetProcedureSlice=js,i.assetProcedureStepFieldValuesAttachmentReducer=xd,i.assetProcedureStepFieldValuesAttachmentSlice=Ys,i.assetProcedureStepFieldValuesReducer=pl,i.assetProcedureStepFieldValuesSlice=Xs,i.assetProcedureStepFieldsAttachmentReducer=bd,i.assetProcedureStepFieldsAttachmentSlice=Ns,i.assetProcedureStepFieldsReducer=$d,i.assetProcedureStepFieldsSlice=Hs,i.assetProcedureStepReducer=_l,i.assetProcedureStepSlice=xs,i.assetProcedureTypeAttachmentReducer=zc,i.assetProcedureTypeAttachmentSlice=Ms,i.assetProcedureTypeFieldValuesAttachmentReducer=Or,i.assetProcedureTypeFieldValuesAttachmentSlice=Bs,i.assetProcedureTypeFieldValuesReducer=qr,i.assetProcedureTypeFieldValuesSlice=Ds,i.assetProcedureTypeFieldsAttachmentReducer=Zc,i.assetProcedureTypeFieldsAttachmentSlice=Es,i.assetProcedureTypeFieldsReducer=ur,i.assetProcedureTypeFieldsSlice=Vs,i.assetProcedureTypeReducer=ud,i.assetProcedureTypeSlice=Us,i.assetReducer=$l,i.assetSlice=ti,i.assetStageCompletionReducer=Ql,i.assetStageCompletionSlice=ni,i.assetStageReducer=hu,i.assetStageSlice=ai,i.assetTypeAttachmentReducer=bu,i.assetTypeAttachmentSlice=di,i.assetTypeFieldValuesAttachmentReducer=yo,i.assetTypeFieldValuesAttachmentSlice=yi,i.assetTypeFieldValuesReducer=Mo,i.assetTypeFieldValuesSlice=wi,i.assetTypeFieldsAttachmentReducer=Cu,i.assetTypeFieldsAttachmentSlice=hi,i.assetTypeFieldsReducer=to,i.assetTypeFieldsSlice=mi,i.assetTypeIdentifierReducer=Lo,i.assetTypeIdentifierSlice=Ti,i.assetTypeIdentifierValueReducer=ih,i.assetTypeIdentifierValueSlice=Oi,i.assetTypeReducer=Sh,i.assetTypeSlice=Fi,i.assetTypeStatusReducer=Eh,i.assetTypeStatusSlice=gi,i.assetTypeStatusSortFn=ic,i.authReducer=Bh,i.authSlice=ts,i.baseReducer=ER,i.baseReducers=Ea,i.clearTokens=cb,i.createModelAdapter=F,i.createOfflineAction=Xw,i.createPayload=R,i.createSelectionAdapter=xg,i.deleteAsset=Vl,i.deleteAssetAttachment=Tc,i.deleteAssetAttachments=bs,i.deleteAssetProcedure=Hr,i.deleteAssetProcedureStep=Ol,i.deleteAssetProcedureStepFieldValues=dl,i.deleteAssetProcedureStepFieldValuesAttachment=Yd,i.deleteAssetProcedureStepFieldValuesAttachments=Zs,i.deleteAssetProcedureStepFieldValuesMany=ll,i.deleteAssetProcedureStepFields=zd,i.deleteAssetProcedureStepFieldsAttachment=Od,i.deleteAssetProcedureStepFieldsAttachments=Fd,i.deleteAssetProcedureStepFieldsMany=qd,i.deleteAssetProcedureSteps=Fl,i.deleteAssetProcedureType=cd,i.deleteAssetProcedureTypeAttachment=Bc,i.deleteAssetProcedureTypeAttachments=Wc,i.deleteAssetProcedureTypeFieldValues=Wr,i.deleteAssetProcedureTypeFieldValuesAttachment=Ir,i.deleteAssetProcedureTypeFieldValuesAttachments=zs,i.deleteAssetProcedureTypeFieldValuesMany=zr,i.deleteAssetProcedureTypeFields=dr,i.deleteAssetProcedureTypeFieldsAttachment=Yc,i.deleteAssetProcedureTypeFieldsAttachments=Jc,i.deleteAssetProcedureTypeFieldsMany=lr,i.deleteAssetProcedureTypes=rd,i.deleteAssetProcedures=Cs,i.deleteAssetStage=uu,i.deleteAssetStageCompletion=Jl,i.deleteAssetStageCompletions=Zl,i.deleteAssetStages=ou,i.deleteAssetType=hh,i.deleteAssetTypeAttachment=Ou,i.deleteAssetTypeAttachments=ui,i.deleteAssetTypeFieldValues=_o,i.deleteAssetTypeFieldValuesAttachment=uo,i.deleteAssetTypeFieldValuesAttachments=Si,i.deleteAssetTypeFieldValuesMany=go,i.deleteAssetTypeFields=Zu,i.deleteAssetTypeFieldsAttachment=zu,i.deleteAssetTypeFieldsAttachments=qu,i.deleteAssetTypeFieldsMany=Qu,i.deleteAssetTypeIdentifier=Do,i.deleteAssetTypeIdentifierValue=Xo,i.deleteAssetTypeIdentifierValues=xo,i.deleteAssetTypeIdentifiers=jo,i.deleteAssetTypeStatus=Ph,i.deleteAssetTypeStatuses=bh,i.deleteAssetTypes=ph,i.deleteAssets=ii,i.deleteConversation=gP,i.deleteConversations=PP,i.deleteDocument=ip,i.deleteDocumentAttachment=Lh,i.deleteDocumentAttachments=Nh,i.deleteDocuments=np,i.deleteEmailDomain=Sp,i.deleteEmailDomains=Ap,i.deleteForm=vm,i.deleteFormIdentifier=Bp,i.deleteFormIdentifierValue=Yp,i.deleteFormIdentifierValues=Jp,i.deleteFormIdentifiers=Wp,i.deleteFormRevision=Ci,i.deleteFormRevisionAttachment=dm,i.deleteFormRevisionAttachments=lm,i.deleteFormRevisions=Ui,i.deleteFormSubmission=iy,i.deleteFormSubmissionAttachment=Gm,i.deleteFormSubmissionAttachments=Yi,i.deleteFormSubmissions=en,i.deleteForms=Vm,i.deleteGeoImage=Sy,i.deleteGeoImages=Ay,i.deleteIssue=Bf,i.deleteIssueAssociation=ky,i.deleteIssueAssociations=ft,i.deleteIssueAttachment=Ky,i.deleteIssueAttachments=dn,i.deleteIssueComment=Of,i.deleteIssueCommentAttachment=df,i.deleteIssueCommentAttachments=lf,i.deleteIssueComments=Ff,i.deleteIssueType=qA,i.deleteIssueTypeAttachment=Yf,i.deleteIssueTypeAttachments=Jf,i.deleteIssueTypeFieldValues=OS,i.deleteIssueTypeFieldValuesAttachment=JS,i.deleteIssueTypeFieldValuesAttachments=gn,i.deleteIssueTypeFieldValuesMany=FS,i.deleteIssueTypeFields=zS,i.deleteIssueTypeFieldsAttachment=dS,i.deleteIssueTypeFieldsAttachments=lS,i.deleteIssueTypeFieldsMany=qS,i.deleteIssueTypeIdentifier=lA,i.deleteIssueTypeIdentifierValue=FA,i.deleteIssueTypeIdentifierValues=_A,i.deleteIssueTypeIdentifiers=uA,i.deleteIssueTypeStatus=QA,i.deleteIssueTypeStatuses=XA,i.deleteIssueTypes=DA,i.deleteIssueUpdate=Dn,i.deleteIssueUpdates=jn,i.deleteIssues=fn,i.deleteOrganization=Gw,i.deleteOrganizationAccess=Ew,i.deleteOrganizationAccesses=vw,i.deleteOrganizations=Hw,i.deleteProject=eI,i.deleteProjectAccess=hT,i.deleteProjectAccesses=pT,i.deleteProjectAttachment=gT,i.deleteProjectAttachments=PT,i.deleteProjectFile=jT,i.deleteProjectFiles=$T,i.deleteProjects=tI,i.deleteTeam=MI,i.deleteTeamMembership=yI,i.deleteTeamMemberships=fI,i.deleteTeams=kI,i.deleteUser=Nn,i.deleteUsers=ww,i.deleteWorkflow=GI,i.deleteWorkflowIssueLink=nO,i.deleteWorkflowIssueLinks=zt,i.deleteWorkflowStep=Y_,i.deleteWorkflowStepAssignee=TO,i.deleteWorkflowStepAssignees=IO,i.deleteWorkflowStepComment=BO,i.deleteWorkflowStepComments=WO,i.deleteWorkflowStepEvent=YO,i.deleteWorkflowStepEvents=JO,i.deleteWorkflowStepFieldValues=YF,i.deleteWorkflowStepFieldValuesAttachment=BF,i.deleteWorkflowStepFieldValuesAttachments=Sa,i.deleteWorkflowStepFieldValuesMany=JF,i.deleteWorkflowStepFieldValuesReview=T_,i.deleteWorkflowStepFieldValuesReviewRequest=r_,i.deleteWorkflowStepFieldValuesReviewRequests=Oa,i.deleteWorkflowStepFieldValuesReviews=ga,i.deleteWorkflowStepFields=IF,i.deleteWorkflowStepFieldsAttachment=rF,i.deleteWorkflowStepFieldsAttachments=ha,i.deleteWorkflowStepFieldsMany=OF,i.deleteWorkflowStepReviewer=B_,i.deleteWorkflowStepReviewers=W_,i.deleteWorkflowSteps=J_,i.deleteWorkflowType=dg,i.deleteWorkflowTypes=lg,i.deleteWorkflows=HI,i.dequeue=_g,i.discard=Pg,i.documentAttachmentReducer=Yh,i.documentAttachmentSlice=bi,i.documentSlice=Mi,i.documentsReducer=ap,i.downloadFile=uP,i.emailDomainsReducer=Op,i.emailDomainsSlice=Ei,i.emailRegex=AP,i.enqueue=Fg,i.enqueueRequest=eT,i.extractResponseFromError=Rg,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=Nt,i.fetchBlobFromObjectUrl=Za,i.fetchFileFromObjectUrl=Qa,i.fileReducer=gp,i.fileSlice=Vi,i.formIdentifierReducer=jp,i.formIdentifierSlice=Bi,i.formIdentifierValueReducer=xp,i.formIdentifierValueSlice=zi,i.formReducer=Bm,i.formRevisionAttachmentReducer=pm,i.formRevisionAttachmentSlice=qi,i.formRevisionReducer=Fm,i.formRevisionsSlice=Di,i.formSlice=Ni,i.formSubmissionAttachmentReducer=Jm,i.formSubmissionAttachmentSlice=Hi,i.formSubmissionReducer=dy,i.formSubmissionSlice=Xi,i.geoImageReducer=Oy,i.geoImageSlice=sn,i.getAssetProcedureStepSubTree=sc,i.getAssetProcedureStepTrees=wP,i.getClientSDK=Vg,i.getClientStore=bt,i.getDocumentSubTree=cc,i.getDocumentTrees=TP,i.getFileExtension=Ja,i.getLocalDateString=Ya,i.getLocalRelativeDateString=cP,i.getOutboxCoordinator=Tt,i.getRenamedFile=lP,i.getRequestDescription=w,i.getS3FileKey=dP,i.hashFile=Gt,i.initSDK=wk,i.initializeAssetAttachments=mc,i.initializeAssetProcedureStepFieldValues=tl,i.initializeAssetProcedureStepFieldValuesAttachments=Ud,i.initializeAssetProcedureStepFields=Md,i.initializeAssetProcedureStepFieldsAttachments=yd,i.initializeAssetProcedureSteps=yl,i.initializeAssetProcedureTypeAttachments=bc,i.initializeAssetProcedureTypeFieldValues=Rr,i.initializeAssetProcedureTypeFieldValuesAttachments=yr,i.initializeAssetProcedureTypeFields=tr,i.initializeAssetProcedureTypeFieldsAttachments=Cc,i.initializeAssetProcedureTypes=td,i.initializeAssetProcedures=Ur,i.initializeAssetStageCompletions=Ul,i.initializeAssetStages=iu,i.initializeAssetTypeAttachments=fu,i.initializeAssetTypeFieldValues=So,i.initializeAssetTypeFieldValuesAttachments=io,i.initializeAssetTypeFields=Lu,i.initializeAssetTypeFieldsAttachments=Mu,i.initializeAssetTypeIdentifierValues=Go,i.initializeAssetTypeIdentifiers=Eo,i.initializeAssetTypeStatuses=wh,i.initializeAssetTypes=ah,i.initializeAssets=Ml,i.initializeConversations=dc,i.initializeDocumentAttachments=zh,i.initializeDocuments=Zh,i.initializeEmailDomains=up,i.initializeFormIdentifierValues=Cp,i.initializeFormIdentifiers=bp,i.initializeFormRevisionAttachments=tm,i.initializeFormRevisions=ym,i.initializeFormSubmissionAttachments=jm,i.initializeFormSubmissions=Qm,i.initializeForms=gm,i.initializeGeoImages=uy,i.initializeIssueAssociations=_y,i.initializeIssueAttachments=Cy,i.initializeIssueCommentAttachments=ef,i.initializeIssueComments=yf,i.initializeIssueTypeAttachments=Cf,i.initializeIssueTypeFieldValues=yS,i.initializeIssueTypeFieldValuesAttachments=LS,i.initializeIssueTypeFields=MS,i.initializeIssueTypeFieldsAttachments=tS,i.initializeIssueTypeIdentifierValues=fA,i.initializeIssueTypeIdentifiers=sA,i.initializeIssueTypeStatuses=NA,i.initializeIssueTypes=kA,i.initializeIssueUpdates=iw,i.initializeIssues=Rf,i.initializeOrganizationAccesses=_w,i.initializeOrganizations=Dw,i.initializeProjectAccesses=aT,i.initializeProjectAttachments=AT,i.initializeProjectFiles=vT,i.initializeProjects=KT,i.initializeTeamMemberships=dI,i.initializeTeams=OI,i.initializeUsers=pw,i.initializeWorkflowIssueLinks=XI,i.initializeWorkflowStepAssignees=pO,i.initializeWorkflowStepComments=bO,i.initializeWorkflowStepEvents=CO,i.initializeWorkflowStepFieldValues=CF,i.initializeWorkflowStepFieldValuesAttachments=RF,i.initializeWorkflowStepFieldValuesReviewRequests=t_,i.initializeWorkflowStepFieldValuesReviews=m_,i.initializeWorkflowStepFields=mF,i.initializeWorkflowStepFieldsAttachments=tF,i.initializeWorkflowStepReviewers=b_,i.initializeWorkflowSteps=C_,i.initializeWorkflowTypes=tg,i.initializeWorkflows=DI,i.isImageFile=oP,i.isObjectUrl=Xa,i.isToday=aP,i.issueAssociationReducer=jy,i.issueAssociationSlice=an,i.issueAttachmentReducer=Xy,i.issueAttachmentSlice=cn,i.issueCommentAttachmentReducer=pf,i.issueCommentAttachmentSlice=un,i.issueCommentReducer=Pf,i.issueCommentSlice=hn,i.issueReducer=jf,i.issueSlice=mn,i.issueTypeAttachmentReducer=xf,i.issueTypeAttachmentSlice=Sn,i.issueTypeFieldValuesAttachmentReducer=eA,i.issueTypeFieldValuesAttachmentSlice=Fn,i.issueTypeFieldValuesReducer=bS,i.issueTypeFieldValuesSlice=In,i.issueTypeFieldsAttachmentReducer=pS,i.issueTypeFieldsAttachmentSlice=wn,i.issueTypeFieldsReducer=CS,i.issueTypeFieldsSlice=On,i.issueTypeIdentifierReducer=mA,i.issueTypeIdentifierSlice=bn,i.issueTypeIdentifierValueReducer=RA,i.issueTypeIdentifierValueSlice=Mn,i.issueTypeReducer=UA,i.issueTypeSlice=kn,i.issueTypeStatusReducer=tw,i.issueTypeStatusSlice=vn,i.issueTypeStatusSortFn=nc,i.issueUpdateReducer=ow,i.issueUpdateSlice=Wn,i.logOnlyOnce=hP,i.markAsDeleted=tT,i.markForDeletion=Lb,i.memoize=Ts,i.organizationAccessReducer=Vw,i.organizationAccessSlice=Hn,i.organizationReducer=Qw,i.organizationSlice=Kn,i.outboxReducer=iT,i.outboxSlice=Yn,i.overmapEnhancer=$R,i.overmapReducer=vR,i.overmapReducers=mg,i.performRequest=Ba,i.performRequestFromAction=gg,i.projectAccessReducer=mT,i.projectAccessSlice=Jn,i.projectAttachmentReducer=kT,i.projectAttachmentSlice=Qn,i.projectFileReducer=GT,i.projectFileSlice=xn,i.projectReducer=sI,i.projectSlice=ea,i.rehydratedReducer=cI,i.rehydratedSlice=ta,i.restructureSelectorWithArgs=S,i.runMiddleware=qg,i.selectAccessToken=rb,i.selectAccessesByUserOfProject=Gb,i.selectAccessibleProjects=Yb,i.selectActiveOrganizationAccess=jb,i.selectAllDocumentAttachments=Ri,i.selectAssetAttachmentById=Oc,i.selectAssetAttachmentMapping=Ic,i.selectAssetAttachments=Rs,i.selectAssetAttachmentsByIds=Fc,i.selectAssetById=Dl,i.selectAssetProcedureById=Xr,i.selectAssetProcedureStepById=gl,i.selectAssetProcedureStepFieldValues=Et,i.selectAssetProcedureStepFieldValuesAttachmentById=Zd,i.selectAssetProcedureStepFieldValuesAttachments=Qs,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Qd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Jd,i.selectAssetProcedureStepFieldValuesById=ol,i.selectAssetProcedureStepFieldValuesByIds=hl,i.selectAssetProcedureStepFieldValuesMapping=ul,i.selectAssetProcedureStepFieldValuesOfAsset=CP,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=UP,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=LP,i.selectAssetProcedureStepFields=Zt,i.selectAssetProcedureStepFieldsAttachmentById=gd,i.selectAssetProcedureStepFieldsAttachments=Gs,i.selectAssetProcedureStepFieldsAttachmentsByIds=Pd,i.selectAssetProcedureStepFieldsAttachmentsMapping=_d,i.selectAssetProcedureStepFieldsById=Dd,i.selectAssetProcedureStepFieldsByIds=jd,i.selectAssetProcedureStepFieldsMapping=Ks,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=DP,i.selectAssetProcedureStepMapping=Qt,i.selectAssetProcedureSteps=ei,i.selectAssetProcedureStepsByIds=Pl,i.selectAssetProcedureStepsMappingOfAssetProcedureType=NP,i.selectAssetProcedureStepsOfAssetProcedureType=GP,i.selectAssetProcedureTypeAttachmentById=Dc,i.selectAssetProcedureTypeAttachmentMapping=qc,i.selectAssetProcedureTypeAttachments=ks,i.selectAssetProcedureTypeAttachmentsByIds=jc,i.selectAssetProcedureTypeById=hd,i.selectAssetProcedureTypeFieldValues=Yt,i.selectAssetProcedureTypeFieldValuesAttachmentById=_r,i.selectAssetProcedureTypeFieldValuesAttachments=qs,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=gr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Fr,i.selectAssetProcedureTypeFieldValuesById=jr,i.selectAssetProcedureTypeFieldValuesByIds=$r,i.selectAssetProcedureTypeFieldValuesMapping=Dr,i.selectAssetProcedureTypeFieldValuesOfAsset=VP,i.selectAssetProcedureTypeFields=Kt,i.selectAssetProcedureTypeFieldsAttachmentById=Xc,i.selectAssetProcedureTypeFieldsAttachments=vs,i.selectAssetProcedureTypeFieldsAttachmentsByIds=xc,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Qc,i.selectAssetProcedureTypeFieldsById=hr,i.selectAssetProcedureTypeFieldsByIds=pr,i.selectAssetProcedureTypeFieldsMapping=or,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=EP,i.selectAssetProcedureTypes=Ls,i.selectAssetProcedureTypesByIds=pd,i.selectAssetProcedureTypesMapping=od,i.selectAssetProcedureTypesOfOrganization=zP,i.selectAssetProcedures=Jt,i.selectAssetProceduresByIds=xr,i.selectAssetProceduresMapping=Zr,i.selectAssetProceduresOfAssetProcedureType=Qr,i.selectAssetProceduresOfAssetType=WP,i.selectAssetStageById=pu,i.selectAssetStageCompletionById=eu,i.selectAssetStageCompletionMapping=Xl,i.selectAssetStageCompletions=xl,i.selectAssetStageCompletionsByIds=tu,i.selectAssetStages=ri,i.selectAssetStagesByIds=mu,i.selectAssetStagesMappingOfAssetProcedureType=KP,i.selectAssetStagesOfAssetProcedureType=YP,i.selectAssetTypeAttachmentById=_u,i.selectAssetTypeAttachmentMapping=Fu,i.selectAssetTypeAttachments=oi,i.selectAssetTypeAttachmentsByIds=gu,i.selectAssetTypeById=yh,i.selectAssetTypeFieldValues=xt,i.selectAssetTypeFieldValuesAttachmentById=ho,i.selectAssetTypeFieldValuesAttachments=Ai,i.selectAssetTypeFieldValuesAttachmentsByIds=po,i.selectAssetTypeFieldValuesAttachmentsMapping=oo,i.selectAssetTypeFieldValuesById=bo,i.selectAssetTypeFieldValuesByIds=Ro,i.selectAssetTypeFieldValuesMapping=Po,i.selectAssetTypeFieldValuesOfAsset=XP,i.selectAssetTypeFields=vt,i.selectAssetTypeFieldsAttachmentById=ju,i.selectAssetTypeFieldsAttachments=pi,i.selectAssetTypeFieldsAttachmentsByIds=$u,i.selectAssetTypeFieldsAttachmentsMapping=Du,i.selectAssetTypeFieldsById=xu,i.selectAssetTypeFieldsByIds=eo,i.selectAssetTypeFieldsMapping=Xu,i.selectAssetTypeFieldsOfAssetType=ZP,i.selectAssetTypeIdentifierById=Co,i.selectAssetTypeIdentifierMapping=$o,i.selectAssetTypeIdentifierValueById=th,i.selectAssetTypeIdentifierValueMapping=eh,i.selectAssetTypeIdentifierValues=es,i.selectAssetTypeIdentifierValuesByIds=sh,i.selectAssetTypeIdentifierValuesOfAsset=tb,i.selectAssetTypeIdentifierValuesOfIdentifier=sb,i.selectAssetTypeIdentifiers=Ii,i.selectAssetTypeIdentifiersByIds=Uo,i.selectAssetTypeIdentifiersOfAssetType=eb,i.selectAssetTypeStatusById=Mh,i.selectAssetTypeStatusMapping=Rh,i.selectAssetTypeStatuses=Pi,i.selectAssetTypeStatusesByIds=kh,i.selectAssetTypeStatusesOfAssetType=nb,i.selectAssetTypeValuesOfAssetType=xP,i.selectAssetTypes=_i,i.selectAssetTypesByIds=fh,i.selectAssetTypesMapping=mh,i.selectAssetTypesOfOrganization=ib,i.selectAssets=Xt,i.selectAssetsByIds=jl,i.selectAssetsMapping=zl,i.selectAssetsOfAssetType=ql,i.selectAssetsOfProject=HP,i.selectAttachmentsOfAsset=_c,i.selectAttachmentsOfAssetProcedureStepFieldValues=Xd,i.selectAttachmentsOfAssetProcedureStepFields=qP,i.selectAttachmentsOfAssetProcedureType=MP,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Pr,i.selectAttachmentsOfAssetProcedureTypeFields=kP,i.selectAttachmentsOfAssetType=Pu,i.selectAttachmentsOfAssetTypeFieldValues=mo,i.selectAttachmentsOfAssetTypeFields=JP,i.selectAttachmentsOfDocument=lb,i.selectAttachmentsOfFormRevision=wb,i.selectAttachmentsOfFormSubmission=Ym,i.selectAttachmentsOfIssue=Jy,i.selectAttachmentsOfIssueComment=Fb,i.selectAttachmentsOfIssueType=Pb,i.selectAttachmentsOfIssueTypeFieldValues=xS,i.selectAttachmentsOfIssueTypeFields=bb,i.selectAttachmentsOfProject=Kb,i.selectAttachmentsOfWorkflowStepFieldValues=DF,i.selectAttachmentsOfWorkflowStepFields=lF,i.selectCommentsOfIssue=_b,i.selectConversation=RP,i.selectConversationMapping=_s,i.selectConversations=bP,i.selectCurrentUser=Iw,i.selectDeletedRequests=Cb,i.selectDescendantsOfAssetProcedureStep=bl,i.selectDescendantsOfDocument=dp,i.selectDocumentAttachmentById=Hh,i.selectDocumentAttachmentMapping=Gh,i.selectDocumentAttachmentsByIds=Kh,i.selectDocumentById=cp,i.selectDocuments=ss,i.selectDocumentsByIds=rp,i.selectDocumentsMapping=ki,i.selectEmailDomainById=Tp,i.selectEmailDomains=vi,i.selectEmailDomainsAsMapping=wp,i.selectEmailDomainsByIds=Ip,i.selectEmailDomainsOfOrganization=hb,i.selectFieldValuesOfAssetProcedure=BP,i.selectFormById=zm,i.selectFormIdentifierById=qp,i.selectFormIdentifierMapping=zp,i.selectFormIdentifierValueById=Qp,i.selectFormIdentifierValueMapping=Zp,i.selectFormIdentifierValues=is,i.selectFormIdentifierValuesByIds=Xp,i.selectFormIdentifierValuesOfFormSubmission=Sb,i.selectFormIdentifierValuesOfIdentifier=Ab,i.selectFormIdentifiers=Wi,i.selectFormIdentifiersByIds=Dp,i.selectFormIdentifiersOfForm=fb,i.selectFormMapping=Wm,i.selectFormRevisionAttachmentById=om,i.selectFormRevisionAttachments=um,i.selectFormRevisionAttachmentsByIds=hm,i.selectFormRevisionAttachmentsMapping=ns,i.selectFormRevisionById=Tm,i.selectFormRevisionMapping=Li,i.selectFormRevisions=as,i.selectFormRevisionsByIds=Im,i.selectFormRevisionsOfForm=Om,i.selectFormSubmissionAttachemntsByIds=Qi,i.selectFormSubmissionAttachmentById=Hm,i.selectFormSubmissionAttachments=Zi,i.selectFormSubmissionAttachmentsByIds=Km,i.selectFormSubmissionAttachmentsMapping=Ji,i.selectFormSubmissionById=ay,i.selectFormSubmissions=ny,i.selectFormSubmissionsByIds=cy,i.selectFormSubmissionsMapping=tn,i.selectFormSubmissionsOfForm=ry,i.selectForms=Gi,i.selectFormsByIds=qm,i.selectFormsOfOrganization=Ib,i.selectGeoImageById=Ty,i.selectGeoImageMapping=wy,i.selectGeoImages=nn,i.selectGeoImagesByIds=Iy,i.selectGeoImagesOfProject=Ob,i.selectIsLoggedIn=db,i.selectIssueAssociationById=vy,i.selectIssueAssociationMapping=Ey,i.selectIssueAssociations=St,i.selectIssueAssociationsByIds=Vy,i.selectIssueAssociationsOfAsset=Dy,i.selectIssueAssociationsOfIssue=qy,i.selectIssueAssociationsOfIssues=zy,i.selectIssueAssociationsToIssue=By,i.selectIssueAssociationsToIssues=Wy,i.selectIssueAttachmentById=Zy,i.selectIssueAttachmentMapping=Yy,i.selectIssueAttachments=ln,i.selectIssueAttachmentsByIds=Qy,i.selectIssueById=zf,i.selectIssueCommentAttachmentById=of,i.selectIssueCommentAttachmentMapping=uf,i.selectIssueCommentAttachments=on,i.selectIssueCommentAttachmentsByIds=hf,i.selectIssueCommentById=_f,i.selectIssueCommentMapping=pn,i.selectIssueCommentsByIds=gf,i.selectIssueMapping=Wf,i.selectIssueTypeAttachmentById=Qf,i.selectIssueTypeAttachmentMapping=Zf,i.selectIssueTypeAttachments=An,i.selectIssueTypeAttachmentsByIds=Xf,i.selectIssueTypeById=$A,i.selectIssueTypeFieldValues=rs,i.selectIssueTypeFieldValuesAttachmentById=QS,i.selectIssueTypeFieldValuesAttachments=Pn,i.selectIssueTypeFieldValuesAttachmentsByIds=XS,i.selectIssueTypeFieldValuesAttachmentsMapping=ZS,i.selectIssueTypeFieldValuesById=gS,i.selectIssueTypeFieldValuesByIds=PS,i.selectIssueTypeFieldValuesMapping=_S,i.selectIssueTypeFieldValuesOfIssue=Rb,i.selectIssueTypeFields=Vt,i.selectIssueTypeFieldsAttachmentById=oS,i.selectIssueTypeFieldsAttachments=Tn,i.selectIssueTypeFieldsAttachmentsByIds=hS,i.selectIssueTypeFieldsAttachmentsMapping=uS,i.selectIssueTypeFieldsById=jS,i.selectIssueTypeFieldsByIds=$S,i.selectIssueTypeFieldsMapping=DS,i.selectIssueTypeFieldsOfIssueType=Mb,i.selectIssueTypeIdentifierById=hA,i.selectIssueTypeIdentifierMapping=oA,i.selectIssueTypeIdentifierValueById=PA,i.selectIssueTypeIdentifierValueMapping=gA,i.selectIssueTypeIdentifierValues=ds,i.selectIssueTypeIdentifierValuesByIds=bA,i.selectIssueTypeIdentifierValuesOfIdentifier=Bb,i.selectIssueTypeIdentifierValuesOfIssue=Vb,i.selectIssueTypeIdentifiers=Rn,i.selectIssueTypeIdentifiersByIds=pA,i.selectIssueTypeIdentifiersOfIssueType=vb,i.selectIssueTypeMapping=jA,i.selectIssueTypeStatusById=Bn,i.selectIssueTypeStatusMapping=xA,i.selectIssueTypeStatuses=Vn,i.selectIssueTypeStatusesByIds=ew,i.selectIssueTypeStatusesOfIssueType=zb,i.selectIssueTypeValuesOfIssueType=Eb,i.selectIssueTypes=En,i.selectIssueTypesByIds=CA,i.selectIssueTypesOfOrganization=Wb,i.selectIssueUpdateById=dw,i.selectIssueUpdateMapping=$n,i.selectIssueUpdates=Cn,i.selectIssueUpdatesByIds=lw,i.selectIssueUpdatesOfIssue=uw,i.selectIssues=cs,i.selectIssuesByIds=qf,i.selectIssuesOfIssueType=Df,i.selectIssuesOfProject=gb,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=jP,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=vP,i.selectLatestAssetTypeFieldsOfAssetType=QP,i.selectLatestFieldsByAssetProcedureStep=$P,i.selectLatestFormRevisionOfForm=Tb,i.selectLatestIssueTypeFieldsOfIssueType=kb,i.selectLatestRetryTime=Ub,i.selectLatestReviewOfWorkflowStepFieldValues=FR,i.selectLatestReviewRequestOfWorkflowStepFieldValues=IR,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=TR,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=gR,i.selectLatestWorkflowStepFieldsOfWorkflowStep=fR,i.selectMembershipsByUserOfTeam=xb,i.selectOrganizationAccessById=Bw,i.selectOrganizationAccessMapping=os,i.selectOrganizationAccessUserMapping=zw,i.selectOrganizationAccessesByIds=Ww,i.selectOrganizationById=Jw,i.selectOrganizationDocuments=ob,i.selectOrganizations=Yw,i.selectOrganizationsByIds=Zw,i.selectOrganizationsMapping=Kw,i.selectProjectAccessById=yT,i.selectProjectAccessMapping=Zn,i.selectProjectAccesses=Bt,i.selectProjectAccessesByIds=fT,i.selectProjectAccessesOfProject=Nb,i.selectProjectAttachmentById=RT,i.selectProjectAttachmentMapping=bT,i.selectProjectAttachments=Xn,i.selectProjectAttachmentsByIds=MT,i.selectProjectById=nI,i.selectProjectDocuments=ub,i.selectProjectFileById=LT,i.selectProjectFileMapping=CT,i.selectProjectFiles=UT,i.selectProjectFilesByIds=NT,i.selectProjectMapping=iI,i.selectProjects=hs,i.selectProjectsByIds=aI,i.selectProjectsOfOrganization=Jb,i.selectRehydrated=Xb,i.selectReviewRequestsOfWorkflowStepFieldValues=o_,i.selectReviewsOfWorkflowStepFieldValues=__,i.selectStageMapping=ci,i.selectTeamById=vI,i.selectTeamMembershipById=wI,i.selectTeamMemberships=ps,i.selectTeamMembershipsByIds=TI,i.selectTeamMembershipsMapping=AI,i.selectTeams=na,i.selectTeamsByIds=VI,i.selectTeamsMapping=EI,i.selectTeamsOfOrganization=tR,i.selectUploadUrl=yb,i.selectUserById=us,i.selectUsers=ls,i.selectUsersByIds=Ow,i.selectUsersMapping=Gn,i.selectUsersOfOrganization=$b,i.selectUsersOfProject=Hb,i.selectUsersOfTeam=eR,i.selectWorkflowById=YI,i.selectWorkflowIssueLinkById=cO,i.selectWorkflowIssueLinks=Ft,i.selectWorkflowIssueLinksByIds=rO,i.selectWorkflowIssueLinksMapping=aO,i.selectWorkflowIssueLinksOfIssue=uO,i.selectWorkflowIssueLinksOfIssues=aR,i.selectWorkflowIssueLinksOfWorkflow=dO,i.selectWorkflowIssueLinksOfWorkflows=lO,i.selectWorkflowMapping=KI,i.selectWorkflowStepAssigneeById=FO,i.selectWorkflowStepAssignees=qt,i.selectWorkflowStepAssigneesByIds=_O,i.selectWorkflowStepAssigneesMapping=OO,i.selectWorkflowStepAssigneesOfWorkflow=cR,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=dR,i.selectWorkflowStepAssigneesOfWorkflowStep=rR,i.selectWorkflowStepById=Q_,i.selectWorkflowStepCommentById=qO,i.selectWorkflowStepComments=Dt,i.selectWorkflowStepCommentsByIds=DO,i.selectWorkflowStepCommentsMapping=zO,i.selectWorkflowStepCommentsOfWorkflow=lR,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=oR,i.selectWorkflowStepCommentsOfWorkflowStep=uR,i.selectWorkflowStepEventById=QO,i.selectWorkflowStepEvents=jt,i.selectWorkflowStepEventsByIds=XO,i.selectWorkflowStepEventsMapping=ZO,i.selectWorkflowStepEventsOfWorkflow=hR,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=mR,i.selectWorkflowStepEventsOfWorkflowStep=pR,i.selectWorkflowStepFieldValues=pt,i.selectWorkflowStepFieldValuesAttachmentById=zF,i.selectWorkflowStepFieldValuesAttachments=Aa,i.selectWorkflowStepFieldValuesAttachmentsByIds=qF,i.selectWorkflowStepFieldValuesAttachmentsMapping=WF,i.selectWorkflowStepFieldValuesById=QF,i.selectWorkflowStepFieldValuesByIds=XF,i.selectWorkflowStepFieldValuesMapping=ZF,i.selectWorkflowStepFieldValuesOfWorkflow=SR,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=wR,i.selectWorkflowStepFieldValuesOfWorkflowStep=AR,i.selectWorkflowStepFieldValuesReviewById=O_,i.selectWorkflowStepFieldValuesReviewRequestById=l_,i.selectWorkflowStepFieldValuesReviewRequests=$t,i.selectWorkflowStepFieldValuesReviewRequestsByIds=u_,i.selectWorkflowStepFieldValuesReviewRequestsMapping=d_,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=OR,i.selectWorkflowStepFieldValuesReviews=_t,i.selectWorkflowStepFieldValuesReviewsByIds=F_,i.selectWorkflowStepFieldValuesReviewsMapping=I_,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=_R,i.selectWorkflowStepFields=ys,i.selectWorkflowStepFieldsAttachmentById=uF,i.selectWorkflowStepFieldsAttachments=pa,i.selectWorkflowStepFieldsAttachmentsByIds=oF,i.selectWorkflowStepFieldsAttachmentsMapping=dF,i.selectWorkflowStepFieldsById=_F,i.selectWorkflowStepFieldsByIds=gF,i.selectWorkflowStepFieldsMapping=FF,i.selectWorkflowStepFieldsOfWorkflowStep=yR,i.selectWorkflowStepReviewerById=q_,i.selectWorkflowStepReviewers=Ct,i.selectWorkflowStepReviewersByIds=D_,i.selectWorkflowStepReviewersMapping=z_,i.selectWorkflowStepReviewersOfWorkflow=PR,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=RR,i.selectWorkflowStepReviewersOfWorkflowStep=bR,i.selectWorkflowSteps=Ra,i.selectWorkflowStepsByIds=X_,i.selectWorkflowStepsMapping=Z_,i.selectWorkflowStepsOfWorkflowType=MR,i.selectWorkflowTypeById=og,i.selectWorkflowTypeMapping=ug,i.selectWorkflowTypes=ka,i.selectWorkflowTypesByIds=hg,i.selectWorkflowTypesOfOrganization=kR,i.selectWorkflows=ms,i.selectWorkflowsByIds=JI,i.selectWorkflowsOfProject=iR,i.selectWorkflowsOfWorkflowType=nR,i.setAsset=Bl,i.setAssetAttachment=fc,i.setAssetAttachments=Sc,i.setAssetProcedure=Kr,i.setAssetProcedureStep=fl,i.setAssetProcedureStepFieldValues=nl,i.setAssetProcedureStepFieldValuesAttachment=Nd,i.setAssetProcedureStepFieldValuesAttachments=Gd,i.setAssetProcedureStepFieldValuesMany=al,i.setAssetProcedureStepFields=vd,i.setAssetProcedureStepFieldsAttachment=Ad,i.setAssetProcedureStepFieldsAttachments=wd,i.setAssetProcedureStepFieldsMany=Vd,i.setAssetProcedureSteps=Sl,i.setAssetProcedureType=dd,i.setAssetProcedureTypeAttachment=kc,i.setAssetProcedureTypeAttachments=Ec,i.setAssetProcedureTypeFieldValues=Er,i.setAssetProcedureTypeFieldValuesAttachment=Sr,i.setAssetProcedureTypeFieldValuesAttachments=Ar,i.setAssetProcedureTypeFieldValuesMany=vr,i.setAssetProcedureTypeFields=nr,i.setAssetProcedureTypeFieldsAttachment=Nc,i.setAssetProcedureTypeFieldsAttachments=Gc,i.setAssetProcedureTypeFieldsMany=ar,i.setAssetProcedureTypes=ld,i.setAssetProcedures=Yr,i.setAssetStage=nu,i.setAssetStageCompletion=Gl,i.setAssetStageCompletions=Hl,i.setAssetStages=au,i.setAssetType=ch,i.setAssetTypeAttachment=Au,i.setAssetTypeAttachments=wu,i.setAssetTypeFieldValues=To,i.setAssetTypeFieldValuesAttachment=ao,i.setAssetTypeFieldValuesAttachments=co,i.setAssetTypeFieldValuesMany=Io,i.setAssetTypeFields=Hu,i.setAssetTypeFieldsAttachment=vu,i.setAssetTypeFieldsAttachments=Vu,i.setAssetTypeFieldsMany=Ku,i.setAssetTypeIdentifier=Bo,i.setAssetTypeIdentifierValue=Yo,i.setAssetTypeIdentifierValues=Jo,i.setAssetTypeIdentifiers=Wo,i.setAssetTypeStatus=Oh,i.setAssetTypeStatuses=Fh,i.setAssetTypes=rh,i.setAssets=Wl,i.setClientSDK=vg,i.setClientStore=kg,i.setConversation=uc,i.setConversations=FP,i.setCurrentUser=qb,i.setCurrentUserProfile=Db,i.setDocument=xh,i.setDocumentAttachment=jh,i.setDocumentAttachments=$h,i.setDocuments=ep,i.setEmailDomain=pp,i.setEmailDomains=mp,i.setForm=Rm,i.setFormIdentifier=kp,i.setFormIdentifierValue=Np,i.setFormIdentifierValues=Gp,i.setFormIdentifiers=Ep,i.setFormRevision=fm,i.setFormRevisionAttachment=nm,i.setFormRevisionAttachments=am,i.setFormRevisions=Sm,i.setFormSubmission=Xm,i.setFormSubmissionAttachment=Cm,i.setFormSubmissionAttachments=Um,i.setFormSubmissions=xm,i.setForms=Mm,i.setGeoImage=oy,i.setGeoImages=hy,i.setIssue=kf,i.setIssueAssociation=Py,i.setIssueAssociations=gy,i.setIssueAttachment=Ly,i.setIssueAttachments=Ny,i.setIssueComment=Af,i.setIssueCommentAttachment=nf,i.setIssueCommentAttachments=af,i.setIssueComments=wf,i.setIssueType=VA,i.setIssueTypeAttachment=Nf,i.setIssueTypeAttachments=Gf,i.setIssueTypeFieldValues=AS,i.setIssueTypeFieldValuesAttachment=GS,i.setIssueTypeFieldValuesAttachments=HS,i.setIssueTypeFieldValuesMany=wS,i.setIssueTypeFields=vS,i.setIssueTypeFieldsAttachment=nS,i.setIssueTypeFieldsAttachments=aS,i.setIssueTypeFieldsMany=VS,i.setIssueTypeIdentifier=aA,i.setIssueTypeIdentifierValue=wA,i.setIssueTypeIdentifierValues=TA,i.setIssueTypeIdentifiers=cA,i.setIssueTypeStatus=KA,i.setIssueTypeStatuses=YA,i.setIssueTypes=BA,i.setIssueUpdate=nw,i.setIssueUpdates=aw,i.setIssues=Ef,i.setLoggedIn=Vh,i.setOrganization=$w,i.setOrganizationAccess=bw,i.setOrganizationAccesses=Rw,i.setOrganizations=jw,i.setProject=JT,i.setProjectAccess=dT,i.setProjectAccesses=lT,i.setProjectAttachment=IT,i.setProjectAttachments=OT,i.setProjectFile=VT,i.setProjectFiles=BT,i.setProjects=YT,i.setRehydrated=Qb,i.setTeam=gI,i.setTeamMembership=oI,i.setTeamMemberships=hI,i.setTeams=PI,i.setTokens=ab,i.setUploadUrl=mb,i.setUser=yw,i.setUsers=mw,i.setWorkflow=CI,i.setWorkflowIssueLink=eO,i.setWorkflowIssueLinks=tO,i.setWorkflowStep=N_,i.setWorkflowStepAssignee=fO,i.setWorkflowStepAssignees=SO,i.setWorkflowStepComment=kO,i.setWorkflowStepComments=EO,i.setWorkflowStepEvent=NO,i.setWorkflowStepEvents=GO,i.setWorkflowStepFieldValues=NF,i.setWorkflowStepFieldValuesAttachment=kF,i.setWorkflowStepFieldValuesAttachments=EF,i.setWorkflowStepFieldValuesMany=GF,i.setWorkflowStepFieldValuesReview=f_,i.setWorkflowStepFieldValuesReviewRequest=i_,i.setWorkflowStepFieldValuesReviewRequests=n_,i.setWorkflowStepFieldValuesReviews=S_,i.setWorkflowStepFields=SF,i.setWorkflowStepFieldsAttachment=iF,i.setWorkflowStepFieldsAttachments=nF,i.setWorkflowStepFieldsMany=AF,i.setWorkflowStepReviewer=k_,i.setWorkflowStepReviewers=E_,i.setWorkflowSteps=G_,i.setWorkflowType=ng,i.setWorkflowTypes=ag,i.setWorkflows=UI,i.shallowEqual=tP,i.slugify=fP,i.spacesToDashesLower=yP,i.teamMembershipReducer=SI,i.teamMembershipSlice=sa,i.teamReducer=BI,i.teamSlice=ia,i.toFileNameSafeString=mP,i.toUuidArray=v,i.toUuidIdRecord=pP,i.truncate=SP,i.updateAsset=El,i.updateAssetAttachment=Ac,i.updateAssetAttachments=wc,i.updateAssetProcedure=Nr,i.updateAssetProcedureStep=Tl,i.updateAssetProcedureStepFieldValues=cl,i.updateAssetProcedureStepFieldValuesAttachment=Hd,i.updateAssetProcedureStepFieldValuesAttachments=Kd,i.updateAssetProcedureStepFieldValuesMany=rl,i.updateAssetProcedureStepFields=Bd,i.updateAssetProcedureStepFieldsAttachment=Td,i.updateAssetProcedureStepFieldsAttachments=Id,i.updateAssetProcedureStepFieldsMany=Wd,i.updateAssetProcedureSteps=Il,i.updateAssetProcedureType=nd,i.updateAssetProcedureTypeAttachment=vc,i.updateAssetProcedureTypeAttachments=Vc,i.updateAssetProcedureTypeFieldValues=Vr,i.updateAssetProcedureTypeFieldValuesAttachment=wr,i.updateAssetProcedureTypeFieldValuesAttachments=Tr,i.updateAssetProcedureTypeFieldValuesMany=Br,i.updateAssetProcedureTypeFields=cr,i.updateAssetProcedureTypeFieldsAttachment=Hc,i.updateAssetProcedureTypeFieldsAttachments=Kc,i.updateAssetProcedureTypeFieldsMany=rr,i.updateAssetProcedureTypes=ad,i.updateAssetProcedures=Gr,i.updateAssetStage=du,i.updateAssetStageCompletion=Kl,i.updateAssetStageCompletions=Yl,i.updateAssetStages=lu,i.updateAssetType=uh,i.updateAssetTypeAttachment=Tu,i.updateAssetTypeAttachments=Iu,i.updateAssetTypeFieldValues=Oo,i.updateAssetTypeFieldValuesAttachment=ro,i.updateAssetTypeFieldValuesAttachments=lo,i.updateAssetTypeFieldValuesMany=Fo,i.updateAssetTypeFields=Yu,i.updateAssetTypeFieldsAttachment=Bu,i.updateAssetTypeFieldsAttachments=Wu,i.updateAssetTypeFieldsMany=Ju,i.updateAssetTypeIdentifier=zo,i.updateAssetTypeIdentifierValue=Zo,i.updateAssetTypeIdentifierValues=Qo,i.updateAssetTypeIdentifiers=qo,i.updateAssetTypeStatus=_h,i.updateAssetTypeStatuses=gh,i.updateAssetTypes=oh,i.updateAssets=vl,i.updateConversation=oc,i.updateConversations=_P,i.updateDocument=tp,i.updateDocumentAttachment=Ch,i.updateDocumentAttachments=Uh,i.updateDocuments=sp,i.updateEmailDomain=yp,i.updateEmailDomains=fp,i.updateForm=km,i.updateFormIdentifier=vp,i.updateFormIdentifierValue=Hp,i.updateFormIdentifierValues=Kp,i.updateFormIdentifiers=Vp,i.updateFormRevision=Am,i.updateFormRevisionAttachment=cm,i.updateFormRevisionAttachments=rm,i.updateFormRevisions=wm,i.updateFormSubmission=ty,i.updateFormSubmissionAttachment=Lm,i.updateFormSubmissionAttachments=Nm,i.updateFormSubmissions=sy,i.updateForms=Em,i.updateGeoImage=yy,i.updateGeoImages=fy,i.updateIssue=vf,i.updateIssueAssociation=by,i.updateIssueAssociations=Ry,i.updateIssueAttachment=Gy,i.updateIssueAttachments=Hy,i.updateIssueComment=Tf,i.updateIssueCommentAttachment=cf,i.updateIssueCommentAttachments=rf,i.updateIssueComments=If,i.updateIssueType=WA,i.updateIssueTypeAttachment=Hf,i.updateIssueTypeAttachments=Kf,i.updateIssueTypeFieldValues=TS,i.updateIssueTypeFieldValuesAttachment=KS,i.updateIssueTypeFieldValuesAttachments=YS,i.updateIssueTypeFieldValuesMany=IS,i.updateIssueTypeFields=BS,i.updateIssueTypeFieldsAttachment=cS,i.updateIssueTypeFieldsAttachments=rS,i.updateIssueTypeFieldsMany=WS,i.updateIssueTypeIdentifier=rA,i.updateIssueTypeIdentifierValue=IA,i.updateIssueTypeIdentifierValues=OA,i.updateIssueTypeIdentifiers=dA,i.updateIssueTypeStatus=JA,i.updateIssueTypeStatuses=ZA,i.updateIssueTypes=zA,i.updateIssueUpdate=cw,i.updateIssueUpdates=rw,i.updateIssues=Vf,i.updateOrganization=Nw,i.updateOrganizationAccess=Mw,i.updateOrganizationAccesses=kw,i.updateOrganizations=Lw,i.updateProject=xT,i.updateProjectAccess=uT,i.updateProjectAccesses=oT,i.updateProjectAttachment=FT,i.updateProjectAttachments=_T,i.updateProjectFile=qT,i.updateProjectFiles=DT,i.updateProjects=XT,i.updateTeam=bI,i.updateTeamMembership=pI,i.updateTeamMemberships=mI,i.updateTeams=RI,i.updateUser=Aw,i.updateUsers=Sw,i.updateWorkflow=LI,i.updateWorkflowIssueLink=sO,i.updateWorkflowIssueLinks=iO,i.updateWorkflowStep=H_,i.updateWorkflowStepAssignee=AO,i.updateWorkflowStepAssignees=wO,i.updateWorkflowStepComment=vO,i.updateWorkflowStepComments=VO,i.updateWorkflowStepEvent=HO,i.updateWorkflowStepEvents=KO,i.updateWorkflowStepFieldValues=HF,i.updateWorkflowStepFieldValuesAttachment=vF,i.updateWorkflowStepFieldValuesAttachments=VF,i.updateWorkflowStepFieldValuesMany=KF,i.updateWorkflowStepFieldValuesReview=A_,i.updateWorkflowStepFieldValuesReviewRequest=a_,i.updateWorkflowStepFieldValuesReviewRequests=c_,i.updateWorkflowStepFieldValuesReviews=w_,i.updateWorkflowStepFields=wF,i.updateWorkflowStepFieldsAttachment=aF,i.updateWorkflowStepFieldsAttachments=cF,i.updateWorkflowStepFieldsMany=TF,i.updateWorkflowStepReviewer=v_,i.updateWorkflowStepReviewers=V_,i.updateWorkflowSteps=K_,i.updateWorkflowType=cg,i.updateWorkflowTypes=rg,i.updateWorkflows=NI,i.useSelectorBuilder=eP,i.userReducer=Tw,i.userSlice=Un,i.uuidObj=O,i.uuidObjSortFn=Os,i.uuidSortFn=Ht,i.versioningReducer=zI,i.versioningSlice=WI,i.workflowIssueLinkReducer=oO,i.workflowIssueLinkSlice=ca,i.workflowReducer=ZI,i.workflowSlice=aa,i.workflowStepAssigneeReducer=gO,i.workflowStepAssigneeSlice=ra,i.workflowStepCommentReducer=jO,i.workflowStepCommentSlice=da,i.workflowStepEventReducer=xO,i.workflowStepEventSlice=la,i.workflowStepFieldValuesAttachmentReducer=jF,i.workflowStepFieldValuesAttachmentSlice=ya,i.workflowStepFieldValuesReducer=xF,i.workflowStepFieldValuesReviewReducer=g_,i.workflowStepFieldValuesReviewRequestReducer=h_,i.workflowStepFieldValuesReviewRequestSlice=Ta,i.workflowStepFieldValuesReviewSlice=Fa,i.workflowStepFieldValuesSlice=wa,i.workflowStepFieldsAttachmentReducer=hF,i.workflowStepFieldsAttachmentSlice=ua,i.workflowStepFieldsReducer=PF,i.workflowStepFieldsSlice=ma,i.workflowStepReducer=x_,i.workflowStepReviewerReducer=j_,i.workflowStepReviewerSlice=Pa,i.workflowStepSlice=ba,i.workflowTypeReducer=pg,i.workflowTypeSlice=Ma,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|