import{E as e,G as a,d as t,H as l,I as o,K as n,c1 as r,l as u,aN as s,M as i,r as d,$ as p,m as v,c,q as b,n as m,w as h,y as _,x as f,z as y,v as g,c2 as x,i as w}from"./main-DxBfl9jt.js";import{u as k,k as z}from"./index-C7026UIK.js";import{r as j}from"./verify-jiRkeBsk.js";import{u as C}from"./index-BVkzzSq5.js";import"./index-BVih7gfm.js";import"./test-BCfkrViE.js";import"./useStore-mdB8rUuJ.js";const R=e("input-group-label","\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n box-sizing: border-box;\n padding: 0 12px;\n display: inline-block;\n border-radius: var(--n-border-radius);\n background-color: var(--n-group-label-color);\n color: var(--n-group-label-text-color);\n font-size: var(--n-font-size);\n line-height: var(--n-height);\n height: var(--n-height);\n flex-shrink: 0;\n white-space: nowrap;\n transition: \n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n",[a("border","\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n border-radius: inherit;\n border: var(--n-group-label-border);\n transition: border-color .3s var(--n-bezier);\n ")]),B=t({name:"InputGroupLabel",props:Object.assign(Object.assign({},n.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),setup(e){const{mergedBorderedRef:a,mergedClsPrefixRef:t,inlineThemeDisabled:l}=o(e),d=n("Input","-input-group-label",R,r,e,t),p=u((()=>{const{size:a}=e,{common:{cubicBezierEaseInOut:t},self:{groupLabelColor:l,borderRadius:o,groupLabelTextColor:n,lineHeight:r,groupLabelBorder:u,[s("fontSize",a)]:i,[s("height",a)]:p}}=d.value;return{"--n-bezier":t,"--n-group-label-color":l,"--n-group-label-border":u,"--n-border-radius":o,"--n-group-label-text-color":n,"--n-font-size":i,"--n-line-height":r,"--n-height":p}})),v=l?i("input-group-label",u((()=>e.size[0])),p,e):void 0;return{mergedClsPrefix:t,mergedBordered:a,cssVars:l?void 0:p,themeClass:null==v?void 0:v.themeClass,onRender:null==v?void 0:v.onRender}},render(){var e,a,t;const{mergedClsPrefix:o}=this;return null===(e=this.onRender)||void 0===e||e.call(this),l("div",{class:[`${o}-input-group-label`,this.themeClass],style:this.cssVars},null===(t=(a=this.$slots).default)||void 0===t?void 0:t.call(a),this.mergedBordered?l("div",{class:`${o}-input-group-label__border`}):null)}});function M(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!w(e)}const O=t({name:"StartNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{exec_type:"auto"}})}},setup(e){const{updateNodeConfig:a,isRefreshNode:t}=k(),{confirm:l}=y(),{handleError:o}=C(),{useFormRadio:n,useFormCustom:r}=v(),s=d(z(e.node.config)),i=[{label:p("t_2_1744875938555"),value:"day"},{label:p("t_0_1744942117992"),value:"week"},{label:p("t_3_1744875938310"),value:"month"}],w=[{label:p("t_1_1744942116527"),value:1},{label:p("t_2_1744942117890"),value:2},{label:p("t_3_1744942117885"),value:3},{label:p("t_4_1744942117738"),value:4},{label:p("t_5_1744942117167"),value:5},{label:p("t_6_1744942117815"),value:6},{label:p("t_7_1744942117862"),value:0}],R={day:{exec_type:"auto",type:"day",hour:1,minute:0},week:{exec_type:"auto",type:"week",hour:1,minute:0,week:1},month:{exec_type:"auto",type:"month",hour:1,minute:0,month:1}},O=(e,a,t,l)=>c(x,null,{default:()=>[c(g,{value:e,onUpdateValue:e=>{null!==e&&a(e)},max:t,min:0,showButton:!1,class:"w-full"},null),c(B,null,M(l)?l:{default:()=>[l]})]}),S=u((()=>{const e=[];return"auto"===s.value.exec_type&&e.push(r((()=>{let e,a;return c(h,{cols:24,xGap:24},{default:()=>[c(b,{label:p("t_2_1744879616413"),span:8,showRequireMark:!0,path:"type"},{default:()=>[c(m,{class:"w-full",options:i,value:s.value.type,"onUpdate:value":e=>s.value.type=e},null)]}),"day"!==s.value.type&&c(b,{span:5,path:"week"===s.value.type?"week":"month"},{default:()=>["week"===s.value.type?c(m,{value:s.value.week,onUpdateValue:e=>{"number"==typeof e&&(s.value.week=e)},options:w},null):O(s.value.month||0,(e=>s.value.month=e),31,p("t_29_1744958838904"))]}),c(b,{span:"day"===s.value.type?7:5,path:"hour"},M(e=O(s.value.hour||0,(e=>s.value.hour=e),23,p("t_5_1744879615277")))?e:{default:()=>[e]}),c(b,{span:"day"===s.value.type?7:5,path:"minute"},M(a=O(s.value.minute||0,(e=>s.value.minute=e),59,p("t_3_1744879615723")))?a:{default:()=>[a]})]})}))),[n(p("t_30_1745735764748"),"exec_type",[{label:p("t_4_1744875940750"),value:"auto"},{label:p("t_5_1744875940010"),value:"manual"}]),...e]})),{component:V,data:I,example:L}=_({defaultValue:s,config:S,rules:j}),N=e=>{let a={...e};if("manual"===a.exec_type){const e=Math.floor(6*Math.random())+1,t=5*Math.floor(12*Math.random());a={...a,hour:e,minute:t},s.value=a}};return f((()=>s.value.exec_type),(e=>{"auto"===e?N(R.day):"manual"===e&&N({exec_type:"manual"})})),f((()=>s.value.type),(e=>{e&&"auto"===s.value.exec_type&&N(R[e])})),l((async l=>{var n;try{await(null==(n=L.value)?void 0:n.validate()),a(e.node.id,I.value),t.value=e.node.id,l()}catch(r){o(r)}})),()=>c("div",{class:"apply-node-drawer"},[c(V,{labelPlacement:"top"},null)])}});export{O as default};