@bloxbean/yaci-viewer
Version:
A Cardano blockchain data viewer for developers. It works with the Yaci-Store backend, supporting both a local devnet and public networks.
2 lines (1 loc) • 3.69 kB
JavaScript
import{e as d,a as V,t as A}from"../chunks/disclose-version.BTC8Bk4r.js";import"../chunks/legacy.DKpsC3nd.js";import{p as W,l as q,a as X,b as Y,s,d as a,r as e,t as B,c as H,g as r,m as L}from"../chunks/runtime.NVyxXVLy.js";import{s as n}from"../chunks/render.Dr_6zaa7.js";import{e as Z,i as tt}from"../chunks/each.e-7RQQYD.js";import{s as T}from"../chunks/attributes.CqauuZ_8.js";import{s as et}from"../chunks/class.DCW6ehBg.js";import{i as at}from"../chunks/lifecycle.BF-zkLgr.js";import{p as rt}from"../chunks/props.Btle0pBM.js";import{s as st,a as ot}from"../chunks/store.EL_7F1Fq.js";import{g as z}from"../chunks/entry.CYtqVooA.js";import{p as lt}from"../chunks/stores.DmQQ1jkb.js";import{t as ct}from"../chunks/util.8sVtkjoC.js";var nt=A('<tr><td class="py-2 px-4 "> </td><td class="py-2 px-4 text-center"> </td><td class="py-2 px-4 text-center"> </td><td class="py-2 px-4 text-center"><a class="text-blue-500"> </a></td><td class="py-2 px-4"><a class="text-blue-500"><span class="ml-2"> </span></a></td></tr>'),pt=A('<section class="container mx-auto text-sm"><h2 class="text-xl font-bold text-center text-gray-500 mb-4">Pool Retirements</h2> <div class="flex flex-wrap justify-between mt-4 mb-2"><a href="#" class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">< Previous</a> <a href="#" class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">Next ></a></div> <div class="overflow-x-auto"><table class="w-full bg-white border border-gray-300"><thead><tr><th class="py-2 px-4 bg-gray-100 font-bold text-center">Pool</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Epoch</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Retirement Epoch</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Block</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Transaction Hash</th></tr></thead><tbody></tbody></table></div> <div class="flex flex-wrap justify-between mt-2 mb-2"><a href="#" class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">< Previous</a> <a href="#" class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">Next ></a></div></section>');function wt(C,P){W(P,!1);const D=st(),w=()=>ot(lt,"$page",D),g=L();let o=rt(P,"data",12),p=L([]);const k=()=>{let t=parseInt(o().page)-1;t<=0&&(t=1),z(`/certificates/pool-retirements?page=${t}&count=${o().count}`)},$=()=>{let l=parseInt(o().page),t=l+1;o().retirements.length==0&&(t=l),z(`/certificates/pool-retirements?page=${t}&count=${o().count}`)};o().retirements||o(o().retirements=[],!0),q(()=>w(),()=>{H(g,w().url.searchParams.get("page"))}),q(()=>(r(p),r(g)),()=>{r(p).forEach(l=>{let x=l.href.split("?").slice(1).join("?");new URLSearchParams(x).get("page")===r(g)?l.active=!0:l.active=!1}),H(p,r(p))}),X(),at();var m=pt(),f=s(a(m),2),U=a(f),F=s(U,2);e(f);var b=s(f,2),j=a(b),E=s(a(j));Z(E,5,()=>o().retirements,tt,(l,t,x)=>{var c=nt();et(c,x%2===0?"bg-gray-50":"bg-white");var i=a(c),J=a(i,!0);e(i);var u=s(i),K=a(u,!0);e(u);var h=s(u),M=a(h,!0);e(h);var v=s(h),y=a(v),O=a(y,!0);e(y),e(v);var N=s(v),_=a(N),S=a(_),Q=a(S,!0);B(()=>n(Q,ct(r(t).tx_hash,30))),e(S),e(_),e(N),e(c),B(()=>{n(J,r(t).pool_id_bech32),n(K,r(t).epoch),n(M,r(t).retirement_epoch),T(y,"href",`/blocks/${r(t).block_number??""}`),n(O,r(t).block_number),T(_,"href",`/transactions/${r(t).tx_hash??""}`)}),V(l,c)}),e(E),e(j),e(b);var R=s(b,2),I=a(R),G=s(I,2);e(R),e(m),d("click",U,k),d("click",F,$),d("click",I,k),d("click",G,$),V(C,m),Y()}export{wt as component};