import{l as r}from"./fetch.474b3c95.js";import{N as t}from"./vue-router.85c27f05.js";import{w as i}from"./metadata.a1d107ae.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[e]="939067f5-b4c4-4d23-a822-16fdcebe2a95",o._sentryDebugIdIdentifier="sentry-dbid-939067f5-b4c4-4d23-a822-16fdcebe2a95")}catch{}})();const l=i.stages.flatMap(o=>o.transitions.flatMap(e=>e.typeName)),c=t.object({type:t.enum(["forms","hooks","jobs","scripts","conditions","iterators"]),id:t.string(),title:t.string(),position:t.object({x:t.number(),y:t.number()}),props:t.object({path:t.string().nullable(),filename:t.string().nullable(),variableName:t.string().nullable(),itemName:t.string().nullable()})}),d=t.object({id:t.string(),type:t.enum(["forms:finished",...l]),sourceStageId:t.string(),targetStageId:t.string(),props:t.object({conditionValue:t.string().nullable()})}),s=t.object({stages:t.array(c),transitions:t.array(d)}),f={"Content-Type":"application/json"},b="abstra-run-id";class p{async load(){const e=await fetch("/_editor/api/workflows");if(e.ok){const a=await e.json();return s.parse(a)}else throw new Error("Failed to fetch initial data")}async update(e){const a=await fetch("/_editor/api/workflows",{method:"PUT",headers:f,body:JSON.stringify(e)});if(a.ok){const n=await a.json();return s.parse(n)}else throw new Error("Failed to update workflow")}}const y=new p;class g{constructor(e,a=r){this.authHeaders=e,this.fetch=a}get headers(){return{"Content-Type":"application/json",...this.authHeaders}}async load(){const e=await this.fetch("/_workflows",{headers:this.headers});if(e.ok){const a=await e.json();return s.parse(a)}else throw new Error("Failed to fetch initial data")}async update(e){throw new Error("not implemented")}}export{b as A,p as E,g as P,y as w};
//# sourceMappingURL=api.fff15498.js.map
