var Q=Object.defineProperty;var n=(p,u)=>Q(p,"name",{value:u,configurable:!0});import{s as y,u as I}from"./vendor-vue-ByIfjd1d.js";import{H as N,s as P,ah as T}from"./vendor-primevue-RJTR6wkG.js";import{cm as g,e as V,d as w,r as E,F as W,v as z,B as F}from"./index-xLwXl4ov.js";import{g as H}from"./GraphView-BPbcCdVW.js";import{bq as S,E as s,k,l as b,c as B,d as h,A as _,br as l,b9 as K,p as L,q as C,e as R,u as j}from"./vendor-other-yzRpIrj2.js";import"./vendor-xterm-CWYFmgbN.js";import"./vendor-three-b7sMVVQK.js";import"./vendor-tiptap-DcddbIvp.js";import"./UserAvatar.vue_vue_type_script_setup_true_lang-D6k2s9ze.js";import"./nodeFilterUtil-D49mCu4H.js";import"./index-wE4B8JeX.js";import"./LazyImage.vue_vue_type_script_setup_true_lang-AaN0rnip.js";import"./keybindingService-C7gB1sJF.js";import"./serverConfigStore-CqEQuh1m.js";import"./WidgetInputNumber.vue_vue_type_script_setup_true_lang-Bk7jJg2H.js";import"./widgetPropFilter-CygYoMQt.js";import"./WidgetLayoutField.vue_vue_type_script_setup_true_lang-C1YhXoEw.js";import"./WidgetWithControl.vue_vue_type_script_setup_true_lang-DKOLlbKi.js";const A=["aria-label"],G=1,O=S({__name:"BatchCountEdit",setup(p){const u=g(),{batchCount:t}=y(u),f=V(),c=s(()=>f.get("Comfy.QueueButton.BatchCountLimit")),r=n(e=>{let o;if(e){const a=t.value-1;o=Math.min(a*2,c.value)}else{const a=t.value+1;o=Math.floor(a/2)}t.value=o},"handleClick");return(e,o)=>{const a=k("tooltip");return b((h(),B("div",{class:"batch-count","aria-label":e.$t("menu.batchCount")},[_(l(N),{modelValue:l(t),"onUpdate:modelValue":o[0]||(o[0]=v=>K(t)?t.value=v:null),class:"w-14",min:G,max:c.value,fluid:"","show-buttons":"",pt:{incrementButton:{class:"w-6",onmousedown:n(()=>{r(!0)},"onmousedown")},decrementButton:{class:"w-6",onmousedown:n(()=>{r(!1)},"onmousedown")}}},null,8,["modelValue","max","pt"])],8,A)),[[a,{value:e.$t("menu.batchCount"),showDelay:600},void 0,{bottom:!0}]])}}}),U=w(O,[["__scopeId","data-v-19217ad4"]]),J={class:"queue-button-group flex"},X=S({__name:"ComfyQueueButton",setup(p){const u=E(),{mode:t,batchCount:f}=y(g()),c=W(),r=s(()=>H(z.rootGraph,c.nodeDefsByName)),{t:e}=I(),o=s(()=>{const i={disabled:{key:"disabled",label:e("menu.run"),tooltip:e("menu.disabledTooltip"),command:n(()=>{t.value="disabled"},"command")},change:{key:"change",label:`${e("menu.run")} (${e("menu.onChange")})`,tooltip:e("menu.onChangeTooltip"),command:n(()=>{t.value="change"},"command")}};return i.instant={key:"instant",label:`${e("menu.run")} (${e("menu.instant")})`,tooltip:e("menu.instantTooltip"),command:n(()=>{t.value="instant"},"command")},i}),a=s(()=>o.value[t.value]||o.value.disabled),v=s(()=>Object.values(o.value)),q=s(()=>r.value?"icon-[lucide--triangle-alert]":u.shiftDown?"icon-[lucide--list-start]":t.value==="disabled"?"icon-[lucide--play]":t.value==="instant"?"icon-[lucide--fast-forward]":t.value==="change"?"icon-[lucide--step-forward]":"icon-[lucide--play]"),D=s(()=>r.value?e("menu.runWorkflowDisabled"):u.shiftDown?e("menu.runWorkflowFront"):e("menu.runWorkflow")),M=F(),$=n(async i=>{const m="shiftKey"in i&&i.shiftKey?"Comfy.QueuePromptFront":"Comfy.QueuePrompt";f.value>1,await M.execute(m,{metadata:{subscribe_to_run:!1,trigger_source:"button"}})},"queuePrompt");return(i,x)=>{const m=k("tooltip");return h(),B("div",J,[b((h(),L(l(T),{class:"comfyui-queue-button",label:String(a.value?.label??""),severity:"primary",size:"small",model:v.value,"data-testid":"queue-button",onClick:$},{icon:C(()=>[R("i",{class:j(q.value)},null,2)]),item:C(({item:d})=>[b(_(l(P),{label:String(d.label??""),icon:d.icon,severity:d.key===l(t)?"primary":"secondary",size:"small",text:""},null,8,["label","icon","severity"]),[[m,{value:d.tooltip,showDelay:600}]])]),_:1},8,["label","model"])),[[m,{value:D.value,showDelay:600},void 0,{bottom:!0}]]),_(U)])}}}),he=w(X,[["__scopeId","data-v-3bdf6466"]]);export{he as default};
//# sourceMappingURL=ComfyQueueButton-DWm1v-kr.js.map
