@overmap-ai/core 1.0.78-bulk-project-access.1 → 1.0.78-bulk-project-access.2

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.
@@ -8203,7 +8203,7 @@ class C_ extends v {
8203
8203
  description: "Add project accesses",
8204
8204
  method: d.POST,
8205
8205
  url: "/project-accesses/bulk/",
8206
- payload: n.map((c) => k(c)),
8206
+ payload: { project_accesses: n.map((c) => k(c)) },
8207
8207
  blockers: n.flatMap((c) => [
8208
8208
  c.project,
8209
8209
  c.organization_access
@@ -8515,7 +8515,7 @@ class L_ extends v {
8515
8515
  description: "Create team memberships",
8516
8516
  method: d.POST,
8517
8517
  url: "/team-memberships/bulk/",
8518
- payload: n.map((c) => k(c)),
8518
+ payload: { team_memberships: n.map((c) => k(c)) },
8519
8519
  blockers: n.map((c) => c.team),
8520
8520
  blocks: n.map((c) => c.uuid)
8521
8521
  });
@@ -11,5 +11,5 @@ Action:`,e);const p=Ye();if(!p)throw new Error("Outbox coordinator not set");p.r
11
11
  REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
12
12
  (with an uuid attached) being returned. Alternatively, you may be running with
13
13
  import.meta.env.PROD, which will result in some file requests being treated as
14
- external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}const p=o.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=n??h+"."+p;if(o=oc(o,A),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),Qt[c]=new Promise(f=>{f(o)})}return o}}class Gb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Ji(c));const r=this.enqueueRequest({description:"Create form identifier",method:l.POST,url:"/form-identifiers/",payload:v(c),blockers:[c.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ht(m))}).catch(()=>{this.dispatch(Xi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Qi(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ht(n));const c=this.enqueueRequest({description:"Update form identifier",method:l.PATCH,url:`/form-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(ht(r))}).catch(()=>{this.dispatch(ht(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Qi(e)(a);if(!n)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(Xi(e));try{return await this.enqueueRequest({description:"Delete form identifier",method:l.DELETE,url:`/form-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Ji(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({description:"Get form identifiers",method:l.GET,url:"/form-identifiers/",queryParams:{form__organization:e},blockers:[],blocks:[]},i);return this.dispatch(so(a)),a}}class Lb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ea(c));const r=this.enqueueRequest({description:"Create form identifier value",method:l.POST,url:"/form-identifier-values/",payload:v(c),blockers:[e.form_submission,e.form_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(ta(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=ia(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(mt(n));const c=this.enqueueRequest({description:"Update form identifier value",method:l.PATCH,url:`/form-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=ia(e)(a);if(!n)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(ta(e));try{return await this.enqueueRequest({description:"Delete form identifier value",method:l.DELETE,url:`/form-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(ea(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get form identifier values",method:l.GET,url:"/form-identifier-values/",queryParams:{limit:E,paginate:!0,form_submission__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ro(n)),n}}class Nb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{revisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const T=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});c.push(T);const F={uuid:T.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,form_revision:h};r.push(F)}this.dispatch(mo(c));const u=this.enqueueRequest({description:"Attach files to form revision",method:l.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.form_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(po(o.attachments))}).catch(()=>{this.dispatch(Ao(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:l.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(ho(a)),a}}class Hb extends j{add(e){var u;const{store:i}=this.client,n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=b({...e,created_by:n,submitted_at:new Date().toISOString()});this.dispatch(ca(c));const r=this.enqueueRequest({description:"Create form revision",method:l.POST,url:"/form-revisions/",payload:v(c),blockers:[e.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(go(m))}).catch(()=>{this.dispatch(ra(c.uuid))}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:l.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Io(a)),a}}class Wb extends j{add(e,i){var o;const{store:a}=this.client,n=new Date().toISOString(),c=(o=a.getState().userReducer.currentUser)==null?void 0:o.id,r=b({...e,submitted_at:n,created_by:c}),u=b({...i,form:r.uuid,submitted_at:n,created_by:c});this.dispatch(la(r)),this.dispatch(ca(u));const m=this.enqueueRequest({description:"Create form",method:l.POST,url:"/forms/",payload:{...v(r),initial_revision:{uuid:u.uuid,submitted_at:u.submitted_at,title:u.title,description:u.description,fields:u.fields}},blockers:[],blocks:[r.uuid,u.uuid]});return m.catch(h=>{throw this.dispatch(ha(r.uuid)),this.dispatch(ra(u.uuid)),h}),[r,u,m]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Mo(e)(a);if(!n)throw new Error("Expected form to exist");const c=$o(e)(a);c.length>0&&this.dispatch(Nt(c.map(({uuid:u})=>u)));const r=Fo(e)(a);r.length>0&&this.dispatch(bo(r.map(({uuid:u})=>u))),this.dispatch(ha(e));try{return await this.enqueueRequest({description:"Delete form",method:l.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(la(n)),r.length>0&&this.dispatch(To(r)),c.length>0&&this.dispatch(Lt(c)),u}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:l.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(_o(a)),a}}class Yb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{submissionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const T=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});c.push(T);const F={uuid:T.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,form_submission:h};r.push(F)}this.dispatch(Bt(c));const u=this.enqueueRequest({description:"Attach files to form submission",method:l.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.form_submission),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(jo(o.attachments))}).catch(o=>{throw this.dispatch($t(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=zo(e)(a);this.dispatch($t(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:l.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Bt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:l.GET,url:"/form-submission-attachments/",queryParams:{limit:E,paginate:!0,form_submission__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form submission attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Vo(n)),n}}class Kb extends j{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add form submission",method:l.POST,url:"/form-submissions/",payload:v(n),blockers:[e.form_revision,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return this.dispatch(fa(n)),c.then(u=>(this.dispatch(Gt(u)),u)).catch(()=>{this.dispatch(ya(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=Ta(e.uuid)(a);if(!n)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(Bo(c));const r=this.enqueueRequest({description:"Delete user form submissions",method:l.PATCH,url:`/form-submissions/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return r.then(u=>{this.dispatch(Gt(u))}).catch(()=>{this.dispatch(Gt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ta(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Uo(e)(a);this.dispatch(ya(e)),this.dispatch($t(c.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:l.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(fa(n)),this.dispatch(Bt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:l.GET,url:"/form-submissions/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch form submissions",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ko(n)),n}}class Zb extends j{async add(e){var p;const{store:i}=this.client,{file:a,...n}=e,c=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.id,u=n.project,m=await this.getFilePayload(a),o=b({...n,file_name:a.name,file_sha1:m.sha1,file:URL.createObjectURL(a),submitted_at:c,created_by:r});this.dispatch(Ko(o));const h=this.enqueueRequest({description:"Add geo image",method:l.POST,url:"/geo-images/",payload:{uuid:o.uuid,submitted_at:c,title:o.title,description:o.description,geo_marker:o.geo_marker,canvas_marker:o.canvas_marker,sha1:o.file_sha1,project:o.project,file_name:o.file_name,direction:o.direction,original_date:o.original_date,file:m},blocks:[u],blockers:[u]});return h.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(pt(A.geo_image))}).catch(()=>{this.dispatch(ba(o.uuid))}),[o,h.then(A=>A.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,n=new Date().toISOString(),c=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,r=[],u=[],m=[],o={};for(const A of e){const{file:f,...T}=A,F=await this.getFilePayload(f);F.sha1 in o||(o[F.sha1]=F);const _=b({...T,file_name:f.name,file_sha1:F.sha1,file:URL.createObjectURL(f),submitted_at:n,created_by:c,project:i});r.push(_),u.push(_.uuid),m.push({uuid:_.uuid,sha1:_.file_sha1,file_name:_.file_name,title:_.title,description:_.description,geo_marker:_.geo_marker,canvas_marker:_.canvas_marker,direction:_.direction,original_date:_.original_date})}this.dispatch(Zo(r));const h=this.enqueueRequest({description:"Bulk add geo images",method:l.POST,url:"/geo-images/bulk/",payload:{submitted_at:n,project:i,geo_images:m,files:Object.values(o)},blocks:[i],blockers:u});return h.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(Yo(A.geo_images))}).catch(()=>{this.dispatch(Xo(u))}),[r,h.then(A=>A.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),n=Fa(e.uuid)(a);if(!n)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const c={...n,...e};this.dispatch(Jo(c));const r=this.enqueueRequest({description:"Update geo image",method:l.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(u=>{this.dispatch(pt(u))}).catch(()=>{this.dispatch(pt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Fa(e)(a);if(!n)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(ba(e));const c=this.enqueueRequest({description:"Delete geo image",method:l.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return c.catch(()=>{this.dispatch(pt(n))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:l.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(Wo(a)),a}}class Jb extends R{add(e){var u;const{store:i}=this.client,a=new Date().toISOString(),n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=b({...e,submitted_at:a,created_by:n});this.dispatch(Oa(c));const r=this.enqueueRequest({description:"Add issue association",method:l.POST,url:"/issue-associations/",payload:v(c),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[c.uuid]});return r.then(m=>{this.dispatch(il(m))}).catch(()=>{this.dispatch(Ra(c.uuid))}),[c,r]}async delete(e){const{store:i}=this.client,a=al(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Ra(e));const n=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(Oa(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:l.GET,url:"/issue-associations/",queryParams:{limit:E,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch issue associations",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(sl(n)),n}}class Xb extends He{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",Ma);S(this,"addAttachments",Ea);S(this,"updateAttachments",ll);S(this,"removeAttachments",Va);S(this,"removeAttachment",hl);S(this,"setAttachment",ol);S(this,"selectAttachment",fl)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Ma(c)),c}}class Qb extends He{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",qa);S(this,"addAttachments",Il);S(this,"updateAttachments",gl);S(this,"removeAttachments",Fl);S(this,"removeAttachment",bl);S(this,"setAttachment",Tl);S(this,"selectAttachment",_l)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_comment:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_comment:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueCommentUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(qa(c)),c}}class xb extends R{add(e){var c;const{store:i}=this.client,a=b({...e,author:(c=i.getState().userReducer.currentUser)==null?void 0:c.id,submitted_at:new Date().toISOString()});this.dispatch(Ua(a));const n=this.enqueueRequest({description:"Add issue comment",method:l.POST,url:"/issue-comments/",payload:v(a),blockers:[e.issue],blocks:[a.uuid]});return n.catch(()=>{this.dispatch(Ca(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=ka(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const n={...a,...e};this.dispatch(Da(n));const c=this.enqueueRequest({description:"Edit issue comment",method:l.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.catch(()=>{this.dispatch(Da(a))}),[n,c]}remove(e){const{store:i}=this.client,a=ka(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(Ca(e));const n=this.enqueueRequest({description:"Delete comment",method:l.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(Ua(a))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:l.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(wl(a)),a}}class eF extends R{add(e){var m;const{store:i}=this.client,a=i.getState(),n=new Date().toISOString(),c=(m=a.userReducer.currentUser)==null?void 0:m.id,r=b({...e,submitted_at:n,created_by:c});this.dispatch($a(r));const u=this.enqueueRequest({description:"Create issue",method:l.POST,url:"/issues/",payload:v(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return u.then(o=>{this.dispatch(Ht(o))}).catch(o=>{throw this.dispatch(Ga(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=Ha(e.uuid)(i);if(!a)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const n={...a,...e};this.dispatch(Ht(n));const c={};for(const o of[V.TITLE,V.DESCRIPTION,V.STATUS,V.CATEGORY,V.PRIORITY,V.ASSIGNED_TO,V.DUE_DATE])if(o in e&&e[o]!==a[o])switch(o){case V.PRIORITY:case V.STATUS:{const h=e[o];c[o]=h!==void 0?Number(h):null;break}case V.DUE_DATE:case V.DESCRIPTION:case V.TITLE:c[o]=e[o]??null;break;case V.CATEGORY:{let h=null;const p=e[o];if(p&&(h=i.categoryReducer.instances[p]??null,!h))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);c[o]=h?{name:h.name,color:h.color,uuid:h.uuid}:null;break}case V.ASSIGNED_TO:{let h=null;const p=e[o];if(p&&(h=i.userReducer.instances[p]??null,!h))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);c[o]=h?{full_name:h.username,id:h.id}:null;break}}const r=b({created_by:(m=i.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:a.uuid,changes:c});this.dispatch(Dh(r));const u=this.enqueueRequest({description:"Edit issue",method:l.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.catch(()=>{this.dispatch(Ht(a)),this.dispatch(kh(r.uuid))}),[n,u]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Ha(e)(a);if(!n)throw new Error(`No issue with uuid ${e} found in the store`);const c=Al(e)(a),r=Lh(e)(a),u=Go(e)(a),m={};for(const h of nl(e)(a))m[h.uuid]=h;for(const h of cl(e)(a))m[h.uuid]=h;const o=Object.values(m);this.dispatch(Ga(e)),c.length>0&&this.dispatch(Va(c.map(({uuid:h})=>h))),r.length>0&&this.dispatch(Bh(r.map(({uuid:h})=>h))),u.length>0&&this.dispatch(Nt(u.map(({uuid:h})=>h))),o.length>0&&this.dispatch(va(o.map(({uuid:h})=>h)));try{return await this.enqueueRequest({description:"Delete issue",method:l.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch($a(n)),this.dispatch(Ea(c)),this.dispatch(Ch(r)),this.dispatch(Lt(u)),this.dispatch(_a(o)),h}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issues",method:l.GET,url:"/issues/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issues",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(jl(n)),n}}class tF extends He{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",Ya);S(this,"addAttachments",kl);S(this,"updateAttachments",$l);S(this,"removeAttachments",Ll);S(this,"removeAttachment",Gl);S(this,"setAttachment",Bl);S(this,"selectAttachment",Wl)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get issue type attachments",method:l.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Ya(n)),n}}class sF extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const T=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(T);const F={uuid:T.uuid,file_name:A.name,file_extension:f.extension,field_identifier:p,file_sha1:f.sha1,fields_revision:h};r.push(F)}this.dispatch(Jl(c));const u=this.enqueueRequest({description:"Add issue type fields attachments",method:l.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Xl(o.attachments))}).catch(()=>{this.dispatch(Ql(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:l.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Zl(a)),a}}class iF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(dh(c));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:l.POST,url:"/issue-type-fields/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(uh(m))}).catch(m=>{throw this.dispatch(oh(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:l.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(rh(a)),a}}class aF extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const T=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});c.push(T);const F={uuid:T.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,field_values:h};r.push(F)}this.dispatch(Yt(c));const u=this.enqueueRequest({description:"Add issue type field values attachments",method:l.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.field_values),blocks:c.map(o=>o.uuid)});return u.then(({presigned_urls:o,attachments:h})=>{this.processPresignedUrls(o),this.dispatch(Ah(h))}).catch(o=>{throw this.dispatch(Kt(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=yh(e)(a);this.dispatch(Kt(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:l.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Yt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ph(n)),n}}class nF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add issue type field values",method:l.POST,url:"/issue-type-field-values/",payload:v(n),blockers:[e.issue,e.fields_revision],blocks:[n.uuid]});return this.dispatch(Ja(n)),c.then(u=>(this.dispatch(ft(u)),u)).catch(()=>{this.dispatch(Xa(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=xa(e.uuid)(a);if(!n)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(ft(c));const r=this.enqueueRequest({description:"Update issue type field values",method:l.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.issue],blocks:[c.uuid]});return r.then(u=>{this.dispatch(ft(u))}).catch(()=>{this.dispatch(ft(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=xa(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Sh(e)(a);this.dispatch(Xa(e)),this.dispatch(Kt(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:l.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Ja(n)),this.dispatch(Yt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:l.GET,url:"/issue-type-field-values/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ih(n)),n}}class cF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(nn(c));const r=this.enqueueRequest({description:"Create issue type identifier",method:l.POST,url:"/issue-type-identifiers/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(yt(m))}).catch(()=>{this.dispatch(cn(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=rn(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(yt(n));const c=this.enqueueRequest({description:"Update issue type identifier",method:l.PATCH,url:`/issue-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(yt(r))}).catch(()=>{this.dispatch(yt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=rn(e)(a);if(!n)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(cn(e));try{return await this.enqueueRequest({description:"Delete issue type identifier",method:l.DELETE,url:`/issue-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(nn(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({description:"Get issue type identifiers",method:l.GET,url:"/issue-type-identifiers/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(gh(a)),a}}class rF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(un(c));const r=this.enqueueRequest({description:"Create issue type identifier value",method:l.POST,url:"/issue-type-identifier-values/",payload:v(c),blockers:[e.issue,e.issue_type_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(St(m))}).catch(()=>{this.dispatch(on(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=hn(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(St(n));const c=this.enqueueRequest({description:"Update issue type identifier value",method:l.PATCH,url:`/issue-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(St(r))}).catch(()=>{this.dispatch(St(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=hn(e)(a);if(!n)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(on(e));try{return await this.enqueueRequest({description:"Delete issue type identifier value",method:l.DELETE,url:`/issue-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(un(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:"/issue-type-identifier-values/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(_h(n)),n}}class dF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.id});this.dispatch(Eh(n));const c=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return c.then(u=>{this.dispatch(It(u))}).catch(()=>{this.dispatch(pn(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=fn(e.uuid)(a);if(!n)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const c={...n,...e};this.dispatch(Vh(c));const r=this.enqueueRequest({method:l.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(It(u))}).catch(()=>{this.dispatch(It(n))}),[c,r]}delete(e){const{store:i}=this.client,a=i.getState(),n=fn(e)(a);if(!n)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const c=Ul(e)(a);this.dispatch(pn(e)),this.dispatch(zl(c.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(It(n)),this.dispatch(ql(c))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:l.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Mh(a)),a}}class uF extends R{async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue updates",method:l.GET,url:"/issue-updates/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue updates",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Uh(n)),n}}const oF=1800;function lF(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 hF extends rb{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:l.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let n;try{n=await a}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!n.access)throw new Error("Missing access token");return{accessToken:n.access,refreshToken:n.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Iu(!1)),this.clearTokens(),this.dispatch(g()),this.dispatch(g())}async renewTokens(){const i=this.getRefreshToken();if(!i)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const a=await this._getRenewedTokens(i);if(!a)return;console.log("Got renewed tokens"),this.setTokens(a)}catch(a){throw console.error("Could not renew tokens; clearing auth",a),this.clearAuth(),a}}tokenIsExpiringSoon(){const i=this.getAccessToken();if(!i)return!1;const a=Date.now()/1e3;let n;try{n=Up(i).exp??a}catch{n=a}return n-a<oF}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(i){return i instanceof D&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??xe).toString()))}}}async handleUnauthorized(i,a){const n=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw n.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new D({message:"You have been signed out due to inactivity.",response:a,discard:!0});if(n.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new D({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Je.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:l.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(n=>{this.setTokens(lF(n))})}}class mF extends R{update(e){const{store:i}=this.client,a=bn(e.uuid)(i.getState()),n={...a,...e};this.dispatch(Jt(n));const c=this.enqueueRequest({description:"Edit organization access",method:l.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(Jt(r))}).catch(r=>{throw this.dispatch(Jt(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=bn(e)(a),c=Xh(n.user)(a);this.dispatch(tm(n.uuid)),this.dispatch(Kh(n.user));try{await this.enqueueRequest({description:"Remove organization access",method:l.DELETE,url:`/organization-accesses/${n.uuid}/`,blockers:[n.uuid],blocks:[]})}catch(r){throw this.dispatch(em(n)),this.dispatch(Yh(c)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:l.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(xh(a)),a}}class pF extends R{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:l.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(cm(i)),i}async update(e){const i=await this.enqueueRequest({description:"Edit organization",method:l.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(rm(i)),i}async invite(e,i){return this.enqueueRequest({description:"Invite user to organization",method:l.POST,url:`/organizations/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const i=await this.enqueueRequest({immediate:!0,description:"Fetch organizations",method:l.GET,url:"/organizations/",blockers:[],blocks:[]},e);return this.dispatch(nm(i)),i}}class AF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(_n(a));const n=this.enqueueRequest({description:"Add project access",method:l.POST,url:"/project-accesses/",payload:v(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Tt(r))}).catch(r=>{throw this.dispatch(vn(a.uuid)),r}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>b({...u,created_by:a}));this.dispatch(Rn(n));const c=this.enqueueRequest({description:"Add project accesses",method:l.POST,url:"/project-accesses/bulk/",payload:n.map(u=>v(u)),blockers:n.flatMap(u=>[u.project,u.organization_access]),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(Sm(u))}).catch(u=>{throw this.dispatch(wn(n.map(m=>m.uuid))),u}),[n,c]}update(e){const{store:i}=this.client,a=En(e.uuid)(i.getState()),n={...a,...e};this.dispatch(Tt(n));const c=this.enqueueRequest({description:"Edit project access",method:l.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return c.then(r=>{this.dispatch(Tt(r))}).catch(r=>{throw this.dispatch(Tt(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=En(e)(i.getState());this.dispatch(vn(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(_n(a)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:l.GET,url:"/project-accesses/",queryParams:{project__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ym(a)),a}}class fF extends He{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"addAttachments",Fm);S(this,"updateAttachments",_m);S(this,"removeAttachments",jn);S(this,"removeAttachment",Rm);S(this,"setAttachment",Pm);S(this,"selectAttachment",Mm)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,project:i.modelUuid})}buildAttachmentPayload(i){return{...i,project:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.projectUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get project attachments",method:l.GET,url:`${this.url}/`,queryParams:{project__organization:i},blockers:[],blocks:[]},a);return this.dispatch(bm(n)),n}}class yF extends R{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const i={...e};delete i.file;const a=this.enqueueRequest({method:l.PATCH,url:`/project-files/${e.uuid}/`,payload:i,blockers:[e.uuid],blocks:[e.uuid]});return a.then(n=>{this.dispatch(zn(n))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const n=i.projectFileReducer.instances[a];if(!n)throw new Error("No active project file");if(!n.bounds&&!n.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let c;if(typeof n.file=="string"&&!n.file.startsWith("blob:")){const m={...n};delete m.file,c={method:l.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else c=new Promise((m,o)=>{this.client.files.uploadFileToS3(n.file_sha1).then(([h])=>{m({method:l.POST,url:`/project-files/${n.project}/`,payload:{...n,...h},blockers:[a],blocks:[a]})}).catch(o)});const u=Promise.resolve(c).then(m=>this.enqueueRequest(m));return u.then(m=>{this.dispatch(zn(m))}),this.dispatch(Bm),this.dispatch(km(null)),this.dispatch(Cm(!1)),[n,u]}delete(e){return this.dispatch(Um(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get project files",method:l.GET,url:"/project-files/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get project files",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(qm(n)),n}}class SF extends R{async add(e){const i=await this.enqueueRequest({description:"Create project",method:l.POST,url:"/projects/",payload:v(e),blockers:[],blocks:[]});return this.dispatch(Dn(i)),i}async update(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return this.dispatch(Wm(e)),await this.enqueueRequest({description:"Update project",method:l.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:i}=this.client,a=i.getState(),n=Zm(e)(a);if(!n)throw new Error("Expected project to exist");const c=Gm(a).filter(m=>m.project===e);this.dispatch(Dm(c.map(({uuid:m})=>m)));const r=Em(n.uuid)(a);this.dispatch(jn(r.map(({uuid:m})=>m)));const u=Tm(e)(a);this.dispatch(wn(u.map(({uuid:m})=>m))),this.dispatch(Cn(n.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(Cn(n.uuid))}catch(m){throw this.dispatch(Dn(n)),this.dispatch(Rn(Object.values(u))),this.dispatch(zm(c)),this.dispatch(Om(r)),m}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch projects",method:l.GET,url:"/projects/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Hm(a)),a}}class IF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(xm(a));const n=this.enqueueRequest({description:"Create team membership",method:l.POST,url:"/team-memberships/",payload:v(a),blockers:[e.team],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Gn(r))}).catch(()=>{this.dispatch(Ln(a.uuid))}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>b({...u,created_by:a}));this.dispatch(ep(n));const c=this.enqueueRequest({description:"Create team memberships",method:l.POST,url:"/team-memberships/bulk/",payload:n.map(u=>v(u)),blockers:n.map(u=>u.team),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(tp(u))}).catch(()=>{this.dispatch(sp(n.map(u=>u.uuid)))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=np(e)(a);if(!n)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(Ln(e));try{return await this.enqueueRequest({description:"Delete team membership",method:l.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(Gn(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:l.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Qm(a)),a}}class TF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,submitted_at:new Date().toISOString(),created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(dp(a));const n=this.enqueueRequest({description:"Create team",method:l.POST,url:"/teams/",payload:v(a),blockers:[],blocks:[a.uuid]});return n.then(r=>{this.dispatch(gt(r))}).catch(()=>{this.dispatch(Wn(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=Kn(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(up(n));const c=this.enqueueRequest({description:"Update team",method:l.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(gt(r))}).catch(()=>{this.dispatch(gt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Kn(e)(a);if(!n)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(Wn(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(gt(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:l.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(rp(a)),a}}class gF extends R{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:l.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(Wh(a)),a}}class bF{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,n){return this._enqueueRequest(e,i,a,n).then(c=>{if(c instanceof D)throw c;return c})}_enqueueRequest(e,i,a,n){const c=new dc,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const u={...r,uuid:e.uuid??Je.v4()},m={payload:u,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:u,BASE_URL:i,serviceName:a}}}};Xn(m,this,n).then(o=>{c.resolve(o.body)}).catch(o=>{Qn(o,m),o instanceof Error?c.reject(o):c.reject(new Error((o??xe).toString()))})}else{const u=this.store.dispatch(hm(r)),m=h=>{if(h)c.resolve(h.body);else{const p=new D({message:"Could not get a response from the server.",response:h,discard:!0});c.reject(p)}},o=h=>{h instanceof D?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
14
+ external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}const p=o.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=n??h+"."+p;if(o=oc(o,A),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),Qt[c]=new Promise(f=>{f(o)})}return o}}class Gb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Ji(c));const r=this.enqueueRequest({description:"Create form identifier",method:l.POST,url:"/form-identifiers/",payload:v(c),blockers:[c.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ht(m))}).catch(()=>{this.dispatch(Xi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Qi(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ht(n));const c=this.enqueueRequest({description:"Update form identifier",method:l.PATCH,url:`/form-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(ht(r))}).catch(()=>{this.dispatch(ht(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Qi(e)(a);if(!n)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(Xi(e));try{return await this.enqueueRequest({description:"Delete form identifier",method:l.DELETE,url:`/form-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Ji(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({description:"Get form identifiers",method:l.GET,url:"/form-identifiers/",queryParams:{form__organization:e},blockers:[],blocks:[]},i);return this.dispatch(so(a)),a}}class Lb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ea(c));const r=this.enqueueRequest({description:"Create form identifier value",method:l.POST,url:"/form-identifier-values/",payload:v(c),blockers:[e.form_submission,e.form_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(ta(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=ia(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(mt(n));const c=this.enqueueRequest({description:"Update form identifier value",method:l.PATCH,url:`/form-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=ia(e)(a);if(!n)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(ta(e));try{return await this.enqueueRequest({description:"Delete form identifier value",method:l.DELETE,url:`/form-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(ea(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get form identifier values",method:l.GET,url:"/form-identifier-values/",queryParams:{limit:E,paginate:!0,form_submission__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ro(n)),n}}class Nb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{revisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const T=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});c.push(T);const F={uuid:T.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,form_revision:h};r.push(F)}this.dispatch(mo(c));const u=this.enqueueRequest({description:"Attach files to form revision",method:l.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.form_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(po(o.attachments))}).catch(()=>{this.dispatch(Ao(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:l.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(ho(a)),a}}class Hb extends j{add(e){var u;const{store:i}=this.client,n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=b({...e,created_by:n,submitted_at:new Date().toISOString()});this.dispatch(ca(c));const r=this.enqueueRequest({description:"Create form revision",method:l.POST,url:"/form-revisions/",payload:v(c),blockers:[e.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(go(m))}).catch(()=>{this.dispatch(ra(c.uuid))}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:l.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Io(a)),a}}class Wb extends j{add(e,i){var o;const{store:a}=this.client,n=new Date().toISOString(),c=(o=a.getState().userReducer.currentUser)==null?void 0:o.id,r=b({...e,submitted_at:n,created_by:c}),u=b({...i,form:r.uuid,submitted_at:n,created_by:c});this.dispatch(la(r)),this.dispatch(ca(u));const m=this.enqueueRequest({description:"Create form",method:l.POST,url:"/forms/",payload:{...v(r),initial_revision:{uuid:u.uuid,submitted_at:u.submitted_at,title:u.title,description:u.description,fields:u.fields}},blockers:[],blocks:[r.uuid,u.uuid]});return m.catch(h=>{throw this.dispatch(ha(r.uuid)),this.dispatch(ra(u.uuid)),h}),[r,u,m]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Mo(e)(a);if(!n)throw new Error("Expected form to exist");const c=$o(e)(a);c.length>0&&this.dispatch(Nt(c.map(({uuid:u})=>u)));const r=Fo(e)(a);r.length>0&&this.dispatch(bo(r.map(({uuid:u})=>u))),this.dispatch(ha(e));try{return await this.enqueueRequest({description:"Delete form",method:l.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(la(n)),r.length>0&&this.dispatch(To(r)),c.length>0&&this.dispatch(Lt(c)),u}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:l.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(_o(a)),a}}class Yb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{submissionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const T=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});c.push(T);const F={uuid:T.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,form_submission:h};r.push(F)}this.dispatch(Bt(c));const u=this.enqueueRequest({description:"Attach files to form submission",method:l.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.form_submission),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(jo(o.attachments))}).catch(o=>{throw this.dispatch($t(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=zo(e)(a);this.dispatch($t(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:l.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Bt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:l.GET,url:"/form-submission-attachments/",queryParams:{limit:E,paginate:!0,form_submission__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form submission attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Vo(n)),n}}class Kb extends j{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add form submission",method:l.POST,url:"/form-submissions/",payload:v(n),blockers:[e.form_revision,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return this.dispatch(fa(n)),c.then(u=>(this.dispatch(Gt(u)),u)).catch(()=>{this.dispatch(ya(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=Ta(e.uuid)(a);if(!n)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(Bo(c));const r=this.enqueueRequest({description:"Delete user form submissions",method:l.PATCH,url:`/form-submissions/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return r.then(u=>{this.dispatch(Gt(u))}).catch(()=>{this.dispatch(Gt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ta(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Uo(e)(a);this.dispatch(ya(e)),this.dispatch($t(c.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:l.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(fa(n)),this.dispatch(Bt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:l.GET,url:"/form-submissions/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch form submissions",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ko(n)),n}}class Zb extends j{async add(e){var p;const{store:i}=this.client,{file:a,...n}=e,c=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.id,u=n.project,m=await this.getFilePayload(a),o=b({...n,file_name:a.name,file_sha1:m.sha1,file:URL.createObjectURL(a),submitted_at:c,created_by:r});this.dispatch(Ko(o));const h=this.enqueueRequest({description:"Add geo image",method:l.POST,url:"/geo-images/",payload:{uuid:o.uuid,submitted_at:c,title:o.title,description:o.description,geo_marker:o.geo_marker,canvas_marker:o.canvas_marker,sha1:o.file_sha1,project:o.project,file_name:o.file_name,direction:o.direction,original_date:o.original_date,file:m},blocks:[u],blockers:[u]});return h.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(pt(A.geo_image))}).catch(()=>{this.dispatch(ba(o.uuid))}),[o,h.then(A=>A.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,n=new Date().toISOString(),c=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,r=[],u=[],m=[],o={};for(const A of e){const{file:f,...T}=A,F=await this.getFilePayload(f);F.sha1 in o||(o[F.sha1]=F);const _=b({...T,file_name:f.name,file_sha1:F.sha1,file:URL.createObjectURL(f),submitted_at:n,created_by:c,project:i});r.push(_),u.push(_.uuid),m.push({uuid:_.uuid,sha1:_.file_sha1,file_name:_.file_name,title:_.title,description:_.description,geo_marker:_.geo_marker,canvas_marker:_.canvas_marker,direction:_.direction,original_date:_.original_date})}this.dispatch(Zo(r));const h=this.enqueueRequest({description:"Bulk add geo images",method:l.POST,url:"/geo-images/bulk/",payload:{submitted_at:n,project:i,geo_images:m,files:Object.values(o)},blocks:[i],blockers:u});return h.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(Yo(A.geo_images))}).catch(()=>{this.dispatch(Xo(u))}),[r,h.then(A=>A.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),n=Fa(e.uuid)(a);if(!n)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const c={...n,...e};this.dispatch(Jo(c));const r=this.enqueueRequest({description:"Update geo image",method:l.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(u=>{this.dispatch(pt(u))}).catch(()=>{this.dispatch(pt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Fa(e)(a);if(!n)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(ba(e));const c=this.enqueueRequest({description:"Delete geo image",method:l.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return c.catch(()=>{this.dispatch(pt(n))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:l.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(Wo(a)),a}}class Jb extends R{add(e){var u;const{store:i}=this.client,a=new Date().toISOString(),n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=b({...e,submitted_at:a,created_by:n});this.dispatch(Oa(c));const r=this.enqueueRequest({description:"Add issue association",method:l.POST,url:"/issue-associations/",payload:v(c),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[c.uuid]});return r.then(m=>{this.dispatch(il(m))}).catch(()=>{this.dispatch(Ra(c.uuid))}),[c,r]}async delete(e){const{store:i}=this.client,a=al(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Ra(e));const n=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(Oa(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:l.GET,url:"/issue-associations/",queryParams:{limit:E,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch issue associations",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(sl(n)),n}}class Xb extends He{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",Ma);S(this,"addAttachments",Ea);S(this,"updateAttachments",ll);S(this,"removeAttachments",Va);S(this,"removeAttachment",hl);S(this,"setAttachment",ol);S(this,"selectAttachment",fl)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Ma(c)),c}}class Qb extends He{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",qa);S(this,"addAttachments",Il);S(this,"updateAttachments",gl);S(this,"removeAttachments",Fl);S(this,"removeAttachment",bl);S(this,"setAttachment",Tl);S(this,"selectAttachment",_l)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_comment:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_comment:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueCommentUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(qa(c)),c}}class xb extends R{add(e){var c;const{store:i}=this.client,a=b({...e,author:(c=i.getState().userReducer.currentUser)==null?void 0:c.id,submitted_at:new Date().toISOString()});this.dispatch(Ua(a));const n=this.enqueueRequest({description:"Add issue comment",method:l.POST,url:"/issue-comments/",payload:v(a),blockers:[e.issue],blocks:[a.uuid]});return n.catch(()=>{this.dispatch(Ca(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=ka(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const n={...a,...e};this.dispatch(Da(n));const c=this.enqueueRequest({description:"Edit issue comment",method:l.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.catch(()=>{this.dispatch(Da(a))}),[n,c]}remove(e){const{store:i}=this.client,a=ka(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(Ca(e));const n=this.enqueueRequest({description:"Delete comment",method:l.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(Ua(a))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:l.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(wl(a)),a}}class eF extends R{add(e){var m;const{store:i}=this.client,a=i.getState(),n=new Date().toISOString(),c=(m=a.userReducer.currentUser)==null?void 0:m.id,r=b({...e,submitted_at:n,created_by:c});this.dispatch($a(r));const u=this.enqueueRequest({description:"Create issue",method:l.POST,url:"/issues/",payload:v(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return u.then(o=>{this.dispatch(Ht(o))}).catch(o=>{throw this.dispatch(Ga(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=Ha(e.uuid)(i);if(!a)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const n={...a,...e};this.dispatch(Ht(n));const c={};for(const o of[V.TITLE,V.DESCRIPTION,V.STATUS,V.CATEGORY,V.PRIORITY,V.ASSIGNED_TO,V.DUE_DATE])if(o in e&&e[o]!==a[o])switch(o){case V.PRIORITY:case V.STATUS:{const h=e[o];c[o]=h!==void 0?Number(h):null;break}case V.DUE_DATE:case V.DESCRIPTION:case V.TITLE:c[o]=e[o]??null;break;case V.CATEGORY:{let h=null;const p=e[o];if(p&&(h=i.categoryReducer.instances[p]??null,!h))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);c[o]=h?{name:h.name,color:h.color,uuid:h.uuid}:null;break}case V.ASSIGNED_TO:{let h=null;const p=e[o];if(p&&(h=i.userReducer.instances[p]??null,!h))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);c[o]=h?{full_name:h.username,id:h.id}:null;break}}const r=b({created_by:(m=i.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:a.uuid,changes:c});this.dispatch(Dh(r));const u=this.enqueueRequest({description:"Edit issue",method:l.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.catch(()=>{this.dispatch(Ht(a)),this.dispatch(kh(r.uuid))}),[n,u]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Ha(e)(a);if(!n)throw new Error(`No issue with uuid ${e} found in the store`);const c=Al(e)(a),r=Lh(e)(a),u=Go(e)(a),m={};for(const h of nl(e)(a))m[h.uuid]=h;for(const h of cl(e)(a))m[h.uuid]=h;const o=Object.values(m);this.dispatch(Ga(e)),c.length>0&&this.dispatch(Va(c.map(({uuid:h})=>h))),r.length>0&&this.dispatch(Bh(r.map(({uuid:h})=>h))),u.length>0&&this.dispatch(Nt(u.map(({uuid:h})=>h))),o.length>0&&this.dispatch(va(o.map(({uuid:h})=>h)));try{return await this.enqueueRequest({description:"Delete issue",method:l.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch($a(n)),this.dispatch(Ea(c)),this.dispatch(Ch(r)),this.dispatch(Lt(u)),this.dispatch(_a(o)),h}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issues",method:l.GET,url:"/issues/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issues",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(jl(n)),n}}class tF extends He{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",Ya);S(this,"addAttachments",kl);S(this,"updateAttachments",$l);S(this,"removeAttachments",Ll);S(this,"removeAttachment",Gl);S(this,"setAttachment",Bl);S(this,"selectAttachment",Wl)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get issue type attachments",method:l.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Ya(n)),n}}class sF extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const T=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(T);const F={uuid:T.uuid,file_name:A.name,file_extension:f.extension,field_identifier:p,file_sha1:f.sha1,fields_revision:h};r.push(F)}this.dispatch(Jl(c));const u=this.enqueueRequest({description:"Add issue type fields attachments",method:l.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Xl(o.attachments))}).catch(()=>{this.dispatch(Ql(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:l.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Zl(a)),a}}class iF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(dh(c));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:l.POST,url:"/issue-type-fields/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(uh(m))}).catch(m=>{throw this.dispatch(oh(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:l.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(rh(a)),a}}class aF extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const T=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});c.push(T);const F={uuid:T.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,field_values:h};r.push(F)}this.dispatch(Yt(c));const u=this.enqueueRequest({description:"Add issue type field values attachments",method:l.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.field_values),blocks:c.map(o=>o.uuid)});return u.then(({presigned_urls:o,attachments:h})=>{this.processPresignedUrls(o),this.dispatch(Ah(h))}).catch(o=>{throw this.dispatch(Kt(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=yh(e)(a);this.dispatch(Kt(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:l.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Yt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ph(n)),n}}class nF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add issue type field values",method:l.POST,url:"/issue-type-field-values/",payload:v(n),blockers:[e.issue,e.fields_revision],blocks:[n.uuid]});return this.dispatch(Ja(n)),c.then(u=>(this.dispatch(ft(u)),u)).catch(()=>{this.dispatch(Xa(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=xa(e.uuid)(a);if(!n)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(ft(c));const r=this.enqueueRequest({description:"Update issue type field values",method:l.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.issue],blocks:[c.uuid]});return r.then(u=>{this.dispatch(ft(u))}).catch(()=>{this.dispatch(ft(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=xa(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Sh(e)(a);this.dispatch(Xa(e)),this.dispatch(Kt(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:l.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Ja(n)),this.dispatch(Yt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:l.GET,url:"/issue-type-field-values/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ih(n)),n}}class cF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(nn(c));const r=this.enqueueRequest({description:"Create issue type identifier",method:l.POST,url:"/issue-type-identifiers/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(yt(m))}).catch(()=>{this.dispatch(cn(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=rn(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(yt(n));const c=this.enqueueRequest({description:"Update issue type identifier",method:l.PATCH,url:`/issue-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(yt(r))}).catch(()=>{this.dispatch(yt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=rn(e)(a);if(!n)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(cn(e));try{return await this.enqueueRequest({description:"Delete issue type identifier",method:l.DELETE,url:`/issue-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(nn(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({description:"Get issue type identifiers",method:l.GET,url:"/issue-type-identifiers/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(gh(a)),a}}class rF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(un(c));const r=this.enqueueRequest({description:"Create issue type identifier value",method:l.POST,url:"/issue-type-identifier-values/",payload:v(c),blockers:[e.issue,e.issue_type_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(St(m))}).catch(()=>{this.dispatch(on(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=hn(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(St(n));const c=this.enqueueRequest({description:"Update issue type identifier value",method:l.PATCH,url:`/issue-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(St(r))}).catch(()=>{this.dispatch(St(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=hn(e)(a);if(!n)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(on(e));try{return await this.enqueueRequest({description:"Delete issue type identifier value",method:l.DELETE,url:`/issue-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(un(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:"/issue-type-identifier-values/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(_h(n)),n}}class dF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.id});this.dispatch(Eh(n));const c=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return c.then(u=>{this.dispatch(It(u))}).catch(()=>{this.dispatch(pn(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=fn(e.uuid)(a);if(!n)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const c={...n,...e};this.dispatch(Vh(c));const r=this.enqueueRequest({method:l.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(It(u))}).catch(()=>{this.dispatch(It(n))}),[c,r]}delete(e){const{store:i}=this.client,a=i.getState(),n=fn(e)(a);if(!n)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const c=Ul(e)(a);this.dispatch(pn(e)),this.dispatch(zl(c.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(It(n)),this.dispatch(ql(c))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:l.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Mh(a)),a}}class uF extends R{async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue updates",method:l.GET,url:"/issue-updates/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue updates",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Uh(n)),n}}const oF=1800;function lF(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 hF extends rb{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:l.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let n;try{n=await a}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!n.access)throw new Error("Missing access token");return{accessToken:n.access,refreshToken:n.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Iu(!1)),this.clearTokens(),this.dispatch(g()),this.dispatch(g())}async renewTokens(){const i=this.getRefreshToken();if(!i)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const a=await this._getRenewedTokens(i);if(!a)return;console.log("Got renewed tokens"),this.setTokens(a)}catch(a){throw console.error("Could not renew tokens; clearing auth",a),this.clearAuth(),a}}tokenIsExpiringSoon(){const i=this.getAccessToken();if(!i)return!1;const a=Date.now()/1e3;let n;try{n=Up(i).exp??a}catch{n=a}return n-a<oF}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(i){return i instanceof D&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??xe).toString()))}}}async handleUnauthorized(i,a){const n=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw n.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new D({message:"You have been signed out due to inactivity.",response:a,discard:!0});if(n.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new D({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Je.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:l.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(n=>{this.setTokens(lF(n))})}}class mF extends R{update(e){const{store:i}=this.client,a=bn(e.uuid)(i.getState()),n={...a,...e};this.dispatch(Jt(n));const c=this.enqueueRequest({description:"Edit organization access",method:l.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(Jt(r))}).catch(r=>{throw this.dispatch(Jt(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=bn(e)(a),c=Xh(n.user)(a);this.dispatch(tm(n.uuid)),this.dispatch(Kh(n.user));try{await this.enqueueRequest({description:"Remove organization access",method:l.DELETE,url:`/organization-accesses/${n.uuid}/`,blockers:[n.uuid],blocks:[]})}catch(r){throw this.dispatch(em(n)),this.dispatch(Yh(c)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:l.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(xh(a)),a}}class pF extends R{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:l.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(cm(i)),i}async update(e){const i=await this.enqueueRequest({description:"Edit organization",method:l.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(rm(i)),i}async invite(e,i){return this.enqueueRequest({description:"Invite user to organization",method:l.POST,url:`/organizations/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const i=await this.enqueueRequest({immediate:!0,description:"Fetch organizations",method:l.GET,url:"/organizations/",blockers:[],blocks:[]},e);return this.dispatch(nm(i)),i}}class AF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(_n(a));const n=this.enqueueRequest({description:"Add project access",method:l.POST,url:"/project-accesses/",payload:v(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Tt(r))}).catch(r=>{throw this.dispatch(vn(a.uuid)),r}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>b({...u,created_by:a}));this.dispatch(Rn(n));const c=this.enqueueRequest({description:"Add project accesses",method:l.POST,url:"/project-accesses/bulk/",payload:{project_accesses:n.map(u=>v(u))},blockers:n.flatMap(u=>[u.project,u.organization_access]),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(Sm(u))}).catch(u=>{throw this.dispatch(wn(n.map(m=>m.uuid))),u}),[n,c]}update(e){const{store:i}=this.client,a=En(e.uuid)(i.getState()),n={...a,...e};this.dispatch(Tt(n));const c=this.enqueueRequest({description:"Edit project access",method:l.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return c.then(r=>{this.dispatch(Tt(r))}).catch(r=>{throw this.dispatch(Tt(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=En(e)(i.getState());this.dispatch(vn(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(_n(a)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:l.GET,url:"/project-accesses/",queryParams:{project__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ym(a)),a}}class fF extends He{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"addAttachments",Fm);S(this,"updateAttachments",_m);S(this,"removeAttachments",jn);S(this,"removeAttachment",Rm);S(this,"setAttachment",Pm);S(this,"selectAttachment",Mm)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,project:i.modelUuid})}buildAttachmentPayload(i){return{...i,project:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.projectUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get project attachments",method:l.GET,url:`${this.url}/`,queryParams:{project__organization:i},blockers:[],blocks:[]},a);return this.dispatch(bm(n)),n}}class yF extends R{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const i={...e};delete i.file;const a=this.enqueueRequest({method:l.PATCH,url:`/project-files/${e.uuid}/`,payload:i,blockers:[e.uuid],blocks:[e.uuid]});return a.then(n=>{this.dispatch(zn(n))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const n=i.projectFileReducer.instances[a];if(!n)throw new Error("No active project file");if(!n.bounds&&!n.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let c;if(typeof n.file=="string"&&!n.file.startsWith("blob:")){const m={...n};delete m.file,c={method:l.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else c=new Promise((m,o)=>{this.client.files.uploadFileToS3(n.file_sha1).then(([h])=>{m({method:l.POST,url:`/project-files/${n.project}/`,payload:{...n,...h},blockers:[a],blocks:[a]})}).catch(o)});const u=Promise.resolve(c).then(m=>this.enqueueRequest(m));return u.then(m=>{this.dispatch(zn(m))}),this.dispatch(Bm),this.dispatch(km(null)),this.dispatch(Cm(!1)),[n,u]}delete(e){return this.dispatch(Um(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get project files",method:l.GET,url:"/project-files/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get project files",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(qm(n)),n}}class SF extends R{async add(e){const i=await this.enqueueRequest({description:"Create project",method:l.POST,url:"/projects/",payload:v(e),blockers:[],blocks:[]});return this.dispatch(Dn(i)),i}async update(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return this.dispatch(Wm(e)),await this.enqueueRequest({description:"Update project",method:l.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:i}=this.client,a=i.getState(),n=Zm(e)(a);if(!n)throw new Error("Expected project to exist");const c=Gm(a).filter(m=>m.project===e);this.dispatch(Dm(c.map(({uuid:m})=>m)));const r=Em(n.uuid)(a);this.dispatch(jn(r.map(({uuid:m})=>m)));const u=Tm(e)(a);this.dispatch(wn(u.map(({uuid:m})=>m))),this.dispatch(Cn(n.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(Cn(n.uuid))}catch(m){throw this.dispatch(Dn(n)),this.dispatch(Rn(Object.values(u))),this.dispatch(zm(c)),this.dispatch(Om(r)),m}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch projects",method:l.GET,url:"/projects/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Hm(a)),a}}class IF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(xm(a));const n=this.enqueueRequest({description:"Create team membership",method:l.POST,url:"/team-memberships/",payload:v(a),blockers:[e.team],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Gn(r))}).catch(()=>{this.dispatch(Ln(a.uuid))}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>b({...u,created_by:a}));this.dispatch(ep(n));const c=this.enqueueRequest({description:"Create team memberships",method:l.POST,url:"/team-memberships/bulk/",payload:{team_memberships:n.map(u=>v(u))},blockers:n.map(u=>u.team),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(tp(u))}).catch(()=>{this.dispatch(sp(n.map(u=>u.uuid)))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=np(e)(a);if(!n)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(Ln(e));try{return await this.enqueueRequest({description:"Delete team membership",method:l.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(Gn(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:l.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Qm(a)),a}}class TF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,submitted_at:new Date().toISOString(),created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(dp(a));const n=this.enqueueRequest({description:"Create team",method:l.POST,url:"/teams/",payload:v(a),blockers:[],blocks:[a.uuid]});return n.then(r=>{this.dispatch(gt(r))}).catch(()=>{this.dispatch(Wn(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=Kn(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(up(n));const c=this.enqueueRequest({description:"Update team",method:l.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(gt(r))}).catch(()=>{this.dispatch(gt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Kn(e)(a);if(!n)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(Wn(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(gt(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:l.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(rp(a)),a}}class gF extends R{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:l.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(Wh(a)),a}}class bF{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,n){return this._enqueueRequest(e,i,a,n).then(c=>{if(c instanceof D)throw c;return c})}_enqueueRequest(e,i,a,n){const c=new dc,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const u={...r,uuid:e.uuid??Je.v4()},m={payload:u,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:u,BASE_URL:i,serviceName:a}}}};Xn(m,this,n).then(o=>{c.resolve(o.body)}).catch(o=>{Qn(o,m),o instanceof Error?c.reject(o):c.reject(new Error((o??xe).toString()))})}else{const u=this.store.dispatch(hm(r)),m=h=>{if(h)c.resolve(h.body);else{const p=new D({message:"Could not get a response from the server.",response:h,discard:!0});c.reject(p)}},o=h=>{h instanceof D?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
15
15
  Converting error to APIError and discarding.`),h=new D({message:"An error occurred while processing the request.",innerError:h,discard:!0})),c.reject(h)};u.then(m,o)}return c}}class et{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new Dp.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new et;for(let a=0;a<e.length;a++){const n=e[a];if(!n){console.error("Outbox item was undefined");continue}i.sneakRequest(n);for(let c=0;c<a;c++){const r=e[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==n.payload.uuid&&r.payload.blocks.some(u=>n.payload.blockers.includes(u))&&et._addDependency(n.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){et._addDependency(e,i,this.graph)}static _addDependency(e,i,a){if(e===i)throw new Error(`Tried to add dependency from node to itself: ${e}`);if(!a.hasNode(e))throw new Error(`Tried to add dependency from non-existent node: ${e} (to node: ${i})`);if(!a.hasNode(i))throw new Error(`Tried to add dependency to non-existent node: ${i} (from node: ${e})`);a.addDependency(e,i)}addRequest(e){if(this.graph.addNode(e.payload.uuid,e),!(e.payload.blockers.length===0||this.graph.size()===1))for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;const a=this.graph.getNodeData(i);e.payload.blockers.some(n=>a.payload.blocks.includes(n))&&this._addDependency(e.payload.uuid,i)}}insertRequest(e){this.graph.addNode(e.payload.uuid,e);for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;this.graph.getNodeData(i).payload.blockers.some(n=>e.payload.blocks.includes(n))&&this._addDependency(i,e.payload.uuid)}}sneakRequest(e){this.graph.addNode(e.payload.uuid,e)}_getNextNode(){const e=this.graph.overallOrder(!0);let i=1/0,a;for(const n of e){const c=this.requestAttemptCounter[n]||0;c<i&&(i=c,a=n)}return a}peek(){const e=this._getNextNode();if(e)return this.graph.getNodeData(e)}remove(e){this.graph.removeNode(e),delete this.requestAttemptCounter[e]}pop(){const e=this.peek();return e&&this.graph.removeNode(e.payload.uuid),e}getQueue(){const e=this.graph.overallOrder().map(a=>this.graph.getNodeData(a)),i=this._getNextNode();if(i){const a=this.graph.getNodeData(i),n=e.findIndex(c=>c.payload.uuid===a.payload.uuid);n!==-1&&(e.splice(n,1),e.unshift(a))}return e}getReady(){let e=this.graph.overallOrder(!0).map(i=>this.graph.getNodeData(i));return e=e.sort((i,a)=>i.meta.offline.effect.timestamp.localeCompare(a.meta.offline.effect.timestamp)),e=e.sort((i,a)=>{const n=this.requestAttemptCounter[i.payload.uuid]||0,c=this.requestAttemptCounter[a.payload.uuid]||0;return n-c}),e}registerRetry(e){this.requestAttemptCounter[e]=(this.requestAttemptCounter[e]||0)+1}}const FF=(t,e)=>{const i=new e(t);return $g(i),Bg(t),i};var vp=(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))(vp||{});s.APIError=D,s.AgentService=db,s.AssetAttachmentService=lb,s.AssetProcedureAttachmentService=hb,s.AssetProcedureFieldValuesAttachmentService=Ab,s.AssetProcedureFieldValuesService=fb,s.AssetProcedureFieldsAttachmentService=mb,s.AssetProcedureFieldsService=pb,s.AssetProcedureInstanceService=yb,s.AssetProcedureService=Sb,s.AssetProcedureStepFieldValuesAttachmentService=gb,s.AssetProcedureStepFieldValuesService=bb,s.AssetProcedureStepFieldsAttachmentService=Ib,s.AssetProcedureStepFieldsService=Tb,s.AssetProcedureStepService=Fb,s.AssetService=Pb,s.AssetStageCompletionService=Ob,s.AssetStageService=_b,s.AssetTypeAttachmentService=Rb,s.AssetTypeFieldValuesAttachmentService=Mb,s.AssetTypeFieldValuesService=Eb,s.AssetTypeFieldsAttachmentService=vb,s.AssetTypeFieldsService=wb,s.AssetTypeIdentifierService=Vb,s.AssetTypeIdentifierValueService=jb,s.AssetTypeService=qb,s.AttachmentModel=cc,s.BaseApiService=R,s.BaseSDK=bF,s.COMMON_AUTO_FIELDS=mc,s.CategoryService=zb,s.DEFAULT_ISSUE_PRIORITY=kp,s.DEFAULT_ISSUE_STATUS=Cp,s.DEFAULT_PAGINATION_PAGE_SIZE=E,s.DeferredPromise=dc,s.DocumentAttachmentService=Ub,s.DocumentService=Db,s.EMPTY_ARRAY=ic,s.EMPTY_OBJECT=ac,s.EmailDomainsService=Cb,s.EmailVerificationService=kb,s.FileService=$b,s.FormIdentifierService=Gb,s.FormIdentifierValueService=Lb,s.FormRevisionAttachmentService=Nb,s.FormRevisionService=Hb,s.FormService=Wb,s.FormSubmissionAttachmentService=Yb,s.FormSubmissionService=Kb,s.GeoImageService=Zb,s.HttpMethod=l,s.IssueAssociationService=Jb,s.IssueAttachmentService=Xb,s.IssueCommentAttachmentService=Qb,s.IssueCommentService=xb,s.IssuePriority=es,s.IssueService=eF,s.IssueStatus=ts,s.IssueTypeAttachmentService=tF,s.IssueTypeFieldValuesAttachmentService=aF,s.IssueTypeFieldValuesService=nF,s.IssueTypeFieldsAttachmentService=sF,s.IssueTypeFieldsService=iF,s.IssueTypeIdentifierService=cF,s.IssueTypeIdentifierValueService=rF,s.IssueTypeService=dF,s.IssueUpdateChange=V,s.IssueUpdateService=uF,s.JWTService=hF,s.OUTBOX_RETRY_DELAY=rc,s.OrganizationAccessLevel=nc,s.OrganizationAccessService=mF,s.OrganizationService=pF,s.OutboxCoordinator=et,s.PAGINATION_MAX_PAGE_SIZE=ub,s.PAGINATION_PAGE_SIZE_QUERY_PARAM=ob,s.ProjectAccessService=AF,s.ProjectAttachmentService=fF,s.ProjectFileService=yF,s.ProjectService=SF,s.RESET_ORGANIZATION_STATE=O,s.RESET_PROJECT_STATE=M,s.RESET_STATE=g,s.SelectorBuilder=kg,s.TeamMembershipService=IF,s.TeamService=TF,s.UNKNOWN_ERROR_MESSAGE=xe,s.UserService=gF,s.VERSION_REDUCER_KEY=tt,s.VerificationCodeType=vp,s._setLatestRetryTime=pm,s.addAsset=Xs,s.addAssetAttachment=mA,s.addAssetAttachments=os,s.addAssetProcedure=Ms,s.addAssetProcedureAttachment=fA,s.addAssetProcedureAttachments=jc,s.addAssetProcedureFieldValues=Is,s.addAssetProcedureFieldValuesAttachment=zA,s.addAssetProcedureFieldValuesAttachments=Ot,s.addAssetProcedureFieldValuesMany=hr,s.addAssetProcedureFields=Qc,s.addAssetProcedureFieldsAttachment=TA,s.addAssetProcedureFieldsAttachments=Nc,s.addAssetProcedureFieldsMany=RA,s.addAssetProcedureInstance=Ps,s.addAssetProcedureInstances=Ir,s.addAssetProcedureStep=Ys,s.addAssetProcedureStepFieldValues=Ls,s.addAssetProcedureStepFieldValuesAttachment=Tf,s.addAssetProcedureStepFieldValuesAttachments=Rt,s.addAssetProcedureStepFieldValuesMany=Yr,s.addAssetProcedureStepFields=Us,s.addAssetProcedureStepFieldsAttachment=af,s.addAssetProcedureStepFieldsAttachments=wr,s.addAssetProcedureStepFieldsMany=lf,s.addAssetProcedureSteps=Vf,s.addAssetProcedures=JA,s.addAssetStage=oi,s.addAssetStageCompletion=ai,s.addAssetStageCompletions=ni,s.addAssetStages=Wf,s.addAssetType=zi,s.addAssetTypeAttachment=Qf,s.addAssetTypeAttachments=pi,s.addAssetTypeFieldValues=gi,s.addAssetTypeFieldValuesAttachment=fy,s.addAssetTypeFieldValuesAttachments=Ut,s.addAssetTypeFieldValuesMany=eu,s.addAssetTypeFields=Bd,s.addAssetTypeFieldsAttachment=ty,s.addAssetTypeFieldsAttachments=Vd,s.addAssetTypeFieldsMany=dy,s.addAssetTypeIdentifier=_i,s.addAssetTypeIdentifierValue=Mi,s.addAssetTypeIdentifierValues=Vy,s.addAssetTypeIdentifiers=_y,s.addAssetTypes=$y,s.addAssets=Vt,s.addCategories=Jy,s.addCategory=Bi,s.addConversation=Sc,s.addConversations=cA,s.addDocumentAttachment=iS,s.addDocumentAttachments=wu,s.addDocuments=Bu,s.addEmailDomain=Hu,s.addEmailDomains=oS,s.addForm=la,s.addFormIdentifier=Ji,s.addFormIdentifierValue=ea,s.addFormIdentifierValues=PS,s.addFormIdentifiers=SS,s.addFormRevision=ca,s.addFormRevisionAttachment=ES,s.addFormRevisionAttachments=mo,s.addFormRevisions=To,s.addFormSubmission=fa,s.addFormSubmissionAttachment=ZS,s.addFormSubmissionAttachments=Bt,s.addFormSubmissions=Lt,s.addForms=GS,s.addGeoImage=Ko,s.addGeoImages=Zo,s.addIssue=$a,s.addIssueAssociation=Oa,s.addIssueAssociations=_a,s.addIssueAttachment=dI,s.addIssueAttachments=Ea,s.addIssueComment=Ua,s.addIssueCommentAttachment=lI,s.addIssueCommentAttachments=Il,s.addIssueComments=fI,s.addIssueType=Eh,s.addIssueTypeAttachment=_I,s.addIssueTypeAttachments=kl,s.addIssueTypeFieldValues=Ja,s.addIssueTypeFieldValuesAttachment=QI,s.addIssueTypeFieldValuesAttachments=Yt,s.addIssueTypeFieldValuesMany=DI,s.addIssueTypeFields=dh,s.addIssueTypeFieldsAttachment=MI,s.addIssueTypeFieldsAttachments=Jl,s.addIssueTypeFieldsMany=LI,s.addIssueTypeIdentifier=nn,s.addIssueTypeIdentifierValue=un,s.addIssueTypeIdentifierValues=oT,s.addIssueTypeIdentifiers=aT,s.addIssueTypes=yT,s.addIssueUpdate=Dh,s.addIssueUpdates=Ch,s.addIssues=ql,s.addOrganization=cm,s.addOrganizationAccess=em,s.addOrganizationAccesses=DT,s.addOrganizations=WT,s.addProject=Dn,s.addProjectAccess=_n,s.addProjectAccesses=Rn,s.addProjectAttachment=ng,s.addProjectAttachments=Fm,s.addProjectFile=ug,s.addProjectFiles=zm,s.addProjects=yg,s.addTeam=dp,s.addTeamMembership=xm,s.addTeamMemberships=ep,s.addTeams=wg,s.addUser=Yh,s.addUsers=MT,s.agentsReducer=gc,s.agentsSlice=cs,s.areArraysEqual=Gp,s.assetAttachmentReducer=Mc,s.assetAttachmentSlice=ds,s.assetProcedureAttachmentReducer=Cc,s.assetProcedureAttachmentSlice=hs,s.assetProcedureFieldValuesAttachmentReducer=ur,s.assetProcedureFieldValuesAttachmentSlice=fs,s.assetProcedureFieldValuesReducer=Ar,s.assetProcedureFieldValuesSlice=Ss,s.assetProcedureFieldsAttachmentReducer=Zc,s.assetProcedureFieldsAttachmentSlice=ms,s.assetProcedureFieldsReducer=sr,s.assetProcedureFieldsSlice=ps,s.assetProcedureInstanceReducer=gr,s.assetProcedureInstanceSlice=Fs,s.assetProcedureReducer=Or,s.assetProcedureSlice=ws,s.assetProcedureStepFieldValuesAttachmentReducer=Nr,s.assetProcedureStepFieldValuesAttachmentSlice=Bs,s.assetProcedureStepFieldValuesReducer=Xr,s.assetProcedureStepFieldValuesSlice=Gs,s.assetProcedureStepFieldsAttachmentReducer=qr,s.assetProcedureStepFieldsAttachmentSlice=qs,s.assetProcedureStepFieldsReducer=Dr,s.assetProcedureStepFieldsSlice=zs,s.assetProcedureStepReducer=td,s.assetProcedureStepSlice=Ws,s.assetReducer=rd,s.assetSlice=Js,s.assetStageCompletionReducer=hd,s.assetStageCompletionSlice=ii,s.assetStageReducer=Sd,s.assetStageSlice=ui,s.assetTypeAttachmentReducer=wd,s.assetTypeAttachmentSlice=mi,s.assetTypeFieldValuesAttachmentReducer=Xd,s.assetTypeFieldValuesAttachmentSlice=Si,s.assetTypeFieldValuesReducer=au,s.assetTypeFieldValuesSlice=Ti,s.assetTypeFieldsAttachmentReducer=Dd,s.assetTypeFieldsAttachmentSlice=fi,s.assetTypeFieldsReducer=Nd,s.assetTypeFieldsSlice=yi,s.assetTypeIdentifierReducer=uu,s.assetTypeIdentifierSlice=Oi,s.assetTypeIdentifierValueReducer=mu,s.assetTypeIdentifierValueSlice=wi,s.assetTypeReducer=yu,s.assetTypeSlice=qi,s.authReducer=Tu,s.authSlice=Ct,s.baseReducer=Ug,s.baseReducers=Zn,s.blobToBase64=Xp,s.categoryReducer=_u,s.categorySlice=ki,s.clearTokens=Yy,s.constructUploadedFilePayloads=Jp,s.createModelAdapter=P,s.createOfflineAction=om,s.createPayload=v,s.createSelectionAdapter=Bp,s.deleteAsset=Qs,s.deleteAssetAttachment=Oc,s.deleteAssetAttachments=ls,s.deleteAssetProcedure=Es,s.deleteAssetProcedureAttachment=Uc,s.deleteAssetProcedureAttachments=Dc,s.deleteAssetProcedureFieldValues=Ts,s.deleteAssetProcedureFieldValuesAttachment=kA,s.deleteAssetProcedureFieldValuesAttachments=_t,s.deleteAssetProcedureFieldValuesMany=pr,s.deleteAssetProcedureFields=er,s.deleteAssetProcedureFieldsAttachment=PA,s.deleteAssetProcedureFieldsAttachments=Wc,s.deleteAssetProcedureFieldsMany=EA,s.deleteAssetProcedureInstance=Os,s.deleteAssetProcedureInstances=Tr,s.deleteAssetProcedureStep=Ks,s.deleteAssetProcedureStepFieldValues=Ns,s.deleteAssetProcedureStepFieldValuesAttachment=Pf,s.deleteAssetProcedureStepFieldValuesAttachments=vt,s.deleteAssetProcedureStepFieldValuesMany=Zr,s.deleteAssetProcedureStepFields=Ds,s.deleteAssetProcedureStepFieldsAttachment=df,s.deleteAssetProcedureStepFieldsAttachments=Er,s.deleteAssetProcedureStepFieldsMany=Af,s.deleteAssetProcedureSteps=qf,s.deleteAssetProcedures=QA,s.deleteAssetStage=li,s.deleteAssetStageCompletion=ci,s.deleteAssetStageCompletions=ri,s.deleteAssetStages=Kf,s.deleteAssetType=Ui,s.deleteAssetTypeAttachment=Pd,s.deleteAssetTypeAttachments=Ai,s.deleteAssetTypeFieldValues=bi,s.deleteAssetTypeFieldValuesAttachment=Ty,s.deleteAssetTypeFieldValuesAttachments=Dt,s.deleteAssetTypeFieldValuesMany=su,s.deleteAssetTypeFields=Gd,s.deleteAssetTypeFieldsAttachment=ny,s.deleteAssetTypeFieldsAttachments=qd,s.deleteAssetTypeFieldsMany=hy,s.deleteAssetTypeIdentifier=Ri,s.deleteAssetTypeIdentifierValue=Ei,s.deleteAssetTypeIdentifierValues=Uy,s.deleteAssetTypeIdentifiers=My,s.deleteAssetTypes=Ly,s.deleteAssets=xs,s.deleteCategories=eS,s.deleteCategory=Pu,s.deleteConversation=uA,s.deleteConversations=oA,s.deleteDocumentAttachment=Vu,s.deleteDocumentAttachments=ju,s.deleteEmailDomain=Wu,s.deleteEmailDomains=AS,s.deleteForm=ha,s.deleteFormIdentifier=Xi,s.deleteFormIdentifierValue=ta,s.deleteFormIdentifierValues=vS,s.deleteFormIdentifiers=bS,s.deleteFormRevision=ra,s.deleteFormRevisionAttachment=zS,s.deleteFormRevisionAttachments=Ao,s.deleteFormRevisions=bo,s.deleteFormSubmission=ya,s.deleteFormSubmissionAttachment=xS,s.deleteFormSubmissionAttachments=$t,s.deleteFormSubmissions=Nt,s.deleteForms=YS,s.deleteGeoImage=ba,s.deleteGeoImages=Xo,s.deleteIssue=Ga,s.deleteIssueAssociation=Ra,s.deleteIssueAssociations=va,s.deleteIssueAttachment=hl,s.deleteIssueAttachments=Va,s.deleteIssueComment=Ca,s.deleteIssueCommentAttachment=bl,s.deleteIssueCommentAttachments=Fl,s.deleteIssueComments=II,s.deleteIssueType=TT,s.deleteIssueTypeAttachment=Gl,s.deleteIssueTypeAttachments=Ll,s.deleteIssueTypeFieldValues=Xa,s.deleteIssueTypeFieldValuesAttachment=sT,s.deleteIssueTypeFieldValuesAttachments=Kt,s.deleteIssueTypeFieldValuesMany=$I,s.deleteIssueTypeFields=oh,s.deleteIssueTypeFieldsAttachment=qI,s.deleteIssueTypeFieldsAttachments=Ql,s.deleteIssueTypeFieldsMany=YI,s.deleteIssueTypeIdentifier=cn,s.deleteIssueTypeIdentifierValue=on,s.deleteIssueTypeIdentifierValues=pT,s.deleteIssueTypeIdentifiers=dT,s.deleteIssueTypes=gT,s.deleteIssueUpdate=kh,s.deleteIssueUpdates=Bh,s.deleteIssues=zl,s.deleteOrganization=KT,s.deleteOrganizationAccess=tm,s.deleteOrganizationAccesses=$T,s.deleteOrganizations=ZT,s.deleteProject=Cn,s.deleteProjectAccess=vn,s.deleteProjectAccesses=wn,s.deleteProjectAttachment=Rm,s.deleteProjectAttachments=jn,s.deleteProjectFile=Um,s.deleteProjectFiles=Dm,s.deleteProjects=Ig,s.deleteTeam=Wn,s.deleteTeamMembership=Ln,s.deleteTeamMemberships=sp,s.deleteTeams=Vg,s.deleteUser=Kh,s.deleteUsers=jT,s.dequeue=Pp,s.discard=Qn,s.documentAttachmentReducer=Du,s.documentAttachmentSlice=Li,s.documentSlice=Ni,s.documentsReducer=Gu,s.downloadFile=Qp,s.downloadInMemoryFile=Zp,s.emailDomainsReducer=Zu,s.emailDomainsSlice=Yi,s.emailRegex=nA,s.enqueue=Fp,s.enqueueRequest=hm,s.fallbackToEmptyArray=I,s.fallbackToEmptyObject=Pt,s.fileReducer=eo,s.fileSlice=Ki,s.fileToBlob=lc,s.formIdentifierReducer=no,s.formIdentifierSlice=Zi,s.formIdentifierValueReducer=oo,s.formIdentifierValueSlice=xi,s.formReducer=Ro,s.formRevisionAttachmentReducer=yo,s.formRevisionAttachmentSlice=aa,s.formRevisionReducer=Po,s.formRevisionsSlice=na,s.formSlice=oa,s.formSubmissionAttachmentReducer=Do,s.formSubmissionAttachmentSlice=ma,s.formSubmissionReducer=No,s.formSubmissionSlice=Aa,s.geoImageReducer=el,s.geoImageSlice=ga,s.getFileIdentifier=Kp,s.getFileS3Key=ns,s.getLocalDateString=uc,s.getLocalRelativeDateString=Wp,s.getOutboxCoordinator=Ye,s.getRenamedFile=oc,s.hashFile=Xe,s.initSDK=FF,s.initializeAssetAttachments=us,s.initializeAssetProcedureAttachments=Vc,s.initializeAssetProcedureFieldValues=lr,s.initializeAssetProcedureFieldValuesAttachments=ar,s.initializeAssetProcedureFields=Xc,s.initializeAssetProcedureFieldsAttachments=Lc,s.initializeAssetProcedureInstances=Sr,s.initializeAssetProcedureStepFieldValues=Wr,s.initializeAssetProcedureStepFieldValuesAttachments=kr,s.initializeAssetProcedureStepFields=Ur,s.initializeAssetProcedureStepFieldsAttachments=vr,s.initializeAssetProcedureSteps=xr,s.initializeAssetProcedures=Pr,s.initializeAssetStageCompletions=ud,s.initializeAssetStages=fd,s.initializeAssetTypeAttachments=gd,s.initializeAssetTypeFieldValues=xd,s.initializeAssetTypeFieldValuesAttachments=Wd,s.initializeAssetTypeFields=kd,s.initializeAssetTypeFieldsAttachments=Ed,s.initializeAssetTypeIdentifierValues=lu,s.initializeAssetTypeIdentifiers=cu,s.initializeAssetTypes=Au,s.initializeAssets=ad,s.initializeCategories=bu,s.initializeConversations=yc,s.initializeDocumentAttachments=vu,s.initializeEmailDomains=Nu,s.initializeFormIdentifierValues=ro,s.initializeFormIdentifiers=so,s.initializeFormRevisionAttachments=ho,s.initializeFormRevisions=Io,s.initializeFormSubmissionAttachments=Vo,s.initializeFormSubmissions=ko,s.initializeForms=_o,s.initializeGeoImages=Wo,s.initializeIssueAssociations=sl,s.initializeIssueAttachments=Ma,s.initializeIssueCommentAttachments=qa,s.initializeIssueComments=AI,s.initializeIssueTypeAttachments=Ya,s.initializeIssueTypeFieldValues=ih,s.initializeIssueTypeFieldValuesAttachments=ph,s.initializeIssueTypeFields=rh,s.initializeIssueTypeFieldsAttachments=Zl,s.initializeIssueTypeIdentifierValues=_h,s.initializeIssueTypeIdentifiers=gh,s.initializeIssueTypes=Mh,s.initializeIssueUpdates=Uh,s.initializeIssues=jl,s.initializeOrganizationAccesses=xh,s.initializeOrganizations=nm,s.initializeProjectAccesses=ym,s.initializeProjectAttachments=bm,s.initializeProjectFiles=qm,s.initializeProjects=Hm,s.initializeTeamMemberships=Qm,s.initializeTeams=rp,s.initializeUsers=Wh,s.isToday=Hp,s.issueAssociationReducer=dl,s.issueAssociationSlice=Pa,s.issueAttachmentReducer=yl,s.issueAttachmentSlice=wa,s.issueCommentAttachmentReducer=Rl,s.issueCommentAttachmentSlice=ja,s.issueCommentReducer=El,s.issueCommentSlice=za,s.issueReducer=Dl,s.issueSlice=Ba,s.issueTypeAttachmentReducer=Yl,s.issueTypeAttachmentSlice=Wa,s.issueTypeFieldValuesAttachmentReducer=Ih,s.issueTypeFieldValuesAttachmentSlice=tn,s.issueTypeFieldValuesReducer=nh,s.issueTypeFieldValuesSlice=Za,s.issueTypeFieldsAttachmentReducer=th,s.issueTypeFieldsAttachmentSlice=Ka,s.issueTypeFieldsReducer=hh,s.issueTypeFieldsSlice=en,s.issueTypeIdentifierReducer=Ph,s.issueTypeIdentifierSlice=an,s.issueTypeIdentifierValueReducer=vh,s.issueTypeIdentifierValueSlice=dn,s.issueTypeReducer=qh,s.issueTypeSlice=mn,s.issueUpdateReducer=Nh,s.issueUpdateSlice=yn,s.logOnlyOnce=xp,s.markAsDeleted=mm,s.markForDeletion=eg,s.memoize=is,s.offline=b,s.onlyUniqueHashes=aA,s.onlyUniqueOfflineIds=Ac,s.organizationAccessReducer=sm,s.organizationAccessSlice=Tn,s.organizationReducer=um,s.organizationSlice=Fn,s.outboxReducer=Am,s.outboxSlice=Pn,s.overmapEnhancer=Jg,s.overmapReducer=Dg,s.overmapReducers=pp,s.performRequest=Xn,s.projectAccessReducer=Im,s.projectAccessSlice=On,s.projectAttachmentReducer=Vm,s.projectAttachmentSlice=Vn,s.projectFileReducer=Lm,s.projectFileSlice=qn,s.projectReducer=Ym,s.projectSlice=Un,s.rehydratedReducer=Jm,s.rehydratedSlice=Bn,s.removeDocuments=Hi,s.removeIssueType=pn,s.resetProjectFileObjectUrls=lg,s.restructureCreateSelectorWithArgs=y,s.saveActiveProjectFileBounds=Bm,s.selectAccessToken=Ky,s.selectAccessesByUserOfProject=ig,s.selectAccessibleProjects=Tg,s.selectActiveOrganizationAccess=GT,s.selectActiveProjectFileId=mg,s.selectAllDocumentAttachments=zu,s.selectAllProjectAttachments=wm,s.selectAssetAttachmentById=vc,s.selectAssetAttachmentMapping=_c,s.selectAssetAttachments=Rc,s.selectAssetById=si,s.selectAssetProcedureAttachmentById=$c,s.selectAssetProcedureAttachmentMapping=kc,s.selectAssetProcedureAttachments=Bc,s.selectAssetProcedureById=js,s.selectAssetProcedureFieldValues=gs,s.selectAssetProcedureFieldValuesAttachmentById=BA,s.selectAssetProcedureFieldValuesAttachments=cr,s.selectAssetProcedureFieldValuesAttachmentsByIds=rr,s.selectAssetProcedureFieldValuesAttachmentsMapping=ys,s.selectAssetProcedureFieldValuesById=bs,s.selectAssetProcedureFieldValuesMapping=fr,s.selectAssetProcedureFieldValuesOfAsset=LA,s.selectAssetProcedureFields=As,s.selectAssetProcedureFieldsAttachmentById=_A,s.selectAssetProcedureFieldsAttachments=Kc,s.selectAssetProcedureFieldsAttachmentsMapping=Yc,s.selectAssetProcedureFieldsById=qA,s.selectAssetProcedureFieldsMapping=tr,s.selectAssetProcedureFieldsOfAssetProcedure=VA,s.selectAssetProcedureInstanceById=vs,s.selectAssetProcedureInstances=Rs,s.selectAssetProcedureInstancesByIds=ZA,s.selectAssetProcedureInstancesMapping=_s,s.selectAssetProcedureInstancesOfAssetProcedure=br,s.selectAssetProcedureInstancesOfAssetType=KA,s.selectAssetProcedureStepById=Zs,s.selectAssetProcedureStepFieldValues=wt,s.selectAssetProcedureStepFieldValuesAttachmentById=Of,s.selectAssetProcedureStepFieldValuesAttachments=$r,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=Gr,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=$s,s.selectAssetProcedureStepFieldValuesById=Hs,s.selectAssetProcedureStepFieldValuesMapping=Jr,s.selectAssetProcedureStepFieldValuesOfAsset=vf,s.selectAssetProcedureStepFieldValuesOfAssetProcedureInstance=wf,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Mf,s.selectAssetProcedureStepFields=ks,s.selectAssetProcedureStepFieldsAttachmentById=of,s.selectAssetProcedureStepFieldsAttachments=jr,s.selectAssetProcedureStepFieldsAttachmentsMapping=Vr,s.selectAssetProcedureStepFieldsById=If,s.selectAssetProcedureStepFieldsMapping=Cs,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=ff,s.selectAssetProcedureStepMapping=Et,s.selectAssetProcedureSteps=sd,s.selectAssetProcedureStepsByIds=Df,s.selectAssetProcedureStepsMappingOfAssetProcedure=zf,s.selectAssetProcedureStepsOfAssetProcedure=Uf,s.selectAssetProcedures=_r,s.selectAssetProceduresByIds=tf,s.selectAssetProceduresMapping=Vs,s.selectAssetProceduresOfOrganization=sf,s.selectAssetStageById=hi,s.selectAssetStageCompletionById=md,s.selectAssetStageCompletionMapping=di,s.selectAssetStageCompletions=Nf,s.selectAssetStageCompletionsByIds=pd,s.selectAssetStages=Id,s.selectAssetStagesByIds=Xf,s.selectAssetStagesMappingOfAssetProcedure=Zf,s.selectAssetStagesOfAssetProcedure=Jf,s.selectAssetTypeAttachmentById=Rd,s.selectAssetTypeAttachmentMapping=Od,s.selectAssetTypeAttachments=_d,s.selectAssetTypeById=Ci,s.selectAssetTypeFieldValues=Fi,s.selectAssetTypeFieldValuesAttachmentById=gy,s.selectAssetTypeFieldValuesAttachments=Kd,s.selectAssetTypeFieldValuesAttachmentsByIds=Zd,s.selectAssetTypeFieldValuesAttachmentsMapping=Ii,s.selectAssetTypeFieldValuesById=Pi,s.selectAssetTypeFieldValuesMapping=iu,s.selectAssetTypeFieldValuesOfAsset=Py,s.selectAssetTypeFields=zt,s.selectAssetTypeFieldsAttachmentById=ry,s.selectAssetTypeFieldsAttachments=Ud,s.selectAssetTypeFieldsAttachmentsMapping=zd,s.selectAssetTypeFieldsById=Ay,s.selectAssetTypeFieldsMapping=Ld,s.selectAssetTypeFieldsOfAssetType=my,s.selectAssetTypeIdentifierById=vi,s.selectAssetTypeIdentifierMapping=ru,s.selectAssetTypeIdentifierValueById=ji,s.selectAssetTypeIdentifierValueMapping=hu,s.selectAssetTypeIdentifierValues=Vi,s.selectAssetTypeIdentifierValuesOfAsset=Dy,s.selectAssetTypeIdentifierValuesOfIdentifier=Cy,s.selectAssetTypeIdentifiers=du,s.selectAssetTypeIdentifiersOfAssetType=Ey,s.selectAssetTypeValuesOfAssetType=Oy,s.selectAssetTypes=fu,s.selectAssetTypesByIds=Ny,s.selectAssetTypesMapping=Di,s.selectAssetTypesOfOrganization=Hy,s.selectAssets=nd,s.selectAssetsByIds=cd,s.selectAssetsMapping=ei,s.selectAssetsOfAssetType=ti,s.selectAttachmentsOfAsset=wc,s.selectAttachmentsOfAssetProcedure=IA,s.selectAttachmentsOfAssetProcedureFieldValues=dr,s.selectAttachmentsOfAssetProcedureFields=OA,s.selectAttachmentsOfAssetProcedureStepFieldValues=Lr,s.selectAttachmentsOfAssetProcedureStepFields=uf,s.selectAttachmentsOfAssetType=vd,s.selectAttachmentsOfAssetTypeFieldValues=Jd,s.selectAttachmentsOfAssetTypeFields=cy,s.selectAttachmentsOfDocument=cS,s.selectAttachmentsOfFormRevision=US,s.selectAttachmentsOfFormSubmission=Uo,s.selectAttachmentsOfIssue=Al,s.selectAttachmentsOfIssueComment=pI,s.selectAttachmentsOfIssueType=wI,s.selectAttachmentsOfIssueTypeFieldValues=Sh,s.selectAttachmentsOfIssueTypeFields=zI,s.selectAttachmentsOfProject=Em,s.selectCategories=Ou,s.selectCategoriesByIds=tS,s.selectCategoriesOfProject=sS,s.selectCategoryById=Gi,s.selectCategoryMapping=$i,s.selectCommentsOfIssue=TI,s.selectConversation=hA,s.selectConversationMapping=rs,s.selectConversations=lA,s.selectCurrentUser=Jh,s.selectDeletedRequests=QT,s.selectDocumentAttachmentById=Uu,s.selectDocumentAttachmentMapping=qu,s.selectDocumentById=$u,s.selectDocuments=Wi,s.selectDocumentsByIds=rS,s.selectDocumentsMapping=kt,s.selectEmailDomains=Ku,s.selectEmailDomainsAsMapping=Yu,s.selectEmailDomainsOfOrganization=fS,s.selectFieldValuesOfAssetProcedureInstance=NA,s.selectFormById=Mo,s.selectFormIdentifierById=Qi,s.selectFormIdentifierMapping=io,s.selectFormIdentifierValueById=ia,s.selectFormIdentifierValueMapping=uo,s.selectFormIdentifierValues=sa,s.selectFormIdentifierValuesOfFormSubmission=wS,s.selectFormIdentifierValuesOfIdentifier=MS,s.selectFormIdentifiers=ao,s.selectFormIdentifiersOfForm=FS,s.selectFormMapping=vo,s.selectFormRevisionAttachmentsMapping=fo,s.selectFormRevisionById=BS,s.selectFormRevisionMapping=da,s.selectFormRevisions=ua,s.selectFormRevisionsOfForm=Fo,s.selectFormSubmissionAttachemntsByIds=zo,s.selectFormSubmissionAttachments=pa,s.selectFormSubmissionAttachmentsMapping=qo,s.selectFormSubmissionById=Ta,s.selectFormSubmissions=Ia,s.selectFormSubmissionsMapping=Sa,s.selectFormSubmissionsOfAsset=Lo,s.selectFormSubmissionsOfForm=$o,s.selectFormSubmissionsOfIssue=Go,s.selectForms=wo,s.selectFormsOfOrganization=KS,s.selectGeoImageById=Fa,s.selectGeoImageMapping=Qo,s.selectGeoImages=xo,s.selectGeoImagesOfProject=iI,s.selectIsImportingProjectFile=pg,s.selectIsLoggedIn=Zy,s.selectIssueAssociationById=al,s.selectIssueAssociationMapping=At,s.selectIssueAssociations=rI,s.selectIssueAssociationsOfAsset=rl,s.selectIssueAssociationsOfIssue=cl,s.selectIssueAssociationsToIssue=nl,s.selectIssueAttachmentById=fl,s.selectIssueAttachmentMapping=ml,s.selectIssueAttachments=pl,s.selectIssueById=Ha,s.selectIssueCommentAttachmentById=_l,s.selectIssueCommentAttachmentMapping=Pl,s.selectIssueCommentAttachments=Ol,s.selectIssueCommentById=ka,s.selectIssueCommentMapping=Ml,s.selectIssueMapping=La,s.selectIssueTypeAttachmentById=Wl,s.selectIssueTypeAttachmentMapping=Nl,s.selectIssueTypeAttachments=Hl,s.selectIssueTypeById=fn,s.selectIssueTypeFieldValues=Qa,s.selectIssueTypeFieldValuesAttachmentById=iT,s.selectIssueTypeFieldValuesAttachments=sn,s.selectIssueTypeFieldValuesAttachmentsByIds=yh,s.selectIssueTypeFieldValuesAttachmentsMapping=fh,s.selectIssueTypeFieldValuesById=xa,s.selectIssueTypeFieldValuesMapping=ah,s.selectIssueTypeFieldValuesOfIssue=GI,s.selectIssueTypeFields=Wt,s.selectIssueTypeFieldsAttachmentById=UI,s.selectIssueTypeFieldsAttachments=eh,s.selectIssueTypeFieldsAttachmentsMapping=xl,s.selectIssueTypeFieldsById=XI,s.selectIssueTypeFieldsMapping=lh,s.selectIssueTypeFieldsOfIssueType=KI,s.selectIssueTypeIdentifierById=rn,s.selectIssueTypeIdentifierMapping=bh,s.selectIssueTypeIdentifierValueById=hn,s.selectIssueTypeIdentifierValueMapping=Rh,s.selectIssueTypeIdentifierValues=ln,s.selectIssueTypeIdentifierValuesOfIdentifier=fT,s.selectIssueTypeIdentifierValuesOfIssue=AT,s.selectIssueTypeIdentifiers=Fh,s.selectIssueTypeIdentifiersOfIssueType=uT,s.selectIssueTypeMapping=An,s.selectIssueTypeValuesOfIssueType=JI,s.selectIssueTypes=jh,s.selectIssueTypesByIds=bT,s.selectIssueTypesOfOrganization=FT,s.selectIssueUpdateMapping=$h,s.selectIssueUpdates=Gh,s.selectIssueUpdatesOfIssue=Lh,s.selectIssues=Na,s.selectIssuesByIds=PI,s.selectIssuesOfIssueType=Ul,s.selectIssuesOfProject=OI,s.selectLatestAssetProcedureFieldsOfAssetProcedure=jA,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=yf,s.selectLatestAssetTypeFieldsOfAssetType=py,s.selectLatestFieldsByAssetProcedureStep=Sf,s.selectLatestFormRevisionOfForm=$S,s.selectLatestIssueTypeFieldsOfIssueType=ZI,s.selectLatestRetryTime=xT,s.selectMembershipsByUserOfTeam=Rg,s.selectNumberOfAssetsOfAssetType=$f,s.selectOrganizationAccessById=bn,s.selectOrganizationAccessMapping=gn,s.selectOrganizationAccessUserMapping=im,s.selectOrganizationById=XT,s.selectOrganizationDocuments=uS,s.selectOrganizations=JT,s.selectOrganizationsMapping=dm,s.selectProjectAccessById=En,s.selectProjectAccessMapping=Mn,s.selectProjectAccesses=Xt,s.selectProjectAccessesOfProject=Tm,s.selectProjectAttachmentById=Mm,s.selectProjectAttachmentMapping=vm,s.selectProjectById=Zm,s.selectProjectDocuments=dS,s.selectProjectFileById=hg,s.selectProjectFileMapping=$m,s.selectProjectFiles=Gm,s.selectProjectMapping=Km,s.selectProjects=kn,s.selectProjectsOfOrganization=gg,s.selectRehydrated=Pg,s.selectStageMapping=qt,s.selectTeamById=Kn,s.selectTeamMembershipById=np,s.selectTeamMemberships=Nn,s.selectTeamMembershipsMapping=ap,s.selectTeams=op,s.selectTeamsByIds=jg,s.selectTeamsMapping=Yn,s.selectTeamsOfOrganization=qg,s.selectUploadUrl=xu,s.selectUserById=Xh,s.selectUsers=In,s.selectUsersByIds=UT,s.selectUsersMapping=Zt,s.selectUsersOfOrganization=LT,s.selectUsersOfProject=ag,s.selectUsersOfTeam=vg,s.setActiveProjectFileId=km,s.setAsset=kf,s.setAssetAttachment=Fc,s.setAssetAttachments=pA,s.setAssetProcedure=xA,s.setAssetProcedureAttachment=qc,s.setAssetProcedureAttachments=yA,s.setAssetProcedureFieldValues=$A,s.setAssetProcedureFieldValuesAttachment=UA,s.setAssetProcedureFieldValuesAttachments=DA,s.setAssetProcedureFieldValuesMany=GA,s.setAssetProcedureFields=vA,s.setAssetProcedureFieldsAttachment=gA,s.setAssetProcedureFieldsAttachments=bA,s.setAssetProcedureFieldsMany=wA,s.setAssetProcedureInstance=WA,s.setAssetProcedureInstances=YA,s.setAssetProcedureStep=ed,s.setAssetProcedureStepFieldValues=_f,s.setAssetProcedureStepFieldValuesAttachment=gf,s.setAssetProcedureStepFieldValuesAttachments=bf,s.setAssetProcedureStepFieldValuesMany=Rf,s.setAssetProcedureStepFields=hf,s.setAssetProcedureStepFieldsAttachment=nf,s.setAssetProcedureStepFieldsAttachments=cf,s.setAssetProcedureStepFieldsMany=mf,s.setAssetProcedureSteps=Ef,s.setAssetProcedures=ef,s.setAssetStage=yd,s.setAssetStageCompletion=Gf,s.setAssetStageCompletions=Lf,s.setAssetStages=Hf,s.setAssetType=ky,s.setAssetTypeAttachment=bd,s.setAssetTypeAttachments=xf,s.setAssetTypeFieldValues=by,s.setAssetTypeFieldValuesAttachment=yy,s.setAssetTypeFieldValuesAttachments=Sy,s.setAssetTypeFieldValuesMany=Fy,s.setAssetTypeFields=uy,s.setAssetTypeFieldsAttachment=sy,s.setAssetTypeFieldsAttachments=iy,s.setAssetTypeFieldsMany=oy,s.setAssetTypeIdentifier=Ry,s.setAssetTypeIdentifierValue=jy,s.setAssetTypeIdentifierValues=qy,s.setAssetTypeIdentifiers=vy,s.setAssetTypes=By,s.setAssets=Bf,s.setCategories=Qy,s.setCategory=Xy,s.setConversation=Ic,s.setConversations=rA,s.setCurrentUser=qT,s.setDocumentAttachment=Mu,s.setDocumentAttachments=aS,s.setDocuments=ku,s.setEmailDomain=lS,s.setEmailDomains=hS,s.setForm=LS,s.setFormIdentifier=IS,s.setFormIdentifierValue=OS,s.setFormIdentifierValues=_S,s.setFormIdentifiers=TS,s.setFormRevision=go,s.setFormRevisionAttachment=VS,s.setFormRevisionAttachments=jS,s.setFormRevisions=DS,s.setFormSubmission=Gt,s.setFormSubmissionAttachment=JS,s.setFormSubmissionAttachments=XS,s.setFormSubmissions=eI,s.setForms=NS,s.setGeoImage=pt,s.setGeoImages=Yo,s.setIsImportingProjectFile=Cm,s.setIssue=gI,s.setIssueAssociation=nI,s.setIssueAssociations=aI,s.setIssueAttachment=ol,s.setIssueAttachments=uI,s.setIssueComment=Da,s.setIssueCommentAttachment=Tl,s.setIssueCommentAttachments=hI,s.setIssueComments=wl,s.setIssueType=It,s.setIssueTypeAttachment=Bl,s.setIssueTypeAttachments=RI,s.setIssueTypeFieldValues=CI,s.setIssueTypeFieldValuesAttachment=xI,s.setIssueTypeFieldValuesAttachments=eT,s.setIssueTypeFieldValuesMany=kI,s.setIssueTypeFields=NI,s.setIssueTypeFieldsAttachment=EI,s.setIssueTypeFieldsAttachments=VI,s.setIssueTypeFieldsMany=HI,s.setIssueTypeIdentifier=nT,s.setIssueTypeIdentifierValue=lT,s.setIssueTypeIdentifierValues=hT,s.setIssueTypeIdentifiers=cT,s.setIssueTypes=ST,s.setIssueUpdate=PT,s.setIssueUpdates=OT,s.setIssues=bI,s.setLoggedIn=Iu,s.setOrganization=HT,s.setOrganizationAccess=CT,s.setOrganizationAccesses=kT,s.setOrganizations=NT,s.setProfilePicture=zT,s.setProject=fg,s.setProjectAccess=tg,s.setProjectAccesses=sg,s.setProjectAttachment=Pm,s.setProjectAttachments=Om,s.setProjectFile=rg,s.setProjectFiles=dg,s.setProjects=Ag,s.setRehydrated=Fg,s.setTeam=gt,s.setTeamMembership=Gn,s.setTeamMemberships=tp,s.setTeams=Mg,s.setTokens=Wy,s.setUploadUrl=Qu,s.setUser=wT,s.setUsers=vT,s.shallowEqual=$p,s.slugify=sA,s.spacesToDashesLower=tA,s.teamMembershipReducer=ip,s.teamMembershipSlice=$n,s.teamReducer=lp,s.teamSlice=Hn,s.toFileNameSafeString=eA,s.toOfflineIdRecord=pc,s.truncate=iA,s.updateAsset=rt,s.updateAssetAttachment=AA,s.updateAssetAttachments=Pc,s.updateAssetProcedure=at,s.updateAssetProcedureAttachment=SA,s.updateAssetProcedureAttachments=zc,s.updateAssetProcedureFieldValues=st,s.updateAssetProcedureFieldValuesAttachment=CA,s.updateAssetProcedureFieldValuesAttachments=nr,s.updateAssetProcedureFieldValuesMany=mr,s.updateAssetProcedureFields=xc,s.updateAssetProcedureFieldsAttachment=FA,s.updateAssetProcedureFieldsAttachments=Hc,s.updateAssetProcedureFieldsMany=MA,s.updateAssetProcedureInstance=it,s.updateAssetProcedureInstances=HA,s.updateAssetProcedureStep=Mt,s.updateAssetProcedureStepFieldValues=ct,s.updateAssetProcedureStepFieldValuesAttachment=Ff,s.updateAssetProcedureStepFieldValuesAttachments=Br,s.updateAssetProcedureStepFieldValuesMany=Kr,s.updateAssetProcedureStepFields=nt,s.updateAssetProcedureStepFieldsAttachment=rf,s.updateAssetProcedureStepFieldsAttachments=Mr,s.updateAssetProcedureStepFieldsMany=pf,s.updateAssetProcedureSteps=jf,s.updateAssetProcedures=XA,s.updateAssetStage=jt,s.updateAssetStageCompletion=od,s.updateAssetStageCompletions=ld,s.updateAssetStages=Yf,s.updateAssetType=lt,s.updateAssetTypeAttachment=ey,s.updateAssetTypeAttachments=Fd,s.updateAssetTypeFieldValues=dt,s.updateAssetTypeFieldValuesAttachment=Iy,s.updateAssetTypeFieldValuesAttachments=Yd,s.updateAssetTypeFieldValuesMany=tu,s.updateAssetTypeFields=$d,s.updateAssetTypeFieldsAttachment=ay,s.updateAssetTypeFieldsAttachments=jd,s.updateAssetTypeFieldsMany=ly,s.updateAssetTypeIdentifier=ut,s.updateAssetTypeIdentifierValue=ot,s.updateAssetTypeIdentifierValues=zy,s.updateAssetTypeIdentifiers=wy,s.updateAssetTypes=Gy,s.updateAssets=Cf,s.updateCategories=xy,s.updateCategory=Fu,s.updateConversation=Tc,s.updateConversations=dA,s.updateDocumentAttachment=nS,s.updateDocumentAttachments=Eu,s.updateDocuments=Qe,s.updateEmailDomain=mS,s.updateEmailDomains=pS,s.updateForm=HS,s.updateFormIdentifier=ht,s.updateFormIdentifierValue=mt,s.updateFormIdentifierValues=RS,s.updateFormIdentifiers=gS,s.updateFormRevision=CS,s.updateFormRevisionAttachment=qS,s.updateFormRevisionAttachments=po,s.updateFormRevisions=kS,s.updateFormSubmission=Bo,s.updateFormSubmissionAttachment=QS,s.updateFormSubmissionAttachments=jo,s.updateFormSubmissions=tI,s.updateForms=WS,s.updateGeoImage=Jo,s.updateGeoImages=sI,s.updateIssue=Ht,s.updateIssueAssociation=il,s.updateIssueAssociations=cI,s.updateIssueAttachment=oI,s.updateIssueAttachments=ll,s.updateIssueComment=yI,s.updateIssueCommentAttachment=mI,s.updateIssueCommentAttachments=gl,s.updateIssueComments=SI,s.updateIssueType=Vh,s.updateIssueTypeAttachment=vI,s.updateIssueTypeAttachments=$l,s.updateIssueTypeFieldValues=ft,s.updateIssueTypeFieldValuesAttachment=tT,s.updateIssueTypeFieldValuesAttachments=Ah,s.updateIssueTypeFieldValuesMany=BI,s.updateIssueTypeFields=uh,s.updateIssueTypeFieldsAttachment=jI,s.updateIssueTypeFieldsAttachments=Xl,s.updateIssueTypeFieldsMany=WI,s.updateIssueTypeIdentifier=yt,s.updateIssueTypeIdentifierValue=St,s.updateIssueTypeIdentifierValues=mT,s.updateIssueTypeIdentifiers=rT,s.updateIssueTypes=IT,s.updateIssueUpdate=_T,s.updateIssueUpdates=RT,s.updateIssues=FI,s.updateOrganization=rm,s.updateOrganizationAccess=Jt,s.updateOrganizationAccesses=BT,s.updateOrganizations=YT,s.updateProject=Wm,s.updateProjectAccess=Tt,s.updateProjectAccesses=Sm,s.updateProjectAttachment=cg,s.updateProjectAttachments=_m,s.updateProjectFile=zn,s.updateProjectFiles=og,s.updateProjects=Sg,s.updateTeam=up,s.updateTeamMembership=Og,s.updateTeamMemberships=_g,s.updateTeams=Eg,s.updateUser=VT,s.updateUsers=ET,s.useSelectorBuilder=Cg,s.userReducer=Zh,s.userSlice=Sn,s.versioningReducer=mp,s.versioningSlice=hp,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core functionality for Overmap",
4
4
  "author": "Wôrdn Inc.",
5
5
  "license": "UNLICENSED",
6
- "version": "1.0.78-bulk-project-access.1",
6
+ "version": "1.0.78-bulk-project-access.2",
7
7
  "type": "module",
8
8
  "main": "dist/overmap-core.umd.cjs",
9
9
  "module": "dist/overmap-core.js",