"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[79137],{979137:(e,t,a)=>{a.r(t),a.d(t,{default:()=>b});var i=a(469733),l=a(296540),n=a(951272),r=a(927099),s=a(71479),A=a(870443),E=a(566723),c=a(126457),C=a(699784),o=a(143811),m=a(705426);const _=(0,s.A)("div")`
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: ${E.S2};
`,u=(0,s.A)(r.A)`
  color: ${({theme:{motifPalette:{text01:e}}})=>e} !important;
  padding-right: ${({theme:{spacing:e}})=>e["spacing-xl"]};
`,d={url:""},O=A.A.object().shape({url:A.A.string().label("DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL").matches(/^(ftp|https?):\/\/.+\/[^\/]+\.(bin|tar)$/,{message:l.createElement(C.sA,{id:"COMMON_VALIDATION_VALID_URL"})}).required()}),b=({onCancel:e,onConfirm:t})=>{const a=(0,i.useDispatch)(),s=(0,l.useCallback)(e=>{t(e.url)},[t]),A=(0,l.useCallback)(()=>{e?e():a((0,c.AS)())},[e]);return l.createElement(n.l1,{initialValues:d,validationSchema:O,onSubmit:s},({handleSubmit:e,dirty:t,isValid:a,isSubmitting:i})=>l.createElement(m.A,{actions:[{text:l.createElement(C.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:A},{text:l.createElement(C.sA,{id:"COMMON_ACTION_UPDATE"}),type:"button",variant:"primary",disabled:!t||(!a||i),onClick:e}],title:l.createElement(u,{size:"body",weight:"bold",truncate:!0},l.createElement(C.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_TITLE"})),size:"small",onRequestClose:A},l.createElement(_,null,l.createElement(r.A,{size:"body"},l.createElement(C.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_MESSAGE"}))),l.createElement(o.A,{name:"url",label:"DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL",variant:"secondary"}),l.createElement(r.A,{color:"tertiary",size:"caption"},l.createElement(C.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_PLACEHOLDER"}))))}}}]);