(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/server/key-upload"],{1785:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>m});var a=i(216),s=i(218),t=i.n(s),l=i(720),o=i.n(l),c=i(217),d=i(373),r=i(1786),f=i.n(r);const u=e=>{const[n,i]=(0,a.useState)(e.values),{data:{config:s}={}}=(0,d.useQuery)(f()),t=({target:e})=>{i({...n,license_key:e.value})},l=({target:e})=>{i({...n,key_code:e.value})},{errors:r}=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",r.key_code?"error":""),children:[(0,a.jsx)("input",{id:"key-code-input",type:"text",value:n.key_code,name:"key_code",onChange:l}),r.key_code?(0,a.jsx)("p",{className:"hint",dangerouslySetInnerHTML:{__html:r.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",r.key_file?"error":""),children:[(0,a.jsx)("input",{id:"key-file-input",name:"key_file",type:"file"}),r.key_file?(0,a.jsx)("p",{className:"hint",children:r.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",r.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}),r.key_code?(0,a.jsx)("p",{className:"hint",dangerouslySetInnerHTML:{__html:r.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};const m=u},1786: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?52dac2867bd50c75e97d