import{i as e,n as t}from"./rolldown-runtime-ConPGZeh.js";import{$n as n,Dr as r,H as i,Lr as a,Nn as o,Qn as s,Rr as c,Sr as l,Ur as u,V as d,Xn as f,Zn as ee,er as p,ii as m,ir as h,li as g,mt as _,oi as v,or as y,pt as b,rr as x}from"./vendor-primevue-D1-E3-0M.js";import{at as S,it as C}from"./vendor-other-CT05lTmi.js";import{i as w,r as T}from"./vendor-vue-W0uRz0qB.js";import{hn as E,mn as D}from"./api-DvJuMrZn.js";import{n as O,t as k}from"./Button-DXEyozJJ.js";import{Ja as A,ai as j,an as M,cn as N,gn as te,hn as ne,ln as re,on as P,oo as ie,ot as F,qa as I,si as L,so as R,st as z}from"./dialogService-DIdX_hbW.js";import{n as B,t as V}from"./_plugin-vue_export-helper-DrrwuIjt.js";import{n as H,t as U}from"./graphHasMissingNodes-Bb2IsTKW.js";var W,G,K,q=t((()=>{o(),T(),b(),I(),j(),W=[`aria-label`],G=1,K=y({__name:`BatchCountEdit`,setup(e){let{batchCount:t}=w(L()),n=A(),i=f(()=>n.get(`Comfy.QueueButton.BatchCountLimit`)),handleClick=e=>{let n;if(e){let e=t.value-1;n=Math.min(e*2,i.value)}else{let e=t.value+1;n=Math.floor(e/2)}t.value=n};return(e,n)=>{let a=r(`tooltip`);return c((l(),p(`div`,{class:`batch-count`,"aria-label":e.$t(`menu.batchCount`)},[h(m(_),{modelValue:m(t),"onUpdate:modelValue":n[0]||=e=>u(t)?t.value=e:null,class:`w-14`,min:G,max:i.value,fluid:``,"show-buttons":``,pt:{incrementButton:{class:`w-6`,onmousedown:()=>{handleClick(!0)}},decrementButton:{class:`w-6`,onmousedown:()=>{handleClick(!1)}}}},null,8,[`modelValue`,`max`,`pt`])],8,W)),[[a,{value:e.$t(`menu.batchCount`),showDelay:600},void 0,{bottom:!0}]])}}})})),J=t((()=>{})),Y,ae=t((()=>{q(),q(),J(),B(),Y=V(K,[[`__scopeId`,`data-v-19217ad4`]])})),X,Z,Q=t((()=>{o(),T(),d(),C(),O(),D(),M(),z(),ie(),N(),j(),ne(),H(),ae(),X={class:`queue-button-group flex`},Z=y({__name:`ComfyQueueButton`,setup(e){let t=te(),{mode:o,batchCount:u}=w(L()),d=re(),_=f(()=>U(F.rootGraph,d.nodeDefsByName)),{t:y}=S(),b=f(()=>{let e={disabled:{key:`disabled`,label:y(`menu.run`),tooltip:y(`menu.disabledTooltip`),command:()=>{o.value=`disabled`}},change:{key:`change`,label:`${y(`menu.run`)} (${y(`menu.onChange`)})`,tooltip:y(`menu.onChangeTooltip`),command:()=>{P()?.trackUiButtonClicked({button_id:`queue_mode_option_run_on_change_selected`}),o.value=`change`}}};return E||(e.instant={key:`instant`,label:`${y(`menu.run`)} (${y(`menu.instant`)})`,tooltip:y(`menu.instantTooltip`),command:()=>{P()?.trackUiButtonClicked({button_id:`queue_mode_option_run_instant_selected`}),o.value=`instant`}}),e}),C=f(()=>b.value[o.value]||b.value.disabled),T=f(()=>Object.values(b.value)),D=f(()=>_.value?`icon-[lucide--triangle-alert]`:t.shiftDown?`icon-[lucide--list-start]`:o.value===`disabled`?`icon-[lucide--play]`:o.value===`instant`?`icon-[lucide--fast-forward]`:o.value===`change`?`icon-[lucide--step-forward]`:`icon-[lucide--play]`),O=f(()=>_.value?y(`menu.runWorkflowDisabled`):t.shiftDown?y(`menu.runWorkflowFront`):y(`menu.runWorkflow`)),A=R(),queuePrompt=async e=>{let t=`shiftKey`in e&&e.shiftKey?`Comfy.QueuePromptFront`:`Comfy.QueuePrompt`;u.value>1&&P()?.trackUiButtonClicked({button_id:`queue_run_multiple_batches_submitted`}),await A.execute(t,{metadata:{subscribe_to_run:!1,trigger_source:`button`}})};return(e,t)=>{let u=r(`tooltip`);return l(),p(`div`,X,[c((l(),s(m(i),{class:`comfyui-queue-button`,label:String(C.value?.label??``),severity:`primary`,size:`small`,model:T.value,"data-testid":`queue-button`,onClick:queuePrompt},{icon:a(()=>[ee(`i`,{class:v(D.value)},null,2)]),item:a(({item:e})=>[c((l(),s(k,{variant:e.key===m(o)?`primary`:`secondary`,size:`sm`,class:`w-full justify-start`},{default:a(()=>[e.icon?(l(),p(`i`,{key:0,class:v(e.icon)},null,2)):n(``,!0),x(` `+g(String(e.label??``)),1)]),_:2},1032,[`variant`])),[[u,{value:e.tooltip,showDelay:600}]])]),_:1},8,[`label`,`model`])),[[u,{value:O.value,showDelay:600},void 0,{bottom:!0}]]),h(Y)])}}})})),oe=t((()=>{})),$,se=t((()=>{Q(),Q(),oe(),B(),$=V(Z,[[`__scopeId`,`data-v-214102f7`]])}));export{se as n,$ as t};
//# sourceMappingURL=ComfyQueueButton-qHdLMXNu.js.map