import{useState as S}from"react";import{Button as u,Image as C,Link as v,Spinner as z,Text as i,Box as I}from"@chakra-ui/react";import{Flex as o}from"@chakra-ui/layout";var s=(e,t)=>e?e.length>t?e.substr(0,t-1)+"..."+e.substr(e.length-(t-1),e.length-1):e:"";import{FaTwitter as B}from"react-icons/fa";import A from"@emotion/styled";import{AiOutlineFullscreen as F}from"react-icons/ai";import{useDispatch as O}from"react-redux";import{createSlice as x}from"@reduxjs/toolkit";var w={selectedCollectionId:null,showMint:!1,collectionViewOpen:!1,selectedSpaceId:!1},f=x({name:"collection",initialState:w,reducers:{updateSelectedCollectionId(e,{payload:{id:t}}){e.selectedCollectionId=t},updateShowMint(e,{payload:{showMint:t}}){e.showMint=t},updateCollectionViewOpen(e,{payload:{collectionViewOpen:t}}){e.collectionViewOpen=t},updateSelectedSpaceId(e,{payload:{id:t}}){e.selectedSpaceId=t}}}),{updateSelectedCollectionId:d,updateShowMint:j,updateCollectionViewOpen:q,updateSelectedSpaceId:L}=f.actions,Y=f.reducer;import{jsx as r,jsxs as n}from"react/jsx-runtime";var k="https://imagedelivery.net/6iczWBYEbx_1dYNU7ek_bA/3761cd57-827a-4a05-f82f-ca8c1abc7300/quality=80,height=100",E="https://imagedelivery.net/6iczWBYEbx_1dYNU7ek_bA/2db84388-37eb-4c01-32cc-67b0e1741e00/height=100,quality=80",N="https://imagedelivery.net/6iczWBYEbx_1dYNU7ek_bA/62a5ffd5-6a84-4b3c-7812-f55cf4c7d300/height=100,quality=80",P=A(I)`
  //margin-left: 30px;
  //margin-right: 30px;
  z-index: 99;
  border: 1px solid #cccc;
  border-radius: 14px;
  padding: 10px 20px;
  height: 76px;
  overflow: hidden;
  ${({offersOpen:e})=>e&&`
    position: absolute;
    top : 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: unset;
  `};
`,c=({imageSrc:e,title:t,onClick:l})=>n(o,{align:"center",justify:"space-between",borderWidth:"1.5px",borderColor:"gray.400",borderRadius:"lg",p:1,mb:2,children:[n(o,{align:"center",children:[r(C,{src:e,w:8,h:8,borderRadius:"50%"}),r(i,{fontSize:"12px",fontWeight:600,mb:1,ml:3,children:t})]}),l&&r(u,{size:"xs",bg:"gray.800",color:"white",_hover:{bg:"gray.800"},onClick:l,fontSize:"10",children:"Claim here"})]}),$=({transaction:e,postTransaction:t})=>r(o,{direction:"column",align:"center",children:(e==null?void 0:e.completed)==="pending"?r(p,{}):(e==null?void 0:e.completed)==="error"?r(M,{}):(e==null?void 0:e.completed)==="completed"?r(W,{showOffers:t==null?void 0:t.showOffers,celebrate:t==null?void 0:t.celebrate,website:t==null?void 0:t.website,address:t==null?void 0:t.address}):r(p,{})}),p=()=>n(o,{flexDirection:"column",align:"center",children:[r(o,{justify:"center",align:"center",bg:"muted",w:10,h:10,borderRadius:"50%",children:r(z,{size:"md"})}),r(i,{fontSize:"lg",fontWeight:"bold",mt:"2",children:"Transaction Pending"})]}),W=({showOffers:e,celebrate:t,website:l,address:g})=>{let[a,m]=S(!1),h=O(),b=y=>{h(d({id:y}))};return n(o,{flexDirection:"column",align:"center",children:[r(o,{justify:"center",align:"center",bg:"muted",w:10,h:10,borderRadius:"50%",children:"\u{1F389}"}),r(i,{fontSize:"lg",fontWeight:"bold",mt:"2",children:"Domain Purchase Successful"}),n(i,{textAlign:"center",marginY:"4",fontSize:14,children:["Note: Login to"," ",r(v,{href:l,target:"_blank",textDecoration:"underline",fontWeight:"semibold",children:l})," ","using ",r("b",{children:s(g,6)})," address to view your domain. It might take upto 10 minutes to register your domain."]}),r(u,{mb:5,border:"1.5px solid",w:"fit-content",borderColor:"input",size:"sm",fontWeight:500,rightIcon:r(B,{width:20,height:20,color:"#1DA1F2"}),onClick:t,children:"Celebrate"}),e&&n(P,{bg:"gray.200",offersOpen:a,children:[n(o,{justify:"space-between",align:"center",children:[r(i,{fontSize:"sm",fontWeight:600,mb:1,children:"Exclusive rewards for purchasing UD"}),r(F,{cursor:"pointer",onClick:()=>m(!a)})]}),r(i,{fontSize:"xs",fontWeight:500,mb:3,children:"As a thank you, we're offering exclusive rewards to the first 2500 users by our partner platforms"}),r(c,{imageSrc:N,onClick:()=>b("64072"),title:"Claim 100 $BAD token wrapped Bandit NFTs by Bandit"}),r(c,{imageSrc:k,title:"Eligible to receive 400K $BONK coins after the offer period by BONK"}),r(c,{imageSrc:E,title:"Get 15% discount on all services by NFT Evening"}),r(i,{fontSize:"2xs",children:"These rewards are only available to the first 2500 users from our partner platforms, so don't miss out! Start exploring the exciting world of web3 domains and NFTs with these amazing offers."})]})]})},M=()=>n(o,{flexDirection:"column",align:"center",children:[r(o,{justify:"center",align:"center",bg:"muted",w:10,h:10,borderRadius:"50%",children:"\u274C"}),r(i,{fontSize:"lg",fontWeight:"bold",mt:"2",children:"Domain Purchase Failed"})]}),oe=$;export{oe as default};
