"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["components/pages/ChangeOwnerPage"],{1017:(e,n,t)=>{t.r(n),t.d(n,{default:()=>d});var s=t(272),r=t.n(s),c=t(271),i=t(89),o=t(270);const a=i.Locale.getTranslate("components.forms.change-subscriptions-owner"),l=({clients:e,domains:n,onCancel:t,...s})=>(0,o.jsxs)(c.Form,{"data-type":"change-subscriptions-owner-form",submitButton:{children:(0,o.jsx)(a,{content:"submit"})},applyButton:!1,cancelButton:{onClick:t},...s,children:[(0,o.jsx)(c.Section,{title:(0,o.jsx)(a,{content:"infoTitle"}),children:(0,o.jsx)("p",{children:(0,o.jsx)(a,{content:"infoDescription",params:{total:n.length,active:n.length,diskSpace:"0 B",traffic:"0 B"}})})}),(0,o.jsx)(c.Section,{title:(0,o.jsx)(a,{content:"possibleOwnersTitle"}),children:(0,o.jsx)(c.FormFieldSelect,{name:"owner",label:null,children:e.map((({id:e,name:n})=>(0,o.jsx)(c.SelectOption,{value:e,children:n},e)))})}),(0,o.jsx)(c.Section,{title:(0,o.jsx)(a,{content:"selectedSubscriptions"}),children:(0,o.jsx)(c.List,{columns:[{key:"name",title:(0,o.jsx)(a,{content:"subscriptionName"})},{key:"owner",title:(0,o.jsx)(a,{content:"ownerName"}),render:({owner:e})=>e.name},{key:"currentIpAddress",title:(0,o.jsx)(a,{content:"currentIpAddress"}),render:({ipAddresses:e})=>e[0]?.ipAddress},{key:"newIpAddress",title:(0,o.jsx)(a,{content:"newIpAddress"})}],data:n})})]});l.propTypes={clients:r().array.isRequired,domains:r().array.isRequired,onCancel:r().func.isRequired};const d=l},1016:(e,n,t)=>{t.r(n),t.d(n,{default:()=>l});var s=t(270),r=t(581),c=t(271),i=t(89),o=t(1017);const a=i.Locale.getTranslate("components.pages.change-owner"),l=()=>{const e=(0,r.useNavigate)(),{viewer:n,domains:t}=(0,r.useLoaderData)(),i=(0,s.useMemo)((()=>{const e=n.client.clients.reduce(((e,{clients:n,...t})=>[...e,t,...n]),[]);return i.sort(((e,n)=>e.name<=n.name?-1:1)),e}),[n.client.clients]),l=(0,s.useCallback)((()=>{e(-1)}),[e]);return(0,s.jsx)(c.Drawer,{"data-type":"change-owner-drawer",isOpen:!0,onClose:l,title:(0,s.jsx)(a,{content:"title"}),form:(0,s.jsx)(o.default,{clients:i,domains:t,onCancel:l})})}}}]);
//# sourceMappingURL=ChangeOwnerPage.js.map?c03c69ccf5dfb5b9a796