"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[6368],{332918(e,a,t){t.d(a,{A:()=>i});var l=t(296540),n=t(629318);const i=(0,t(51946).w)(e=>(0,l.createElement)("svg",(0,n.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,l.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,l.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,l.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})))},660075(e,a,t){t.d(a,{A:()=>i});var l=t(296540),n=t(629318);const i=(0,t(51946).w)(e=>(0,l.createElement)("svg",(0,n.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,l.createElement)("path",{d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",fill:"currentColor",className:e.twotonedclassname}),(0,l.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,l.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})))},747280(e,a,t){t.d(a,{A:()=>i});var l=t(296540),n=t(629318);const i=(0,t(51946).w)(e=>(0,l.createElement)("svg",(0,n.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,l.createElement)("rect",{x:5,y:5,width:10,height:12,rx:1,fill:"currentColor",className:e.twotonedclassname}),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 5V4a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1h3a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1h3Zm6 0V4h-5v1h5Z",fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("path",{d:"M14 17H6a1 1 0 0 1-1-1V7.5a.5.5 0 0 1 1 0V16h8V7.5a.5.5 0 0 1 1 0V16a1 1 0 0 1-1 1Z",fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("path",{d:"M8 13.5a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-1 0v4Zm3.5.5a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 1 0v4a.5.5 0 0 1-.5.5Z",fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("path",{d:"M16.854 5.854A.502.502 0 0 0 16.5 5h-3V4a1 1 0 0 0-1-1h-5a1 1 0 0 0-1 1v1h-3a.502.502 0 0 0-.5.5.5.5 0 0 0 .5.5h13a.502.502 0 0 0 .354-.146Z",fill:"currentColor",className:e.fillclassname}),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Zm2.5 7a.5.5 0 0 0 .5-.5v-4a.502.502 0 0 0-.5-.5.5.5 0 0 0-.5.5v4a.5.5 0 0 0 .5.5Zm3 0a.5.5 0 0 0 .5-.5v-4a.502.502 0 0 0-.5-.5.5.5 0 0 0-.5.5v4a.5.5 0 0 0 .5.5Z",fill:"currentColor",className:e.fillclassname})))},917536(e,a,t){t.d(a,{E:()=>n,f:()=>l});const l=-1,n=0},133141(e,a,t){t.d(a,{d:()=>E});var l=t(801081),n=t(25553),i=t(87485),r=t(721778),s=t(441652);const o=(0,n.uh)((0,s.wI)()),c=(0,l.Mz)(o,i.kh),E=(0,l.Mz)(c,e=>e.filter(({type:e})=>e===r.K.PRIMARY||e===r.K.SECONDARY))},755825(e,a,t){t.d(a,{A:()=>A});var l=t(822336),n=t(296540),i=t(758649),r=t(747280),s=t(71479),o=t(382389),c=t(566723),E=t(311785),m=t(199582);const _=(0,s.A)(i.A,(0,E.A)("applyMarginRight","applyMarginLeft"))`
  font-size: 14px !important;
  ${({applyMarginRight:e})=>e&&`margin-right: ${c.Ln};`}
  ${({applyMarginLeft:e})=>e&&`margin-left: ${c.Ln};`}
`,A=({children:e,onClick:a,name:t="remove-button",applyMarginLeft:i=!1,applyMarginRight:s=!1,disabled:c=!1,[m.L]:E})=>{const{themeName:A}=(0,o.u)();return n.createElement(_,{...E&&{[m.L]:E},name:t,variant:"inline",type:"button",color:"danger",Icon:r.A,iconSize:"original",iconProps:{...!c&&{color:l.Ay[`desktop-color-red-06-${A}`]},disabled:c},onClick:a,applyMarginLeft:i,applyMarginRight:s,disabled:c},e)}},344926(e,a,t){t.d(a,{P:()=>_,_:()=>A});var l=t(296540),n=t(469733),i=t(137298),r=t(282556),s=t(498050),o=t(916537),c=t(602021),E=t(198494);const m=({timestamp:e})=>l.createElement(l.Fragment,null,new Intl.DateTimeFormat((0,n.useSelector)(r.zi),{hourCycle:(0,n.useSelector)(E.BQ),timeZone:(0,n.useSelector)(c.hq),day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric"}).format(e)),_=[{growthFactor:100,id:"datetime",label:l.createElement(o.sA,{id:"COMMON_CREATED"}),renderCell:({time:e})=>l.createElement(m,{timestamp:e}),minWidth:100},{growthFactor:50,id:"version",label:l.createElement(o.sA,{id:"COMMON_VERSION"}),renderCell:({version:e})=>e,minWidth:50},{growthFactor:50,id:"size",label:l.createElement(o.sA,{id:"COMMON_SIZE"}),renderCell:({size:e})=>(0,i.z3)(e),minWidth:50}],A=e=>{switch(e){case s.Us.Daily:return l.createElement(o.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_DAILY"});case s.Us.Weekly:return l.createElement(o.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_WEEKLY"});case s.Us.Monthly:return l.createElement(o.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_MONTHLY"});default:return null}}},706368(e,a,t){t.r(a),t.d(a,{default:()=>x});var l=t(296540),n=t(300477),i=t(469733),r=t(963070),s=t(617147),o=t(758649),c=t(217439),E=t(660075),m=t(162420),_=t(332918),A=t(71479),d=t(180524),T=t(362412),N=t(525512),S=t(566723),u=t(675359),M=t(126457),h=t(916537),C=t(84575),O=t(344926),p=t(86392),I=t(87485),v=t(441652);var L=t(917536);const g=L.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:L.E,label:e({id:"SETTINGS_COMMON_VALUE_SETTINGS_ONLY"})}]:[{value:L.E,label:e({id:"SETTINGS_COMMON_VALUE_SETTINGS_ONLY"})},...f([7,30,60,90,180,365],e),{value:L.f,label:e({id:"SETTINGS_CONTROLLER_MAINTENANCE_VALUES_NO_LIMIT"})}]];var b=t(509092),D=t(755825),w=t(532419),y=t(133141),U=t(294303),k=t(734707);const P=(0,A.A)(k.Ay)`
  margin-left: ${S.Ln};
  font-size: 14px !important;
`,G=(0,A.A)(c.A)`
  margin-right: ${S.YC};
`,V=(0,A.A)(o.A)`
  margin-right: ${S.Ln};
`,Y=(0,A.A)(E.A)`
  margin-bottom: 2px;
`,B=(0,A.A)(_.A)`
  margin-bottom: 2px;
`,x=()=>{const{formatMessage:e}=(0,h.tz)(),a=(0,i.useDispatch)(),[t,E]=(0,l.useState)([]),[A,L]=(0,l.useState)(g),f=(0,i.useSelector)(C.p),k=(0,i.useSelector)(y.d),x=(0,i.useSelector)(w.YS),F=(0,l.useCallback)(()=>{a((0,M.AS)())},[a]),H=(0,l.useCallback)(async()=>{var e;E([]),a((e=t.map(e=>k.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:h.ko},onConfirm:()=>(async(e,a)=>{const{failureToast:t}=(0,I.rk)("SETTINGS_BACKUP_REMOVE_ERROR");try{for await(const t of e.map(e=>(0,v.TC)(e)))a(t);await a((0,v.wI)())}catch(e){a((0,u.ox)(t(void 0,e)))}a((0,M.AS)())})(e,a)}))))},[t,k,a]),z=(0,l.useCallback)(e=>{e.returnValue=!1},[]),Z=(0,l.useCallback)(()=>{const t="pendingBackupListenerId";window.addEventListener("beforeunload",z),(0,N.K6)(["EVT_AD_BackupCreated","EVT_AD_BackupFailed"],()=>{window.removeEventListener("beforeunload",z),(0,N.$N)(t)},!0,t);const l=(0,n.A)();a((0,b.Nz)(l)),a((0,u.ox)({id:l,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)(l)),a((0,b.ro)())},id:`file-${l}`}],duration:0,notificationType:"DownloadsToast"})),a((0,b.tf)(A)),F()},[a,e,F,A,z]),W=(0,l.useCallback)(async()=>{E([]);const l=t.map(t=>{const l=k.find(({filename:e})=>e===t);if(l){const t=(0,n.A)();return a((0,u.ox)({id:t,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)(t))},id:`file-${t}`}],duration:0,notificationType:"DownloadsToast"})),(0,v.Sq)(l,t)}}).filter(e=>e);F();for await(const e of l)a(e)},[t,k,e,a,F]),K=(0,l.useCallback)(()=>{const[e]=t;a((0,b.dH)(k.find(({filename:a})=>a===e)))},[k,t,a]),$=(0,l.useCallback)(({value:e})=>{L(e)},[]);return l.createElement(s.A,{isOpen:!0,size:"small",title:l.createElement(h.sA,{id:"SETTINGS_CONTROLLER_MAINTENANCE_LABEL_EXPORT_CONFIG"}),onRequestClose:F},l.createElement(U.A,{flexDirection:"column"},l.createElement(U.A,{flexDirection:"column",marginBottom:S.Er},l.createElement(U.A,{alignItems:"center",marginBottom:S.xO},l.createElement(G,{color:"inherit",size:"medium"},l.createElement(h.sA,{id:"SETTINGS_CONTROLLER_MAINTENANCE_LABEL_CURRENT_BACKUP"})),l.createElement(d.A,{description:l.createElement(h.sA,{id:"SETTINGS_CONTROLLER_MAINTENANCE_LABEL_EXPORT_CONFIG_DESCRIPTION"})},l.createElement("span",null,l.createElement(m.A,{isActive:!0,size:"original"})))),l.createElement(U.A,{alignItems:"center"},l.createElement(T.A,{variant:"secondary",value:A,onChange:$,options:R(e,x),width:"100%"}),l.createElement(P,{name:"backupDownload",type:"button",variant:"inline",onClick:Z,Icon:_.A,iconProps:{isActive:!f,size:"original",disabled:f},disabled:f},l.createElement(h.sA,{id:"COMMON_DOWNLOAD"})))),k.length>0?l.createElement(U.A,{width:"103%",flexDirection:"column",maxHeight:500,overflow:"scroll"},l.createElement(U.A,{alignItems:"center"},l.createElement(G,{color:"inherit",size:"medium"},l.createElement(h.sA,{id:"SETTINGS_SYSTEM_AUTO_BACKUP_AVAILABLE_BACKUPS"})),l.createElement(d.A,{description:l.createElement(h.sA,{id:"SETTINGS_SYSTEM_AUTO_BACKUP_AVAILABLE_BACKUPS_DESC"})},l.createElement("span",null,l.createElement(m.A,{isActive:!0,size:"original"})))),l.createElement(r.A,{columns:O.P,items:k,truncateHeaderCells:!0,disableColumnFilters:!0,idField:"filename",multiSelectMode:!0,initialSelectedIds:t,selectedIds:t,onChangeSelection:E}),l.createElement(U.A,{width:"100%",marginTop:S.xO},l.createElement(D.A,{name:"removeBackups",onClick:H,applyMarginRight:!0,disabled:!t.length},l.createElement(h.sA,{id:"COMMON_ACTION_REMOVE"})),l.createElement(V,{name:"downloadBackups",type:"button",variant:"inline",onClick:W,Icon:B,iconProps:{variant:"twoTone",size:"original"},disabled:!t.length},l.createElement(c.A,{size:"medium",color:"inherit"},l.createElement(h.sA,{id:"COMMON_DOWNLOAD"}))),l.createElement(o.A,{name:"restoreBackup",type:"button",variant:"inline",Icon:Y,iconProps:{isActive:!0,size:"original"},onClick:K,disabled:!t.length||t.length>1},l.createElement(c.A,{size:"medium",color:"inherit"},l.createElement(h.sA,{id:"COMMON_ACTION_RESTORE"}))))):null))}},498050(e,a,t){t.d(a,{Sj:()=>A,Us:()=>l,ZV:()=>d,hW:()=>o,tH:()=>E});var l,n=t(296540),i=t(870443),r=t(916537),s=t(682474);!function(e){e.Daily="daily",e.Weekly="weekly",e.Monthly="monthly"}(l||(l={}));const o=e=>[{value:l.Daily,label:e({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_DAILY"})},{value:l.Weekly,label:e({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_WEEKLY"})},{value:l.Monthly,label:e({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_MONTHLY"})}],c={[l.Daily]:60,[l.Weekly]:25,[l.Monthly]:12,networkServer:100},E=e=>i.A.object().shape({super_mgmt:i.A.object().shape({autobackup_cron_expr:i.A.string().test("isOneDaySelected",n.createElement(r.sA,{id:"COMMON_VALIDATION_DAY"}),e=>"*"===e.slice(-1)||!Number.isNaN(Number.parseInt(e.slice(-1),10))),autobackup_max_files:i.A.number().integer().test({name:"notExceedMaxFileLimit",test:(a,t)=>{const l=(0,s.sq)(t.parent.autobackup_cron_expr),i=e?c.networkServer:c[l];return!(a<1||a>i||!a)||t.createError({message:n.createElement(r.sA,{id:"SETTINGS_VALIDATION_ALLOWED_NUMBER_IS_MIN_TO_MAX",values:{min:1,max:i}})})}})})}),m={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"},_=Object.entries(m),A=(e,a)=>a?[{value:0,label:e({id:m[0]})}]:_.map(([a,t])=>({value:Number(a),label:e({id:t},{days:a})})),d=new Array(31).fill(1).map((e,a)=>({value:a+1,label:a+1}))},682474(e,a,t){t.d(a,{Dh:()=>r,E$:()=>i,sq:()=>n});var l=t(498050);const n=e=>{let a=l.Us.Monthly;const t=e?.split(" ")||[],n=t?.[2],i=t?.[4];return a="*"!==n?l.Us.Monthly:"*"!==i?l.Us.Weekly:l.Us.Daily,a},i=e=>{let a=1,t=l.Us.Monthly,n=0,i=[];const[r,s,o,c,E]=e?.split(" ")||[];return r&&s&&(n=60*(Number(s)||0)+(Number(r)||0)),"*"!==o?(t=l.Us.Monthly,a=+o):"*"!==E?(t=l.Us.Weekly,i=E.split(",").map(Number)):t=l.Us.Daily,[n,t,a,i]},r=(e,a,t,n)=>{const i=Math.floor(e/60),r=e%60;let s,o;switch(a){case l.Us.Daily:break;case l.Us.Weekly:o=n.join(",");break;case l.Us.Monthly:s=t}return((...e)=>e.map(e=>e??"*").join(" "))(r,i,s,void 0,o)}}}]);