import{E as e,F as t,D as n,G as a,bz as l,aj as r,d as o,H as i,aW as s,aY as c,I as d,aM as u,K as p,bA as v,O as _,W as f,bB as h,aI as b,bC as m,ae as g,bD as y,bE as x,A as z,a$ as w,l as C,aN as k,M as S,ai as $,_ as j,a0 as I,a1 as N,a as P,f as R,bF as U,bG as B,$ as F,r as O,m as A,c as T,a5 as V,p as D,y as E,o as M,t as H,bH as L,Y as W,B as q,an as G,i as Y}from"./main-_YC_VKXp.js";import{u as K}from"./index-CfvcGIZn.js";import{u as J,k as Q}from"./index-om8gqXR9.js";import{S as X}from"./index-B4eCK1Vg.js";import{D as Z}from"./index-B5gc07tN.js";import{r as ee}from"./verify-D4tLpEQV.js";import{n as te}from"./utils-CRt-4gJj.js";import{a as ne}from"./text-B3dBNZHq.js";import{N as ae,a as le}from"./Tabs-mOLosYrf.js";import"./test-ewKHOpi5.js";import"./useStore-DPijp5DV.js";import"./useStore-nSggliRA.js";import"./setting-BMEV_MFa.js";import"./index-DhckRLAl.js";import"./index-C6bi-oGn.js";import"./business-BHFtjiXL.js";import"./throttle-By-0aq0z.js";const re=e("steps","\n width: 100%;\n display: flex;\n",[e("step","\n position: relative;\n display: flex;\n flex: 1;\n ",[t("disabled","cursor: not-allowed"),t("clickable","\n cursor: pointer;\n "),n("&:last-child",[e("step-splitor","display: none;")])]),e("step-splitor","\n background-color: var(--n-splitor-color);\n margin-top: calc(var(--n-step-header-font-size) / 2);\n height: 1px;\n flex: 1;\n align-self: flex-start;\n margin-left: 12px;\n margin-right: 12px;\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n "),e("step-content","flex: 1;",[e("step-content-header","\n color: var(--n-header-text-color);\n margin-top: calc(var(--n-indicator-size) / 2 - var(--n-step-header-font-size) / 2);\n line-height: var(--n-step-header-font-size);\n font-size: var(--n-step-header-font-size);\n position: relative;\n display: flex;\n font-weight: var(--n-step-header-font-weight);\n margin-left: 9px;\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n ",[a("title","\n white-space: nowrap;\n flex: 0;\n ")]),a("description","\n color: var(--n-description-text-color);\n margin-top: 12px;\n margin-left: 9px;\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n ")]),e("step-indicator","\n background-color: var(--n-indicator-color);\n box-shadow: 0 0 0 1px var(--n-indicator-border-color);\n height: var(--n-indicator-size);\n width: var(--n-indicator-size);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n ",[e("step-indicator-slot","\n position: relative;\n width: var(--n-indicator-icon-size);\n height: var(--n-indicator-icon-size);\n font-size: var(--n-indicator-icon-size);\n line-height: var(--n-indicator-icon-size);\n ",[a("index","\n display: inline-block;\n text-align: center;\n position: absolute;\n left: 0;\n top: 0;\n white-space: nowrap;\n font-size: var(--n-indicator-index-font-size);\n width: var(--n-indicator-icon-size);\n height: var(--n-indicator-icon-size);\n line-height: var(--n-indicator-icon-size);\n color: var(--n-indicator-text-color);\n transition: color .3s var(--n-bezier);\n ",[l()]),e("icon","\n color: var(--n-indicator-text-color);\n transition: color .3s var(--n-bezier);\n ",[l()]),e("base-icon","\n color: var(--n-indicator-text-color);\n transition: color .3s var(--n-bezier);\n ",[l()])])]),t("vertical","flex-direction: column;",[r("show-description",[n(">",[e("step","padding-bottom: 8px;")])]),n(">",[e("step","margin-bottom: 16px;",[n("&:last-child","margin-bottom: 0;"),n(">",[e("step-indicator",[n(">",[e("step-splitor","\n position: absolute;\n bottom: -8px;\n width: 1px;\n margin: 0 !important;\n left: calc(var(--n-indicator-size) / 2);\n height: calc(100% - var(--n-indicator-size));\n ")])]),e("step-content",[a("description","margin-top: 8px;")])])])])])]);function oe(e){return e.map(((e,t)=>function(e,t){return"object"!=typeof e||null===e||Array.isArray(e)?null:(e.props||(e.props={}),e.props.internalIndex=t+1,e)}(e,t)))}const ie=Object.assign(Object.assign({},p.props),{current:Number,status:{type:String,default:"process"},size:{type:String,default:"medium"},vertical:Boolean,"onUpdate:current":[Function,Array],onUpdateCurrent:[Function,Array]}),se=_("n-steps"),ce=o({name:"Steps",props:ie,slots:Object,setup(e,{slots:t}){const{mergedClsPrefixRef:n,mergedRtlRef:a}=d(e),l=u("Steps",a,n),r=p("Steps","-steps",re,v,e,n);return f(se,{props:e,mergedThemeRef:r,mergedClsPrefixRef:n,stepsSlots:t}),{mergedClsPrefix:n,rtlEnabled:l}},render(){const{mergedClsPrefix:e}=this;return i("div",{class:[`${e}-steps`,this.rtlEnabled&&`${e}-steps--rtl`,this.vertical&&`${e}-steps--vertical`]},oe(s(c(this))))}}),de=o({name:"Step",props:{status:String,title:String,description:String,disabled:Boolean,internalIndex:{type:Number,default:0}},slots:Object,setup(e){const t=z(se,null);t||w("step","`n-step` must be placed inside `n-steps`.");const{inlineThemeDisabled:n}=d(),{props:a,mergedThemeRef:l,mergedClsPrefixRef:r,stepsSlots:o}=t,i=C((()=>a.vertical)),s=C((()=>{const{status:t}=e;if(t)return t;{const{internalIndex:t}=e,{current:n}=a;if(void 0===n)return"process";if(tn)return"wait"}return"process"})),c=C((()=>{const{value:e}=s,{size:t}=a,{common:{cubicBezierEaseInOut:n},self:{stepHeaderFontWeight:r,[k("stepHeaderFontSize",t)]:o,[k("indicatorIndexFontSize",t)]:i,[k("indicatorSize",t)]:c,[k("indicatorIconSize",t)]:d,[k("indicatorTextColor",e)]:u,[k("indicatorBorderColor",e)]:p,[k("headerTextColor",e)]:v,[k("splitorColor",e)]:_,[k("indicatorColor",e)]:f,[k("descriptionTextColor",e)]:h}}=l.value;return{"--n-bezier":n,"--n-description-text-color":h,"--n-header-text-color":v,"--n-indicator-border-color":p,"--n-indicator-color":f,"--n-indicator-icon-size":d,"--n-indicator-index-font-size":i,"--n-indicator-size":c,"--n-indicator-text-color":u,"--n-splitor-color":_,"--n-step-header-font-size":o,"--n-step-header-font-weight":r}})),u=n?S("step",C((()=>{const{value:e}=s,{size:t}=a;return`${e[0]}${t[0]}`})),c,a):void 0,p=C((()=>{if(e.disabled)return;const{onUpdateCurrent:t,"onUpdate:current":n}=a;return t||n?()=>{t&&$(t,e.internalIndex),n&&$(n,e.internalIndex)}:void 0}));return{stepsSlots:o,mergedClsPrefix:r,vertical:i,mergedStatus:s,handleStepClick:p,cssVars:n?void 0:c,themeClass:null==u?void 0:u.themeClass,onRender:null==u?void 0:u.onRender}},render(){const{mergedClsPrefix:e,onRender:t,handleStepClick:n,disabled:a}=this,l=h(this.$slots.default,(t=>{const n=t||this.description;return n?i("div",{class:`${e}-step-content__description`},n):null}));return null==t||t(),i("div",{class:[`${e}-step`,a&&`${e}-step--disabled`,!a&&n&&`${e}-step--clickable`,this.themeClass,l&&`${e}-step--show-description`,`${e}-step--${this.mergedStatus}-status`],style:this.cssVars,onClick:n},i("div",{class:`${e}-step-indicator`},i("div",{class:`${e}-step-indicator-slot`},i(m,null,{default:()=>h(this.$slots.icon,(t=>{const{mergedStatus:n,stepsSlots:a}=this;return"finish"!==n&&"error"!==n?t||i("div",{key:this.internalIndex,class:`${e}-step-indicator-slot__index`},this.internalIndex):"finish"===n?i(g,{clsPrefix:e,key:"finish"},{default:()=>b(a["finish-icon"],(()=>[i(y,null)]))}):"error"===n?i(g,{clsPrefix:e,key:"error"},{default:()=>b(a["error-icon"],(()=>[i(x,null)]))}):null}))})),this.vertical?i("div",{class:`${e}-step-splitor`}):null),i("div",{class:`${e}-step-content`},i("div",{class:`${e}-step-content-header`},i("div",{class:`${e}-step-content-header__title`},b(this.$slots.title,(()=>[this.title]))),this.vertical?null:i("div",{class:`${e}-step-splitor`})),l))}}),ue={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},pe=o({name:"SearchOutlined",render:function(e,t){return I(),j("svg",ue,t[0]||(t[0]=[N("path",{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1c-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z",fill:"currentColor"},null,-1)]))}}),ve="_configContainer_1yoz7_4",_e="_leftPanel_1yoz7_9",fe="_rightPanel_1yoz7_15",he="_searchBar_1yoz7_20",be="_cardContainer_1yoz7_25",me="_optionCard_1yoz7_31",ge="_optionCardSelected_1yoz7_36",ye="_cardContent_1yoz7_62",xe="_icon_1yoz7_67",ze="_iconSelected_1yoz7_71",we="_footer_1yoz7_76",Ce="_footerButton_1yoz7_80",ke="_container_1yoz7_85",Se="_formContainer_1yoz7_90";function $e(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Y(e)}const je=o({name:"DeployNodeDrawer",props:{node:{type:Object,default:()=>({id:"",inputs:[],config:{provider:"",provider_id:"",inputs:{fromNodeId:"",name:""},skip:1}})}},setup(e){const{updateNode:t,updateNodeConfig:n,findApplyUploadNodesUp:a,isRefreshNode:l}=J(),{useFormInput:r,useFormTextarea:o,useFormSelect:i}=A(),s=P(["primaryColor","borderColor"]),{handleError:c}=K(),d=R(),u=U(),p=B(),v=[{label:F("t_6_1747271296994"),value:"localhost",category:"host",icon:"ssh"},{label:F("t_5_1744958839222"),value:"ssh",category:"host",icon:"ssh"},{label:F("t_10_1745735765165"),value:"btpanel",category:"btpanel",icon:"btpanel"},{label:F("t_11_1745735766456"),value:"btpanel-site",category:"btpanel",icon:"btpanel"},{label:F("t_0_1747215751189"),value:"btwaf-site",category:"btpanel",icon:"btpanel"},{label:F("t_0_1747367069267"),value:"btpanel-dockersite",category:"btpanel",icon:"btpanel"},{label:F("t_12_1745735765571"),value:"1panel",category:"1panel",icon:"1panel"},{label:F("t_13_1745735766084"),value:"1panel-site",category:"1panel",icon:"1panel"},{label:F("t_14_1745735766121"),value:"tencentcloud-cdn",category:"tencentcloud",icon:"tencentcloud"},{label:F("t_15_1745735768976"),value:"tencentcloud-cos",category:"tencentcloud",icon:"tencentcloud"},{label:F("t_16_1745735766712"),value:"aliyun-cdn",category:"aliyun",icon:"aliyun"},{label:F("t_2_1746697487164"),value:"aliyun-oss",category:"aliyun",icon:"aliyun"},{label:F("t_0_1747298114839"),value:"safeline-site",category:"safeline",icon:"safeline"},{label:F("t_1_1747298114192"),value:"safeline-panel",category:"safeline",icon:"safeline"}],_=O([]),f=O(1),h=O(!0),b=O("process"),m=O("all"),g=O(""),y=O(Q(e.node.config)),x=O([{label:F("t_6_1747271296994"),value:"localhost"}]),z=C((()=>{var e;return y.value.provider?F("t_4_1746858917773")+":"+(null==(e=v.find((e=>e.value===y.value.provider)))?void 0:e.label):F("t_19_1745735766810")})),w=C((()=>{let e=v;if("all"!==m.value&&(e=e.filter((e=>e.category===m.value))),g.value){const t=g.value.toLowerCase();e=e.filter((e=>e.label.toLowerCase().includes(t)||e.value.toLowerCase().includes(t)))}return e})),k=C((()=>{const e=[];switch(e.push("localhost"!==y.value.provider?{type:"custom",render:()=>T(Z,{type:y.value.provider,path:"provider_id",value:y.value.provider_id,"onUpdate:value":e=>{y.value.provider_id=e.value}},null)}:i(F("t_0_1746754500246"),"provider",x.value,{disabled:!0}),i(F("t_1_1745748290291"),"inputs.fromNodeId",_.value,{onUpdateValue:(e,t)=>{y.value.inputs.fromNodeId=e,y.value.inputs.name=null==t?void 0:t.label}})),y.value.provider){case"localhost":case"ssh":e.push(r(F("t_1_1747280813656"),"certPath",{placeholder:F("t_30_1746667591892"),allowInput:te}),r(F("t_2_1747280811593"),"keyPath",{placeholder:F("t_31_1746667593074"),allowInput:te}),o(F("t_3_1747280812067"),"beforeCmd",{placeholder:F("t_21_1745735769154"),rows:2},{showRequireMark:!1}),o(F("t_4_1747280811462"),"afterCmd",{placeholder:F("t_22_1745735767366"),rows:2},{showRequireMark:!1}));break;case"btwaf-site":case"btpanel-site":case"btpanel-dockersite":case"safeline-site":e.push(r(F("t_0_1747296173751"),"siteName",{placeholder:F("t_1_1747296175494"),allowInput:te}));break;case"1panel-site":e.push(r(F("t_6_1747280809615"),"site_id",{placeholder:F("t_24_1745735766826"),allowInput:te}));break;case"tencentcloud-cdn":case"aliyun-cdn":e.push(r(F("t_17_1745227838561"),"domain",{placeholder:F("t_0_1744958839535"),allowInput:te}));break;case"tencentcloud-cos":case"aliyun-oss":e.push(r(F("t_17_1745227838561"),"domain",{placeholder:F("t_0_1744958839535"),allowInput:te})),e.push(r(F("t_7_1747280808936"),"region",{placeholder:F("t_25_1745735766651"),allowInput:te})),e.push(r(F("t_8_1747280809382"),"bucket",{placeholder:F("t_26_1745735767144"),allowInput:te}))}return e.push({type:"custom",render:()=>{let e,t;return T(D,{label:F("t_9_1747280810169"),path:"skip"},{default:()=>[T(ne,null,$e(e=F("t_10_1747280816952"))?e:{default:()=>[e]}),T(V,{value:y.value.skip,"onUpdate:value":e=>y.value.skip=e,checkedValue:1,uncheckedValue:0,class:"mx-[.5rem] "},{checked:()=>F("t_11_1747280809178"),unchecked:()=>F("t_12_1747280809893")}),T(ne,null,$e(t=F("t_13_1747280810369"))?t:{default:()=>[t]})]})}}),e})),S=async()=>{var t,n,l;if(!y.value.provider)return d.error(F("t_0_1746858920894"));"localhost"===y.value.provider?delete y.value.provider_id:y.value.provider_id=e.node.config.provider_id,_.value=a(e.node.id).map((e=>({label:e.name,value:e.id}))),_.value.length?(null==(t=y.value.inputs)?void 0:t.fromNodeId)||(y.value.inputs={name:(null==(n=_.value[0])?void 0:n.label)||"",fromNodeId:(null==(l=_.value[0])?void 0:l.value)||""}):d.warning(F("t_3_1745748298161")),f.value++,h.value=!1},$=()=>{f.value--,h.value=!0,y.value.provider_id="",y.value.provider=""},{component:j,example:I}=E({config:k,defaultValue:y,rules:ee}),N=async()=>{var a;try{await(null==(a=I.value)?void 0:a.validate());const r=y.value,o=r.inputs;n(e.node.id,{...r}),t(e.node.id,{inputs:[o]},!1),l.value=e.node.id,p()}catch(r){c(r)}};return M((()=>{u.value.footer=!1,u.value.area=[850,600],y.value.provider&&(e.node.inputs&&(y.value.inputs=e.node.inputs[0]),S())})),()=>{let e,t;return T("div",{class:ke,style:s.value},[T(ce,{size:"small",current:f.value,status:b.value},{default:()=>[T(de,{title:F("t_28_1745735766626"),description:z.value},null),T(de,{title:F("t_29_1745735768933"),description:F("t_2_1745738969878")},null)]}),1===f.value&&T("div",{class:ve},[T("div",{class:_e},[T(ae,{type:"bar",placement:"left",value:m.value,onUpdateValue:e=>m.value=e},{default:()=>[T(le,{name:"all",tab:F("t_7_1747271292060")},null),T(le,{name:"host",tab:F("t_1_1745833931535")},null),T(le,{name:"btpanel",tab:F("t_8_1747271290414")},null),T(le,{name:"1panel",tab:F("t_9_1747271284765")},null),T(le,{name:"tencentcloud",tab:F("t_3_1747019616129")},null),T(le,{name:"aliyun",tab:F("t_2_1747019616224")},null),T(le,{name:"safeline",tab:F("t_1_1747298114192")},null)]})]),T("div",{class:fe},[T("div",{class:he},[T(H,{value:g.value,onUpdateValue:e=>g.value=e,placeholder:F("t_14_1747280811231"),clearable:!0},{suffix:()=>T("div",{class:"flex items-center"},[T(pe,{class:"text-[var(--text-color-3)] w-[1.6rem] cursor-pointer font-bold"},null)])})]),T(L,{class:"!my-[1rem]"},null),T("div",{class:be},[w.value.map((e=>T("div",{key:e.value,class:`${me} ${y.value.provider===e.value?ge:""}`,onClick:()=>{y.value.provider=e.value}},[T("div",{class:ye},[T(X,{icon:`resources-${e.icon.replace(/-[a-z]+$/,"")}`,size:"2rem",class:`${xe} ${y.value.provider===e.value?ze:""}`},null),T(ne,{type:y.value.provider===e.value?"primary":"default"},{default:()=>[e.label]})])])))])])]),2===f.value&&T(W,{class:Se},{default:()=>[T(j,{labelPlacement:"top"},null)]}),T("div",{class:we},[T(q,{class:Ce,onClick:p},$e(e=F("t_4_1744870861589"))?e:{default:()=>[e]}),T(G,{trigger:"hover",disabled:!!y.value.provider},{default:()=>[h.value?F("t_4_1745765868807"):null],trigger:()=>T(q,{type:h.value?"primary":"default",class:Ce,disabled:!y.value.provider,onClick:h.value?S:$},{default:()=>[h.value?F("t_27_1745735764546"):F("t_0_1745738961258")]})}),!h.value&&T(q,{type:"primary",onClick:N},$e(t=F("t_1_1745738963744"))?t:{default:()=>[t]})])])}}});export{je as default};