"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[69120],{435689(e,a,i){i.d(a,{A:()=>t});var n=i(602086),l=i(141992);const t=(0,i(272338).w)(e=>(0,n.createElement)("svg",(0,l.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,n.createElement)("path",{d:"M16 5H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1Z",fill:"currentColor",className:e.twotonedclassname}),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m10.367 13.887 2.12-2.121a.5.5 0 1 0-.706-.708l-1.267 1.268V3.5a.5.5 0 0 0-1 0v8.827l-1.268-1.269a.5.5 0 0 0-.707.708l2.12 2.121a.502.502 0 0 0 .708 0ZM17 6a1 1 0 0 0-1-1h-3v1h3v10H4V6h3V5H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.038 3a.75.75 0 0 1 .75.75v7.683l.479-.479a.747.747 0 0 1 1.06 0 .75.75 0 0 1 0 1.061l-1.767 1.768a.737.737 0 0 1-.53.22L9.958 14a.737.737 0 0 1-.47-.217L7.72 12.015a.752.752 0 0 1-.001-1.061.751.751 0 0 1 1.062 0l.507.507V3.75a.75.75 0 0 1 .75-.75ZM17 6.004a1 1 0 0 0-1-1h-3v1.5h2.5v9h-11v-9H7v-1.5H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-10Z",fill:"currentColor",className:e.fillclassname})))},308516(e,a,i){i.d(a,{A:()=>t});var n=i(602086),l=i(141992);const t=(0,i(272338).w)(e=>(0,n.createElement)("svg",(0,l.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,n.createElement)("path",{d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",fill:"currentColor",className:e.twotonedclassname}),(0,n.createElement)("path",{d:"M10.017 2c.58 0 1.169.064 1.758.196 2.316.521 4.165 2 5.226 3.927v-1.62a.502.502 0 0 1 .499-.5.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1 0-1h1.823A6.95 6.95 0 0 0 10.02 3a7.04 7.04 0 0 0-6.845 5.467c-.859 3.765 1.502 7.516 5.262 8.361a7.015 7.015 0 0 0 1.533.171c1.57 0 3.07-.534 4.277-1.462a.503.503 0 0 1 .73.128.497.497 0 0 1-.111.659A8.02 8.02 0 0 1 9.973 18c-.58 0-1.168-.063-1.757-.196-4.304-.968-6.997-5.247-6.014-9.557A8.034 8.034 0 0 1 10.017 2ZM17 7.003v-.015l-.024.015H17Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{d:"M10.02 2c.563 0 1.131.06 1.7.184a7.969 7.969 0 0 1 4.78 3.135V4.75a.75.75 0 0 1 1.5 0v3c0 .413-.337.75-.751.75h-3.002a.75.75 0 0 1 0-1.5h1.545a.778.778 0 0 1-.08-.119 6.491 6.491 0 0 0-5.7-3.383c-2.863 0-5.478 1.916-6.268 4.749-1.003 3.595 1.22 7.27 4.82 8.089a6.506 6.506 0 0 0 5.245-1.068.735.735 0 0 1 .43-.139.755.755 0 0 1 .754.75.76.76 0 0 1-.32.619 7.996 7.996 0 0 1-6.442 1.301c-4.372-.994-7.087-5.389-5.985-9.758C3.154 4.439 6.436 2 10.02 2Z",fill:"currentColor",className:e.fillclassname})))},370939(e,a,i){i.d(a,{E:()=>l,f:()=>n});const n=-1,l=0},332692(e,a,i){i.d(a,{d:()=>_});var n=i(222102),l=i(656466),t=i(401042),s=i(777731),r=i(759997);const o=(0,l.uh)((0,r.wI)()),c=(0,n.Mz)(o,t.kh),_=(0,n.Mz)(c,e=>e.filter(({type:e})=>e===s.K.PRIMARY||e===s.K.SECONDARY))},303024(e,a,i){i.d(a,{A:()=>d});var n=i(274934),l=i(814557),t=i(599110),s=i(789577),r=i(247816),o=i(263705),c=i(309130),_=i(291508),E=i(147045);const A=(0,r.A)(t.A,(0,_.A)("applyMarginRight","applyMarginLeft"))`
  font-size: 14px !important;
  ${({applyMarginRight:e})=>e&&`margin-right: ${c.Ln};`}
  ${({applyMarginLeft:e})=>e&&`margin-left: ${c.Ln};`}
`,d=({children:e,onClick:a,name:i="remove-button",applyMarginLeft:t=!1,applyMarginRight:r=!1,disabled:c=!1,[E.L]:_})=>{const{themeName:d}=(0,o.u)();return(0,n.jsx)(A,{..._&&{[E.L]:_},name:i,variant:"inline",type:"button",color:"danger",Icon:s.A,iconSize:"original",iconProps:{...!c&&{color:l.Ay[`desktop-color-red-06-${d}`]},disabled:c},onClick:a,applyMarginLeft:t,applyMarginRight:r,disabled:c,children:e})}},149729(e,a,i){i.d(a,{P:()=>A,_:()=>d});var n=i(274934),l=i(977872),t=i(320509),s=i(820633),r=i(710697),o=i(470070),c=i(897166),_=i(570801);const E=({timestamp:e})=>(0,n.jsx)(n.Fragment,{children:new Intl.DateTimeFormat((0,l.d4)(s.zi),{hourCycle:(0,l.d4)(_.BQ),timeZone:(0,l.d4)(c.hq),day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric"}).format(e)}),A=[{growthFactor:100,id:"datetime",label:(0,n.jsx)(o.sA,{id:"COMMON_CREATED"}),renderCell:({time:e})=>(0,n.jsx)(E,{timestamp:e}),minWidth:100},{growthFactor:50,id:"version",label:(0,n.jsx)(o.sA,{id:"COMMON_VERSION"}),renderCell:({version:e})=>e,minWidth:50},{growthFactor:50,id:"size",label:(0,n.jsx)(o.sA,{id:"COMMON_SIZE"}),renderCell:({size:e})=>(0,t.z3)(e),minWidth:50}],d=e=>{switch(e){case r.Us.Daily:return(0,n.jsx)(o.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_DAILY"});case r.Us.Weekly:return(0,n.jsx)(o.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_WEEKLY"});case r.Us.Monthly:return(0,n.jsx)(o.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_MONTHLY"});default:return null}}},869120(e,a,i){i.r(a),i.d(a,{default:()=>V});var n=i(274934),l=i(602086),t=i(425040),s=i(977872),r=i(792929),o=i(832162),c=i(599110),_=i(938984),E=i(308516),A=i(853777),d=i(435689),T=i(247816),N=i(669439),S=i(237887),m=i(653547),M=i(309130),u=i(700444),h=i(869332),O=i(470070),I=i(248284),C=i(149729),p=i(771927),L=i(401042),g=i(759997);var v=i(370939);const x=v.E,f=(e,a)=>e.map(e=>({value:e,label:a({id:"SETTINGS_DATE_TIME_VALUE_LAST_DAYS"},{days:e})})),R=(e,a)=>[...a?[{value:v.E,label:e({id:"SETTINGS_COMMON_VALUE_SETTINGS_ONLY"})}]:[{value:v.E,label:e({id:"SETTINGS_COMMON_VALUE_SETTINGS_ONLY"})},...f([7,30,60,90,180,365],e),{value:v.f,label:e({id:"SETTINGS_CONTROLLER_MAINTENANCE_VALUES_NO_LIMIT"})}]];var D=i(975440),b=i(303024),y=i(754924),U=i(332692),j=i(100978),w=i(648576);const k=(0,T.A)(w.Ay)`
  margin-left: ${M.Ln};
  font-size: 14px !important;
`,P=(0,T.A)(_.A)`
  margin-right: ${M.YC};
`,G=(0,T.A)(c.A)`
  margin-right: ${M.Ln};
`,Y=(0,T.A)(E.A)`
  margin-bottom: 2px;
`,B=(0,T.A)(d.A)`
  margin-bottom: 2px;
`,V=()=>{const{formatMessage:e}=(0,O.tz)(),a=(0,s.wA)(),[i,E]=(0,l.useState)([]),[T,v]=(0,l.useState)(x),f=(0,s.d4)(I.p),w=(0,s.d4)(U.d),V=(0,s.d4)(y.YS),F=(0,l.useCallback)(()=>{a((0,h.AS)())},[a]),z=(0,l.useCallback)(async()=>{var e;E([]),a((e=i.map(e=>w.find(({filename:a})=>a===e)),a=>a((0,p.E)({title:"SETTINGS_AUTO_BACKUP_REMOVE_MODAL_TITLE",titleValues:{count:e.length},message:"SETTINGS_AUTO_BACKUP_REMOVE_MODAL_MESSAGE",messageValues:{names:e.map(({filename:e})=>e).join(", "),count:e.length,strong:O.ko},onConfirm:()=>(async(e,a)=>{const{failureToast:i}=(0,L.rk)("SETTINGS_BACKUP_REMOVE_ERROR");try{for await(const i of e.map(e=>(0,g.TC)(e)))a(i);await a((0,g.wI)())}catch(e){a((0,u.ox)(i(void 0,e)))}a((0,h.AS)())})(e,a)}))))},[i,w,a]),H=(0,l.useCallback)(e=>{e.returnValue=!1},[]),W=(0,l.useCallback)(()=>{const i="pendingBackupListenerId";window.addEventListener("beforeunload",H),(0,m.K6)(["EVT_AD_BackupCreated","EVT_AD_BackupFailed"],()=>{window.removeEventListener("beforeunload",H),(0,m.$N)(i)},!0,i);const n=(0,t.A)();a((0,D.Nz)(n)),a((0,u.ox)({id:n,downloads:[{filename:e({id:"SETTINGS_SYSTEM_MAINTENANCE_SUPPORT_INFORMATION_PREPARING"}),status:e({id:"SETTINGS_SYSTEM_MAINTENANCE_SUPPORT_INFORMATION_FETCHING"}),progress:0,onCancel:()=>{a((0,u.uU)(n)),a((0,D.ro)())},id:`file-${n}`}],duration:0,notificationType:"DownloadsToast"})),a((0,D.tf)(T)),F()},[a,e,F,T,H]),K=(0,l.useCallback)(async()=>{E([]);const n=i.map(i=>{const n=w.find(({filename:e})=>e===i);if(n){const i=(0,t.A)();return a((0,u.ox)({id:i,downloads:[{filename:e({id:"SETTINGS_SYSTEM_MAINTENANCE_SUPPORT_INFORMATION_PREPARING"}),status:e({id:"SETTINGS_SYSTEM_MAINTENANCE_SUPPORT_INFORMATION_FETCHING"}),progress:0,onCancel:()=>{a((0,u.uU)(i))},id:`file-${i}`}],duration:0,notificationType:"DownloadsToast"})),(0,g.Sq)(n,i)}}).filter(e=>e);F();for await(const e of n)a(e)},[i,w,e,a,F]),Z=(0,l.useCallback)(()=>{const[e]=i;a((0,D.dH)(w.find(({filename:a})=>a===e)))},[w,i,a]),$=(0,l.useCallback)(({value:e})=>{v(e)},[]);return(0,n.jsx)(o.A,{isOpen:!0,size:"small",title:(0,n.jsx)(O.sA,{id:"SETTINGS_CONTROLLER_MAINTENANCE_LABEL_EXPORT_CONFIG"}),onRequestClose:F,children:(0,n.jsxs)(j.A,{flexDirection:"column",children:[(0,n.jsxs)(j.A,{flexDirection:"column",marginBottom:M.Er,children:[(0,n.jsxs)(j.A,{alignItems:"center",marginBottom:M.xO,children:[(0,n.jsx)(P,{color:"inherit",size:"medium",children:(0,n.jsx)(O.sA,{id:"SETTINGS_CONTROLLER_MAINTENANCE_LABEL_CURRENT_BACKUP"})}),(0,n.jsx)(N.A,{description:(0,n.jsx)(O.sA,{id:"SETTINGS_CONTROLLER_MAINTENANCE_LABEL_EXPORT_CONFIG_DESCRIPTION"}),children:(0,n.jsx)("span",{children:(0,n.jsx)(A.A,{isActive:!0,size:"original"})})})]}),(0,n.jsxs)(j.A,{alignItems:"center",children:[(0,n.jsx)(S.A,{variant:"secondary",value:T,onChange:$,options:R(e,V),width:"100%"}),(0,n.jsx)(k,{name:"backupDownload",type:"button",variant:"inline",onClick:W,Icon:d.A,iconProps:{isActive:!f,size:"original",disabled:f},disabled:f,children:(0,n.jsx)(O.sA,{id:"COMMON_DOWNLOAD"})})]})]}),w.length>0?(0,n.jsxs)(j.A,{width:"103%",flexDirection:"column",maxHeight:500,overflow:"scroll",children:[(0,n.jsxs)(j.A,{alignItems:"center",children:[(0,n.jsx)(P,{color:"inherit",size:"medium",children:(0,n.jsx)(O.sA,{id:"SETTINGS_SYSTEM_AUTO_BACKUP_AVAILABLE_BACKUPS"})}),(0,n.jsx)(N.A,{description:(0,n.jsx)(O.sA,{id:"SETTINGS_SYSTEM_AUTO_BACKUP_AVAILABLE_BACKUPS_DESC"}),children:(0,n.jsx)("span",{children:(0,n.jsx)(A.A,{isActive:!0,size:"original"})})})]}),(0,n.jsx)(r.A,{columns:C.P,items:w,truncateHeaderCells:!0,disableColumnFilters:!0,idField:"filename",multiSelectMode:!0,initialSelectedIds:i,selectedIds:i,onChangeSelection:E}),(0,n.jsxs)(j.A,{width:"100%",marginTop:M.xO,children:[(0,n.jsx)(b.A,{name:"removeBackups",onClick:z,applyMarginRight:!0,disabled:!i.length,children:(0,n.jsx)(O.sA,{id:"COMMON_ACTION_REMOVE"})}),(0,n.jsx)(G,{name:"downloadBackups",type:"button",variant:"inline",onClick:K,Icon:B,iconProps:{variant:"twoTone",size:"original"},disabled:!i.length,children:(0,n.jsx)(_.A,{size:"medium",color:"inherit",children:(0,n.jsx)(O.sA,{id:"COMMON_DOWNLOAD"})})}),(0,n.jsx)(c.A,{name:"restoreBackup",type:"button",variant:"inline",Icon:Y,iconProps:{isActive:!0,size:"original"},onClick:Z,disabled:!i.length||i.length>1,children:(0,n.jsx)(_.A,{size:"medium",color:"inherit",children:(0,n.jsx)(O.sA,{id:"COMMON_ACTION_RESTORE"})})})]})]}):null]})})}},710697(e,a,i){i.d(a,{Sj:()=>d,Us:()=>n,ZV:()=>T,hW:()=>o,tH:()=>_});var n,l=i(274934),t=i(950804),s=i(470070),r=i(809287);!function(e){e.Daily="daily",e.Weekly="weekly",e.Monthly="monthly"}(n||(n={}));const o=e=>[{value:n.Daily,label:e({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_DAILY"})},{value:n.Weekly,label:e({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_WEEKLY"})},{value:n.Monthly,label:e({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_MONTHLY"})}],c={[n.Daily]:60,[n.Weekly]:25,[n.Monthly]:12,networkServer:100},_=e=>t.A.object().shape({super_mgmt:t.A.object().shape({autobackup_cron_expr:t.A.string().test("isOneDaySelected",(0,l.jsx)(s.sA,{id:"COMMON_VALIDATION_DAY"}),e=>"*"===e.slice(-1)||!Number.isNaN(Number.parseInt(e.slice(-1),10))),autobackup_max_files:t.A.number().integer().test({name:"notExceedMaxFileLimit",test:(a,i)=>{const n=(0,r.sq)(i.parent.autobackup_cron_expr),t=e?c.networkServer:c[n];return!(a<1||a>t||!a)||i.createError({message:(0,l.jsx)(s.sA,{id:"SETTINGS_VALIDATION_ALLOWED_NUMBER_IS_MIN_TO_MAX",values:{min:1,max:t}})})}})})}),E={0:"SETTINGS_COMMON_VALUE_SETTINGS_ONLY",7:"SETTINGS_COMMON_X_DAYS",30:"SETTINGS_COMMON_X_DAYS",60:"SETTINGS_COMMON_X_DAYS",90:"SETTINGS_COMMON_X_DAYS",180:"SETTINGS_COMMON_X_DAYS",365:"SETTINGS_COMMON_X_DAYS","-1":"SETTINGS_SYSTEM_AUTO_BACKUP_NO_LIMIT"},A=Object.entries(E),d=(e,a)=>a?[{value:0,label:e({id:E[0]})}]:A.map(([a,i])=>({value:Number(a),label:e({id:i},{days:a})})),T=new Array(31).fill(1).map((e,a)=>({value:a+1,label:a+1}))},809287(e,a,i){i.d(a,{Dh:()=>s,E$:()=>t,sq:()=>l});var n=i(710697);const l=e=>{let a=n.Us.Monthly;const i=e?.split(" ")||[],l=i?.[2],t=i?.[4];return a="*"!==l?n.Us.Monthly:"*"!==t?n.Us.Weekly:n.Us.Daily,a},t=e=>{let a=1,i=n.Us.Monthly,l=0,t=[];const[s,r,o,c,_]=e?.split(" ")||[];return s&&r&&(l=60*(Number(r)||0)+(Number(s)||0)),"*"!==o?(i=n.Us.Monthly,a=+o):"*"!==_?(i=n.Us.Weekly,t=_.split(",").map(Number)):i=n.Us.Daily,[l,i,a,t]},s=(e,a,i,l)=>{const t=Math.floor(e/60),s=e%60;let r,o;switch(a){case n.Us.Daily:break;case n.Us.Weekly:o=l.join(",");break;case n.Us.Monthly:r=i}return((...e)=>e.map(e=>e??"*").join(" "))(s,t,r,void 0,o)}}}]);