(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/server/key-upload"],{1376:(e,n,i)=>{"use strict";i.r(n);var a=i(208),s=i(210),t=i.n(s),l=i(703),o=i.n(l),c=i(209),r=i(361),d=i(1377),f=i.n(d);const u=e=>{const[n,i]=(0,a.useState)(e.values),{data:{config:s}={}}=(0,r.useQuery)(f()),t=({target:e})=>{i({...n,license_key:e.value})},l=({target:e})=>{i({...n,key_code:e.value})},{errors:d}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:(0,a.jsx)(c.Translate,{content:s?.license?.fileUpload?"description":"descriptionCodeOnly"})}),s?.license?.fileUpload?(0,a.jsxs)("div",{className:"form-row",children:[(0,a.jsx)("div",{className:"field-name",children:(0,a.jsx)("label",{htmlFor:"key-code",children:(0,a.jsx)(c.Translate,{content:"licenseKey"})})}),(0,a.jsx)("div",{className:"field-value",children:(0,a.jsxs)("div",{className:"text-value",children:[(0,a.jsxs)("div",{className:"indent-box",children:[(0,a.jsx)("input",{type:"radio",value:"key-code",id:"key-code",className:"radiobox",name:"license_key",onChange:t,checked:"key-code"===n.license_key}),(0,a.jsxs)("div",{className:"indent-box-content",children:[(0,a.jsx)("label",{htmlFor:"key-code",children:(0,a.jsx)(c.Translate,{content:"codeText"})}),(0,a.jsxs)("div",{className:o()("form-row",d.key_code?"error":""),children:[(0,a.jsx)("input",{id:"key-code-input",type:"text",value:n.key_code,name:"key_code",onChange:l}),d.key_code?(0,a.jsx)("p",{className:"hint",dangerouslySetInnerHTML:{__html:d.key_code}}):null,(0,a.jsx)("p",{className:"text-muted",children:(0,a.jsx)(c.Translate,{content:"codeHint"})})]})]})]}),(0,a.jsxs)("div",{className:"indent-box",children:[(0,a.jsx)("input",{type:"radio",value:"key-file",id:"key-file",className:"radiobox",name:"license_key",onChange:t,checked:"key-file"===n.license_key}),(0,a.jsxs)("div",{className:"indent-box-content",children:[(0,a.jsx)("label",{htmlFor:"key-file",children:(0,a.jsx)(c.Translate,{content:"fileText"})}),(0,a.jsxs)("div",{className:o()("form-row",d.key_file?"error":""),children:[(0,a.jsx)("input",{id:"key-file-input",name:"key_file",type:"file"}),d.key_file?(0,a.jsx)("p",{className:"hint",children:d.key_file}):null,(0,a.jsx)("p",{className:"text-muted",children:(0,a.jsx)(c.Translate,{content:"fileHint"})})]})]})]})]})})]}):(0,a.jsxs)("div",{className:o()("form-row",d.key_code?"error":""),children:[(0,a.jsx)("div",{className:"field-name",children:(0,a.jsx)("label",{htmlFor:"key-code",children:(0,a.jsx)(c.Translate,{content:"codeText"})})}),(0,a.jsxs)("div",{className:"field-value",children:[(0,a.jsx)("input",{id:"key-code-input",type:"text",value:n.key_code,name:"key_code",onChange:l}),d.key_code?(0,a.jsx)("p",{className:"hint",dangerouslySetInnerHTML:{__html:d.key_code}}):null,(0,a.jsx)("p",{className:"text-muted",children:(0,a.jsx)(c.Translate,{content:"codeHint"})})]})]})]})};u.propTypes={values:t().object.isRequired,errors:t().object.isRequired},n.default=u},1377:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ServerKeyUploadPage"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"config"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"license"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fileUpload"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:107}};n.loc.source={body:"query ServerKeyUploadPage {\r\n    config {\r\n        license {\r\n            fileUpload\r\n        }\r\n    }\r\n}\r\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var a=e.type;"NamedType"===a.kind&&n.add(a.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,n)})),e.definitions&&e.definitions.forEach((function(e){i(e,n)}))}var a={};function s(e,n){for(var i=0;i<e.definitions.length;i++){var a=e.definitions[i];if(a.name&&a.name.value==n)return a}}n.definitions.forEach((function(e){if(e.name){var n=new Set;i(e,n),a[e.name.value]=n}})),e.exports=n,e.exports.ServerKeyUploadPage=function(e,n){var i={kind:e.kind,definitions:[s(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var t=a[n]||new Set,l=new Set,o=new Set;for(t.forEach((function(e){o.add(e)}));o.size>0;){var c=o;o=new Set,c.forEach((function(e){l.has(e)||(l.add(e),(a[e]||new Set).forEach((function(e){o.add(e)})))}))}return l.forEach((function(n){var a=s(e,n);a&&i.definitions.push(a)})),i}(n,"ServerKeyUploadPage")}}]);
//# sourceMappingURL=key-upload.js.map?7fab7c3f05cebd0665d1