"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[10685],{725508(e,t,n){n.d(t,{A:()=>l});var a=n(296540),r=n(629318);const l=(0,n(51946).w)(e=>(0,a.createElement)("svg",(0,r.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3a1 1 0 0 1 1-1h7a1 1 0 0 1 .707.293l3 3A1 1 0 0 1 16 6v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V3Z",fill:"currentColor",className:e.twotonedclassname}),(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V6a1 1 0 0 0-.293-.707l-3-3A1 1 0 0 0 12 2H5Zm0 15V3h6.999v2a1 1 0 0 0 1 1h2L15 17H5Z",fill:"currentColor",className:e.baseclassname}),(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.999 2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V6a1 1 0 0 0-.293-.707l-3-3A1 1 0 0 0 12 2H5Zm10 4.5h-2.5a1 1 0 0 1-1-1V3L15 6.5Z",fill:"currentColor",className:e.fillclassname})))},747280(e,t,n){n.d(t,{A:()=>l});var a=n(296540),r=n(629318);const l=(0,n(51946).w)(e=>(0,a.createElement)("svg",(0,r.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,a.createElement)("rect",{x:5,y:5,width:10,height:12,rx:1,fill:"currentColor",className:e.twotonedclassname}),(0,a.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,a.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,a.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,a.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,a.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})))},470591(e,t,n){n.d(t,{A:()=>a});const a=(0,n(296540).createContext)({isStandalone:!0,header:[null,()=>{}],footer:[null,()=>{}]})},691441(e,t,n){n.d(t,{A:()=>l});var a=n(296540),r=n(470591);function l(e){const{children:t}=e,{isStandalone:n,footer:[,l]}=(0,a.useContext)(r.A);return(0,a.useLayoutEffect)(()=>{if(!n)return l(t),()=>l(null)},[n,t]),a.createElement(a.Fragment,null,n&&t)}},313615(e,t,n){n.d(t,{A:()=>i});var a=n(296540),r=n(42302),l=n(40964);const o=(0,n(722860).c)(l.A),i=a.forwardRef(function(e,t){const{accept:n,multiple:l=!1,id:i="file-upload",name:c="file-upload",className:s="",inputClassName:m="",onChange:d=r.A,children:u,...E}=e,A=(0,a.useRef)(null),p=t||A;return a.createElement("label",{className:s,tabIndex:0,onKeyDown:e=>{var t;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),null===(t=p.current)||void 0===t||t.click())}},a.createElement("input",{type:"file",id:i,name:c,accept:n,multiple:l,ref:p,onChange:e=>d(e,p),className:o.concat(m)("input"),...E}),u)})},40964(e,t,n){n.d(t,{A:()=>r});var a=n(349005),r={input:"input__kxWRaesR",uploadButton:"uploadButton__kxWRaesR"};(0,a.A)(".input__kxWRaesR{display:none}.uploadButton__kxWRaesR{-webkit-appearance:none;-moz-appearance:none;appearance:none}")},588915(e,t,n){n.d(t,{A:()=>m});var a=n(296540),r=n(313615),l=n(40964),o=n(722860),i=n(758649),c=n(273133);const s=(0,o.c)(l.A),m=(0,c.A)(({id:e="file",name:t="file",accept:n,multiple:l=!1,motif:o="light",disabled:c,children:m,onChange:d,className:u,buttonClassName:E,forwardedRef:A,...p})=>a.createElement(r.A,{id:e,name:t,accept:n,multiple:l,onChange:d,className:u,disabled:c},a.createElement(i.A,{component:"span",className:s.concat(E)("uploadButton"),motif:o,ref:A,disabled:c,...p},m)))},263130(e,t,n){n.d(t,{A:()=>d});var a=n(822336),r=n(296540),l=n(217439),o=n(71479),i=n(382389),c=n(566723),s=n(294303);const m=(0,o.A)(l.A)`
  line-height: 20px;
`,d=({icon:e,description:t,action:n,footer:l,background:o,...d})=>{const{themeName:u}=(0,i.u)();return r.createElement(s.A,{flexGrow:1,borderRadius:c.YC,padding:c.kc,background:o||a.Ay[`desktop-color-neutral-01-${u}`],gap:c.kc,flexDirection:"column",...d},r.createElement(s.A,{flexGrow:1,gap:c.kc},e,t?r.createElement(m,{size:"medium"},t):null,n?r.createElement(s.A,{marginLeft:"auto"},r.createElement(m,{size:"medium"},n)):null),l)}},823084(e,t,n){n.d(t,{A:()=>c});var a=n(822336),r=n(296540),l=n(162420),o=n(382389),i=n(263130);const c=({children:e,icon:t,background:n,...c})=>{const{themeName:s}=(0,o.u)();return r.createElement(i.A,{icon:t||r.createElement(l.A,{variant:"fill",size:"original",color:a.Ay[`desktop-color-ublue-06-${s}`]}),description:e,background:n,...c})}},689965(e,t,n){n.d(t,{A:()=>A,I:()=>a});var a,r=n(296540),l=n(822336),o=n(963724),i=n(71479),c=n(825032),s=n(566723),m=n(294303),d=n(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(a||(a={}));const u=(0,i.A)(m.A,(0,d.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||l.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,E=(0,i.A)(o.A,(0,d.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||l.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||l.Ay[t===c.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${s.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${s.Ln} ${s.Ln};
      }
    }
  }
`,A=({type:e,marginBottom:t,margin:n,padding:l,flex:o,width:i,nested:c,...s})=>"items"in s?r.createElement(E,{marginBottom:t,margin:n,padding:l,flex:o,nested:c,...s}):r.createElement(u,{nested:c,width:i,marginBottom:t,margin:n,padding:l,flex:o,isButtonList:e===a.BUTTON_LIST,...s},s.children)},242366(e,t,n){n.d(t,{A:()=>o});var a=n(296540),r=n(566723),l=n(294303);const o=(0,a.forwardRef)((e,t)=>a.createElement(l.A,{ref:t,flexDirection:"column",gap:r.kc,width:"100%",...e}))},48925(e,t,n){n.d(t,{A:()=>_});var a=n(822336),r=n(296540),l=n(217439),o=n(71479),i=n(566723),c=n(968906),s=n(199582),m=n(311785),d=n(766624),u=n(294303),E=n(689965),A=n(242366);const p=(0,o.A)(E.A,(0,m.A)("isOutlined"))`
  border: ${({theme:{themeName:e},isOutlined:t})=>`1px solid ${t?a.Ay[`desktop-color-ublue-06-${e}`]:"transparent"}`};
`,_=({children:e,title:t,tooltip:n,tooltipProps:a,[s.L]:o,titleAction:m,isOutlined:E})=>{const _=(e=>r.Children.toArray(e).length>0)(e);return r.createElement(p,{marginBottom:"none",...c.A.addDataTestId(o??""),isOutlined:E},r.createElement(u.A,{flexDirection:"column",..._&&{gap:i.Ln},width:"100%"},t?r.createElement(u.A,{alignItems:"center",gap:i.YC,justifyContent:"space-between",width:"100%"},r.createElement(u.A,{gap:i.YC,alignItems:"center"},r.createElement(l.A,{variant:"heading-medium"},t),n?r.createElement(d.A,{description:n,portal:!0,...a}):null),m?r.createElement(u.A,null,m):null):null,_?r.createElement(A.A,null,e):null))}},373229(e,t,n){n.d(t,{A:()=>m});var a=n(296540),r=n(758649),l=n(71479),o=n(566723),i=n(916537),c=n(311785);const s=(0,l.A)("footer",(0,c.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${o.S2} ${o.fS};
  gap: ${o.kc};
`,m=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:l,onFormSubmit:o,onFormReset:c,onFormCancel:m,className:d,submitButtonText:u,customButton:E,applyButton:A,applyButtonFirst:p,hideCancelButton:_,form:T})=>{const g=(0,a.useMemo)(()=>A||a.createElement(r.A,{name:"submit",variant:"primary",type:"submit",onClick:o,disabled:!t||n||l,form:T},a.createElement(i.sA,{id:u||"COMMON_ACTION_APPLY_CHANGES"})),[A,T,t,n,l,o,u]);return a.createElement(s,{className:d,hasFormResetButton:!!c},p?g:E,_?null:a.createElement(r.A,{name:"cancel",variant:"default",type:"button",onClick:m,disabled:!e&&!t},a.createElement(i.sA,{id:"COMMON_ACTION_CANCEL"})),c?a.createElement(r.A,{name:"reset",variant:"default",type:"button",onClick:c,disabled:!t},a.createElement(i.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})):null,p?E:g)}},329109(e,t,n){n.d(t,{A:()=>m});var a=n(296540),r=n(691441),l=n(71479),o=n(132196),i=n(373229);const c=(0,l.A)("div")`
  height: 66px;
`,s=o.AH`
  padding: 0px !important;
`,m=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:l,...o})=>e?a.createElement(r.A,null,a.createElement(i.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:l,className:s,...o})):a.createElement(c,null)},766889(e,t,n){n.r(t),n.d(t,{default:()=>U});var a=n(469733),r=n(296540),l=n(742920),o=n(38671),i=n(79786),c=n(845030),s=n(675359),m=n(175165),d=n(329109),u=n(305455),E=n(614476),A=n(263963);const p=E.z.intersection(E.z.object({name:E.z.string({message:(0,A.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_NAME_VALIDATION")}).min(1,{message:(0,A.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_NAME_VALIDATION")}).max(64,{message:(0,A.rn)("SETTINGS_COMMON_FIELD_SHOULD_NOT_EXCEED_MAX_LENGTH",{limit:64,name:(0,A.rn)("COMMON_NAME")})})}),E.z.union([E.z.object({type:E.z.literal(u.M.SELF_SIGNED),commonName:E.z.string().min(1,{message:(0,A.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_COMMON_NAME_VALIDATION")}),alternativeName:E.z.string()}),E.z.object({type:E.z.literal(u.M.UPLOAD),certificate:E.z.string().min(1,{message:(0,A.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_CERTIFICATE_VALIDATION")}),private_key:E.z.string().min(1,{message:(0,A.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_PRIVATE_KEY_VALIDATION")}),certificateFileName:E.z.string().min(1),private_keyFileName:E.z.string().min(1)})]));var _=n(349785),T=n(979106),g=n(217439),S=n(132196),f=n(895424),C=n(566723),I=n(823084),N=n(48925),h=n(242366),v=n(349107),b=n(294303),M=n(916537),R=n(765562),L=n(822336),O=n(588915),y=n(758649),F=n(705145),x=n(86838),k=n(747280),D=n(725508),w=n(382389),G=n(258840),$=n(766624);const B=S.AH`
  padding: 0;
`,P=({form:e,name:t,fileNameField:n,label:a,tooltip:l,accept:o})=>{const{themeName:i}=(0,w.u)(),c=(0,A.L_)();return r.createElement(_.xI,{control:e.control,name:t,render:({field:s,fieldState:m})=>{const d=e.watch(n),u=Boolean(s.value&&d);return r.createElement(b.A,{flexDirection:"column",alignItems:"flex-start"},u?r.createElement(b.A,{borderRadius:C.YC,padding:C.YC,gap:C.kc,width:"100%",background:L.Ay[`desktop-color-neutral-01-${i}`],minHeight:C.fS,alignItems:"center"},r.createElement(D.A,{size:"original",variant:"fill",color:L.Ay[`desktop-color-neutral-08-${i}`]}),r.createElement(F.A,{isTruncated:!0,style:{flex:1},color:"text-2"},d),r.createElement(_.xI,{control:e.control,name:n,render:({field:e})=>r.createElement(y.A,{variant:"inline",onClick:()=>{s.onChange(""),e.onChange("")}},r.createElement(k.A,{size:"original",color:L.Ay[`desktop-color-neutral-08-${i}`]}))})):r.createElement(b.A,{minHeight:C.fS,alignItems:"center",gap:C.kc},r.createElement(_.xI,{control:e.control,name:n,render:({field:e})=>r.createElement(O.A,{name:t,variant:"link",accept:o,buttonClassName:S.AH`
                      ${B}
                    `,onChange:async({target:t})=>{const n=t.files?.[0];if(n)try{const t=await(0,G.Gu)(n);e.onChange(n.name),s.onChange(t)}catch{}else e.onChange(""),s.onChange("")}},a)}),l?r.createElement($.A,{description:l,portal:!0}):null),m.error?r.createElement(x.A,{isInvalid:!0,label:c(m.error.message)}):null)}})},V=[{id:u.M.SELF_SIGNED,label:r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_SELF_SIGNED"})},{id:u.M.UPLOAD,label:r.createElement(M.sA,{id:"COMMON_UPLOAD"})}],Y=({form:e,isContentFiltering:t})=>{const n=(0,_.FH)({control:e.control,name:"type"}),{formatMessage:a}=(0,M.tz)();return r.createElement(N.A,null,r.createElement(b.A,{flexDirection:"column",width:"100%",gap:C.Ln},r.createElement(I.A,null,r.createElement(M.sA,{id:n===u.M.SELF_SIGNED?t?"SETTINGS_SYSTEM_CTRL_CERTIFICATES_SELF_SIGNED_INFO_CONTENT_FILTERING":"SETTINGS_SYSTEM_CTRL_CERTIFICATES_SELF_SIGNED_INFO":t?"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ADD_NEW_INFO_CONTENT_FILTERING":"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ADD_NEW_INFO",values:{link:r.createElement(v.A,{id:"COMMON_LEARN_MORE",href:R.A.sslInspectionArticle,noWrap:!0})}})),r.createElement(f.A,{control:e.control,name:"name",label:r.createElement(M.sA,{id:"COMMON_NAME"})}),r.createElement(_.xI,{control:e.control,name:"type",render:({field:e})=>r.createElement(T.A,{tabsClassName:S.AH`
                flex: 1;
              `,variant:"capsule",tabs:V,selectedTab:e.value,onSelectTab:({id:t})=>e.onChange(t)})}),n===u.M.SELF_SIGNED?r.createElement(h.A,null,r.createElement(f.A,{control:e.control,name:"commonName",label:r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_COMMON_NAME"}),tooltip:r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_COMMON_NAME_TOOLTIP"}),placeholder:a({id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_COMMON_NAME_PLACEHOLDER"})}),r.createElement(f.A,{control:e.control,name:"alternativeName",label:r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ALTERNATIVE_NAME"}),tooltip:r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ALTERNATIVE_NAME_TOOLTIP"})}),r.createElement(g.A,{size:"small",color:"text-3"},r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATE_EXPIRES_AT"}))):r.createElement(h.A,{alignItems:"flex-start"},r.createElement(P,{form:e,name:"certificate",fileNameField:"certificateFileName",label:r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD"}),tooltip:r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_TOOLTIP"}),accept:".crt,.cer,.ca-bundle,.p7b,.p7c,.p7s,.pem"}),r.createElement(P,{form:e,name:"private_key",fileNameField:"private_keyFileName",label:r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_PRIVATE_KEY"}),tooltip:r.createElement(M.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_PRIVATE_KEY_TOOLTIP"}),accept:".pfx,p12"}))))},z={type:u.M.SELF_SIGNED,name:"",commonName:"",alternativeName:"",certificate:"",private_key:"",certificateFileName:"",private_keyFileName:""},U=({activeItem:e})=>{const t=(0,a.useDispatch)(),n=(0,i.m)({schema:p,defaultValues:z}),E=n.handleSubmit(async e=>{try{await(async e=>{const n=e.type===u.M.SELF_SIGNED?(0,m.pY)({name:e.name,common_name:e.commonName||"",alternative_name:e.alternativeName||""}):(0,m.GX)({name:e.name,certificate:btoa(e.certificate||""),private_key:btoa(e.private_key||"")});return t(n)})(e),t((0,m.d6)()),t((0,c.K5)()),n.reset()}catch(e){const n=(0,o.F)(e)?e:void 0;t((0,s.ox)({type:l.C.danger,message:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ADD_ERROR",errorMessage:n?.msg}))}});return r.createElement("form",{onSubmit:E,style:{height:"100%"}},r.createElement(Y,{form:n,isContentFiltering:e.id===u.I.CONTENT_FILTERING}),r.createElement(d.A,{onFormSubmit:E,onFormCancel:()=>n.reset(),isDirty:n.formState.isDirty,isSubmitting:n.formState.isSubmitting,submitButtonText:"SETTINGS_SYSTEM_CTRL_CERTIFICATE_ADD"}))}},305455(e,t,n){var a,r;n.d(t,{I:()=>r,M:()=>a}),function(e){e.SELF_SIGNED="SELF_SIGNED",e.UPLOAD="UPLOAD"}(a||(a={})),function(e){e.SSL_INSPECTION="sslInspection",e.CONTENT_FILTERING="contentFiltering"}(r||(r={}))},766624(e,t,n){n.d(t,{A:()=>c});var a=n(296540),r=n(271856),l=n(709690),o=n(284428),i=n(566723);const c=({description:e,isInteractive:t,portal:n=!0,cursorType:c,title:s,position:m,width:d,iconProps:u,disabled:E=!1})=>{const A=(0,o.Im)()||E,p=(0,o.q)();return a.createElement(r.A,{description:e,portal:n,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:c,title:s,position:m,width:d,disableHover:p},a.createElement(l.A,{isActive:!0,size:"original",opacity:A?i.xN:void 0,...u}))}},79786(e,t,n){n.d(t,{m:()=>i});var a=n(296540),r=n(349785),l=n(59116),o=n(870893);function i({schema:e,defaultValues:t,presets:n}){const i=(0,a.useMemo)(()=>n?(0,l.A)(n,e=>e.defaultValues):{},[n]),c=(0,a.useMemo)(()=>({...t,...i}),[i,t]),s=(0,r.mN)({resolver:(0,o.u)(e),shouldFocusError:!0,defaultValues:c,shouldUseNativeValidation:!1,mode:"onTouched"}),m=(0,a.useRef)(c);m.current=c;const d=(0,a.useCallback)((...e)=>{const[t,...n]=e;return s.reset(t?{...t,...i}:m.current,...n)},[i,s]);return{...s,reset:d,formState:{...s.formState,isDirty:!!Object.keys(s.formState.dirtyFields).length,isSubmitting:s.formState.isSubmitting},handleSubmit:(...e)=>s.handleSubmit(e[0],(t,...n)=>{const a=Object.keys(t)[0];if(a)try{const e=document.getElementsByName(a)?.[0];e?.scrollIntoView?.({behavior:"smooth",block:"center"}),e?.focus?.({preventScroll:!0})}catch{}e[1]?.(t,...n)})}}},451449(e,t,n){n.d(t,{I:()=>a});const a=(0,n(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},284428(e,t,n){n.d(t,{Im:()=>c,iL:()=>s,mQ:()=>o,pv:()=>l,q:()=>i});var a=n(296540),r=n(451449);function l(){return(0,a.useContext)(r.I)}function o(){return l().fields}function i(){return l().tooltipPopovers}function c(){return l().tooltipIcons}function s(){return l().labels}},263963(e,t,n){n.d(t,{L_:()=>s,MS:()=>c,rn:()=>i});var a=n(296540),r=n(614476),l=n(916537);const o="{::}",i=(e,t)=>`${e}${o}${JSON.stringify(t??{})}`,c=(e,t)=>{if("string"!=typeof t)return;const[n,...a]=t.split(o);if(!n||!a.length)return t;let r={};try{r=Object.fromEntries(Object.entries(JSON.parse(a.join(o))).map(([t,n])=>[t,"string"==typeof n?c(e,n):n]))}catch{}return e.formatMessage({id:n},r)};function s(){const{formatMessage:e}=(0,l.tz)();return(0,a.useCallback)(t=>c({formatMessage:e},t),[e])}r.z.setErrorMap((e,t)=>e.message?{message:e.message}:e.code===r.z.ZodIssueCode.too_small&&"string"===e.type?{message:i("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===r.z.ZodIssueCode.too_big&&"string"===e.type?{message:i("COMMON_MAX_CHARS",{name:i("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===r.z.ZodIssueCode.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:i("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===r.z.ZodIssueCode.too_small&&"array"===e.type?{message:i("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===r.z.ZodIssueCode.invalid_type&&"undefined"===e.received?{message:i("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===r.z.ZodIssueCode.invalid_type&&"number"===e.expected?{message:i("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:t.defaultError})},895424(e,t,n){n.d(t,{A:()=>m});var a=n(296540),r=n(349785),l=n(438628),o=n(705145),i=n(566723),c=n(263963),s=n(284428);const m=function({control:e,name:t,label:n,placeholder:m,tooltip:d,tooltipProps:u,autoFocus:E,motif:A,onChange:p,onBlur:_,onAfterChange:T,onPaste:g,onKeyDown:S,passwordToggle:f,type:C,helperMessage:I,autoComplete:N,contentBefore:h,contentAfter:v,onFocus:b,value:M,invalid:R}){const L=(0,s.mQ)(),O=(0,s.Im)(),y=(0,s.q)(),F=(0,c.L_)();return a.createElement(r.xI,{control:e,name:t,render:({field:e,fieldState:c,formState:s})=>a.createElement(l.A,{type:C||(f?"password":"text"),variant:"secondary",width:"100%",autoFocus:E,...e,onChange:t=>{p?p(t,e,s):e.onChange(t),T?.(t)},onBlur:t=>{_?_(t,e,s):e.onBlur()},onFocus:b,onPaste:g,disabled:L,value:M??e.value?.toString(),invalid:R||(c.invalid?a.createElement(o.A,{variant:"inherit",style:{overflowWrap:"break-word"}},F((0,r.Jt)(s.errors,t)?.message)||!0," "):void 0),label:n,placeholder:m,labelTooltip:d,labelTooltipProps:{style:{opacity:O?i.xN:void 0,pointerEvents:y?"none":void 0,...u?.style},...u},motif:A,passwordToggle:f,helperMessage:I,autoComplete:N,onKeyDown:S,contentBefore:h,contentAfter:v})})}},383149(e,t,n){n.d(t,{A:()=>r});var a=n(885205);const r=function(e,t){return!(null==e||!e.length)&&(0,a.A)(e,t,0)>-1}},887809(e,t,n){n.d(t,{A:()=>a});const a=function(e,t,n){for(var a=-1,r=null==e?0:e.length;++a<r;)if(n(t,e[a]))return!0;return!1}},458043(e,t,n){n.d(t,{A:()=>s});var a=n(8300),r=n(383149),l=n(887809),o=n(45572),i=n(552789),c=n(764099);const s=function(e,t,n,s){var m=-1,d=r.A,u=!0,E=e.length,A=[],p=t.length;if(!E)return A;n&&(t=(0,o.A)(t,(0,i.A)(n))),s?(d=l.A,u=!1):t.length>=200&&(d=c.A,u=!1,t=new a.A(t));e:for(;++m<E;){var _=e[m],T=null==n?_:n(_);if(_=s||0!==_?_:0,u&&T==T){for(var g=p;g--;)if(t[g]===T)continue e;A.push(_)}else d(t,T,s)||A.push(_)}return A}},144757(e,t,n){n.d(t,{A:()=>i});var a=n(458043),r=n(187671),l=n(224326),o=n(153533);const i=(0,l.A)(function(e,t){return(0,o.A)(e)?(0,a.A)(e,(0,r.A)(t,1,o.A,!0)):[]})}}]);