"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[11804],{711804(i,e,t){t.r(e),t.d(e,{default:()=>b});var s=t(274934),l=t(602086),a=t(977872),n=t(843871),r=t(938984),A=t(247816),C=t(950804),d=t(309130),o=t(869332),_=t(470070),c=t(120197),u=t(384783);const E=(0,A.A)("div")`
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: ${d.S2};
`,O=(0,A.A)(r.A)`
  color: ${({theme:{motifPalette:{text01:i}}})=>i} !important;
  padding-right: ${({theme:{spacing:i}})=>i["spacing-xl"]};
`,m={url:""},h=C.A.object().shape({url:C.A.string().label("DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL").matches(/^(ftp|https?):\/\/.+\/[^\/]+\.(bin|tar)$/,{message:(0,s.jsx)(_.sA,{id:"COMMON_VALIDATION_VALID_URL"})}).required()}),b=({onCancel:i,onConfirm:e})=>{const t=(0,a.wA)(),A=(0,l.useCallback)(i=>{e(i.url)},[e]),C=(0,l.useCallback)(()=>{i?i():t((0,o.AS)())},[i,t]);return(0,s.jsx)(n.l1,{initialValues:m,validationSchema:h,onSubmit:A,children:({handleSubmit:i,dirty:e,isValid:t,isSubmitting:l})=>(0,s.jsxs)(u.A,{actions:[{text:(0,s.jsx)(_.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:C},{text:(0,s.jsx)(_.sA,{id:"COMMON_ACTION_UPDATE"}),type:"button",variant:"primary",disabled:!e||!t||l,onClick:i}],title:(0,s.jsx)(O,{size:"medium",weight:"bold",isTruncated:!0,children:(0,s.jsx)(_.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_TITLE"})}),size:"small",onRequestClose:C,children:[(0,s.jsx)(E,{children:(0,s.jsx)(r.A,{size:"medium",children:(0,s.jsx)(_.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_MESSAGE"})})}),(0,s.jsx)(c.A,{name:"url",label:"DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL",variant:"secondary"}),(0,s.jsx)(r.A,{color:"text-3",size:"small",children:(0,s.jsx)(_.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_PLACEHOLDER"})})]})})}}}]);