import{Flex as m,Modal as O,ModalBody as R,ModalCloseButton as W,ModalContent as v,ModalHeader as B,ModalOverlay as P,Spinner as k,Text as r}from"@chakra-ui/react";import{LAMPORTS_PER_SOL as L}from"@solana/web3.js";import{Box as u,Flex as a,Slider as p,SliderFilledTrack as b,SliderThumb as z,SliderTrack as T,Spinner as C,Text as n}from"@chakra-ui/react";import h from"@emotion/styled";import{LAMPORTS_PER_SOL as y}from"@solana/web3.js";import"react";import{jsx as t,jsxs as o}from"react/jsx-runtime";var F="https://docs.bonfida.org/collection/naming-service/how-to-create-a-solana-domain-name/purchasing-a-domain-name/direct-registration",M=h(a)`
  position: relative;
`,w=({size:l,setSize:s,loading:S,subTotalPrice:f})=>o(M,{paddingY:4,flexDir:"column",alignItems:"center",children:[o(p,{defaultValue:0,min:1,max:10,step:1,w:"94%",onChange:d=>{s(d)},value:l,children:[o(T,{bg:"muted",children:[t(u,{position:"relative",right:10}),t(b,{bg:"mutedForeground"})]}),t(z,{boxSize:4,borderColor:"mutedForeground",borderWidth:"1"})]}),o(a,{justifyContent:"space-between",w:"full",mt:"1",children:[t(n,{fontSize:"12",children:"1 Kb"}),t(n,{fontSize:"12",children:"10 Kb"})]}),o(a,{w:"full",justifyContent:"space-between",children:[o(n,{fontSize:14,mt:4,fontWeight:"semibold",children:["Selected Size: ",`${l} Kb`]}),t(n,{fontSize:14,mt:4,textDecoration:"underline",cursor:"pointer",onClick:()=>window.open(F),textAlign:"right",children:"How much storage is right for you?"})]}),o(a,{w:"full",justifyContent:"space-between",alignItems:"center",children:[t(n,{fontSize:14,mt:4,fontWeight:"bold",children:"Storage cost"}),o(a,{alignItems:"flex-end",justifyContent:"center",mt:4,children:[S?t(C,{size:"xs",mb:"1"}):o(n,{fontSize:14,fontWeight:"bold",children:["+",`${(f/y).toFixed(5)}`]}),t(n,{ml:"1",fontSize:14,fontWeight:"bold",children:"SOL"})]})]})]}),g=w;import{jsx as e,jsxs as i}from"react/jsx-runtime";var I=({size:l,setSize:s,onOpen:S,onClose:f,isOpen:c,loading:d,subTotalPrice:x})=>i(m,{mt:"2",justifyContent:"space-between",children:[i(m,{alignItems:"center",children:[e(r,{fontSize:"12",mr:"1",children:"Storage Cost:"}),e(r,{textDecoration:"underline",fontSize:"12",cursor:"pointer",onClick:S,children:"Edit"})]}),i(m,{alignItems:"center",justifyContent:"center",children:[d?e(k,{size:"xs"}):i(r,{fontSize:"12",fontWeight:"bold",children:["+",`${(x/L).toFixed(5)}`]}),e(r,{ml:"1",fontSize:"12",fontWeight:"bold",children:"SOL"}),e(r,{fontSize:"12",mx:"1",children:`(${l} KB)`})]}),i(O,{blockScrollOnMount:!1,isOpen:c,onClose:f,isCentered:!0,children:[e(P,{}),i(v,{children:[e(B,{children:"Edit storage size"}),e(W,{}),i(R,{children:[e(r,{fontSize:"12",py:"2",px:"4",borderColor:"mutedForeground",borderWidth:"1px",borderStyle:"solid",borderRadius:"8",children:"Storage size cannot be changed after initial registration."}),e(g,{size:l,setSize:s,loading:d,subTotalPrice:x})]})]})]})]}),Y=I;export{Y as default};
