import{d as r,o as c,H as u,b as p,et as f,f as g,u as b,af as w}from"./outputWidgets.52de64cd.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="c598874b-8f6b-45bd-a0e4-de0639494f34",s._sentryDebugIdIdentifier="sentry-dbid-c598874b-8f6b-45bd-a0e4-de0639494f34")}catch{}})();class y{async list(t){const a=new URLSearchParams({stage:t});return await(await fetch(`/_editor/api/stage_runs?${a}`)).json()}}const h=new y;class l{constructor(t){this.dto=t}static async list(t){return(await h.list(t)).map(o=>new l(o))}get id(){return this.dto.id}get data(){return this.dto.data}get assignee(){return this.dto.assignee}get stage(){return this.dto.stage}get status(){return this.dto.status}}const S=r({__name:"StageRunSelector",props:{path:{},optional:{type:Boolean},disabled:{type:Boolean}},emits:["select"],setup(s,{emit:t}){const a=s;c(async()=>{const i=await l.list(a.path);n.options=i.filter(e=>e.status==="waiting").map(e=>({value:e.id,label:e.id.split("-")[0]}))});const o=i=>{t("select",i)},n=u({options:[],loading:!1});return(i,e)=>(p(),f("div",null,[g(b(w),{value:n.stageRunId,"onUpdate:value":e[0]||(e[0]=d=>n.stageRunId=d),"filter-option":"","allow-clear":a.optional,style:{width:"100%"},placeholder:"Select task instance",options:n.options,disabled:a.disabled,"not-found-content":"There are no waiting task instances",onSelect:e[1]||(e[1]=d=>o(d))},null,8,["value","allow-clear","options","disabled"])]))}});export{l as S,S as _};
//# sourceMappingURL=StageRunSelector.vue_vue_type_script_setup_true_lang.6f54e569.js.map
