(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[270],{21712:function(t,n,e){"use strict";e.d(n,{iconButtonClasses:function(){return to.iconButtonClasses}});var s=e(80276);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}});var o=e(91990);e.o(o,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return o.iconButtonClasses}});var u=e(98745);e.o(u,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return u.iconButtonClasses}});var i=e(97351);e.o(i,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return i.iconButtonClasses}});var r=e(91763);e.o(r,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return r.iconButtonClasses}});var c=e(69275);e.o(c,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return c.iconButtonClasses}});var a=e(35760);e.o(a,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return a.iconButtonClasses}});var l=e(69214);e.o(l,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return l.iconButtonClasses}});var d=e(462);e.o(d,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return d.iconButtonClasses}});var f=e(15706);e.o(f,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return f.iconButtonClasses}});var C=e(30958);e.o(C,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return C.iconButtonClasses}});var B=e(50032);e.o(B,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return B.iconButtonClasses}});var v=e(67541);e.o(v,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return v.iconButtonClasses}});var p=e(65210);e.o(p,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return p.iconButtonClasses}});var k=e(11385);e.o(k,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return k.iconButtonClasses}});var m=e(68623);e.o(m,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return m.iconButtonClasses}});var g=e(66241);e.o(g,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return g.iconButtonClasses}});var w=e(16036);e.o(w,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return w.iconButtonClasses}});var h=e(14445);e.o(h,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return h.iconButtonClasses}});var x=e(42866);e.o(x,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return x.iconButtonClasses}});var b=e(21150);e.o(b,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return b.iconButtonClasses}});var I=e(83535);e.o(I,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return I.iconButtonClasses}});var M=e(73450);e.o(M,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return M.iconButtonClasses}});var N=e(37409);e.o(N,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return N.iconButtonClasses}});var y=e(88508);e.o(y,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return y.iconButtonClasses}});var j=e(71344);e.o(j,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return j.iconButtonClasses}});var S=e(41915);e.o(S,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return S.iconButtonClasses}});var Z=e(84618);e.o(Z,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return Z.iconButtonClasses}});var R=e(38453);e.o(R,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return R.iconButtonClasses}});var D=e(64364);e.o(D,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return D.iconButtonClasses}});var P=e(19223);e.o(P,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return P.iconButtonClasses}});var A=e(12591);e.o(A,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return A.iconButtonClasses}});var V=e(49351);e.o(V,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return V.iconButtonClasses}});var U=e(75138);e.o(U,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return U.iconButtonClasses}});var F=e(8609);e.o(F,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return F.iconButtonClasses}});var L=e(56210);e.o(L,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return L.iconButtonClasses}});var q=e(47216);e.o(q,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return q.iconButtonClasses}});var E=e(89479);e.o(E,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return E.iconButtonClasses}});var T=e(2921);e.o(T,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return T.iconButtonClasses}});var O=e(8694);e.o(O,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return O.iconButtonClasses}});var _=e(1313);e.o(_,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return _.iconButtonClasses}});var H=e(69560);e.o(H,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return H.iconButtonClasses}});var W=e(78034);e.o(W,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return W.iconButtonClasses}});var $=e(49790);e.o($,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return $.iconButtonClasses}});var G=e(15008);e.o(G,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return G.iconButtonClasses}});var J=e(91940);e.o(J,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return J.iconButtonClasses}});var z=e(98338);e.o(z,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return z.iconButtonClasses}});var K=e(73102);e.o(K,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return K.iconButtonClasses}});var X=e(68263);e.o(X,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return X.iconButtonClasses}});var Q=e(52358);e.o(Q,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return Q.iconButtonClasses}});var Y=e(55588);e.o(Y,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return Y.iconButtonClasses}});var tt=e(24565);e.o(tt,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return tt.iconButtonClasses}});var tn=e(2806);e.o(tn,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return tn.iconButtonClasses}});var te=e(33527);e.o(te,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return te.iconButtonClasses}});var ts=e(2540);e.o(ts,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return ts.iconButtonClasses}});var to=e(44525)},4053:function(){},84023:function(){},98745:function(t,n,e){"use strict";var s=e(84023);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},94908:function(){},97351:function(t,n,e){"use strict";var s=e(94908);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},84293:function(){},91763:function(t,n,e){"use strict";var s=e(84293);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},2541:function(){},69275:function(t,n,e){"use strict";var s=e(2541);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},65198:function(){},35760:function(t,n,e){"use strict";var s=e(65198);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},7713:function(){},69214:function(t,n,e){"use strict";var s=e(7713);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},2959:function(){},462:function(t,n,e){"use strict";var s=e(2959);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},2457:function(){},15706:function(t,n,e){"use strict";var s=e(2457);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},13857:function(){},30958:function(t,n,e){"use strict";var s=e(13857);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},55161:function(){},50032:function(t,n,e){"use strict";var s=e(55161);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},85079:function(){},67541:function(t,n,e){"use strict";var s=e(85079);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},53181:function(){},65210:function(t,n,e){"use strict";var s=e(53181);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},50835:function(){},11385:function(t,n,e){"use strict";var s=e(50835);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},57514:function(){},68623:function(t,n,e){"use strict";var s=e(57514);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},85212:function(){},66241:function(t,n,e){"use strict";var s=e(85212);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},45494:function(){},16036:function(t,n,e){"use strict";var s=e(45494);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},47147:function(){},14445:function(t,n,e){"use strict";var s=e(47147);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},42130:function(){},42866:function(t,n,e){"use strict";var s=e(42130);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}});var o=e(62188);e.o(o,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return o.iconButtonClasses}})},62188:function(){},7131:function(){},21150:function(t,n,e){"use strict";var s=e(7131);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},77590:function(){},83535:function(t,n,e){"use strict";var s=e(77590);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},9703:function(){},73450:function(t,n,e){"use strict";var s=e(9703);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},58351:function(){},37409:function(t,n,e){"use strict";var s=e(58351);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},4593:function(){},88508:function(t,n,e){"use strict";var s=e(4593);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},47761:function(){},71344:function(t,n,e){"use strict";var s=e(47761);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},71756:function(){},41915:function(t,n,e){"use strict";var s=e(71756);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},74424:function(){},84618:function(t,n,e){"use strict";var s=e(74424);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},61302:function(){},38453:function(t,n,e){"use strict";var s=e(61302);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},7142:function(){},64364:function(t,n,e){"use strict";var s=e(7142);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},19223:function(){},46871:function(){},12591:function(t,n,e){"use strict";var s=e(46871);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},86704:function(){},49351:function(t,n,e){"use strict";var s=e(86704);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},75138:function(){},58615:function(){},56210:function(t,n,e){"use strict";var s=e(58615);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},65069:function(){},47216:function(t,n,e){"use strict";var s=e(65069);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},36526:function(){},89479:function(t,n,e){"use strict";var s=e(36526);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},67705:function(){},2921:function(t,n,e){"use strict";var s=e(67705);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},47209:function(){},8694:function(t,n,e){"use strict";var s=e(47209);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},9266:function(){},1313:function(t,n,e){"use strict";var s=e(9266);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},47366:function(){},69560:function(t,n,e){"use strict";var s=e(47366);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},88725:function(){},78034:function(t,n,e){"use strict";var s=e(88725);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},49790:function(){},95253:function(){},15008:function(t,n,e){"use strict";var s=e(95253);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},5174:function(){},91940:function(t,n,e){"use strict";var s=e(5174);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},343:function(){},98338:function(t,n,e){"use strict";var s=e(343);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},62531:function(){},73102:function(t,n,e){"use strict";var s=e(62531);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},83565:function(){},68263:function(t,n,e){"use strict";var s=e(83565);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},6534:function(){},9340:function(){},52358:function(t,n,e){"use strict";var s=e(6534);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}});var o=e(9340);e.o(o,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return o.iconButtonClasses}})},21981:function(){},55588:function(t,n,e){"use strict";var s=e(21981);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},2806:function(){},33527:function(){},23013:function(){},2540:function(t,n,e){"use strict";var s=e(23013);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},44525:function(t,n,e){"use strict";e.d(n,{iconButtonClasses:function(){return s.Z}});var s=e(96239)},57438:function(){},16560:function(){},24565:function(t,n,e){"use strict";var s=e(57438);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}});var o=e(16560);e.o(o,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return o.iconButtonClasses}})},8609:function(){},80276:function(t,n,e){"use strict";var s=e(4053);e.o(s,"iconButtonClasses")&&e.d(n,{iconButtonClasses:function(){return s.iconButtonClasses}})},91990:function(){},39174:function(t,n,e){"use strict";var s=e(85893),o=e(5616),u=e(6010);let i="Decorator",r={ok:"".concat(i,"-ok"),warning:"".concat(i,"-warning"),error:"".concat(i,"-error"),off:"".concat(i,"-off")};n.Z=t=>{let{colour:n,sx:e,...i}=t;return(0,s.jsx)(o.Z,{...i,className:r[n],sx:{borderRadius:u.n_,height:"100%",width:"1.4em",["&.".concat(r.ok)]:{backgroundColor:u.Ej},["&.".concat(r.warning)]:{backgroundColor:u.Wd},["&.".concat(r.error)]:{backgroundColor:u.hM},["&.".concat(r.off)]:{backgroundColor:u.s7},...e}})}},69836:function(t,n,e){"use strict";var s=e(85893),o=e(43800),u=e(23795),i=e(6010),r=e(55238);n.Z=t=>{let{children:n,sx:e,...c}=t;return(0,s.jsx)(u.Z,{underline:"hover",variant:"subtitle1",...c,sx:{color:i.lD,textDecorationColor:i.s7,...e},children:(0,s.jsxs)(r.Z,{row:!0,children:[n,(0,s.jsx)(o.Z,{sx:{marginLeft:".3em"}})]})})}},7932:function(t,n,e){"use strict";e.d(n,{Z:function(){return _}});var s=e(85893),o=e(5616),u=e(2734),i=e(98396),r=e(21712),c=e(96540),a=e(27036),l=e(50594),d=e(8280),f=e(63488),C=e(73490),B=e(28951),v=e(67294),p=e(25934),k=e(98436),m=e(6010),g=e(5813),w=e(65939),h=e(54799),x=e(84154);let BriefNetworkInterface=t=>{let{isFloating:n,networkInterface:{networkInterfaceName:e},onClose:u,sx:i,...r}=t,c=n?{borderColor:m.s7,borderRadius:m.n_,borderStyle:"solid",borderWidth:"1px",backgroundColor:m.E5,padding:".6em 1.2em"}:{};return(0,s.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"row",alignItems:"center","& > :not(:first-child)":{marginLeft:".5em"},...c,...i},...r,children:[(0,s.jsx)(x.$_,{children:e}),u&&(0,s.jsx)(h.Z,{onClick:u,size:"small",sx:{color:m.s7},children:(0,s.jsx)(l.Z,{})})]})};BriefNetworkInterface.defaultProps={isFloating:!1,onClose:void 0};var b=e(39174),I=e(90948);let M=(0,I.ZP)(o.Z)(()=>({borderColor:m.s7,borderStyle:"dashed",borderWidth:"4px",display:"flex",flexDirection:"column",padding:".6em","& > :not(:first-child)":{marginTop:".3em"}}));var N=e(55238),y=e(83221),j=e(92917),S=e(21642),Z=e(55675),R=e(37260),D=e(64666),P=e(52886),A=e(10406),V=e(81796),U=e(50233);let F={ifaceNotApplied:"".concat("NetworkInitForm","-network-interface-not-applied")},L=[void 0,void 0],q={dnsCSV:"dns",gateway:"gateway",networkInterfaces:t=>"".concat(t,"Interface"),networkIPAddress:t=>"".concat(t,"IPAddress"),networkName:t=>"".concat(t,"Name"),networkSubnetMask:t=>"".concat(t,"SubnetMask"),networkSubnetConflict:t=>"".concat(t,"NetworkSubnetConflict")},E=Array.from({length:2},(t,n)=>n+1),T={bcn:{ip:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"10.20".concat(t,".").concat(n)},mask:"255.255.0.0"},ifn:{ip:()=>"",mask:""},mn:{ip:()=>"10.199.",mask:"255.255.0.0"},sn:{ip:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"10.10".concat(t,".").concat(n)},mask:"255.255.0.0"}},createInputTestPrefix=t=>"network".concat(t),createNetworkInput=function(){let{inputUUID:t=(0,p.Z)(),interfaces:n=[...L],ipAddress:e="",name:s,subnetMask:o="",type:u="",typeCount:i=0,...r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=s;return s||(c=g.default[u]&&i>0?"".concat(g.default[u]," ").concat(i):"Unknown Network"),{inputUUID:t,interfaces:n,ipAddress:e,name:c,subnetMask:o,type:u,typeCount:i,...r}},createNetworkInterfaceTableColumns=(t,n)=>[{align:"center",field:"",renderCell:e=>{var u;let{row:i}=e,{isApplied:r}=null!==(u=n[i.networkInterfaceUUID])&&void 0!==u&&u,c="grab",handleMouseDown=function(){for(var n=arguments.length,e=Array(n),s=0;s{let{row:{networkInterfaceState:n}={},value:e}=t;return(0,s.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"row","& > :not(:first-child)":{marginLeft:".5em"}},children:[(0,s.jsx)(b.Z,{colour:"up"===n?"ok":"off",sx:{height:"auto"}}),(0,s.jsx)(x.$_,{children:e})]})}},{field:"networkInterfaceMACAddress",flex:1,headerName:"MAC",renderCell:t=>{let{value:n}=t;return(0,s.jsx)(x.$_,{text:n})}},{field:"networkInterfaceState",flex:1,headerName:"State",renderCell:t=>{let{value:n}=t,e=String(n);return(0,s.jsx)(x.KI,{text:"".concat(e.charAt(0).toUpperCase()).concat(e.substring(1))})}},{field:"networkInterfaceSpeed",flex:1,headerName:"Speed",renderCell:t=>{let{value:n}=t;return(0,s.jsx)(x.KI,{text:"".concat(parseFloat(n).toLocaleString()," Mbps")})}},{field:"networkInterfaceOrder",flex:1,headerName:"Order"}],NetworkForm=t=>{let{allowMigrationNetwork:n,createDropMouseUpHandler:e,getNetworkTypeCount:r,hostDetail:{hostType:a,sequence:d}={},networkIndex:f,networkInput:C,networkInterfaceCount:B,networkInterfaceInputMap:p,removeNetwork:k,setMessageRe:w,setNetworkInputs:h,setNetworkInterfaceInputMap:b,testInput:I,testInputToToggleSubmitDisabled:N}=t,S=(0,u.Z)(),D=(0,i.Z)(S.breakpoints.up("md")),A=(0,i.Z)(S.breakpoints.up("lg")),V=(0,v.useRef)({}),U=(0,v.useRef)({}),{inputUUID:F,interfaces:L,ipAddress:O,isRequired:_,subnetMask:H,type:W,typeCount:$}=C,G=(0,v.useMemo)(()=>createInputTestPrefix(F),[F]),J=(0,v.useMemo)(()=>q.networkInterfaces(G),[G]),z=(0,v.useMemo)(()=>q.networkIPAddress(G),[G]),K=(0,v.useMemo)(()=>q.networkSubnetMask(G),[G]),X=(0,v.useMemo)(()=>q.networkSubnetConflict(G),[G]),Q=(0,v.useMemo)(()=>"node"===a,[a]),Y=(0,v.useMemo)(()=>!Q&&B<=2?[1]:E,[Q,B]),tt=(0,v.useMemo)(()=>{let{bcn:t,ifn:e,mn:s,sn:o}=g.default;return Q&&B>=8&&(n||"mn"===W)?{bcn:t,ifn:e,mn:s,sn:o}:{bcn:t,ifn:e,sn:o}},[n,Q,B,W]),tn=(0,v.useCallback)((t,n,e)=>{let{current:{getIsChangedByUser:s,setValue:o}}=V,{current:{getIsChangedByUser:u,setValue:i}}=U;(null==s?void 0:s.call(null))||(t.ipAddress=n,null==o||o.call(null,n)),(null==u?void 0:u.call(null))||(t.subnetMask=e,null==i||i.call(null,e))},[]);return(0,v.useEffect)(()=>{var t,n;if("striker"!==a||"ifn"===W)return;let e=null===(t=V.current.getIsChangedByUser)||void 0===t?void 0:t.call(null);!e&&Number(d)&&(null===(n=V.current.setValue)||void 0===n||n.call(null,O.replace(/^((?:\d+\.){3})\d*$/,"$1".concat(d))))},[a,O,d,W]),(0,v.useEffect)(()=>{let{ipAddressInputRef:t,subnetMaskInputRef:n}=C;(t!==V||n!==U)&&(C.ipAddressInputRef=V,C.subnetMaskInputRef=U,h(t=>[...t]))},[C,h]),(0,s.jsxs)(R.Lg,{children:[(0,s.jsxs)(R.CH,{children:[(0,s.jsx)(P.Z,{id:"network-".concat(F,"-name"),isReadOnly:_,inputLabelProps:{isNotifyRequired:!0},label:"Network name",selectItems:Object.entries(tt).map(t=>{let[n,e]=t,s=r(n,{lastIndex:f});n!==W&&(s+=1);let o="".concat(e," ").concat(s);return{value:n,displayValue:o}}),selectProps:{onChange:t=>{let{target:{value:n}}=t,e=String(n);C.type=e;let s=r(e,{lastIndex:f});C.typeCount=s,C.name="".concat(g.default[e]," ").concat(s);let o=T[e];if(o){let t;let{ip:n,mask:u}=o;"striker"===a&&"bcn"===e&&(t="4."),tn(C,n(s,t),u)}h(t=>[...t])},renderValue:A?void 0:t=>"".concat(String(t).toUpperCase()," ").concat($),value:W}}),!_&&(0,s.jsx)(y.Z,{onClick:()=>{k(f)},sx:{padding:".2em",position:"absolute",right:"-9px",top:"-4px"},children:(0,s.jsx)(l.Z,{fontSize:"small"})})]}),(0,s.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column",margin:".6em","& > :not(:first-child)":{marginTop:"1em"}},children:[Y.map(t=>{let n="Link ".concat(t),u=t-1,i=L[u],{networkInterfaceUUID:r=""}=null!=i?i:{},a=D?(0,s.jsx)(x.Ac,{text:"Drop to add interface."}):(0,s.jsx)(c.Z,{sx:{alignSelf:"center",color:m.s7}});return(0,s.jsxs)(o.Z,{sx:{alignItems:"center",display:"flex",flexDirection:"row","& > :not(:first-child)":{marginLeft:"1em"},"& > :last-child":{flexGrow:1}},children:[(0,s.jsx)(x.Ac,{sx:{whiteSpace:"nowrap"},text:n}),(0,s.jsx)(M,{onMouseUp:function(){for(var t,n=arguments.length,s=Array(n),o=0;o{L[u]=void 0,p[r].isApplied=!1,b(t=>({...t})),N({inputs:{[J]:{isIgnoreOnCallbacks:!1}},isContinueOnFailure:!0})}},"network-interface-".concat(r)):a})]},"network-".concat(F,"-link-").concat(t))}),(0,s.jsx)(j.Z,{input:(0,s.jsx)(Z.Z,{id:"network-".concat(F,"-ip-address"),inputProps:{onBlur:t=>{let{target:{value:n}}=t;I({inputs:{[z]:{value:n}}})}},inputLabelProps:{isNotifyRequired:!0},label:"IP address",onChange:t=>{let{target:{value:n}}=t;N({inputs:{[z]:{value:n}}}),w(RegExp("(?:^(?:".concat(z,"|").concat(X,")|").concat(F,"$)")))},value:O}),ref:V}),(0,s.jsx)(j.Z,{input:(0,s.jsx)(Z.Z,{id:"network-".concat(F,"-subnet-mask"),inputProps:{onBlur:t=>{let{target:{value:n}}=t;I({inputs:{[K]:{value:n}}})}},inputLabelProps:{isNotifyRequired:!0},label:"Subnet mask",onChange:t=>{let{target:{value:n}}=t;N({inputs:{[K]:{value:n}}}),w(RegExp("(?:^(?:".concat(K,"|").concat(X,")|").concat(F,"$)")))},value:H}),ref:U})]})]})};NetworkForm.defaultProps={allowMigrationNetwork:!0,createDropMouseUpHandler:void 0,hostDetail:void 0};let O=(0,v.forwardRef)((t,n)=>{let e,{expectHostDetail:u=!1,hostDetail:i,hostSequence:a,toggleSubmitDisabled:l}=t,d="local",h=a;u?i&&({hostType:e,hostUUID:d,sequence:h}=i):e="striker";let x=(0,v.useMemo)(()=>{let t=[];if("striker"===e){let n=h?"10.201.4.".concat(h):"10.201.4.";return t.push(createNetworkInput({ipAddress:n,isRequired:!0,subnetMask:"255.255.0.0",type:"bcn",typeCount:1}),createNetworkInput({isRequired:!0,type:"ifn",typeCount:1})),t}return t.push(createNetworkInput({ipAddress:"10.201.",isRequired:!0,subnetMask:"255.255.0.0",type:"bcn",typeCount:1}),createNetworkInput({isRequired:!0,type:"ifn",typeCount:1}),createNetworkInput({ipAddress:"10.101.",isRequired:!0,subnetMask:"255.255.0.0",type:"sn",typeCount:1})),t},[e,h]),b=(0,v.useMemo)(()=>"node"===e?{bcn:1,ifn:1,sn:1}:{bcn:1,ifn:1},[e]),[I,M]=(0,v.useState)({x:0,y:0}),[R,P]=(0,v.useState)({}),[L,E]=(0,v.useState)(x),[T,O]=(0,v.useState)(),[_,H]=(0,v.useState)(""),W=(0,v.useRef)({}),$=(0,v.useRef)({}),G=(0,v.useRef)(!0),J=(0,v.useRef)({}),{data:z=[],isLoading:K}=(0,D.Z)("".concat(k.Z,"/init/network-interface/").concat(d),{refreshInterval:2e3,onSuccess:t=>{let n=t.reduce((t,n)=>{var e;let{networkInterfaceUUID:s}=n;return t[s]=null!==(e=R[s])&&void 0!==e?e:{metadata:n},t},{});P(n)}}),X=(0,v.useMemo)(()=>L.length>=z.length||Object.values(R).every(t=>{let{isApplied:n}=t;return n})||"node"===e&&z.length<=6,[e,L,z,R]),Q=(0,v.useMemo)(()=>u&&!i,[u,i]),Y=(0,v.useMemo)(()=>L.every(t=>{let{type:n}=t;return"mn"!==n}),[L]),tt=(0,v.useCallback)((t,n)=>{var e;return null===(e=J.current.setMessage)||void 0===e?void 0:e.call(null,t,n)},[]),tn=(0,v.useCallback)((t,n)=>{var e;return null===(e=J.current.setMessageRe)||void 0===e?void 0:e.call(null,t,n)},[]),te=(0,v.useCallback)(t=>tt(q.dnsCSV,t),[tt]),ts=(0,v.useCallback)(t=>tt(q.gateway,t),[tt]),to=(0,v.useCallback)(t=>{let n,{fn:e="every",ip:s="",mask:o="",isNegateMatch:u="every"===e,onMatch:i,onMiss:r,skipUUID:c}=t,a="every"===e,match=(t,n)=>{let{b:e,bIP:s=""}=n;return t.contains(null!=e?e:s)||void 0!==e&&e.contains(t)};try{n=new B.Netmask("".concat(s,"/").concat(o))}catch(t){}return L[e](t=>{var e,o;let{inputUUID:l,ipAddressInputRef:d,subnetMaskInputRef:f}=t;if(l===c)return a;let C=null==d?void 0:null===(e=d.current.getValue)||void 0===e?void 0:e.call(null),v=null==f?void 0:null===(o=f.current.getValue)||void 0===o?void 0:o.call(null),p=!1;try{let t=new B.Netmask("".concat(C,"/").concat(v));p=match(t,{b:n,bIP:s})}catch(t){}return p?null==i||i.call(null,t):null==r||r.call(null,t),u?!p:p})},[L]),tu=(0,v.useCallback)(t=>{tt("api",t)},[tt]),ti=(0,v.useMemo)(()=>{let t={[q.dnsCSV]:{defaults:{getValue:()=>{var t;return null===(t=W.current.getValue)||void 0===t?void 0:t.call(null)},onSuccess:()=>{te()}},isRequired:!0,tests:[{onFailure:()=>{te({children:"Domain name servers should be a comma-separated list of IPv4 addresses without trailing comma(s)."})},test:t=>{let{value:n}=t;return w.ah.test(n)}},{test:U.HJ}]},[q.gateway]:{defaults:{getValue:()=>{var t;return null===(t=$.current.getValue)||void 0===t?void 0:t.call(null)},onSuccess:()=>{ts()}},isRequired:!0,tests:[{onFailure:()=>{ts({children:"Gateway should be a valid IPv4 address."})},test:t=>{let{value:n}=t;return w.tf.test(n)}},{test:t=>{let{value:n}=t,e=!0,s=to({fn:"some",ip:n,onMatch:t=>{let{ipAddress:s,name:o,type:u,typeCount:i}=t;if(n===s){e=!1,ts({children:"Gateway cannot be the same as IP address in ".concat(o,".")});return}H("".concat(u).concat(i))}});return s||ts({children:"Gateway must be in one network's subnet."}),s&&e}},{test:U.HJ}]}};return L.forEach(n=>{var e,s;let{inputUUID:o,interfaces:u,ipAddressInputRef:i,name:r,subnetMaskInputRef:c}=n,a=createInputTestPrefix(o),l=q.networkInterfaces(a),d=q.networkIPAddress(a),f=q.networkSubnetMask(a),setNetworkIfacesInputMessage=t=>tt(l,t),setNetworkIPAddressInputMessage=t=>tt(d,t),setNetworkSubnetMaskInputMessage=t=>tt(f,t),setNetworkSubnetConflictInputMessage=(t,n,e)=>{var s;let o="".concat(q.networkSubnetConflict(a),"-").concat(n),u="".concat(q.networkSubnetConflict(createInputTestPrefix(n)),"-").concat(t);tt((null===(s=J.current.exists)||void 0===s?void 0:s.call(null,u))?u:o,e)},testNetworkSubnetConflictWithDefaults=t=>{let{ip:n=null==i?void 0:null===(e=i.current.getValue)||void 0===e?void 0:e.call(null),mask:u=null==c?void 0:null===(s=c.current.getValue)||void 0===s?void 0:s.call(null)}=t;return to({ip:n,mask:u,onMatch:t=>{let{inputUUID:n,name:e}=t;setNetworkSubnetConflictInputMessage(o,n,{children:'"'.concat(r,'" and "').concat(e,'" cannot be in the same subnet.')})},onMiss:t=>{let{inputUUID:n}=t;setNetworkSubnetConflictInputMessage(o,n)},skipUUID:o})};t[l]={defaults:{getCompare:()=>u.map(t=>void 0!==t),onSuccess:()=>{setNetworkIfacesInputMessage()}},isRequired:!0,tests:[{onFailure:()=>{setNetworkIfacesInputMessage({children:"".concat(r," must have at least 1 interface.")})},test:t=>{let{compare:n}=t;return n.some(t=>t)}},{onFailure:()=>{setNetworkIfacesInputMessage({children:"".concat(r," must have a Link 1 interface.")})},test:t=>{let{compare:[n,e]}=t;return!(e&&!n)}}]},t[d]={defaults:{getValue:()=>{var t;return null==i?void 0:null===(t=i.current.getValue)||void 0===t?void 0:t.call(null)},onSuccess:()=>{setNetworkIPAddressInputMessage()}},isRequired:!0,tests:[{onFailure:()=>{setNetworkIPAddressInputMessage({children:"IP address in ".concat(r," must be a valid IPv4 address.")})},test:t=>{let{value:n}=t;return w.tf.test(n)}},{test:t=>{let{value:n}=t;return testNetworkSubnetConflictWithDefaults({ip:n})}},{test:U.HJ}]},t[q.networkName(a)]={defaults:{value:r},isRequired:!0,tests:[{test:U.HJ}]},t[f]={defaults:{getValue:()=>{var t;return null==c?void 0:null===(t=c.current.getValue)||void 0===t?void 0:t.call(null)},onSuccess:()=>{setNetworkSubnetMaskInputMessage()}},isRequired:!0,tests:[{onFailure:()=>{setNetworkSubnetMaskInputMessage({children:"Subnet mask in ".concat(r," must be a valid IPv4 address.")})},test:t=>{let{value:n}=t;return w.tf.test(n)}},{test:t=>{let{value:n}=t;return testNetworkSubnetConflictWithDefaults({mask:n})}},{test:U.HJ}]}}),t},[L,te,ts,tt,to]),tr=(0,v.useMemo)(()=>(0,U.LT)(ti),[ti]),tc=(0,v.useCallback)(t=>{null==l||l.call(null,tr({isIgnoreOnCallbacks:!0,isTestAll:!0,...t}))},[tr,l]),ta=(0,v.useCallback)(()=>{O(void 0)},[]),tl=(0,v.useCallback)(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};L.unshift(createNetworkInput(t)),null==l||l.call(null,!1),E([...L])},[L,l]),td=(0,v.useCallback)(t=>{let[{inputUUID:n,interfaces:e}]=L.splice(t,1);e.forEach(t=>{if(void 0===t)return;let{networkInterfaceUUID:n}=t;R[n].isApplied=!1}),tc({excludeTestIdsRe:RegExp(n)}),E([...L]),P(t=>({...t}))},[L,R,tc]),tf=(0,v.useCallback)(function(t){let{inputs:n=L,lastIndex:e=0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=0;for(let o=n.length-1;o>=e;o-=1)n[o].type===t&&(s+=1);return s},[L]),tC=(0,v.useMemo)(()=>{if(void 0===T)return;let{networkInterfaceUUID:t}=T;return(n,e)=>()=>{var s;let{networkInterfaceUUID:o}=null!==(s=n[e])&&void 0!==s?s:{};o&&o!==t&&(R[o].isApplied=!1),n[e]=T,R[t].isApplied=!0}},[T,R]),tB=(0,v.useMemo)(()=>T?{cursor:"grabbing",userSelect:"none"}:{},[T]),tv=(0,v.useMemo)(()=>{if(void 0===T)return(0,s.jsx)(s.Fragment,{});let{x:t,y:n}=I;return(0,s.jsx)(BriefNetworkInterface,{isFloating:!0,networkInterface:T,sx:{left:"calc(".concat(t,"px + .4em)"),position:"absolute",top:"calc(".concat(n,"px - 1.6em)"),zIndex:20}})},[I,T]),tp=(0,v.useMemo)(()=>T?()=>{ta()}:void 0,[ta,T]),tk=(0,v.useMemo)(()=>T?t=>{let{currentTarget:n,nativeEvent:{clientX:e,clientY:s}}=t,{left:o,top:u}=n.getBoundingClientRect();M({x:e-o,y:s-u})}:void 0,[T]),tm=(0,v.useMemo)(()=>T?()=>{ta()}:void 0,[ta,T]);(0,v.useEffect)(()=>{if([Object.keys(R).length>0,u,i,G.current,W.current,$.current].every(t=>!!t)){var t,n;G.current=!1;let{dns:e,gateway:s,gatewayInterface:o,networks:u}=i;if([e,s,o,u].some(t=>!t))return;null===(t=W.current.setValue)||void 0===t||t.call(null,e),null===(n=$.current.setValue)||void 0===n||n.call(null,s);let r=[],c=Object.values(u).reduce((t,n)=>{var e,s;let{ip:o,link1Uuid:u,link2Uuid:i="",subnetMask:c,type:a}=n,l=tf(a,{inputs:t})+1,d=b[a]===l,f="".concat(g.default[a]," ").concat(l);return r.push(u,i),t.push({inputUUID:(0,p.Z)(),interfaces:[null===(e=R[u])||void 0===e?void 0:e.metadata,null===(s=R[i])||void 0===s?void 0:s.metadata],ipAddress:o,isRequired:d,name:f,subnetMask:c,type:a,typeCount:l}),t},[]);H(o),P(t=>{let n={...t};return r.forEach(t=>{n[t]&&(n[t].isApplied=!0)}),n}),E(c),tc()}},[u,tf,i,R,b,tc]),(0,v.useEffect)(()=>((0,A.Z)(1,tu),window&&window.addEventListener("beforeunload",()=>{let t=new XMLHttpRequest;t.open("PUT","".concat(k.Z,"/init/set-map-network"),!1),t.send(null)},{once:!0}),()=>{(0,A.Z)(0,tu)}),[tu]),(0,v.useImperativeHandle)(n,()=>({...J.current,get:()=>{var t,n;return{dns:null===(t=W.current.getValue)||void 0===t?void 0:t.call(null),gateway:null===(n=$.current.getValue)||void 0===n?void 0:n.call(null),gatewayInterface:_,networks:L.map(t=>{var n,e,s,o;let{inputUUID:u,interfaces:i,ipAddressInputRef:r,name:c,subnetMaskInputRef:a,type:l,typeCount:d}=t;return{inputUUID:u,interfaces:i,ipAddress:null!==(s=null==r?void 0:null===(n=r.current.getValue)||void 0===n?void 0:n.call(null))&&void 0!==s?s:"",name:c,subnetMask:null!==(o=null==a?void 0:null===(e=a.current.getValue)||void 0===e?void 0:e.call(null))&&void 0!==o?o:"",type:l,typeCount:d}})}}}),[_,L]);let tg="13em";return K?(0,s.jsx)(V.Z,{}):(0,s.jsxs)(o.Z,{onMouseDown:t=>{let{clientX:n,clientY:e,currentTarget:s}=t,{left:o,top:u}=s.getBoundingClientRect();M({x:n-o,y:e-u})},onMouseLeave:tp,onMouseMove:tk,onMouseUp:tm,sx:{position:"relative",...tB},children:[tv,(0,s.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column","& > :not(:first-child, :nth-child(3))":{marginTop:"1em"}},children:[(0,s.jsx)(f._,{autoHeight:!0,columns:createNetworkInterfaceTableColumns(t=>{O(t)},R),componentsProps:{row:{onMouseDown:t=>{let{target:{parentElement:{dataset:{id:n}={}}={}}={}}=t;if(n){let{isApplied:t,metadata:e}=R[n];t||O(e)}}}},disableColumnMenu:!0,disableSelectionOnClick:!0,getRowClassName:t=>{var n;let{row:{networkInterfaceUUID:e}}=t,{isApplied:s}=null!==(n=R[e])&&void 0!==n&&n,o="";return s||(o+=" ".concat(F.ifaceNotApplied)),o},getRowId:t=>{let{networkInterfaceUUID:n}=t;return n},hideFooter:!0,initialState:{sorting:{sortModel:[{field:"networkInterfaceName",sort:"asc"}]}},rows:z,sx:{color:m.s7,["& .".concat(r.iconButtonClasses.root)]:{color:"inherit"},["& .".concat(C._.cell,":focus")]:{outline:"none"},["& .".concat(C._.row,".").concat(F.ifaceNotApplied,":hover")]:{cursor:"grab",["& .".concat(C._.cell," p")]:{cursor:"auto"}}}}),!Q&&(0,s.jsx)(N.Z,{row:!0,sx:{"& > :first-child":{alignSelf:"start",marginTop:".7em"},"& > :last-child":{flexGrow:1}},children:(0,s.jsx)(o.Z,{sx:{alignItems:"strech",display:"flex",flexDirection:"row",overflowX:"auto",paddingLeft:".3em","& > div":{marginBottom:".8em",marginTop:".4em",minWidth:tg,width:"25%"},"& > :not(:first-child)":{marginLeft:"1em"}},children:L.map((t,n)=>{let{inputUUID:o}=t;return(0,s.jsx)(NetworkForm,{allowMigrationNetwork:Y,createDropMouseUpHandler:tC,getNetworkTypeCount:tf,hostDetail:{hostType:e,sequence:h},networkIndex:n,networkInput:t,networkInterfaceCount:z.length,networkInterfaceInputMap:R,removeNetwork:td,setMessageRe:tn,setNetworkInputs:E,setNetworkInterfaceInputMap:P,testInput:tr,testInputToToggleSubmitDisabled:tc},"network-".concat(o))})})}),(0,s.jsxs)(N.Z,{sm:"row",sx:{marginTop:".2em","& > :not(button)":{minWidth:tg,width:{sm:"25%"}}},children:[(0,s.jsx)(y.Z,{disabled:X,onClick:()=>{tl()},children:(0,s.jsx)(c.Z,{})}),(0,s.jsx)(j.Z,{input:(0,s.jsx)(Z.Z,{id:"network-init-gateway",inputProps:{onBlur:t=>{let{target:{value:n}}=t;tr({inputs:{[q.gateway]:{value:n}}})}},inputLabelProps:{isNotifyRequired:!0},onChange:t=>{let{target:{value:n}}=t;tc({inputs:{[q.gateway]:{value:n}}}),ts()},label:"Gateway"}),ref:$}),(0,s.jsx)(j.Z,{input:(0,s.jsx)(Z.Z,{id:"network-init-dns-csv",inputProps:{onBlur:t=>{let{target:{value:n}}=t;tr({inputs:{[q.dnsCSV]:{value:n}}})}},inputLabelProps:{isNotifyRequired:!0},onChange:t=>{let{target:{value:n}}=t;tc({inputs:{[q.dnsCSV]:{value:n}}}),te()},label:"Domain name server(s)"}),ref:W})]}),(0,s.jsx)(S.Z,{count:1,defaultMessageType:"warning",ref:J})]})]})});O.defaultProps={expectHostDetail:!1,hostDetail:void 0,hostSequence:void 0,toggleSubmitDisabled:void 0},O.displayName="NetworkInitForm";var _=O},5813:function(t,n){"use strict";n.default={bcn:"Back-Channel Network",ifn:"Internet-Facing Network",mn:"Migration Network",sn:"Storage Network"}},10406:function(t,n,e){"use strict";var s=e(85893),o=e(67645),u=e(41247);n.Z=(t,n)=>{o.Z.put("/init/set-map-network",{value:t}).catch(e=>{let o=(0,u.Z)(e);o.children=(0,s.jsxs)(s.Fragment,{children:["Failed to ",t?"enable":"disable"," network mapping."," ",o.children]}),null==n||n.call(null,o)})}}}]);