1import{d as D,T as R,r as i,k as N,m as y,S as O,an as B,b as f,o,c as l,f as w,a as e,F as C,K as H,g as S,J as V,e as j,w as d,n as T,t as p,D as c,aI as F,aJ as G,_ as K}from"./index-CQwIQ2Uz.js";const b=x=>(F("data-v-4198ada3"),x=x(),G(),x),q=b(()=>e("div",{class:"m:px-2 md:px-8 lg:px-16 xl:px-24 2xl:px-32 pt-10 grid grid-cols-1 mx-10 md:mx-0"},[e("h2",{class:"pixelfont text-yellow-600 text-4xl mb-2 w-full"},"Shop")],-1)),z={key:0,class:"sm:px-2 md:px-8 lg:px-16 xl:px-24 2xl:px-32 pb-32 pt-10 grid grid-cols-1 mx-10 md:mx-0 4xl gap-4"},J=b(()=>e("h1",{class:"pixelfont text-xl"},"Oops! Our shop is taking a short break. We'll be back soon. Thanks for your understanding!",-1)),M=[J],P={key:1,class:"sm:px-2 md:px-8 lg:px-16 xl:px-24 2xl:px-32 pb-32 pt-10 grid grid-cols-1 mx-10 md:mx-0 4xl gap-4"},W={key:2,class:"sm:px-2 md:px-8 lg:px-16 xl:px-24 2xl:px-32 pb-b pt-4 grid grid-cols-1 mx-10 md:mx-0 4xl gap-4 pb-40"},Y=b(()=>e("p",{class:"prose-lg"},[c("You can now purchase LooperLands assets by credit card - no crypto required!"),e("br"),c(" LooperLands will send the asset to the connected wallet address, and activate "),e("b",null,"Loopring L2"),c(" if needed."),e("br"),c(" LooperLands assets are on Loopring, and can be viewed on the blockchain explorer or transacted via "),e("a",{href:"https://loopring.io",target:"_blank",class:"text-green-700 hover:underline"},"Loopring.io"),c("."),e("br"),c(" Popular Loopring marketplaces such as "),e("a",{href:"https://loopexchange.art",target:"_blank",class:"text-green-700 hover:underline"},"LoopExchange.art"),c(" allow anyone to buy or sell assets, and is the home of thousands of unique LooperLands assets as well. ")],-1)),$={class:"pt-10 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 mx-2 sm:mx-4 md:mx-6 lg:mx-10 md:mx-0 4xl:grid-cols-6 gap-4"},Q=["src","alt"],U={key:1,class:"w-full flex justify-center my-10"},X=["src","onerror"],Z={class:"flex flex-row items-center"},ee={class:"flex-grow pixelfont text-yellow-500 text-md leading-6"},te={class:"text-xs shrink-0"},se={key:0,class:"font-sans mt-2 pt-2 text-slate-600 text-xs w-full border-t whitespace-pre-line"},oe={class:"flex flex-row items-center -my-2"},ae={class:"flex-grow text-lg font-bold flex-shrink-0"},ne=D({__name:"Shop",setup(x){const L=R(),v=i(!1),u=i([]),g=i(null);N(()=>{E(),v.value=!0,y().post("asset/listable",{}).then(a=>a.data).then(a=>{u.value=a.assets,v.value=!1})});async function E(){let _=(await O.get("https://api3.loopring.io/api/v3/user/balances?address="+"0xc5094ec2ca180f7593c9fc7a06706d43cfabb2ad"+"&tokens=1")).data[0].total/1e18;g.value=_>10}B(V,{onChange:s=>{m.value=s.isConnected}});const m=i(!1),h=i(null);function I(s){var r;if(!m.value){(r=document.getElementById("connect-button"))==null||r.click();return}h.value=s.id,y().post("asset/buy/"+s.id).then(n=>n.data).then(n=>{window.location.href=n.url}).catch(n=>{L.error({title:"Couldn't process purchase",content:n.response.data.message,duration:5e3})}).finally(()=>{h.value=null})}function A(s,a){s.currentTarget.onerror=null,s.currentTarget.src="https://cdn.jsdelivr.net/gh/balkshamster/looperlands@main/client/img/2/"+a.token.tokenId.replace("0x","NFT_")+".png"}return(s,a)=>{const r=f("n-spin"),n=f("n-button"),k=f("n-card");return o(),l(C,null,[q,g.value===!1?(o(),l("div",z,M)):g.value===null?(o(),l("div",P,[w(r)])):(o(),l("div",W,[Y,e("div",$,[u.value?(o(!0),l(C,{key:0},H(u.value,t=>(o(),j(k,{class:"rounded-xl overflow-hidden shadow-lg hover:shadow-xl ease-in-out bg-slate-50"},{header:d(()=>[e("div",{class:T(["-m-6 -mb-2 bg-slate-200",t.assetType!=="tracker"?"-mt-20 pt-20":""])},[t.assetType==="tracker"?(o(),l("img",{key:0,src:"https://looperlands.sfo3.digitaloceanspaces.com/assets/"+t.assetType+"/1/"+t.token.tokenHash+".png",class:"w-full h-[250px] object-cover",alt:t.name},null,8,Q)):(o(),l("div",U,[e("img",{src:"https://looperlands.sfo3.cdn.digitaloceanspaces.com/assets/"+t.assetType+"/2/"+t.token.tokenHash+".png",onerror:_=>A(_,t),class:T(["rounded-md bg-slate-50 shadow-md top-4 relative object-none object-left-bottom spriteAnimation idle scale-150",t.assetType])},null,10,X)]))],2)]),footer:d(()=>[]),action:d(()=>[e("div",oe,[e("div",ae,"$ "+p(t.listing.price),1),w(n,{type:"primary",size:"small",round:"",loading:h.value===t.id,onClick:()=>I(t)},{default:d(()=>[c(p(m.value?"Buy":"Connect wallet to buy"),1)]),_:2},1032,["loading","onClick"])])]),default:d(()=>[e("div",Z,[e("div",ee,p(t.name),1),e("div",te,p(t.assetType),1)]),t.listing.description?(o(),l("div",se,p(t.listing.description),1)):S("",!0)]),_:2},1024))),256)):S("",!0)])]))],64)}}}),ce=K(ne,[["__scopeId","data-v-4198ada3"]]);export{ce as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.