@overmap-ai/core 1.0.78-identifiers.2 → 1.0.78-identifiers.3

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