@origintrail-official/dkg-node-ui 10.0.2 → 10.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chain-cursor-stores.d.ts +45 -0
- package/dist/chain-cursor-stores.d.ts.map +1 -0
- package/dist/chain-cursor-stores.js +107 -0
- package/dist/chain-cursor-stores.js.map +1 -0
- package/dist/chat-memory.d.ts +0 -17
- package/dist/chat-memory.d.ts.map +1 -1
- package/dist/chat-memory.js +6 -33
- package/dist/chat-memory.js.map +1 -1
- package/dist/db.d.ts +15 -0
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +40 -1
- package/dist/db.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/notifications-scope.d.ts +19 -0
- package/dist/notifications-scope.d.ts.map +1 -1
- package/dist/notifications-scope.js +34 -2
- package/dist/notifications-scope.js.map +1 -1
- package/dist-ui/assets/{3d-force-graph-CcVMtgO4.js → 3d-force-graph-DRDhpplH.js} +1 -1
- package/dist-ui/assets/AgentHub-DdUAxJoy.js +1 -0
- package/dist-ui/assets/AgentProfilePage-yI8fA4vv.js +1 -0
- package/dist-ui/assets/ApproveWalletsModal-9w2edv7e.js +57 -0
- package/dist-ui/assets/ConvictionDetailView-CcQMya-y.js +2 -0
- package/dist-ui/assets/Network-DpAKVzwi.js +1 -0
- package/dist-ui/assets/OnChainProvenanceCard-DMOm3jLz.js +1 -0
- package/dist-ui/assets/{Operations-CCMDENBd.js → Operations-DKJFp6hM.js} +1 -1
- package/dist-ui/assets/PublishingConviction-1CPHxNwp.js +2 -0
- package/dist-ui/assets/Settings-DaYMlGHD.js +1 -0
- package/dist-ui/assets/ccip-hCQYqfNz.js +1 -0
- package/dist-ui/assets/{index-BrxEjqsW.js → index-Bh_8bMB0.js} +3 -3
- package/dist-ui/assets/{index-W4n8cdTA.js → index-CVwCoJrM.js} +10 -10
- package/dist-ui/assets/index-D5UiTYlY.css +1 -0
- package/dist-ui/assets/index-DGpnb_b1.js +1661 -0
- package/dist-ui/assets/{jsonld-32FQRO67-CbN9NJJW.js → jsonld-32FQRO67-C3B_LjZ-.js} +2 -2
- package/dist-ui/assets/{jsonld-DkQdPwg5.js → jsonld-CoPRWQuM.js} +1 -1
- package/dist-ui/assets/{renderer-3d-2EVDZII7-CTUExXUn.js → renderer-3d-2EVDZII7-Bx6o7Gge.js} +2 -2
- package/dist-ui/index.html +2 -2
- package/package.json +5 -3
- package/dist-ui/assets/Admin-DNNaF7rz.js +0 -45
- package/dist-ui/assets/AgentHub-eWb_Tns6.js +0 -1
- package/dist-ui/assets/AgentProfilePage-D2T_V6PG.js +0 -1
- package/dist-ui/assets/Network-C6MDsv2e.js +0 -1
- package/dist-ui/assets/OnChainProvenanceCard-BbrU7jzL.js +0 -1
- package/dist-ui/assets/Settings-WaFKYtwQ.js +0 -1
- package/dist-ui/assets/ccip-CDdHldzo.js +0 -1
- package/dist-ui/assets/formatTrac-BTy0WudH.js +0 -1
- package/dist-ui/assets/index-2Gzrk1k3.js +0 -1661
- package/dist-ui/assets/index-CmliV5st.css +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ad as e,aN as $,aI as R,ap as y,ag as K,an as Q,Z as P,H as Z,n as E,aD as S,af as M,z as W,aM as J,$ as Y,aB as X,o as O,Q as I,a5 as ee,S as ae,a1 as ne}from"./index-DGpnb_b1.js";import{f as U,k as V,u as te,e as B,g as se,d as re,A as le,a as _,C as oe,E as ie,G as ce,F as de,H as pe,c as ue,W as me,D as he,x as ve}from"./ApproveWalletsModal-9w2edv7e.js";const D=(a,n)=>!!a&&!!n&&a.toLowerCase()===n.toLowerCase();function we({agents:a,nodeWallets:n,ownerIsPrimary:r,ownerTitle:l,confirmRemove:s,onAskRemove:t,onCancelRemove:i,onConfirmRemove:v,removeBusy:u,explorer:p}){return e.jsx("div",{className:"v10-pca-detail-agentlist","data-testid":"pca-agent-list",children:a.map(c=>{const h=n.some(f=>D(f,c)),o=D(s??void 0,c);return e.jsx("div",{className:"v10-pca-agent-row","data-testid":"pca-agent-row",children:e.jsx(U,{address:c,status:h?"approved · this node":"approved",statusTone:"success",trailing:o?e.jsxs("span",{className:"v10-pca-agent-confirm",children:[e.jsx("span",{children:h?"This is one of this node’s own signing wallets — its publishes will pay the direct cost (and revert if it holds no TRAC). Remove?":"Publishes from this wallet will pay the direct cost (and revert if it holds no TRAC). Remove?"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","data-testid":"pca-deregister-btn","aria-label":`Confirm removing ${c}`,onClick:()=>v(c),disabled:u,children:u?"Removing…":"Yes, remove"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Cancel removing ${c}`,onClick:i,disabled:u,children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[p&&e.jsx("a",{className:"v10-pca-card-explorer",href:`${p}/address/${c}`,target:"_blank",rel:"noreferrer","aria-label":`View ${c} on explorer`,children:"↗"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Remove ${c}`,onClick:()=>t(c),disabled:!r,title:l,children:"Remove"})]})})},c)})})}function ge(){const a=$(l=>l.setBootstrap),n=$(l=>l.initWallet),r=R(l=>l.setScope);y.useEffect(()=>{let l=!1;return K().then(s=>{l||(r(Q(s)),a(s))}).catch(()=>{}).finally(()=>{l||n()}),()=>{l=!0}},[n,r,a])}function be(a){return a==="topup"?{requiresApproval:!0,actionLabel:"Sign top-up"}:{requiresApproval:!1,actionLabel:"Sign remove wallet"}}function q(a,n){const r=V(a,"action");return n==="remove"&&r.kind==="rejected"?"You rejected the remove-wallet transaction. No wallet was removed.":r.message}const fe={busy:!1,error:null,result:null};function z(){return y.useState(fe)}function xe({accountId:a,setFund:n,refresh:r}){const l=R(i=>i.topUpPending[a]??null),s=R(i=>i.clearTopUpPending),t=$(i=>i.bootstrap);y.useEffect(()=>{var p;if(!l||!((p=t==null?void 0:t.rpcUrls)!=null&&p.length))return;let i=!1,v=null;const u=async()=>{try{const h=await te(t.chainId,t.rpcUrls).getTransactionReceipt({hash:l.txHash});if(i)return;s(a),h.status==="success"?(n({busy:!1,error:null,warning:null,result:{txHash:l.txHash,message:"Top-up confirmed on-chain."}}),r()):n({busy:!1,error:"The pending top-up transaction reverted on-chain.",warning:null,result:null})}catch{i||(v=setTimeout(u,5e3))}};return u(),()=>{i=!0,v&&clearTimeout(v)}},[a,s,r,n,l,t])}function ye({accountId:a,snapshot:n,ownerTrac:r,explorer:l,access:s,ownerTitle:t,owner:i,deviceProgress:v,refresh:u}){const p=R(b=>b.topUpPending[a]??null),c=R(b=>b.setTopUpPending),h=R(b=>b.clearTopUpPending),[o,f]=y.useState(""),[m,w]=z();xe({accountId:a,setFund:w,refresh:u});const C=async()=>{var b,x;s.mode==="wallet"?v.begin("topup"):v.reset(),w({busy:!0,error:null,result:null,warning:null});try{const d=await i.topUp(a,o.trim());h(a),w({busy:!1,error:null,result:{txHash:d.txHash,message:`Added ${P(d.addedTokens)} TRAC.`}}),f(""),u()}catch(d){if(d instanceof Z&&d.status===504){const j=(b=d.body)==null?void 0:b.txHash;if(j){c({accountId:a,ownerEoa:n.owner,submittedAt:Date.now(),txHash:j,tokens:o.trim(),previousTopUpBufferTrac:n.topUpBufferTrac}),w({busy:!1,error:null,result:null,warning:{txHash:j,message:"Your top-up was submitted but we lost confirmation — it may already be on-chain. Verify on the explorer before adding again; a second top-up would lock additional TRAC."}});return}}if(d instanceof B&&d.txStep==="action"&&d.txHash){c({accountId:a,ownerEoa:n.owner,submittedAt:Date.now(),txHash:d.txHash,tokens:o.trim(),previousTopUpBufferTrac:n.topUpBufferTrac}),w({busy:!1,error:null,result:null,warning:{txHash:d.txHash,message:"Your top-up was submitted but we lost confirmation - it may already be on-chain. This exact transaction is being checked; do not add again until it resolves."}});return}if(s.mode==="wallet"){const j=V(d,d instanceof se?d.txStep:d instanceof B?d.txStep??"action":"action");w({busy:!1,error:j.message,result:null,warning:d instanceof re?null:void 0});return}w({busy:!1,error:((x=E(d,{accountId:a}))==null?void 0:x.message)??(d==null?void 0:d.message)??"Top-up failed.",result:null})}};return e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsx("h3",{className:"v10-pca-detail-section-title",children:"Funding"}),e.jsxs("p",{className:"v10-pca-detail-hint",children:["Top-up raises the spendable buffer. It does ",e.jsx("strong",{children:"not"})," extend the lock period — when the account expires you create a new one."]}),r!=null&&e.jsxs("p",{className:"v10-pca-detail-hint",children:["Owner balance: ",P(r)," TRAC"]}),e.jsxs("div",{className:"v10-pca-detail-form",children:[e.jsx("input",{className:"v10-form-input",type:"text",inputMode:"decimal",value:o,onChange:b=>f(b.target.value),placeholder:"Top up (TRAC)",disabled:!s.writesEnabled||m.busy||!!p,"aria-label":"Top-up amount in TRAC"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn primary","data-testid":"pca-topup-btn",onClick:C,disabled:!s.writesEnabled||m.busy||!!p||!/^\d+(\.\d+)?$/.test(o.trim())||Number(o.trim())<=0,title:t,children:m.busy?"Adding…":"Add funds"})]}),e.jsx(Ce,{state:m,explorer:l,onRecheck:u}),p&&e.jsxs("p",{className:"v10-pca-create-warn","data-testid":"pca-topup-pending",role:"alert",children:["Top-up transaction ",e.jsx("code",{children:p.txHash})," is pending confirmation. The top-up button is disabled while this exact receipt is checked; adding again could lock more TRAC."," ",e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:u,children:"Recheck account"})]})]})}function Ce({state:a,explorer:n,onRecheck:r}){if(a.warning){const s=n&&a.warning.txHash?`${n}/tx/${a.warning.txHash}`:void 0;return e.jsxs("p",{className:"v10-pca-create-warn","data-testid":"pca-action-warning",role:"alert",children:[a.warning.message," ",a.warning.txHash&&(s?e.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",children:[a.warning.txHash," ↗"]}):e.jsx("code",{children:a.warning.txHash}))," ",r&&e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:r,children:"Recheck"})]})}if(a.error)return e.jsx("p",{className:"v10-modal-error",role:"alert",children:a.error});if(!a.result)return null;const l=n&&a.result.txHash?`${n}/tx/${a.result.txHash}`:void 0;return e.jsxs("p",{className:"v10-pca-detail-result","data-testid":"pca-action-result",role:"status",children:[a.result.message," ",l&&e.jsx("a",{href:l,target:"_blank",rel:"noreferrer",children:"tx ↗"})," ","Still pending? You can close this and verify here."]})}const je=/^0x[0-9a-fA-F]{40}$/;function Ne({accountId:a,snapshot:n,wallets:r,explorer:l,access:s,ownerTitle:t,owner:i,deviceProgress:v,refresh:u}){const[p,c]=y.useState(""),[h,o]=y.useState(null),[f,m]=y.useState(null),[w,C]=z(),[b,x]=y.useState(!1),{data:d,loading:j,refresh:N}=S(()=>M(a),[a]),k=d&&d.accountId===a?d:null,G=async()=>{var T,A;o(null);const g=p.trim();if(!je.test(g)){o("Enter a valid 0x address.");return}try{const L=(T=(await W(a,g)).probedKey)==null?void 0:T.registered;o(L===!0?`✓ ${g} is an approved publishing wallet here.`:L===!1?`✗ ${g} is NOT approved here.`:`Couldn’t determine whether ${g} is approved here — retry.`)}catch(F){o(((A=E(F,{accountId:a}))==null?void 0:A.message)??"Probe failed.")}},H=async g=>{var T;s.mode==="wallet"?v.begin("remove"):v.reset(),C({busy:!0,error:null,result:null});try{await i.deregisterAgent(a,g),C({busy:!1,error:null,result:{message:`Removed ${g}.`}}),m(null),u(),N()}catch(A){C({busy:!1,error:s.mode==="wallet"?q(A,"remove"):((T=E(A,{accountId:a}))==null?void 0:T.message)??(A==null?void 0:A.message)??"Remove failed.",result:null})}};return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsxs("h3",{className:"v10-pca-detail-section-title",children:["Publishing wallets — ",n.agentCount," / 100"]}),e.jsxs("div",{className:"v10-pca-detail-form",children:[e.jsx(le,{mode:"single",value:p,onChange:c,label:"Check a wallet",cruxNote:null}),e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:G,children:"Probe"})]}),h&&e.jsx("p",{className:"v10-pca-detail-hint",role:"status",children:h}),j&&!k?e.jsx("p",{className:"v10-pca-detail-hint",role:"status",children:"Loading approved wallets…"}):k?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"v10-pca-detail-subhead",children:"Approved publishing wallets:"}),k.agents.length>0?e.jsx(we,{agents:k.agents,nodeWallets:r,ownerIsPrimary:s.writesEnabled,ownerTitle:t,confirmRemove:f,onAskRemove:g=>m(g),onCancelRemove:()=>m(null),onConfirmRemove:g=>H(g),removeBusy:w.busy,explorer:l}):e.jsx("div",{className:"v10-pca-detail-agentlist","data-testid":"pca-agent-list",children:e.jsx("p",{className:"v10-pca-handshake-empty",children:"No approved publishing wallets yet."})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"v10-pca-detail-subhead",children:"This node’s wallets:"}),e.jsxs("div",{className:"v10-pca-detail-agentlist","data-testid":"pca-agent-list",children:[r.map(g=>e.jsx(Ae,{accountId:a,wallet:g,ownerIsPrimary:s.writesEnabled,ownerTitle:t,confirming:f===g,onAskRemove:()=>m(g),onCancelRemove:()=>m(null),onConfirmRemove:()=>H(g),removeBusy:w.busy},g)),r.length===0&&e.jsx("p",{className:"v10-pca-handshake-empty",children:"No operational wallets on this node."})]}),e.jsx("p",{className:"v10-pca-overview-caveat",children:"ⓘ The chain exposes how many wallets are approved, not the full list — only this node’s wallets and any you probe are shown here."})]}),w.error&&e.jsx("p",{className:"v10-modal-error",role:"alert",children:w.error}),w.result&&e.jsx("p",{className:"v10-pca-detail-result",role:"status","data-testid":"pca-remove-result",children:w.result.message}),e.jsx("button",{type:"button",className:"v10-pca-card-btn primary",onClick:()=>x(!0),disabled:!s.writesEnabled,title:t,children:"+ Approve publishing wallet"})]}),b&&e.jsx(_,{accountId:a,initialMode:"self",onClose:()=>{x(!1),u(),N()}})]})}function Ae({accountId:a,wallet:n,ownerIsPrimary:r,ownerTitle:l,confirming:s,onAskRemove:t,onCancelRemove:i,onConfirmRemove:v,removeBusy:u}){var m;const{data:p,loading:c,error:h}=S(()=>W(a,n),[a,n]),o=(m=p==null?void 0:p.probedKey)==null?void 0:m.registered,f=!c&&(h!=null||p!=null&&o==null);return e.jsx("div",{className:"v10-pca-agent-row","data-testid":"pca-agent-row",children:e.jsx(U,{address:n,status:o===!0?"approved":o===!1?"not approved":f?"couldn’t determine":"checking…",statusTone:o===!0?"success":o===!1?"danger":"neutral",trailing:o===!0?s?e.jsxs("span",{className:"v10-pca-agent-confirm",children:[e.jsx("span",{children:"This is one of this node’s own signing wallets — its publishes will pay the direct cost (and revert if it holds no TRAC). Remove?"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","data-testid":"pca-deregister-btn","aria-label":`Confirm removing ${n}`,onClick:v,disabled:u,children:u?"Removing…":"Yes, remove"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Cancel removing ${n}`,onClick:i,disabled:u,children:"Cancel"})]}):e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Remove ${n}`,onClick:t,disabled:!r,title:l,children:"Remove"}):void 0})})}function Re(a){const[n,r]=y.useState(!1),[l,s]=y.useState(!1),[t,i]=y.useState(null),v=J(c=>c.openTab);return{renewOpen:n,renewChaining:l,renewApprove:t,openRenew:()=>r(!0),closeRenew:()=>r(!1),onRenewSuccess:c=>{r(!1),s(!0),M(a).then(h=>({agents:h.agents,resolved:!0})).catch(()=>({agents:[],resolved:!1})).then(({agents:h,resolved:o})=>{s(!1),i({newAccountId:c,seedBulk:h.join(`
|
|
2
|
+
`),agentsResolved:o})})},onManageNew:c=>{r(!1),v({id:`conviction:${c}`,label:`PCA #${c}`,closable:!0})},clearRenewApprove:()=>i(null)}}function Te({accountId:a,snapshot:n,access:r,ownerTitle:l,health:s}){const t=Re(a);return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsx("h3",{className:"v10-pca-detail-section-title",children:"Lifecycle"}),(s==="expiring"||s==="expired")&&e.jsxs("p",{className:"v10-pca-card-warn",children:[Y(n.expiresAtTimestamp),". The lock period can’t be extended — Renew creates a fresh replacement account seeded from this one (the old TRAC stays locked until its own expiry)."]}),e.jsx("button",{type:"button",className:`v10-pca-card-btn${s==="expiring"||s==="expired"?" primary":""}`,"data-testid":"pca-renew-btn",onClick:()=>t.openRenew(),disabled:!r.writesEnabled,title:l,children:"Renew — create a replacement PCA"})]}),t.renewOpen&&e.jsx(oe,{seed:{tokens:n.committedTRACTrac,primaryNode:n.primaryNode&&n.primaryNode!=="0"?String(n.primaryNode):void 0,primaryNodeUnknown:n.primaryNode==null},replacingAccountId:a,initialOwnerKey:r.mode==="wallet"?"hardware":"hot",onClose:()=>t.closeRenew(),onApproveOwnWallets:t.onRenewSuccess,onManage:t.onManageNew,onGetSponsored:()=>t.closeRenew()}),t.renewChaining&&e.jsx("div",{className:"lazy-spinner",role:"status","data-testid":"pca-renew-chaining",children:"Preparing re-approval…"}),t.renewApprove&&e.jsx(_,{accountId:t.renewApprove.newAccountId,initialMode:"sponsor",seedBulk:t.renewApprove.seedBulk,deregisterFrom:a,seedAgentsResolved:t.renewApprove.agentsResolved,onClose:()=>t.clearRenewApprove()})]})}function Pe(a){return Y(a).replace(/^Expires in /,"")}function Ee({accountId:a}){var d,j;const{data:n,loading:r,error:l,refresh:s}=S(()=>W(a,void 0,{extended:!0}),[a]),t=(n==null?void 0:n.accountId)===a?n:null,{data:i,error:v,refresh:u}=S(I,[],0),p=X(N=>N.nodeStatus),c=(p==null?void 0:p.blockExplorerUrl)??null,h=$(N=>N.address),o=(i==null?void 0:i.wallets)??[],f=ve(i,v),m=ie({owner:t==null?void 0:t.owner,primaryWallet:o[0],primaryWalletState:f});if(ge(),r&&!t)return e.jsxs("div",{className:"lazy-spinner",children:["Loading PCA #",a,"…"]});if(l||!t)return e.jsx("div",{className:"v10-pca-detail",children:e.jsx("div",{className:"card",children:e.jsxs("div",{className:"card-body v10-pca-card-error",children:[e.jsxs("p",{children:["Couldn’t load PCA #",a,"."]}),e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>s(),children:"Retry"})]})})});const w=o.some(N=>O(N,t.owner)),C=m.ownerUnknownCause==="wallets-loading",b=m.ownerUnknownCause==="wallets-unreadable",x=C?`Confirming ownership of PCA #${a}…`:b?`Couldn't load this node's wallets - can't confirm ownership of PCA #${a}.`:m.mode==="wallet"&&m.wrongNetwork?`Wrong network - switch the connected wallet to this node's PCA network to manage PCA #${a}.`:m.mode==="wallet"?`Connected wallet ${t.owner} owns PCA #${a}; device-signed owner actions are enabled.`:w?`Owner-only - PCA #${a} is owned by ${t.owner}, not this node's primary operational wallet, so node-UI can't sign for it.`:h?`Owner-only - connected as ${h}; switch to ${t.owner} to manage PCA #${a}.`:`Owner-only - connect ${t.owner} to manage PCA #${a}.`;return e.jsx(ke,{accountId:a,snapshot:t,wallets:o,ownerTrac:(j=(d=i==null?void 0:i.balances)==null?void 0:d.find(N=>O(N.address,t.owner)))==null?void 0:j.trac,explorer:c,access:m,connectedWallet:h,ownerOnlyReason:x,walletsLoading:C,walletsUnreadable:b,onRetryWallets:u,refresh:s})}function ke({accountId:a,snapshot:n,wallets:r,ownerTrac:l,explorer:s,access:t,connectedWallet:i,ownerOnlyReason:v,walletsLoading:u,walletsUnreadable:p,onRetryWallets:c,refresh:h}){const o=ce({labels:{idle:"Confirm on your device",approveActive:"Confirm on your device (1 of 2): approve TRAC",approveReady:"Allowance ready — continue to the owner action",actionActive:x=>x==="remove"?"Confirm on your device: remove wallet":"Confirm on your device (2 of 2): top up",submitted:"Waiting for on-chain confirmation",confirmed:"Transaction confirmed on-chain",failed:"Wallet transaction failed"},flow:x=>be(x??"topup"),describeActionError:(x,d)=>q(x,d??"topup")}),f=de({access:t,onWalletProgress:t.mode==="wallet"?o.onProgress:void 0}),m=ee(n),w=t.writesEnabled?void 0:v,C=(n.discountBps/100).toFixed(n.discountBps%100===0?0:1),b=i?t.mode==="wallet"?t.wrongNetwork?"Owner wallet matches; switch network before signing owner actions.":"Connected owner wallet will sign top-up, approve, remove, and renewal actions.":t.mode==="daemon"?"Connected wallet is available for wallet-owned PCAs; this account uses the node daemon for owner actions.":`Connected as ${i}; switch to ${n.owner} to manage owner actions.`:t.mode==="external"?"Connect the PCA owner wallet to manage this account. Provider metadata is display-only.":"Connect a wallet to view and manage wallet-owned PCAs from this tab.";return e.jsxs("div",{className:"v10-pca-detail","data-testid":"pca-detail",children:[e.jsxs("div",{className:"v10-pca-detail-band",children:[e.jsxs("span",{className:"v10-pca-detail-id",children:["PCA #",a]}),e.jsxs("span",{className:"badge badge-info",children:["◉ ",C,"% discount"]}),e.jsxs("span",{className:"v10-pca-detail-committed",children:[P(n.committedTRACTrac)," TRAC committed"]}),e.jsx("span",{className:"v10-pca-card-spacer"}),e.jsx(pe,{state:m})]}),e.jsxs("div",{className:"v10-modal-tip",role:"status",children:[b,i?e.jsx(ue,{}):e.jsx(me,{})]}),o.steps.length>0&&e.jsx(he,{steps:o.steps,currentLabel:o.currentLabel,blockExplorerUrl:s}),!t.writesEnabled&&(u?e.jsx("div",{className:"v10-modal-tip",role:"status",children:v}):e.jsxs("div",{className:"v10-modal-warning",role:"status",children:["ⓘ ",v," ",p?e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:c,children:"Retry"}):"Wallet probe stays available."]})),e.jsx(ae,{items:[{id:"buffer",label:"Top-up buffer",value:`${P(n.topUpBufferTrac)} TRAC`},{id:"per-epoch",label:"TRAC per epoch",value:`${ne(n.baseEpochAllowance)} TRAC`},...n.remainingAllowanceTrac!=null?[{id:"remaining",label:"Remaining this epoch",value:`${P(n.remainingAllowanceTrac)} TRAC`,tooltip:n.currentEpoch!=null?`Current epoch ${n.currentEpoch}`:void 0}]:[],{id:"wallets",label:"Publishing wallets",value:`${n.agentCount} / 100`},{id:"expires",label:"Expires in",value:Pe(n.expiresAtTimestamp),tooltip:`Expiry epoch ${n.expiresAtEpoch}`},...n.primaryNode!=null?[{id:"primary-node",label:"Primary node",value:n.primaryNode==="0"?"None set":`Node #${n.primaryNode}`,tooltip:n.lastPrimaryNodeChangeEpoch!=null?`Last changed epoch ${n.lastPrimaryNodeChangeEpoch}`:void 0}]:[]]}),e.jsxs("div",{className:"v10-pca-detail-owner",children:[e.jsx("span",{className:"v10-pca-card-owner-lbl",children:"Owner"}),e.jsx(U,{address:n.owner,trailing:s?e.jsx("a",{className:"v10-pca-card-explorer",href:`${s}/address/${n.owner}`,target:"_blank",rel:"noreferrer","aria-label":"View owner on explorer",children:"↗"}):void 0})]}),e.jsx(ye,{accountId:a,snapshot:n,ownerTrac:l,explorer:s,access:t,ownerTitle:w,owner:f,deviceProgress:o,refresh:h}),e.jsx(Ne,{accountId:a,snapshot:n,wallets:r,explorer:s,access:t,ownerTitle:w,owner:f,deviceProgress:o,refresh:h}),e.jsx(Te,{accountId:a,snapshot:n,access:t,ownerTitle:w,health:m})]})}export{Ee as ConvictionDetailView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aD as r,q as o,p as h,ad as e,L as x,aq as d,V as l}from"./index-DGpnb_b1.js";function j({agent:s}){if(s.connectionStatus==="self")return e.jsx("span",{className:"badge",style:{background:"var(--text-muted)"},children:"Self"});if(s.connectionStatus==="connected"){const n=s.connectionTransport==="relayed"?"Relayed":"Direct",i=s.connectedSinceMs?` · ${l(s.connectedSinceMs)}`:"";return e.jsxs("span",{className:"badge badge-success",title:`${s.connectionDirection??""} ${n.toLowerCase()} connection${i}`,children:[n,i]})}return e.jsx("span",{className:"badge",style:{background:"var(--error)"},children:"Disconnected"})}function v(){const{data:s}=r(o,[],1e4),{data:n}=r(h,[],15e3),i=(s==null?void 0:s.connections)??[],a=(n==null?void 0:n.agents)??[];return e.jsxs("div",{children:[e.jsxs(x,{to:"/",className:"page-back-link",style:{display:"inline-flex",alignItems:"center",gap:6,marginBottom:12,fontSize:13,color:"var(--text-secondary)",textDecoration:"none"},children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 12H5"}),e.jsx("path",{d:"M12 19l-7-7 7-7"})]}),"Back to dashboard"]}),e.jsx("h1",{className:"page-title",children:"Network"}),e.jsxs("div",{className:"stats-grid",children:[e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Total Connections"}),e.jsx("div",{className:"stat-value",children:(s==null?void 0:s.total)??"—"})]}),e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Direct"}),e.jsx("div",{className:"stat-value",children:(s==null?void 0:s.direct)??"—"})]}),e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Relayed"}),e.jsx("div",{className:"stat-value",children:(s==null?void 0:s.relayed)??"—"})]}),e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Known Agents"}),e.jsx("div",{className:"stat-value",children:a.length})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"card-title",children:"Active Connections"}),i.length===0?e.jsxs("div",{className:"empty-state empty-state--compact",children:[e.jsx("div",{className:"empty-state-icon",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"M12 5l7 7-7 7"})]})}),e.jsx("div",{className:"empty-state-title",children:"No active connections"}),e.jsx("div",{className:"empty-state-desc",children:"Connections will appear here as your node links with peers on the network."})]}):e.jsxs("table",{className:"data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Peer"}),e.jsx("th",{children:"Transport"}),e.jsx("th",{children:"Direction"}),e.jsx("th",{children:"Remote Address"}),e.jsx("th",{children:"Duration"})]})}),e.jsx("tbody",{children:i.map((t,c)=>e.jsxs("tr",{children:[e.jsx("td",{className:"mono",children:d(t.peerId,12)}),e.jsx("td",{children:e.jsx("span",{className:`badge ${t.transport==="direct"?"badge-success":"badge-info"}`,children:t.transport})}),e.jsx("td",{children:t.direction}),e.jsx("td",{className:"mono",style:{fontSize:11},children:t.remoteAddr}),e.jsx("td",{children:l(t.durationMs)})]},c))})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"card-title",children:"Discovered Agents"}),a.length===0?e.jsxs("div",{className:"empty-state empty-state--compact",children:[e.jsx("div",{className:"empty-state-icon",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),e.jsx("div",{className:"empty-state-title",children:"No agents discovered"}),e.jsx("div",{className:"empty-state-desc",children:"Agents will be listed here as they are discovered through the network."})]}):e.jsxs("table",{className:"data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Name"}),e.jsx("th",{children:"PeerId"}),e.jsx("th",{children:"Framework"}),e.jsx("th",{children:"Role"}),e.jsx("th",{children:"Connection"})]})}),e.jsx("tbody",{children:a.map((t,c)=>e.jsxs("tr",{children:[e.jsx("td",{style:{fontWeight:600},children:t.name}),e.jsx("td",{className:"mono",children:d(t.peerId,12)}),e.jsx("td",{children:t.framework??"—"}),e.jsx("td",{children:t.nodeRole??"—"}),e.jsx("td",{children:e.jsx(j,{agent:t})})]},c))})]})]})]})}export{v as NetworkPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ap as h,aC as x,ad as e,aw as r}from"./index-DGpnb_b1.js";import{u as N}from"./index-Bh_8bMB0.js";import"./ordinal-DhEzRPdO.js";const b={wm:"This entity lives in Working Memory — a private local draft. It gets an on-chain anchor only after it is promoted and published to Verifiable Memory.",swm:"This entity lives in Shared Working Memory. It is not anchored on-chain until it is published to Verifiable Memory.",vm:"No on-chain receipt found for this entity yet. It may still be settling, or it was read back from a pre-cutover graph."},I=({contextGraphId:t,layer:a,explorerUrl:l})=>{const{selectedNode:n}=N(),[p,d]=h.useState(null),s=(n==null?void 0:n.id)??null;h.useEffect(()=>{d(null)},[s]);const v=!!s&&s!==p,i=x(t,s,v);if(!v||!n)return null;const o=y=>{var m;(m=navigator.clipboard)==null||m.writeText(y).catch(()=>{})},u=n.label||n.id,c=i.status==="verified";return e.jsxs("div",{className:`v10-graph-prov-card${c?" verified":""}`,role:"dialog","aria-label":"On-chain provenance",children:[e.jsxs("div",{className:"v10-graph-prov-head",children:[e.jsx("span",{className:"v10-graph-prov-glyph",children:c?"◉":"◌"}),e.jsx("span",{className:"v10-graph-prov-title",children:"On-chain provenance"}),c&&e.jsx("span",{className:"v10-graph-prov-badge",children:"VERIFIED"}),e.jsx("button",{type:"button",className:"v10-graph-prov-close",onClick:()=>d(s),"aria-label":"Dismiss",title:"Dismiss",children:"×"})]}),e.jsx("div",{className:"v10-graph-prov-entity",title:n.id,children:u}),i.status==="loading"&&e.jsx("div",{className:"v10-graph-prov-muted",children:"Resolving on-chain identity…"}),i.status==="error"&&e.jsx("div",{className:"v10-graph-prov-muted",children:"Couldn’t load on-chain identity."}),i.status==="offchain"&&e.jsxs("div",{className:"v10-graph-prov-offchain",children:[e.jsx("span",{className:"v10-graph-prov-offchain-tag",children:"Off-chain"}),e.jsx("p",{children:b[a??"vm"]})]}),c&&e.jsxs("div",{className:"v10-vm-identity",style:{margin:0,background:"none",border:"none",padding:0},children:[i.ual&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"UAL"}),e.jsx("span",{className:"v10-vm-identity-val mono",title:i.ual,children:i.ual}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.ual),title:"Copy UAL",children:"⎘"})]}),i.txHash&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Tx"}),l?e.jsxs("a",{className:"v10-vm-identity-val mono v10-graph-prov-link",href:`${l}/tx/${i.txHash}`,target:"_blank",rel:"noopener noreferrer",title:i.txHash,children:[r(i.txHash,10,8)," ↗"]}):e.jsx("span",{className:"v10-vm-identity-val mono",title:i.txHash,children:r(i.txHash,10,8)}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.txHash),title:"Copy transaction hash",children:"⎘"})]}),i.blockNumber&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Block"}),e.jsx("span",{className:"v10-vm-identity-val mono",children:j(i.blockNumber)})]}),i.kaId&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"KA id"}),e.jsx("span",{className:"v10-vm-identity-val mono",title:i.kaId,children:r(i.kaId,8,8)}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.kaId),title:"Copy KA id",children:"⎘"})]}),i.author&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Author"}),l?e.jsxs("a",{className:"v10-vm-identity-val mono v10-graph-prov-link",href:`${l}/address/${i.author}`,target:"_blank",rel:"noopener noreferrer",title:i.author,children:[r(i.author,6,4)," ↗"]}):e.jsx("span",{className:"v10-vm-identity-val mono",title:i.author,children:r(i.author,6,4)}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.author),title:"Copy author address",children:"⎘"})]}),i.finalizedAt&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Finalized"}),e.jsx("span",{className:"v10-vm-identity-val",children:f(i.finalizedAt)})]})]})]})};function j(t){const a=Number.parseInt(t,10);return Number.isFinite(a)?a.toLocaleString():t}function f(t){const a=new Date(t.replace(/^"|"$/g,""));return Number.isFinite(a.getTime())?a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):t}export{I as OnChainProvenanceCard};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as oi,V as le,Z as $,R as P,d as ne,X as h,ag as Re,T as vt,I as Yx,z as Zx,O as lt,v as Jx,t as Qx,H as e1,a5 as gi,D as t1,B as r1,F as n1,C as i1,E as a1,r as o1,o as s1,p as u1,s as c1}from"./index-2Gzrk1k3.js";import{a as l1,e as Uc,c as ld,f as fd,g as f1,h as dd,m as hd,o as Bg,d as at,b as Pt,i as d1}from"./ordinal-DhEzRPdO.js";function h1(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function p1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function v1(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=Gr(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function y1(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function m1(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Gr(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}function Gr(e,t){var r=typeof t,n;return t==null||r==="boolean"?l1(t):(r==="number"?Uc:r==="string"?(n=ld(t))?(t=n,fd):f1:t instanceof ld?fd:t instanceof Date?y1:p1(t)?h1:Array.isArray(t)?v1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?m1:Uc)(e,t)}function of(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function g1(e,t){t===void 0&&(t=e,e=Gr);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(o){var s=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[s](o-s)}}function Dt(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function b1(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function sf(e){let t,r,n;e.length!==2?(t=Dt,r=(s,u)=>Dt(e(s),u),n=(s,u)=>e(s)-u):(t=e===Dt||e===b1?e:x1,r=e,n=e);function i(s,u,c=0,f=s.length){if(c<f){if(t(u,u)!==0)return f;do{const l=c+f>>>1;r(s[l],u)<0?c=l+1:f=l}while(c<f)}return c}function a(s,u,c=0,f=s.length){if(c<f){if(t(u,u)!==0)return f;do{const l=c+f>>>1;r(s[l],u)<=0?c=l+1:f=l}while(c<f)}return c}function o(s,u,c=0,f=s.length){const l=i(s,u,c,f-1);return l>c&&n(s[l-1],u)>-n(s[l],u)?l-1:l}return{left:i,center:o,right:a}}function x1(){return 0}function Lg(e){return e===null?NaN:+e}function*w1(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const _1=sf(Dt),Qn=_1.right;sf(Lg).center;function O1(e=Dt){if(e===Dt)return qg;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function qg(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const S1=Math.sqrt(50),j1=Math.sqrt(10),A1=Math.sqrt(2);function bi(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=S1?10:a>=j1?5:a>=A1?2:1;let s,u,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(e*c),u=Math.round(t*c),s/c<e&&++s,u/c>t&&--u,c=-c):(c=Math.pow(10,i)*o,s=Math.round(e/c),u=Math.round(t/c),s*c<e&&++s,u*c>t&&--u),u<s&&.5<=r&&r<2?bi(e,t,r*2):[s,u,c]}function Gc(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,o]=n?bi(t,e,r):bi(e,t,r);if(!(a>=i))return[];const s=a-i+1,u=new Array(s);if(n)if(o<0)for(let c=0;c<s;++c)u[c]=(a-c)/-o;else for(let c=0;c<s;++c)u[c]=(a-c)*o;else if(o<0)for(let c=0;c<s;++c)u[c]=(i+c)/-o;else for(let c=0;c<s;++c)u[c]=(i+c)*o;return u}function Hc(e,t,r){return t=+t,e=+e,r=+r,bi(e,t,r)[2]}function Kc(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?Hc(t,e,r):Hc(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function zg(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?qg:O1(i);n>r;){if(n-r>600){const u=n-r+1,c=t-r+1,f=Math.log(u),l=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*l*(u-l)/u)*(c-u/2<0?-1:1),v=Math.max(r,Math.floor(t-c*l/u+d)),m=Math.min(n,Math.floor(t+(u-c)*l/u+d));zg(e,t,v,m,i)}const a=e[t];let o=r,s=n;for(en(e,r,t),i(e[n],a)>0&&en(e,r,n);o<s;){for(en(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[r],a)===0?en(e,r,s):(++s,en(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function en(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function P1(e,t,r){if(e=Float64Array.from(w1(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return dd(e);if(t>=1)return hd(e);var n,i=(n-1)*t,a=Math.floor(i),o=hd(zg(e,a).subarray(0,a+1)),s=dd(e.subarray(a+1));return o+(s-o)*(i-a)}}function T1(e,t,r=Lg){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function E1(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}function bn(){var e=Bg().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,o,s=!1,u=0,c=0,f=.5;delete e.unknown;function l(){var d=t().length,v=i<n,m=v?i:n,y=v?n:i;a=(y-m)/Math.max(1,d-u+c*2),s&&(a=Math.floor(a)),m+=(y-m-a*(d-u))*f,o=a*(1-u),s&&(m=Math.round(m),o=Math.round(o));var p=E1(d).map(function(g){return m+a*g});return r(v?p.reverse():p)}return e.domain=function(d){return arguments.length?(t(d),l()):t()},e.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,l()):[n,i]},e.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,s=!0,l()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(d){return arguments.length?(s=!!d,l()):s},e.padding=function(d){return arguments.length?(u=Math.min(1,c=+d),l()):u},e.paddingInner=function(d){return arguments.length?(u=Math.min(1,d),l()):u},e.paddingOuter=function(d){return arguments.length?(c=+d,l()):c},e.align=function(d){return arguments.length?(f=Math.max(0,Math.min(1,d)),l()):f},e.copy=function(){return bn(t(),[n,i]).round(s).paddingInner(u).paddingOuter(c).align(f)},at.apply(l(),arguments)}function Fg(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Fg(t())},e}function pn(){return Fg(bn.apply(null,arguments).paddingInner(1))}function M1(e){return function(){return e}}function xi(e){return+e}var pd=[0,1];function ke(e){return e}function Vc(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:M1(isNaN(t)?NaN:.5)}function C1(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function I1(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i<n?(n=Vc(i,n),a=r(o,a)):(n=Vc(n,i),a=r(a,o)),function(s){return a(n(s))}}function k1(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=Vc(e[o],e[o+1]),a[o]=r(t[o],t[o+1]);return function(s){var u=Qn(e,s,1,n)-1;return a[u](i[u](s))}}function ei(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function va(){var e=pd,t=pd,r=Gr,n,i,a,o=ke,s,u,c;function f(){var d=Math.min(e.length,t.length);return o!==ke&&(o=C1(e[0],e[d-1])),s=d>2?k1:I1,u=c=null,l}function l(d){return d==null||isNaN(d=+d)?a:(u||(u=s(e.map(n),t,r)))(n(o(d)))}return l.invert=function(d){return o(i((c||(c=s(t,e.map(n),Uc)))(d)))},l.domain=function(d){return arguments.length?(e=Array.from(d,xi),f()):e.slice()},l.range=function(d){return arguments.length?(t=Array.from(d),f()):t.slice()},l.rangeRound=function(d){return t=Array.from(d),r=of,f()},l.clamp=function(d){return arguments.length?(o=d?!0:ke,f()):o!==ke},l.interpolate=function(d){return arguments.length?(r=d,f()):r},l.unknown=function(d){return arguments.length?(a=d,l):a},function(d,v){return n=d,i=v,f()}}function uf(){return va()(ke,ke)}function $1(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wi(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Or(e){return e=wi(Math.abs(e)),e?e[1]:NaN}function N1(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),a.push(r.substring(i-=s,i+s)),!((u+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function R1(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var D1=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xn(e){if(!(t=D1.exec(e)))throw new Error("invalid format: "+e);var t;return new cf({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}xn.prototype=cf.prototype;function cf(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}cf.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function B1(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var _i;function L1(e,t){var r=wi(e,t);if(!r)return _i=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(_i=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+wi(e,Math.max(0,t+a-1))[0]}function vd(e,t){var r=wi(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const yd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$1,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vd(e*100,t),r:vd,s:L1,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function md(e){return e}var gd=Array.prototype.map,bd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function q1(e){var t=e.grouping===void 0||e.thousands===void 0?md:N1(gd.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?md:R1(gd.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function c(l,d){l=xn(l);var v=l.fill,m=l.align,y=l.sign,p=l.symbol,g=l.zero,x=l.width,O=l.comma,_=l.precision,b=l.trim,w=l.type;w==="n"?(O=!0,w="g"):yd[w]||(_===void 0&&(_=12),b=!0,w="g"),(g||v==="0"&&m==="=")&&(g=!0,v="0",m="=");var S=(d&&d.prefix!==void 0?d.prefix:"")+(p==="$"?r:p==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),j=(p==="$"?n:/[%p]/.test(w)?o:"")+(d&&d.suffix!==void 0?d.suffix:""),A=yd[w],C=/[defgprs%]/.test(w);_=_===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function E(T){var M=S,k=j,I,R,B;if(w==="c")k=A(T)+k,T="";else{T=+T;var q=T<0||1/T<0;if(T=isNaN(T)?u:A(Math.abs(T),_),b&&(T=B1(T)),q&&+T==0&&y!=="+"&&(q=!1),M=(q?y==="("?y:s:y==="-"||y==="("?"":y)+M,k=(w==="s"&&!isNaN(T)&&_i!==void 0?bd[8+_i/3]:"")+k+(q&&y==="("?")":""),C){for(I=-1,R=T.length;++I<R;)if(B=T.charCodeAt(I),48>B||B>57){k=(B===46?i+T.slice(I+1):T.slice(I))+k,T=T.slice(0,I);break}}}O&&!g&&(T=t(T,1/0));var z=M.length+T.length+k.length,G=z<x?new Array(x-z+1).join(v):"";switch(O&&g&&(T=t(G+T,G.length?x-k.length:1/0),G=""),m){case"<":T=M+T+k+G;break;case"=":T=M+G+T+k;break;case"^":T=G.slice(0,z=G.length>>1)+M+T+k+G.slice(z);break;default:T=G+M+T+k;break}return a(T)}return E.toString=function(){return l+""},E}function f(l,d){var v=Math.max(-8,Math.min(8,Math.floor(Or(d)/3)))*3,m=Math.pow(10,-v),y=c((l=xn(l),l.type="f",l),{suffix:bd[8+v/3]});return function(p){return y(m*p)}}return{format:c,formatPrefix:f}}var si,lf,Wg;z1({thousands:",",grouping:[3],currency:["$",""]});function z1(e){return si=q1(e),lf=si.format,Wg=si.formatPrefix,si}function F1(e){return Math.max(0,-Or(Math.abs(e)))}function W1(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Or(t)/3)))*3-Or(Math.abs(e)))}function U1(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Or(t)-Or(e))+1}function Ug(e,t,r,n){var i=Kc(e,t,r),a;switch(n=xn(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=W1(i,o))&&(n.precision=a),Wg(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=U1(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=F1(i))&&(n.precision=a-(n.type==="%")*2);break}}return lf(n)}function qt(e){var t=e.domain;return e.ticks=function(r){var n=t();return Gc(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Ug(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],u,c,f=10;for(s<o&&(c=o,o=s,s=c,c=i,i=a,a=c);f-- >0;){if(c=Hc(o,s,r),c===u)return n[i]=o,n[a]=s,t(n);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;u=c}return e},e}function Oi(){var e=uf();return e.copy=function(){return ei(e,Oi())},at.apply(e,arguments),qt(e)}function Gg(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,xi),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Gg(e).unknown(t)},e=arguments.length?Array.from(e,xi):[0,1],qt(r)}function Hg(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return a<i&&(o=r,r=n,n=o,o=i,i=a,a=o),e[r]=t.floor(i),e[n]=t.ceil(a),e}function xd(e){return Math.log(e)}function wd(e){return Math.exp(e)}function G1(e){return-Math.log(-e)}function H1(e){return-Math.exp(-e)}function K1(e){return isFinite(e)?+("1e"+e):e<0?0:e}function V1(e){return e===10?K1:e===Math.E?Math.exp:t=>Math.pow(e,t)}function X1(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function _d(e){return(t,r)=>-e(-t,r)}function ff(e){const t=e(xd,wd),r=t.domain;let n=10,i,a;function o(){return i=X1(n),a=V1(n),r()[0]<0?(i=_d(i),a=_d(a),e(G1,H1)):e(xd,wd),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const u=r();let c=u[0],f=u[u.length-1];const l=f<c;l&&([c,f]=[f,c]);let d=i(c),v=i(f),m,y;const p=s==null?10:+s;let g=[];if(!(n%1)&&v-d<p){if(d=Math.floor(d),v=Math.ceil(v),c>0){for(;d<=v;++d)for(m=1;m<n;++m)if(y=d<0?m/a(-d):m*a(d),!(y<c)){if(y>f)break;g.push(y)}}else for(;d<=v;++d)for(m=n-1;m>=1;--m)if(y=d>0?m/a(-d):m*a(d),!(y<c)){if(y>f)break;g.push(y)}g.length*2<p&&(g=Gc(c,f,p))}else g=Gc(d,v,Math.min(v-d,p)).map(a);return l?g.reverse():g},t.tickFormat=(s,u)=>{if(s==null&&(s=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=xn(u)).precision==null&&(u.trim=!0),u=lf(u)),s===1/0)return u;const c=Math.max(1,n*s/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*n<n-.5&&(l*=n),l<=c?u(f):""}},t.nice=()=>r(Hg(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function Kg(){const e=ff(va()).domain([1,10]);return e.copy=()=>ei(e,Kg()).base(e.base()),at.apply(e,arguments),e}function Od(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Sd(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function df(e){var t=1,r=e(Od(t),Sd(t));return r.constant=function(n){return arguments.length?e(Od(t=+n),Sd(t)):t},qt(r)}function Vg(){var e=df(va());return e.copy=function(){return ei(e,Vg()).constant(e.constant())},at.apply(e,arguments)}function jd(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Y1(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Z1(e){return e<0?-e*e:e*e}function hf(e){var t=e(ke,ke),r=1;function n(){return r===1?e(ke,ke):r===.5?e(Y1,Z1):e(jd(r),jd(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},qt(t)}function pf(){var e=hf(va());return e.copy=function(){return ei(e,pf()).exponent(e.exponent())},at.apply(e,arguments),e}function J1(){return pf.apply(null,arguments).exponent(.5)}function Ad(e){return Math.sign(e)*e*e}function Q1(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Xg(){var e=uf(),t=[0,1],r=!1,n;function i(a){var o=Q1(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(Ad(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,xi)).map(Ad)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Xg(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},at.apply(i,arguments),qt(i)}function Yg(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o<s;)r[o-1]=T1(e,o/s);return a}function a(o){return o==null||isNaN(o=+o)?n:t[Qn(r,o)]}return a.invertExtent=function(o){var s=t.indexOf(o);return s<0?[NaN,NaN]:[s>0?r[s-1]:e[0],s<r.length?r[s]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let s of o)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Dt),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return Yg().domain(e).range(t).unknown(n)},at.apply(a,arguments)}function Zg(){var e=0,t=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[Qn(n,u,0,r)]:a}function s(){var u=-1;for(n=new Array(r);++u<r;)n[u]=((u+1)*t-(u-r)*e)/(r+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,s()):[e,t]},o.range=function(u){return arguments.length?(r=(i=Array.from(u)).length-1,s()):i.slice()},o.invertExtent=function(u){var c=i.indexOf(u);return c<0?[NaN,NaN]:c<1?[e,n[0]]:c>=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Zg().domain([e,t]).range(i).unknown(a)},at.apply(qt(o),arguments)}function Jg(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Qn(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Jg().domain(e).range(t).unknown(r)},at.apply(i,arguments)}const Va=new Date,Xa=new Date;function Oe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const u=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return u;let c;do u.push(c=new Date(+a)),t(a,s),e(a);while(c<a&&a<o);return u},i.filter=a=>Oe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Va.setTime(+a),Xa.setTime(+o),e(Va),e(Xa),Math.floor(r(Va,Xa))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Si=Oe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Si.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Oe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Si);Si.range;const yt=1e3,Ze=yt*60,mt=Ze*60,Ot=mt*24,vf=Ot*7,Pd=Ot*30,Ya=Ot*365,Zt=Oe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yt)},(e,t)=>(t-e)/yt,e=>e.getUTCSeconds());Zt.range;const yf=Oe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getMinutes());yf.range;const mf=Oe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getUTCMinutes());mf.range;const gf=Oe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt-e.getMinutes()*Ze)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getHours());gf.range;const bf=Oe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getUTCHours());bf.range;const ti=Oe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ze)/Ot,e=>e.getDate()-1);ti.range;const ya=Oe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>e.getUTCDate()-1);ya.range;const Qg=Oe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>Math.floor(e/Ot));Qg.range;function lr(e){return Oe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Ze)/vf)}const ma=lr(0),ji=lr(1),ew=lr(2),tw=lr(3),Sr=lr(4),rw=lr(5),nw=lr(6);ma.range;ji.range;ew.range;tw.range;Sr.range;rw.range;nw.range;function fr(e){return Oe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/vf)}const ga=fr(0),Ai=fr(1),iw=fr(2),aw=fr(3),jr=fr(4),ow=fr(5),sw=fr(6);ga.range;Ai.range;iw.range;aw.range;jr.range;ow.range;sw.range;const xf=Oe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());xf.range;const wf=Oe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());wf.range;const St=Oe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());St.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Oe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});St.range;const jt=Oe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());jt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Oe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});jt.range;function eb(e,t,r,n,i,a){const o=[[Zt,1,yt],[Zt,5,5*yt],[Zt,15,15*yt],[Zt,30,30*yt],[a,1,Ze],[a,5,5*Ze],[a,15,15*Ze],[a,30,30*Ze],[i,1,mt],[i,3,3*mt],[i,6,6*mt],[i,12,12*mt],[n,1,Ot],[n,2,2*Ot],[r,1,vf],[t,1,Pd],[t,3,3*Pd],[e,1,Ya]];function s(c,f,l){const d=f<c;d&&([c,f]=[f,c]);const v=l&&typeof l.range=="function"?l:u(c,f,l),m=v?v.range(c,+f+1):[];return d?m.reverse():m}function u(c,f,l){const d=Math.abs(f-c)/l,v=sf(([,,p])=>p).right(o,d);if(v===o.length)return e.every(Kc(c/Ya,f/Ya,l));if(v===0)return Si.every(Math.max(Kc(c,f,l),1));const[m,y]=o[d/o[v-1][2]<o[v][2]/d?v-1:v];return m.every(y)}return[s,u]}const[uw,cw]=eb(jt,wf,ga,Qg,bf,mf),[lw,fw]=eb(St,xf,ma,ti,gf,yf);function Za(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ja(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tn(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function dw(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,u=e.shortMonths,c=rn(i),f=nn(i),l=rn(a),d=nn(a),v=rn(o),m=nn(o),y=rn(s),p=nn(s),g=rn(u),x=nn(u),O={a:B,A:q,b:z,B:G,c:null,d:kd,e:kd,f:Nw,g:Gw,G:Kw,H:Iw,I:kw,j:$w,L:tb,m:Rw,M:Dw,p:K,q:W,Q:Rd,s:Dd,S:Bw,u:Lw,U:qw,V:zw,w:Fw,W:Ww,x:null,X:null,y:Uw,Y:Hw,Z:Vw,"%":Nd},_={a:V,A:ue,b:ve,B:Le,c:null,d:$d,e:$d,f:Jw,g:u_,G:l_,H:Xw,I:Yw,j:Zw,L:nb,m:Qw,M:e_,p:Gt,q:$e,Q:Rd,s:Dd,S:t_,u:r_,U:n_,V:i_,w:a_,W:o_,x:null,X:null,y:s_,Y:c_,Z:f_,"%":Nd},b={a:C,A:E,b:T,B:M,c:k,d:Cd,e:Cd,f:Tw,g:Md,G:Ed,H:Id,I:Id,j:Sw,L:Pw,m:Ow,M:jw,p:A,q:_w,Q:Mw,s:Cw,S:Aw,u:mw,U:gw,V:bw,w:yw,W:xw,x:I,X:R,y:Md,Y:Ed,Z:ww,"%":Ew};O.x=w(r,O),O.X=w(n,O),O.c=w(t,O),_.x=w(r,_),_.X=w(n,_),_.c=w(t,_);function w(F,X){return function(Z){var D=[],he=-1,ee=0,ge=F.length,be,Ne,Mt;for(Z instanceof Date||(Z=new Date(+Z));++he<ge;)F.charCodeAt(he)===37&&(D.push(F.slice(ee,he)),(Ne=Td[be=F.charAt(++he)])!=null?be=F.charAt(++he):Ne=be==="e"?" ":"0",(Mt=X[be])&&(be=Mt(Z,Ne)),D.push(be),ee=he+1);return D.push(F.slice(ee,he)),D.join("")}}function S(F,X){return function(Z){var D=tn(1900,void 0,1),he=j(D,F,Z+="",0),ee,ge;if(he!=Z.length)return null;if("Q"in D)return new Date(D.Q);if("s"in D)return new Date(D.s*1e3+("L"in D?D.L:0));if(X&&!("Z"in D)&&(D.Z=0),"p"in D&&(D.H=D.H%12+D.p*12),D.m===void 0&&(D.m="q"in D?D.q:0),"V"in D){if(D.V<1||D.V>53)return null;"w"in D||(D.w=1),"Z"in D?(ee=Ja(tn(D.y,0,1)),ge=ee.getUTCDay(),ee=ge>4||ge===0?Ai.ceil(ee):Ai(ee),ee=ya.offset(ee,(D.V-1)*7),D.y=ee.getUTCFullYear(),D.m=ee.getUTCMonth(),D.d=ee.getUTCDate()+(D.w+6)%7):(ee=Za(tn(D.y,0,1)),ge=ee.getDay(),ee=ge>4||ge===0?ji.ceil(ee):ji(ee),ee=ti.offset(ee,(D.V-1)*7),D.y=ee.getFullYear(),D.m=ee.getMonth(),D.d=ee.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),ge="Z"in D?Ja(tn(D.y,0,1)).getUTCDay():Za(tn(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(ge+5)%7:D.w+D.U*7-(ge+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Ja(D)):Za(D)}}function j(F,X,Z,D){for(var he=0,ee=X.length,ge=Z.length,be,Ne;he<ee;){if(D>=ge)return-1;if(be=X.charCodeAt(he++),be===37){if(be=X.charAt(he++),Ne=b[be in Td?X.charAt(he++):be],!Ne||(D=Ne(F,Z,D))<0)return-1}else if(be!=Z.charCodeAt(D++))return-1}return D}function A(F,X,Z){var D=c.exec(X.slice(Z));return D?(F.p=f.get(D[0].toLowerCase()),Z+D[0].length):-1}function C(F,X,Z){var D=v.exec(X.slice(Z));return D?(F.w=m.get(D[0].toLowerCase()),Z+D[0].length):-1}function E(F,X,Z){var D=l.exec(X.slice(Z));return D?(F.w=d.get(D[0].toLowerCase()),Z+D[0].length):-1}function T(F,X,Z){var D=g.exec(X.slice(Z));return D?(F.m=x.get(D[0].toLowerCase()),Z+D[0].length):-1}function M(F,X,Z){var D=y.exec(X.slice(Z));return D?(F.m=p.get(D[0].toLowerCase()),Z+D[0].length):-1}function k(F,X,Z){return j(F,t,X,Z)}function I(F,X,Z){return j(F,r,X,Z)}function R(F,X,Z){return j(F,n,X,Z)}function B(F){return o[F.getDay()]}function q(F){return a[F.getDay()]}function z(F){return u[F.getMonth()]}function G(F){return s[F.getMonth()]}function K(F){return i[+(F.getHours()>=12)]}function W(F){return 1+~~(F.getMonth()/3)}function V(F){return o[F.getUTCDay()]}function ue(F){return a[F.getUTCDay()]}function ve(F){return u[F.getUTCMonth()]}function Le(F){return s[F.getUTCMonth()]}function Gt(F){return i[+(F.getUTCHours()>=12)]}function $e(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var X=w(F+="",O);return X.toString=function(){return F},X},parse:function(F){var X=S(F+="",!1);return X.toString=function(){return F},X},utcFormat:function(F){var X=w(F+="",_);return X.toString=function(){return F},X},utcParse:function(F){var X=S(F+="",!0);return X.toString=function(){return F},X}}}var Td={"-":"",_:" ",0:"0"},Pe=/^\s*\d+/,hw=/^%/,pw=/[\\^$*+?|[\]().{}]/g;function re(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function vw(e){return e.replace(pw,"\\$&")}function rn(e){return new RegExp("^(?:"+e.map(vw).join("|")+")","i")}function nn(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function yw(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function mw(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function gw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function bw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function xw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Ed(e,t,r){var n=Pe.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Md(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function ww(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function _w(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ow(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Cd(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Sw(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Id(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function jw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Aw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Pw(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Tw(e,t,r){var n=Pe.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ew(e,t,r){var n=hw.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Mw(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Cw(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function kd(e,t){return re(e.getDate(),t,2)}function Iw(e,t){return re(e.getHours(),t,2)}function kw(e,t){return re(e.getHours()%12||12,t,2)}function $w(e,t){return re(1+ti.count(St(e),e),t,3)}function tb(e,t){return re(e.getMilliseconds(),t,3)}function Nw(e,t){return tb(e,t)+"000"}function Rw(e,t){return re(e.getMonth()+1,t,2)}function Dw(e,t){return re(e.getMinutes(),t,2)}function Bw(e,t){return re(e.getSeconds(),t,2)}function Lw(e){var t=e.getDay();return t===0?7:t}function qw(e,t){return re(ma.count(St(e)-1,e),t,2)}function rb(e){var t=e.getDay();return t>=4||t===0?Sr(e):Sr.ceil(e)}function zw(e,t){return e=rb(e),re(Sr.count(St(e),e)+(St(e).getDay()===4),t,2)}function Fw(e){return e.getDay()}function Ww(e,t){return re(ji.count(St(e)-1,e),t,2)}function Uw(e,t){return re(e.getFullYear()%100,t,2)}function Gw(e,t){return e=rb(e),re(e.getFullYear()%100,t,2)}function Hw(e,t){return re(e.getFullYear()%1e4,t,4)}function Kw(e,t){var r=e.getDay();return e=r>=4||r===0?Sr(e):Sr.ceil(e),re(e.getFullYear()%1e4,t,4)}function Vw(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+re(t/60|0,"0",2)+re(t%60,"0",2)}function $d(e,t){return re(e.getUTCDate(),t,2)}function Xw(e,t){return re(e.getUTCHours(),t,2)}function Yw(e,t){return re(e.getUTCHours()%12||12,t,2)}function Zw(e,t){return re(1+ya.count(jt(e),e),t,3)}function nb(e,t){return re(e.getUTCMilliseconds(),t,3)}function Jw(e,t){return nb(e,t)+"000"}function Qw(e,t){return re(e.getUTCMonth()+1,t,2)}function e_(e,t){return re(e.getUTCMinutes(),t,2)}function t_(e,t){return re(e.getUTCSeconds(),t,2)}function r_(e){var t=e.getUTCDay();return t===0?7:t}function n_(e,t){return re(ga.count(jt(e)-1,e),t,2)}function ib(e){var t=e.getUTCDay();return t>=4||t===0?jr(e):jr.ceil(e)}function i_(e,t){return e=ib(e),re(jr.count(jt(e),e)+(jt(e).getUTCDay()===4),t,2)}function a_(e){return e.getUTCDay()}function o_(e,t){return re(Ai.count(jt(e)-1,e),t,2)}function s_(e,t){return re(e.getUTCFullYear()%100,t,2)}function u_(e,t){return e=ib(e),re(e.getUTCFullYear()%100,t,2)}function c_(e,t){return re(e.getUTCFullYear()%1e4,t,4)}function l_(e,t){var r=e.getUTCDay();return e=r>=4||r===0?jr(e):jr.ceil(e),re(e.getUTCFullYear()%1e4,t,4)}function f_(){return"+0000"}function Nd(){return"%"}function Rd(e){return+e}function Dd(e){return Math.floor(+e/1e3)}var vr,ab,ob;d_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function d_(e){return vr=dw(e),ab=vr.format,vr.parse,ob=vr.utcFormat,vr.utcParse,vr}function h_(e){return new Date(e)}function p_(e){return e instanceof Date?+e:+new Date(+e)}function _f(e,t,r,n,i,a,o,s,u,c){var f=uf(),l=f.invert,d=f.domain,v=c(".%L"),m=c(":%S"),y=c("%I:%M"),p=c("%I %p"),g=c("%a %d"),x=c("%b %d"),O=c("%B"),_=c("%Y");function b(w){return(u(w)<w?v:s(w)<w?m:o(w)<w?y:a(w)<w?p:n(w)<w?i(w)<w?g:x:r(w)<w?O:_)(w)}return f.invert=function(w){return new Date(l(w))},f.domain=function(w){return arguments.length?d(Array.from(w,p_)):d().map(h_)},f.ticks=function(w){var S=d();return e(S[0],S[S.length-1],w??10)},f.tickFormat=function(w,S){return S==null?b:c(S)},f.nice=function(w){var S=d();return(!w||typeof w.range!="function")&&(w=t(S[0],S[S.length-1],w??10)),w?d(Hg(S,w)):f},f.copy=function(){return ei(f,_f(e,t,r,n,i,a,o,s,u,c))},f}function v_(){return at.apply(_f(lw,fw,St,xf,ma,ti,gf,yf,Zt,ab).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function y_(){return at.apply(_f(uw,cw,jt,wf,ga,ya,bf,mf,Zt,ob).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ba(){var e=0,t=1,r,n,i,a,o=ke,s=!1,u;function c(l){return l==null||isNaN(l=+l)?u:o(i===0?.5:(l=(a(l)-r)*i,s?Math.max(0,Math.min(1,l)):l))}c.domain=function(l){return arguments.length?([e,t]=l,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),c):[e,t]},c.clamp=function(l){return arguments.length?(s=!!l,c):s},c.interpolator=function(l){return arguments.length?(o=l,c):o};function f(l){return function(d){var v,m;return arguments.length?([v,m]=d,o=l(v,m),c):[o(0),o(1)]}}return c.range=f(Gr),c.rangeRound=f(of),c.unknown=function(l){return arguments.length?(u=l,c):u},function(l){return a=l,r=l(e),n=l(t),i=r===n?0:1/(n-r),c}}function zt(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function sb(){var e=qt(ba()(ke));return e.copy=function(){return zt(e,sb())},Pt.apply(e,arguments)}function ub(){var e=ff(ba()).domain([1,10]);return e.copy=function(){return zt(e,ub()).base(e.base())},Pt.apply(e,arguments)}function cb(){var e=df(ba());return e.copy=function(){return zt(e,cb()).constant(e.constant())},Pt.apply(e,arguments)}function Of(){var e=hf(ba());return e.copy=function(){return zt(e,Of()).exponent(e.exponent())},Pt.apply(e,arguments)}function m_(){return Of.apply(null,arguments).exponent(.5)}function lb(){var e=[],t=ke;function r(n){if(n!=null&&!isNaN(n=+n))return t((Qn(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Dt),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>P1(e,a/n))},r.copy=function(){return lb(t).domain(e)},Pt.apply(r,arguments)}function xa(){var e=0,t=.5,r=1,n=1,i,a,o,s,u,c=ke,f,l=!1,d;function v(y){return isNaN(y=+y)?d:(y=.5+((y=+f(y))-a)*(n*y<n*a?s:u),c(l?Math.max(0,Math.min(1,y)):y))}v.domain=function(y){return arguments.length?([e,t,r]=y,i=f(e=+e),a=f(t=+t),o=f(r=+r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v):[e,t,r]},v.clamp=function(y){return arguments.length?(l=!!y,v):l},v.interpolator=function(y){return arguments.length?(c=y,v):c};function m(y){return function(p){var g,x,O;return arguments.length?([g,x,O]=p,c=g1(y,[g,x,O]),v):[c(0),c(.5),c(1)]}}return v.range=m(Gr),v.rangeRound=m(of),v.unknown=function(y){return arguments.length?(d=y,v):d},function(y){return f=y,i=y(e),a=y(t),o=y(r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v}}function fb(){var e=qt(xa()(ke));return e.copy=function(){return zt(e,fb())},Pt.apply(e,arguments)}function db(){var e=ff(xa()).domain([.1,1,10]);return e.copy=function(){return zt(e,db()).base(e.base())},Pt.apply(e,arguments)}function hb(){var e=df(xa());return e.copy=function(){return zt(e,hb()).constant(e.constant())},Pt.apply(e,arguments)}function Sf(){var e=hf(xa());return e.copy=function(){return zt(e,Sf()).exponent(e.exponent())},Pt.apply(e,arguments)}function g_(){return Sf.apply(null,arguments).exponent(.5)}function pb(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=pb(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=pb(e))&&(n&&(n+=" "),n+=t);return n}var Qa,Bd;function Be(){if(Bd)return Qa;Bd=1;var e=Array.isArray;return Qa=e,Qa}var eo,Ld;function vb(){if(Ld)return eo;Ld=1;var e=typeof oi=="object"&&oi&&oi.Object===Object&&oi;return eo=e,eo}var to,qd;function ht(){if(qd)return to;qd=1;var e=vb(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return to=r,to}var ro,zd;function ri(){if(zd)return ro;zd=1;var e=ht(),t=e.Symbol;return ro=t,ro}var no,Fd;function b_(){if(Fd)return no;Fd=1;var e=ri(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),u=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(s?o[i]=u:delete o[i]),f}return no=a,no}var io,Wd;function x_(){if(Wd)return io;Wd=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return io=r,io}var ao,Ud;function Tt(){if(Ud)return ao;Ud=1;var e=ri(),t=b_(),r=x_(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return ao=o,ao}var oo,Gd;function Et(){if(Gd)return oo;Gd=1;function e(t){return t!=null&&typeof t=="object"}return oo=e,oo}var so,Hd;function Hr(){if(Hd)return so;Hd=1;var e=Tt(),t=Et(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return so=n,so}var uo,Kd;function jf(){if(Kd)return uo;Kd=1;var e=Be(),t=Hr(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return uo=i,uo}var co,Vd;function Ft(){if(Vd)return co;Vd=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return co=e,co}var lo,Xd;function Af(){if(Xd)return lo;Xd=1;var e=Tt(),t=Ft(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var u=e(s);return u==n||u==i||u==r||u==a}return lo=o,lo}var fo,Yd;function w_(){if(Yd)return fo;Yd=1;var e=ht(),t=e["__core-js_shared__"];return fo=t,fo}var ho,Zd;function __(){if(Zd)return ho;Zd=1;var e=w_(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return ho=r,ho}var po,Jd;function yb(){if(Jd)return po;Jd=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return po=r,po}var vo,Qd;function O_(){if(Qd)return vo;Qd=1;var e=Af(),t=__(),r=Ft(),n=yb(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,f=RegExp("^"+u.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(d){if(!r(d)||t(d))return!1;var v=e(d)?f:a;return v.test(n(d))}return vo=l,vo}var yo,eh;function S_(){if(eh)return yo;eh=1;function e(t,r){return t==null?void 0:t[r]}return yo=e,yo}var mo,th;function dr(){if(th)return mo;th=1;var e=O_(),t=S_();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return mo=r,mo}var go,rh;function wa(){if(rh)return go;rh=1;var e=dr(),t=e(Object,"create");return go=t,go}var bo,nh;function j_(){if(nh)return bo;nh=1;var e=wa();function t(){this.__data__=e?e(null):{},this.size=0}return bo=t,bo}var xo,ih;function A_(){if(ih)return xo;ih=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return xo=e,xo}var wo,ah;function P_(){if(ah)return wo;ah=1;var e=wa(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return wo=i,wo}var _o,oh;function T_(){if(oh)return _o;oh=1;var e=wa(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return _o=n,_o}var Oo,sh;function E_(){if(sh)return Oo;sh=1;var e=wa(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return Oo=r,Oo}var So,uh;function M_(){if(uh)return So;uh=1;var e=j_(),t=A_(),r=P_(),n=T_(),i=E_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,So=a,So}var jo,ch;function C_(){if(ch)return jo;ch=1;function e(){this.__data__=[],this.size=0}return jo=e,jo}var Ao,lh;function Pf(){if(lh)return Ao;lh=1;function e(t,r){return t===r||t!==t&&r!==r}return Ao=e,Ao}var Po,fh;function _a(){if(fh)return Po;fh=1;var e=Pf();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return Po=t,Po}var To,dh;function I_(){if(dh)return To;dh=1;var e=_a(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():r.call(a,o,1),--this.size,!0}return To=n,To}var Eo,hh;function k_(){if(hh)return Eo;hh=1;var e=_a();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return Eo=t,Eo}var Mo,ph;function $_(){if(ph)return Mo;ph=1;var e=_a();function t(r){return e(this.__data__,r)>-1}return Mo=t,Mo}var Co,vh;function N_(){if(vh)return Co;vh=1;var e=_a();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Co=t,Co}var Io,yh;function Oa(){if(yh)return Io;yh=1;var e=C_(),t=I_(),r=k_(),n=$_(),i=N_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Io=a,Io}var ko,mh;function Tf(){if(mh)return ko;mh=1;var e=dr(),t=ht(),r=e(t,"Map");return ko=r,ko}var $o,gh;function R_(){if(gh)return $o;gh=1;var e=M_(),t=Oa(),r=Tf();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return $o=n,$o}var No,bh;function D_(){if(bh)return No;bh=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return No=e,No}var Ro,xh;function Sa(){if(xh)return Ro;xh=1;var e=D_();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Ro=t,Ro}var Do,wh;function B_(){if(wh)return Do;wh=1;var e=Sa();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Do=t,Do}var Bo,_h;function L_(){if(_h)return Bo;_h=1;var e=Sa();function t(r){return e(this,r).get(r)}return Bo=t,Bo}var Lo,Oh;function q_(){if(Oh)return Lo;Oh=1;var e=Sa();function t(r){return e(this,r).has(r)}return Lo=t,Lo}var qo,Sh;function z_(){if(Sh)return qo;Sh=1;var e=Sa();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return qo=t,qo}var zo,jh;function Ef(){if(jh)return zo;jh=1;var e=R_(),t=B_(),r=L_(),n=q_(),i=z_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,zo=a,zo}var Fo,Ah;function mb(){if(Ah)return Fo;Ah=1;var e=Ef(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],u=a.cache;if(u.has(s))return u.get(s);var c=n.apply(this,o);return a.cache=u.set(s,c)||u,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,Fo=r,Fo}var Wo,Ph;function F_(){if(Ph)return Wo;Ph=1;var e=mb(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return Wo=r,Wo}var Uo,Th;function W_(){if(Th)return Uo;Th=1;var e=F_(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,s,u,c){a.push(u?c.replace(r,"$1"):s||o)}),a});return Uo=n,Uo}var Go,Eh;function Mf(){if(Eh)return Go;Eh=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return Go=e,Go}var Ho,Mh;function U_(){if(Mh)return Ho;Mh=1;var e=ri(),t=Mf(),r=Be(),n=Hr(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return t(s,o)+"";if(n(s))return a?a.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return Ho=o,Ho}var Ko,Ch;function gb(){if(Ch)return Ko;Ch=1;var e=U_();function t(r){return r==null?"":e(r)}return Ko=t,Ko}var Vo,Ih;function bb(){if(Ih)return Vo;Ih=1;var e=Be(),t=jf(),r=W_(),n=gb();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return Vo=i,Vo}var Xo,kh;function ja(){if(kh)return Xo;kh=1;var e=Hr();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Xo=t,Xo}var Yo,$h;function Cf(){if($h)return Yo;$h=1;var e=bb(),t=ja();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return Yo=r,Yo}var Zo,Nh;function xb(){if(Nh)return Zo;Nh=1;var e=Cf();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return Zo=t,Zo}var G_=xb();const Je=le(G_);var Jo,Rh;function H_(){if(Rh)return Jo;Rh=1;function e(t){return t==null}return Jo=e,Jo}var K_=H_();const Q=le(K_);var Qo,Dh;function V_(){if(Dh)return Qo;Dh=1;var e=Tt(),t=Be(),r=Et(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return Qo=i,Qo}var X_=V_();const ar=le(X_);var Y_=Af();const Y=le(Y_);var Z_=Ft();const Kr=le(Z_);var es={exports:{}},ie={};/**
|
|
1
|
+
import{k as oi,a3 as le,ap as $,R as P,g as ne,ad as h,aD as Re,a0 as vt,N as Yx,B as Zx,V as lt,y as Jx,x as Qx,M as e1,aq as gi,G as t1,D as r1,J as n1,F as i1,I as a1,u as o1,r as s1,s as u1,w as c1}from"./index-DGpnb_b1.js";import{a as l1,e as Uc,c as ld,f as fd,g as f1,h as dd,m as hd,o as Bg,d as at,b as Pt,i as d1}from"./ordinal-DhEzRPdO.js";function h1(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function p1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function v1(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=Gr(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function y1(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function m1(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Gr(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}function Gr(e,t){var r=typeof t,n;return t==null||r==="boolean"?l1(t):(r==="number"?Uc:r==="string"?(n=ld(t))?(t=n,fd):f1:t instanceof ld?fd:t instanceof Date?y1:p1(t)?h1:Array.isArray(t)?v1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?m1:Uc)(e,t)}function of(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function g1(e,t){t===void 0&&(t=e,e=Gr);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(o){var s=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[s](o-s)}}function Dt(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function b1(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function sf(e){let t,r,n;e.length!==2?(t=Dt,r=(s,u)=>Dt(e(s),u),n=(s,u)=>e(s)-u):(t=e===Dt||e===b1?e:x1,r=e,n=e);function i(s,u,c=0,f=s.length){if(c<f){if(t(u,u)!==0)return f;do{const l=c+f>>>1;r(s[l],u)<0?c=l+1:f=l}while(c<f)}return c}function a(s,u,c=0,f=s.length){if(c<f){if(t(u,u)!==0)return f;do{const l=c+f>>>1;r(s[l],u)<=0?c=l+1:f=l}while(c<f)}return c}function o(s,u,c=0,f=s.length){const l=i(s,u,c,f-1);return l>c&&n(s[l-1],u)>-n(s[l],u)?l-1:l}return{left:i,center:o,right:a}}function x1(){return 0}function Lg(e){return e===null?NaN:+e}function*w1(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const _1=sf(Dt),Qn=_1.right;sf(Lg).center;function O1(e=Dt){if(e===Dt)return qg;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function qg(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const S1=Math.sqrt(50),j1=Math.sqrt(10),A1=Math.sqrt(2);function bi(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=S1?10:a>=j1?5:a>=A1?2:1;let s,u,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(e*c),u=Math.round(t*c),s/c<e&&++s,u/c>t&&--u,c=-c):(c=Math.pow(10,i)*o,s=Math.round(e/c),u=Math.round(t/c),s*c<e&&++s,u*c>t&&--u),u<s&&.5<=r&&r<2?bi(e,t,r*2):[s,u,c]}function Gc(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,o]=n?bi(t,e,r):bi(e,t,r);if(!(a>=i))return[];const s=a-i+1,u=new Array(s);if(n)if(o<0)for(let c=0;c<s;++c)u[c]=(a-c)/-o;else for(let c=0;c<s;++c)u[c]=(a-c)*o;else if(o<0)for(let c=0;c<s;++c)u[c]=(i+c)/-o;else for(let c=0;c<s;++c)u[c]=(i+c)*o;return u}function Hc(e,t,r){return t=+t,e=+e,r=+r,bi(e,t,r)[2]}function Kc(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?Hc(t,e,r):Hc(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function zg(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?qg:O1(i);n>r;){if(n-r>600){const u=n-r+1,c=t-r+1,f=Math.log(u),l=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*l*(u-l)/u)*(c-u/2<0?-1:1),v=Math.max(r,Math.floor(t-c*l/u+d)),m=Math.min(n,Math.floor(t+(u-c)*l/u+d));zg(e,t,v,m,i)}const a=e[t];let o=r,s=n;for(en(e,r,t),i(e[n],a)>0&&en(e,r,n);o<s;){for(en(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[r],a)===0?en(e,r,s):(++s,en(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function en(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function P1(e,t,r){if(e=Float64Array.from(w1(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return dd(e);if(t>=1)return hd(e);var n,i=(n-1)*t,a=Math.floor(i),o=hd(zg(e,a).subarray(0,a+1)),s=dd(e.subarray(a+1));return o+(s-o)*(i-a)}}function T1(e,t,r=Lg){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function E1(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}function bn(){var e=Bg().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,o,s=!1,u=0,c=0,f=.5;delete e.unknown;function l(){var d=t().length,v=i<n,m=v?i:n,y=v?n:i;a=(y-m)/Math.max(1,d-u+c*2),s&&(a=Math.floor(a)),m+=(y-m-a*(d-u))*f,o=a*(1-u),s&&(m=Math.round(m),o=Math.round(o));var p=E1(d).map(function(g){return m+a*g});return r(v?p.reverse():p)}return e.domain=function(d){return arguments.length?(t(d),l()):t()},e.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,l()):[n,i]},e.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,s=!0,l()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(d){return arguments.length?(s=!!d,l()):s},e.padding=function(d){return arguments.length?(u=Math.min(1,c=+d),l()):u},e.paddingInner=function(d){return arguments.length?(u=Math.min(1,d),l()):u},e.paddingOuter=function(d){return arguments.length?(c=+d,l()):c},e.align=function(d){return arguments.length?(f=Math.max(0,Math.min(1,d)),l()):f},e.copy=function(){return bn(t(),[n,i]).round(s).paddingInner(u).paddingOuter(c).align(f)},at.apply(l(),arguments)}function Fg(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Fg(t())},e}function pn(){return Fg(bn.apply(null,arguments).paddingInner(1))}function M1(e){return function(){return e}}function xi(e){return+e}var pd=[0,1];function ke(e){return e}function Vc(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:M1(isNaN(t)?NaN:.5)}function C1(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function I1(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i<n?(n=Vc(i,n),a=r(o,a)):(n=Vc(n,i),a=r(a,o)),function(s){return a(n(s))}}function k1(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=Vc(e[o],e[o+1]),a[o]=r(t[o],t[o+1]);return function(s){var u=Qn(e,s,1,n)-1;return a[u](i[u](s))}}function ei(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function va(){var e=pd,t=pd,r=Gr,n,i,a,o=ke,s,u,c;function f(){var d=Math.min(e.length,t.length);return o!==ke&&(o=C1(e[0],e[d-1])),s=d>2?k1:I1,u=c=null,l}function l(d){return d==null||isNaN(d=+d)?a:(u||(u=s(e.map(n),t,r)))(n(o(d)))}return l.invert=function(d){return o(i((c||(c=s(t,e.map(n),Uc)))(d)))},l.domain=function(d){return arguments.length?(e=Array.from(d,xi),f()):e.slice()},l.range=function(d){return arguments.length?(t=Array.from(d),f()):t.slice()},l.rangeRound=function(d){return t=Array.from(d),r=of,f()},l.clamp=function(d){return arguments.length?(o=d?!0:ke,f()):o!==ke},l.interpolate=function(d){return arguments.length?(r=d,f()):r},l.unknown=function(d){return arguments.length?(a=d,l):a},function(d,v){return n=d,i=v,f()}}function uf(){return va()(ke,ke)}function $1(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wi(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Or(e){return e=wi(Math.abs(e)),e?e[1]:NaN}function N1(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),a.push(r.substring(i-=s,i+s)),!((u+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function R1(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var D1=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xn(e){if(!(t=D1.exec(e)))throw new Error("invalid format: "+e);var t;return new cf({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}xn.prototype=cf.prototype;function cf(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}cf.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function B1(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var _i;function L1(e,t){var r=wi(e,t);if(!r)return _i=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(_i=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+wi(e,Math.max(0,t+a-1))[0]}function vd(e,t){var r=wi(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const yd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$1,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vd(e*100,t),r:vd,s:L1,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function md(e){return e}var gd=Array.prototype.map,bd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function q1(e){var t=e.grouping===void 0||e.thousands===void 0?md:N1(gd.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?md:R1(gd.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function c(l,d){l=xn(l);var v=l.fill,m=l.align,y=l.sign,p=l.symbol,g=l.zero,x=l.width,O=l.comma,_=l.precision,b=l.trim,w=l.type;w==="n"?(O=!0,w="g"):yd[w]||(_===void 0&&(_=12),b=!0,w="g"),(g||v==="0"&&m==="=")&&(g=!0,v="0",m="=");var S=(d&&d.prefix!==void 0?d.prefix:"")+(p==="$"?r:p==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),j=(p==="$"?n:/[%p]/.test(w)?o:"")+(d&&d.suffix!==void 0?d.suffix:""),A=yd[w],C=/[defgprs%]/.test(w);_=_===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function E(T){var M=S,k=j,I,R,B;if(w==="c")k=A(T)+k,T="";else{T=+T;var q=T<0||1/T<0;if(T=isNaN(T)?u:A(Math.abs(T),_),b&&(T=B1(T)),q&&+T==0&&y!=="+"&&(q=!1),M=(q?y==="("?y:s:y==="-"||y==="("?"":y)+M,k=(w==="s"&&!isNaN(T)&&_i!==void 0?bd[8+_i/3]:"")+k+(q&&y==="("?")":""),C){for(I=-1,R=T.length;++I<R;)if(B=T.charCodeAt(I),48>B||B>57){k=(B===46?i+T.slice(I+1):T.slice(I))+k,T=T.slice(0,I);break}}}O&&!g&&(T=t(T,1/0));var z=M.length+T.length+k.length,G=z<x?new Array(x-z+1).join(v):"";switch(O&&g&&(T=t(G+T,G.length?x-k.length:1/0),G=""),m){case"<":T=M+T+k+G;break;case"=":T=M+G+T+k;break;case"^":T=G.slice(0,z=G.length>>1)+M+T+k+G.slice(z);break;default:T=G+M+T+k;break}return a(T)}return E.toString=function(){return l+""},E}function f(l,d){var v=Math.max(-8,Math.min(8,Math.floor(Or(d)/3)))*3,m=Math.pow(10,-v),y=c((l=xn(l),l.type="f",l),{suffix:bd[8+v/3]});return function(p){return y(m*p)}}return{format:c,formatPrefix:f}}var si,lf,Wg;z1({thousands:",",grouping:[3],currency:["$",""]});function z1(e){return si=q1(e),lf=si.format,Wg=si.formatPrefix,si}function F1(e){return Math.max(0,-Or(Math.abs(e)))}function W1(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Or(t)/3)))*3-Or(Math.abs(e)))}function U1(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Or(t)-Or(e))+1}function Ug(e,t,r,n){var i=Kc(e,t,r),a;switch(n=xn(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=W1(i,o))&&(n.precision=a),Wg(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=U1(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=F1(i))&&(n.precision=a-(n.type==="%")*2);break}}return lf(n)}function qt(e){var t=e.domain;return e.ticks=function(r){var n=t();return Gc(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Ug(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],u,c,f=10;for(s<o&&(c=o,o=s,s=c,c=i,i=a,a=c);f-- >0;){if(c=Hc(o,s,r),c===u)return n[i]=o,n[a]=s,t(n);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;u=c}return e},e}function Oi(){var e=uf();return e.copy=function(){return ei(e,Oi())},at.apply(e,arguments),qt(e)}function Gg(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,xi),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Gg(e).unknown(t)},e=arguments.length?Array.from(e,xi):[0,1],qt(r)}function Hg(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return a<i&&(o=r,r=n,n=o,o=i,i=a,a=o),e[r]=t.floor(i),e[n]=t.ceil(a),e}function xd(e){return Math.log(e)}function wd(e){return Math.exp(e)}function G1(e){return-Math.log(-e)}function H1(e){return-Math.exp(-e)}function K1(e){return isFinite(e)?+("1e"+e):e<0?0:e}function V1(e){return e===10?K1:e===Math.E?Math.exp:t=>Math.pow(e,t)}function X1(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function _d(e){return(t,r)=>-e(-t,r)}function ff(e){const t=e(xd,wd),r=t.domain;let n=10,i,a;function o(){return i=X1(n),a=V1(n),r()[0]<0?(i=_d(i),a=_d(a),e(G1,H1)):e(xd,wd),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const u=r();let c=u[0],f=u[u.length-1];const l=f<c;l&&([c,f]=[f,c]);let d=i(c),v=i(f),m,y;const p=s==null?10:+s;let g=[];if(!(n%1)&&v-d<p){if(d=Math.floor(d),v=Math.ceil(v),c>0){for(;d<=v;++d)for(m=1;m<n;++m)if(y=d<0?m/a(-d):m*a(d),!(y<c)){if(y>f)break;g.push(y)}}else for(;d<=v;++d)for(m=n-1;m>=1;--m)if(y=d>0?m/a(-d):m*a(d),!(y<c)){if(y>f)break;g.push(y)}g.length*2<p&&(g=Gc(c,f,p))}else g=Gc(d,v,Math.min(v-d,p)).map(a);return l?g.reverse():g},t.tickFormat=(s,u)=>{if(s==null&&(s=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=xn(u)).precision==null&&(u.trim=!0),u=lf(u)),s===1/0)return u;const c=Math.max(1,n*s/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*n<n-.5&&(l*=n),l<=c?u(f):""}},t.nice=()=>r(Hg(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function Kg(){const e=ff(va()).domain([1,10]);return e.copy=()=>ei(e,Kg()).base(e.base()),at.apply(e,arguments),e}function Od(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Sd(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function df(e){var t=1,r=e(Od(t),Sd(t));return r.constant=function(n){return arguments.length?e(Od(t=+n),Sd(t)):t},qt(r)}function Vg(){var e=df(va());return e.copy=function(){return ei(e,Vg()).constant(e.constant())},at.apply(e,arguments)}function jd(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Y1(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Z1(e){return e<0?-e*e:e*e}function hf(e){var t=e(ke,ke),r=1;function n(){return r===1?e(ke,ke):r===.5?e(Y1,Z1):e(jd(r),jd(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},qt(t)}function pf(){var e=hf(va());return e.copy=function(){return ei(e,pf()).exponent(e.exponent())},at.apply(e,arguments),e}function J1(){return pf.apply(null,arguments).exponent(.5)}function Ad(e){return Math.sign(e)*e*e}function Q1(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Xg(){var e=uf(),t=[0,1],r=!1,n;function i(a){var o=Q1(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(Ad(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,xi)).map(Ad)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Xg(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},at.apply(i,arguments),qt(i)}function Yg(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o<s;)r[o-1]=T1(e,o/s);return a}function a(o){return o==null||isNaN(o=+o)?n:t[Qn(r,o)]}return a.invertExtent=function(o){var s=t.indexOf(o);return s<0?[NaN,NaN]:[s>0?r[s-1]:e[0],s<r.length?r[s]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let s of o)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Dt),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return Yg().domain(e).range(t).unknown(n)},at.apply(a,arguments)}function Zg(){var e=0,t=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[Qn(n,u,0,r)]:a}function s(){var u=-1;for(n=new Array(r);++u<r;)n[u]=((u+1)*t-(u-r)*e)/(r+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,s()):[e,t]},o.range=function(u){return arguments.length?(r=(i=Array.from(u)).length-1,s()):i.slice()},o.invertExtent=function(u){var c=i.indexOf(u);return c<0?[NaN,NaN]:c<1?[e,n[0]]:c>=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Zg().domain([e,t]).range(i).unknown(a)},at.apply(qt(o),arguments)}function Jg(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Qn(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Jg().domain(e).range(t).unknown(r)},at.apply(i,arguments)}const Va=new Date,Xa=new Date;function Oe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const u=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return u;let c;do u.push(c=new Date(+a)),t(a,s),e(a);while(c<a&&a<o);return u},i.filter=a=>Oe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Va.setTime(+a),Xa.setTime(+o),e(Va),e(Xa),Math.floor(r(Va,Xa))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Si=Oe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Si.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Oe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Si);Si.range;const yt=1e3,Ze=yt*60,mt=Ze*60,Ot=mt*24,vf=Ot*7,Pd=Ot*30,Ya=Ot*365,Zt=Oe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yt)},(e,t)=>(t-e)/yt,e=>e.getUTCSeconds());Zt.range;const yf=Oe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getMinutes());yf.range;const mf=Oe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ze)},(e,t)=>(t-e)/Ze,e=>e.getUTCMinutes());mf.range;const gf=Oe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yt-e.getMinutes()*Ze)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getHours());gf.range;const bf=Oe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*mt)},(e,t)=>(t-e)/mt,e=>e.getUTCHours());bf.range;const ti=Oe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ze)/Ot,e=>e.getDate()-1);ti.range;const ya=Oe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>e.getUTCDate()-1);ya.range;const Qg=Oe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ot,e=>Math.floor(e/Ot));Qg.range;function lr(e){return Oe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Ze)/vf)}const ma=lr(0),ji=lr(1),ew=lr(2),tw=lr(3),Sr=lr(4),rw=lr(5),nw=lr(6);ma.range;ji.range;ew.range;tw.range;Sr.range;rw.range;nw.range;function fr(e){return Oe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/vf)}const ga=fr(0),Ai=fr(1),iw=fr(2),aw=fr(3),jr=fr(4),ow=fr(5),sw=fr(6);ga.range;Ai.range;iw.range;aw.range;jr.range;ow.range;sw.range;const xf=Oe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());xf.range;const wf=Oe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());wf.range;const St=Oe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());St.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Oe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});St.range;const jt=Oe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());jt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Oe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});jt.range;function eb(e,t,r,n,i,a){const o=[[Zt,1,yt],[Zt,5,5*yt],[Zt,15,15*yt],[Zt,30,30*yt],[a,1,Ze],[a,5,5*Ze],[a,15,15*Ze],[a,30,30*Ze],[i,1,mt],[i,3,3*mt],[i,6,6*mt],[i,12,12*mt],[n,1,Ot],[n,2,2*Ot],[r,1,vf],[t,1,Pd],[t,3,3*Pd],[e,1,Ya]];function s(c,f,l){const d=f<c;d&&([c,f]=[f,c]);const v=l&&typeof l.range=="function"?l:u(c,f,l),m=v?v.range(c,+f+1):[];return d?m.reverse():m}function u(c,f,l){const d=Math.abs(f-c)/l,v=sf(([,,p])=>p).right(o,d);if(v===o.length)return e.every(Kc(c/Ya,f/Ya,l));if(v===0)return Si.every(Math.max(Kc(c,f,l),1));const[m,y]=o[d/o[v-1][2]<o[v][2]/d?v-1:v];return m.every(y)}return[s,u]}const[uw,cw]=eb(jt,wf,ga,Qg,bf,mf),[lw,fw]=eb(St,xf,ma,ti,gf,yf);function Za(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ja(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tn(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function dw(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,u=e.shortMonths,c=rn(i),f=nn(i),l=rn(a),d=nn(a),v=rn(o),m=nn(o),y=rn(s),p=nn(s),g=rn(u),x=nn(u),O={a:B,A:q,b:z,B:G,c:null,d:kd,e:kd,f:Nw,g:Gw,G:Kw,H:Iw,I:kw,j:$w,L:tb,m:Rw,M:Dw,p:K,q:W,Q:Rd,s:Dd,S:Bw,u:Lw,U:qw,V:zw,w:Fw,W:Ww,x:null,X:null,y:Uw,Y:Hw,Z:Vw,"%":Nd},_={a:V,A:ue,b:ve,B:Le,c:null,d:$d,e:$d,f:Jw,g:u_,G:l_,H:Xw,I:Yw,j:Zw,L:nb,m:Qw,M:e_,p:Gt,q:$e,Q:Rd,s:Dd,S:t_,u:r_,U:n_,V:i_,w:a_,W:o_,x:null,X:null,y:s_,Y:c_,Z:f_,"%":Nd},b={a:C,A:E,b:T,B:M,c:k,d:Cd,e:Cd,f:Tw,g:Md,G:Ed,H:Id,I:Id,j:Sw,L:Pw,m:Ow,M:jw,p:A,q:_w,Q:Mw,s:Cw,S:Aw,u:mw,U:gw,V:bw,w:yw,W:xw,x:I,X:R,y:Md,Y:Ed,Z:ww,"%":Ew};O.x=w(r,O),O.X=w(n,O),O.c=w(t,O),_.x=w(r,_),_.X=w(n,_),_.c=w(t,_);function w(F,X){return function(Z){var D=[],he=-1,ee=0,ge=F.length,be,Ne,Mt;for(Z instanceof Date||(Z=new Date(+Z));++he<ge;)F.charCodeAt(he)===37&&(D.push(F.slice(ee,he)),(Ne=Td[be=F.charAt(++he)])!=null?be=F.charAt(++he):Ne=be==="e"?" ":"0",(Mt=X[be])&&(be=Mt(Z,Ne)),D.push(be),ee=he+1);return D.push(F.slice(ee,he)),D.join("")}}function S(F,X){return function(Z){var D=tn(1900,void 0,1),he=j(D,F,Z+="",0),ee,ge;if(he!=Z.length)return null;if("Q"in D)return new Date(D.Q);if("s"in D)return new Date(D.s*1e3+("L"in D?D.L:0));if(X&&!("Z"in D)&&(D.Z=0),"p"in D&&(D.H=D.H%12+D.p*12),D.m===void 0&&(D.m="q"in D?D.q:0),"V"in D){if(D.V<1||D.V>53)return null;"w"in D||(D.w=1),"Z"in D?(ee=Ja(tn(D.y,0,1)),ge=ee.getUTCDay(),ee=ge>4||ge===0?Ai.ceil(ee):Ai(ee),ee=ya.offset(ee,(D.V-1)*7),D.y=ee.getUTCFullYear(),D.m=ee.getUTCMonth(),D.d=ee.getUTCDate()+(D.w+6)%7):(ee=Za(tn(D.y,0,1)),ge=ee.getDay(),ee=ge>4||ge===0?ji.ceil(ee):ji(ee),ee=ti.offset(ee,(D.V-1)*7),D.y=ee.getFullYear(),D.m=ee.getMonth(),D.d=ee.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),ge="Z"in D?Ja(tn(D.y,0,1)).getUTCDay():Za(tn(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(ge+5)%7:D.w+D.U*7-(ge+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Ja(D)):Za(D)}}function j(F,X,Z,D){for(var he=0,ee=X.length,ge=Z.length,be,Ne;he<ee;){if(D>=ge)return-1;if(be=X.charCodeAt(he++),be===37){if(be=X.charAt(he++),Ne=b[be in Td?X.charAt(he++):be],!Ne||(D=Ne(F,Z,D))<0)return-1}else if(be!=Z.charCodeAt(D++))return-1}return D}function A(F,X,Z){var D=c.exec(X.slice(Z));return D?(F.p=f.get(D[0].toLowerCase()),Z+D[0].length):-1}function C(F,X,Z){var D=v.exec(X.slice(Z));return D?(F.w=m.get(D[0].toLowerCase()),Z+D[0].length):-1}function E(F,X,Z){var D=l.exec(X.slice(Z));return D?(F.w=d.get(D[0].toLowerCase()),Z+D[0].length):-1}function T(F,X,Z){var D=g.exec(X.slice(Z));return D?(F.m=x.get(D[0].toLowerCase()),Z+D[0].length):-1}function M(F,X,Z){var D=y.exec(X.slice(Z));return D?(F.m=p.get(D[0].toLowerCase()),Z+D[0].length):-1}function k(F,X,Z){return j(F,t,X,Z)}function I(F,X,Z){return j(F,r,X,Z)}function R(F,X,Z){return j(F,n,X,Z)}function B(F){return o[F.getDay()]}function q(F){return a[F.getDay()]}function z(F){return u[F.getMonth()]}function G(F){return s[F.getMonth()]}function K(F){return i[+(F.getHours()>=12)]}function W(F){return 1+~~(F.getMonth()/3)}function V(F){return o[F.getUTCDay()]}function ue(F){return a[F.getUTCDay()]}function ve(F){return u[F.getUTCMonth()]}function Le(F){return s[F.getUTCMonth()]}function Gt(F){return i[+(F.getUTCHours()>=12)]}function $e(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var X=w(F+="",O);return X.toString=function(){return F},X},parse:function(F){var X=S(F+="",!1);return X.toString=function(){return F},X},utcFormat:function(F){var X=w(F+="",_);return X.toString=function(){return F},X},utcParse:function(F){var X=S(F+="",!0);return X.toString=function(){return F},X}}}var Td={"-":"",_:" ",0:"0"},Pe=/^\s*\d+/,hw=/^%/,pw=/[\\^$*+?|[\]().{}]/g;function re(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function vw(e){return e.replace(pw,"\\$&")}function rn(e){return new RegExp("^(?:"+e.map(vw).join("|")+")","i")}function nn(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function yw(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function mw(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function gw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function bw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function xw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Ed(e,t,r){var n=Pe.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Md(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function ww(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function _w(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ow(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Cd(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Sw(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Id(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function jw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Aw(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Pw(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Tw(e,t,r){var n=Pe.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ew(e,t,r){var n=hw.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Mw(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Cw(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function kd(e,t){return re(e.getDate(),t,2)}function Iw(e,t){return re(e.getHours(),t,2)}function kw(e,t){return re(e.getHours()%12||12,t,2)}function $w(e,t){return re(1+ti.count(St(e),e),t,3)}function tb(e,t){return re(e.getMilliseconds(),t,3)}function Nw(e,t){return tb(e,t)+"000"}function Rw(e,t){return re(e.getMonth()+1,t,2)}function Dw(e,t){return re(e.getMinutes(),t,2)}function Bw(e,t){return re(e.getSeconds(),t,2)}function Lw(e){var t=e.getDay();return t===0?7:t}function qw(e,t){return re(ma.count(St(e)-1,e),t,2)}function rb(e){var t=e.getDay();return t>=4||t===0?Sr(e):Sr.ceil(e)}function zw(e,t){return e=rb(e),re(Sr.count(St(e),e)+(St(e).getDay()===4),t,2)}function Fw(e){return e.getDay()}function Ww(e,t){return re(ji.count(St(e)-1,e),t,2)}function Uw(e,t){return re(e.getFullYear()%100,t,2)}function Gw(e,t){return e=rb(e),re(e.getFullYear()%100,t,2)}function Hw(e,t){return re(e.getFullYear()%1e4,t,4)}function Kw(e,t){var r=e.getDay();return e=r>=4||r===0?Sr(e):Sr.ceil(e),re(e.getFullYear()%1e4,t,4)}function Vw(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+re(t/60|0,"0",2)+re(t%60,"0",2)}function $d(e,t){return re(e.getUTCDate(),t,2)}function Xw(e,t){return re(e.getUTCHours(),t,2)}function Yw(e,t){return re(e.getUTCHours()%12||12,t,2)}function Zw(e,t){return re(1+ya.count(jt(e),e),t,3)}function nb(e,t){return re(e.getUTCMilliseconds(),t,3)}function Jw(e,t){return nb(e,t)+"000"}function Qw(e,t){return re(e.getUTCMonth()+1,t,2)}function e_(e,t){return re(e.getUTCMinutes(),t,2)}function t_(e,t){return re(e.getUTCSeconds(),t,2)}function r_(e){var t=e.getUTCDay();return t===0?7:t}function n_(e,t){return re(ga.count(jt(e)-1,e),t,2)}function ib(e){var t=e.getUTCDay();return t>=4||t===0?jr(e):jr.ceil(e)}function i_(e,t){return e=ib(e),re(jr.count(jt(e),e)+(jt(e).getUTCDay()===4),t,2)}function a_(e){return e.getUTCDay()}function o_(e,t){return re(Ai.count(jt(e)-1,e),t,2)}function s_(e,t){return re(e.getUTCFullYear()%100,t,2)}function u_(e,t){return e=ib(e),re(e.getUTCFullYear()%100,t,2)}function c_(e,t){return re(e.getUTCFullYear()%1e4,t,4)}function l_(e,t){var r=e.getUTCDay();return e=r>=4||r===0?jr(e):jr.ceil(e),re(e.getUTCFullYear()%1e4,t,4)}function f_(){return"+0000"}function Nd(){return"%"}function Rd(e){return+e}function Dd(e){return Math.floor(+e/1e3)}var vr,ab,ob;d_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function d_(e){return vr=dw(e),ab=vr.format,vr.parse,ob=vr.utcFormat,vr.utcParse,vr}function h_(e){return new Date(e)}function p_(e){return e instanceof Date?+e:+new Date(+e)}function _f(e,t,r,n,i,a,o,s,u,c){var f=uf(),l=f.invert,d=f.domain,v=c(".%L"),m=c(":%S"),y=c("%I:%M"),p=c("%I %p"),g=c("%a %d"),x=c("%b %d"),O=c("%B"),_=c("%Y");function b(w){return(u(w)<w?v:s(w)<w?m:o(w)<w?y:a(w)<w?p:n(w)<w?i(w)<w?g:x:r(w)<w?O:_)(w)}return f.invert=function(w){return new Date(l(w))},f.domain=function(w){return arguments.length?d(Array.from(w,p_)):d().map(h_)},f.ticks=function(w){var S=d();return e(S[0],S[S.length-1],w??10)},f.tickFormat=function(w,S){return S==null?b:c(S)},f.nice=function(w){var S=d();return(!w||typeof w.range!="function")&&(w=t(S[0],S[S.length-1],w??10)),w?d(Hg(S,w)):f},f.copy=function(){return ei(f,_f(e,t,r,n,i,a,o,s,u,c))},f}function v_(){return at.apply(_f(lw,fw,St,xf,ma,ti,gf,yf,Zt,ab).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function y_(){return at.apply(_f(uw,cw,jt,wf,ga,ya,bf,mf,Zt,ob).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ba(){var e=0,t=1,r,n,i,a,o=ke,s=!1,u;function c(l){return l==null||isNaN(l=+l)?u:o(i===0?.5:(l=(a(l)-r)*i,s?Math.max(0,Math.min(1,l)):l))}c.domain=function(l){return arguments.length?([e,t]=l,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),c):[e,t]},c.clamp=function(l){return arguments.length?(s=!!l,c):s},c.interpolator=function(l){return arguments.length?(o=l,c):o};function f(l){return function(d){var v,m;return arguments.length?([v,m]=d,o=l(v,m),c):[o(0),o(1)]}}return c.range=f(Gr),c.rangeRound=f(of),c.unknown=function(l){return arguments.length?(u=l,c):u},function(l){return a=l,r=l(e),n=l(t),i=r===n?0:1/(n-r),c}}function zt(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function sb(){var e=qt(ba()(ke));return e.copy=function(){return zt(e,sb())},Pt.apply(e,arguments)}function ub(){var e=ff(ba()).domain([1,10]);return e.copy=function(){return zt(e,ub()).base(e.base())},Pt.apply(e,arguments)}function cb(){var e=df(ba());return e.copy=function(){return zt(e,cb()).constant(e.constant())},Pt.apply(e,arguments)}function Of(){var e=hf(ba());return e.copy=function(){return zt(e,Of()).exponent(e.exponent())},Pt.apply(e,arguments)}function m_(){return Of.apply(null,arguments).exponent(.5)}function lb(){var e=[],t=ke;function r(n){if(n!=null&&!isNaN(n=+n))return t((Qn(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Dt),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>P1(e,a/n))},r.copy=function(){return lb(t).domain(e)},Pt.apply(r,arguments)}function xa(){var e=0,t=.5,r=1,n=1,i,a,o,s,u,c=ke,f,l=!1,d;function v(y){return isNaN(y=+y)?d:(y=.5+((y=+f(y))-a)*(n*y<n*a?s:u),c(l?Math.max(0,Math.min(1,y)):y))}v.domain=function(y){return arguments.length?([e,t,r]=y,i=f(e=+e),a=f(t=+t),o=f(r=+r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v):[e,t,r]},v.clamp=function(y){return arguments.length?(l=!!y,v):l},v.interpolator=function(y){return arguments.length?(c=y,v):c};function m(y){return function(p){var g,x,O;return arguments.length?([g,x,O]=p,c=g1(y,[g,x,O]),v):[c(0),c(.5),c(1)]}}return v.range=m(Gr),v.rangeRound=m(of),v.unknown=function(y){return arguments.length?(d=y,v):d},function(y){return f=y,i=y(e),a=y(t),o=y(r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v}}function fb(){var e=qt(xa()(ke));return e.copy=function(){return zt(e,fb())},Pt.apply(e,arguments)}function db(){var e=ff(xa()).domain([.1,1,10]);return e.copy=function(){return zt(e,db()).base(e.base())},Pt.apply(e,arguments)}function hb(){var e=df(xa());return e.copy=function(){return zt(e,hb()).constant(e.constant())},Pt.apply(e,arguments)}function Sf(){var e=hf(xa());return e.copy=function(){return zt(e,Sf()).exponent(e.exponent())},Pt.apply(e,arguments)}function g_(){return Sf.apply(null,arguments).exponent(.5)}function pb(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=pb(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=pb(e))&&(n&&(n+=" "),n+=t);return n}var Qa,Bd;function Be(){if(Bd)return Qa;Bd=1;var e=Array.isArray;return Qa=e,Qa}var eo,Ld;function vb(){if(Ld)return eo;Ld=1;var e=typeof oi=="object"&&oi&&oi.Object===Object&&oi;return eo=e,eo}var to,qd;function ht(){if(qd)return to;qd=1;var e=vb(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return to=r,to}var ro,zd;function ri(){if(zd)return ro;zd=1;var e=ht(),t=e.Symbol;return ro=t,ro}var no,Fd;function b_(){if(Fd)return no;Fd=1;var e=ri(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),u=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(s?o[i]=u:delete o[i]),f}return no=a,no}var io,Wd;function x_(){if(Wd)return io;Wd=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return io=r,io}var ao,Ud;function Tt(){if(Ud)return ao;Ud=1;var e=ri(),t=b_(),r=x_(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return ao=o,ao}var oo,Gd;function Et(){if(Gd)return oo;Gd=1;function e(t){return t!=null&&typeof t=="object"}return oo=e,oo}var so,Hd;function Hr(){if(Hd)return so;Hd=1;var e=Tt(),t=Et(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return so=n,so}var uo,Kd;function jf(){if(Kd)return uo;Kd=1;var e=Be(),t=Hr(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return uo=i,uo}var co,Vd;function Ft(){if(Vd)return co;Vd=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return co=e,co}var lo,Xd;function Af(){if(Xd)return lo;Xd=1;var e=Tt(),t=Ft(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var u=e(s);return u==n||u==i||u==r||u==a}return lo=o,lo}var fo,Yd;function w_(){if(Yd)return fo;Yd=1;var e=ht(),t=e["__core-js_shared__"];return fo=t,fo}var ho,Zd;function __(){if(Zd)return ho;Zd=1;var e=w_(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return ho=r,ho}var po,Jd;function yb(){if(Jd)return po;Jd=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return po=r,po}var vo,Qd;function O_(){if(Qd)return vo;Qd=1;var e=Af(),t=__(),r=Ft(),n=yb(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,f=RegExp("^"+u.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(d){if(!r(d)||t(d))return!1;var v=e(d)?f:a;return v.test(n(d))}return vo=l,vo}var yo,eh;function S_(){if(eh)return yo;eh=1;function e(t,r){return t==null?void 0:t[r]}return yo=e,yo}var mo,th;function dr(){if(th)return mo;th=1;var e=O_(),t=S_();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return mo=r,mo}var go,rh;function wa(){if(rh)return go;rh=1;var e=dr(),t=e(Object,"create");return go=t,go}var bo,nh;function j_(){if(nh)return bo;nh=1;var e=wa();function t(){this.__data__=e?e(null):{},this.size=0}return bo=t,bo}var xo,ih;function A_(){if(ih)return xo;ih=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return xo=e,xo}var wo,ah;function P_(){if(ah)return wo;ah=1;var e=wa(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return wo=i,wo}var _o,oh;function T_(){if(oh)return _o;oh=1;var e=wa(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return _o=n,_o}var Oo,sh;function E_(){if(sh)return Oo;sh=1;var e=wa(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return Oo=r,Oo}var So,uh;function M_(){if(uh)return So;uh=1;var e=j_(),t=A_(),r=P_(),n=T_(),i=E_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,So=a,So}var jo,ch;function C_(){if(ch)return jo;ch=1;function e(){this.__data__=[],this.size=0}return jo=e,jo}var Ao,lh;function Pf(){if(lh)return Ao;lh=1;function e(t,r){return t===r||t!==t&&r!==r}return Ao=e,Ao}var Po,fh;function _a(){if(fh)return Po;fh=1;var e=Pf();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return Po=t,Po}var To,dh;function I_(){if(dh)return To;dh=1;var e=_a(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():r.call(a,o,1),--this.size,!0}return To=n,To}var Eo,hh;function k_(){if(hh)return Eo;hh=1;var e=_a();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return Eo=t,Eo}var Mo,ph;function $_(){if(ph)return Mo;ph=1;var e=_a();function t(r){return e(this.__data__,r)>-1}return Mo=t,Mo}var Co,vh;function N_(){if(vh)return Co;vh=1;var e=_a();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Co=t,Co}var Io,yh;function Oa(){if(yh)return Io;yh=1;var e=C_(),t=I_(),r=k_(),n=$_(),i=N_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Io=a,Io}var ko,mh;function Tf(){if(mh)return ko;mh=1;var e=dr(),t=ht(),r=e(t,"Map");return ko=r,ko}var $o,gh;function R_(){if(gh)return $o;gh=1;var e=M_(),t=Oa(),r=Tf();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return $o=n,$o}var No,bh;function D_(){if(bh)return No;bh=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return No=e,No}var Ro,xh;function Sa(){if(xh)return Ro;xh=1;var e=D_();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Ro=t,Ro}var Do,wh;function B_(){if(wh)return Do;wh=1;var e=Sa();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Do=t,Do}var Bo,_h;function L_(){if(_h)return Bo;_h=1;var e=Sa();function t(r){return e(this,r).get(r)}return Bo=t,Bo}var Lo,Oh;function q_(){if(Oh)return Lo;Oh=1;var e=Sa();function t(r){return e(this,r).has(r)}return Lo=t,Lo}var qo,Sh;function z_(){if(Sh)return qo;Sh=1;var e=Sa();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return qo=t,qo}var zo,jh;function Ef(){if(jh)return zo;jh=1;var e=R_(),t=B_(),r=L_(),n=q_(),i=z_();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,zo=a,zo}var Fo,Ah;function mb(){if(Ah)return Fo;Ah=1;var e=Ef(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],u=a.cache;if(u.has(s))return u.get(s);var c=n.apply(this,o);return a.cache=u.set(s,c)||u,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,Fo=r,Fo}var Wo,Ph;function F_(){if(Ph)return Wo;Ph=1;var e=mb(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return Wo=r,Wo}var Uo,Th;function W_(){if(Th)return Uo;Th=1;var e=F_(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,s,u,c){a.push(u?c.replace(r,"$1"):s||o)}),a});return Uo=n,Uo}var Go,Eh;function Mf(){if(Eh)return Go;Eh=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return Go=e,Go}var Ho,Mh;function U_(){if(Mh)return Ho;Mh=1;var e=ri(),t=Mf(),r=Be(),n=Hr(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return t(s,o)+"";if(n(s))return a?a.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return Ho=o,Ho}var Ko,Ch;function gb(){if(Ch)return Ko;Ch=1;var e=U_();function t(r){return r==null?"":e(r)}return Ko=t,Ko}var Vo,Ih;function bb(){if(Ih)return Vo;Ih=1;var e=Be(),t=jf(),r=W_(),n=gb();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return Vo=i,Vo}var Xo,kh;function ja(){if(kh)return Xo;kh=1;var e=Hr();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Xo=t,Xo}var Yo,$h;function Cf(){if($h)return Yo;$h=1;var e=bb(),t=ja();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return Yo=r,Yo}var Zo,Nh;function xb(){if(Nh)return Zo;Nh=1;var e=Cf();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return Zo=t,Zo}var G_=xb();const Je=le(G_);var Jo,Rh;function H_(){if(Rh)return Jo;Rh=1;function e(t){return t==null}return Jo=e,Jo}var K_=H_();const Q=le(K_);var Qo,Dh;function V_(){if(Dh)return Qo;Dh=1;var e=Tt(),t=Be(),r=Et(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return Qo=i,Qo}var X_=V_();const ar=le(X_);var Y_=Af();const Y=le(Y_);var Z_=Ft();const Kr=le(Z_);var es={exports:{}},ie={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-is.production.min.js
|
|
4
4
|
*
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ap as i,z as ie,a8 as de,aI as _,aD as ee,Q as pe,ak as ue,v as ge,a9 as xe,aN as D,ad as e,$ as be,S as fe,Z as ne,a1 as Ce,ah as je,ab as Ne,X as ye,Y as ke,j as Ae,n as Pe,aB as Ie,aM as Se,ac as Ee,aG as Te,aa as ce,o as J,av as ae,ag as Re,an as We,E as $e}from"./index-DGpnb_b1.js";import{u as Me,v as oe,H as Oe,f as q,t as Be,z as Fe,P as De,w as Ue,W as Le,C as Ge,a as _e}from"./ApproveWalletsModal-9w2edv7e.js";function Ve(){const[t,s]=i.useState("loading"),[c,l]=i.useState(0);return i.useEffect(()=>{let h=!0;return s("loading"),ie("0").then(()=>{h&&s("available")}).catch(d=>{h&&s(de(d)?"unavailable":"available")}),()=>{h=!1}},[c]),{status:t,recheck:()=>l(h=>h+1)}}function Ye(t){const{accountId:s,relation:c,...l}=t;return l}function ze(t,s){return t===s?t:"both"}function qe(){const t=_(n=>n.trackedIds),s=_(n=>n.trackAccount),{data:c,loading:l,refresh:h}=ee(async()=>{let n=!1;const p=await pe().catch(()=>(n=!0,null));typeof(p==null?void 0:p.error)=="string"&&p.error.length>0&&(n=!0);const o=(p==null?void 0:p.wallets)??[],v=(await Promise.all(o.map(async g=>{const N=await ue(g).catch(()=>(n=!0,null));return N!=null&&N.accountId?{accountId:N.accountId,wallet:g}:null}))).filter(g=>g!=null);let u=[],C=!1;try{u=(await ge({hydrate:!0})).accounts}catch(g){de(g)&&!xe(g)?u=[]:C=!0}return{agentPairs:v,mine:u,ownedError:C,agentError:n}},[],0),d=i.useMemo(()=>{const n=new Map;for(const p of(c==null?void 0:c.mine)??[])n.set(p.accountId,{accountId:p.accountId,relation:p.relation,basics:Ye(p)});for(const p of(c==null?void 0:c.agentPairs)??[]){const o=n.get(p.accountId);o?(o.relation=ze(o.relation,"agent"),o.agentWallet||(o.agentWallet=p.wallet)):n.set(p.accountId,{accountId:p.accountId,relation:"agent",agentWallet:p.wallet})}return[...n.values()]},[c]);i.useEffect(()=>{for(const n of d)(n.relation==="agent"||n.relation==="both")&&!t.includes(n.accountId)&&s(n.accountId)},[d,t,s]);const x=i.useMemo(()=>d.filter(n=>!t.includes(n.accountId)),[d,t]);return{discovered:d,untracked:x,ownedError:(c==null?void 0:c.ownedError)??!1,agentError:(c==null?void 0:c.agentError)??!1,loading:l,refresh:h}}function He(){const t=D(n=>n.address),s=D(n=>n.bootstrap),[c,l]=i.useState({loading:!1,error:null,ids:[]}),[h,d]=i.useState(0);i.useEffect(()=>{let n=!1;async function p(o,v){var u;l(C=>({...C,loading:!0,error:null}));try{if(!((u=o.rpcUrls)!=null&&u.length))throw new Error("No PCA RPC endpoints were provided.");const C=Me(o.chainId,o.rpcUrls),g=o.nft,N=v,T=await C.readContract({address:g,abi:oe,functionName:"balanceOf",args:[N]}),S=[],m=typeof T=="bigint"?T:BigInt(String(T));for(let y=0n;y<m;y+=1n){const k=await C.readContract({address:g,abi:oe,functionName:"tokenOfOwnerByIndex",args:[N,y]});S.push((typeof k=="bigint"?k:BigInt(String(k))).toString())}if(n)return;l({loading:!1,error:null,ids:S})}catch(C){if(n)return;l({loading:!1,error:(C==null?void 0:C.message)??"Could not read connected-wallet PCAs.",ids:[]})}}return!t||!s?(l({loading:!1,error:null,ids:[]}),()=>{n=!0}):(p(s,t),()=>{n=!0})},[t,s,h]);const x=i.useCallback(()=>d(n=>n+1),[]);return{ids:c.ids,loading:c.loading,error:c.error,refresh:x}}function re(t){if(typeof t!="number"||!Number.isFinite(t))return"—";const s=t/100;return`${s%1===0?s.toFixed(0):s.toFixed(1)}%`}function te({account:t,blockExplorerUrl:s,nowSec:c,onManage:l,onApproveWallets:h,onUseForPublishing:d,onRemove:x,onRetry:n,onSwitchNetwork:p,view:o}){const{accountId:v,snapshot:u,notFound:C,classification:g,ownerIsPrimaryWallet:N}=t;if(C)return e.jsx("div",{className:"card v10-pca-card","data-state":"not-found","data-account":v,"data-testid":"pca-account-card",children:e.jsxs("div",{className:"card-body v10-pca-card-error",children:[e.jsxs("p",{children:["PCA #",v," no longer exists on-chain."]}),x&&e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>x(v),children:"Remove from tracked"})]})});if(!u)return e.jsx("div",{className:"card v10-pca-card","data-state":"error","data-account":v,"data-testid":"pca-account-card",children:e.jsxs("div",{className:"card-body v10-pca-card-error",children:[e.jsxs("p",{children:["Couldn’t load PCA #",v,"."]}),n&&e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>n(v),children:"Retry"})]})});const T=be(u.expiresAtTimestamp,c),S=s?`${s}/address/${u.owner}`:void 0,m=t.ownerMode??(N?"daemon":"external"),y=m==="wallet"&&!!t.walletWrongNetwork,k=Be(m,y),b=t.connectedWallet,R=m==="daemon"?void 0:m==="wallet"?y?"Wrong network - switch the connected wallet to this node's PCA network.":"Connected wallet will sign this owner action.":b?`Connected as ${b}; switch to ${u.owner} to manage PCA #${v}.`:`Connect owner wallet ${u.owner} to manage PCA #${v}.`,W=e.jsxs("div",{className:"v10-pca-card-title",children:[e.jsxs("span",{className:"v10-pca-card-id",children:["PCA #",v]}),e.jsxs("span",{className:"badge badge-info v10-pca-card-discount",children:["◉ ",re(u.discountBps)," discount"]}),m==="wallet"&&e.jsx("span",{className:"badge badge-info",children:"✎ wallet-managed"}),m==="external"&&e.jsx("span",{className:"badge badge-warn",children:"tracked external"}),e.jsx("span",{className:"v10-pca-card-spacer"}),t.health&&e.jsx(Oe,{state:t.health})]}),A=e.jsxs("div",{className:"v10-pca-card-owner",children:[e.jsx("span",{className:"v10-pca-card-owner-lbl",children:"Owner"}),e.jsx(q,{address:u.owner,trailing:S?e.jsx("a",{className:"v10-pca-card-explorer",href:S,target:"_blank",rel:"noreferrer","aria-label":`View owner ${u.owner} on the block explorer`,children:"↗"}):void 0})]}),L=m==="daemon"?"Daemon-managed: owner actions use this node’s primary operational wallet.":m==="wallet"?"Wallet-managed: owner actions are signed by the connected wallet.":b?`Read-only here: connected as ${b}; switch to the owner wallet to manage.`:"Read-only here: connect the owner wallet to manage this PCA.";if(o==="coverage"?!1:o==="owner"?!0:g==="owned"||m==="wallet"||m==="external"&&t.approvedCount===0){const Y=t.approvedCount>0,$=t.probesInconclusive;return e.jsx("div",{className:"card v10-pca-card","data-state":"owned","data-owner-mode":m,"data-account":v,"data-testid":"pca-account-card",children:e.jsxs("div",{className:"card-body",children:[W,e.jsx(fe,{items:[{id:"committed",label:"Committed",value:`${ne(u.committedTRACTrac)} TRAC`},{id:"buffer",label:"Top-up buffer",value:`${ne(u.topUpBufferTrac)} TRAC`},{id:"per-epoch",label:"Per-epoch allowance",value:`${Ce(u.baseEpochAllowance)} TRAC`},{id:"wallets",label:"Publishing wallets",value:`${u.agentCount} / 100`}]}),A,m==="daemon"?e.jsxs("p",{className:"v10-pca-card-owner-note",children:["This is the node’s operational wallet — who ",e.jsx("strong",{children:"signs"}),", not who’s covered."]}):e.jsx("p",{className:"v10-pca-card-owner-note",children:L}),y&&e.jsxs("p",{className:"v10-pca-card-warn",role:"alert",children:["Wrong network. Reads still work, but wallet-owner writes are disabled until the wallet is switched."," ",p&&e.jsx("button",{type:"button",className:"v10-pca-inline-btn",onClick:p,children:"Switch network"})]}),m==="external"&&e.jsx("p",{className:"v10-pca-card-warn",children:b?`Connected as ${b} - switch to ${u.owner} to manage PCA #${v}.`:`Connect ${u.owner} to manage PCA #${v}.`}),$?e.jsx("p",{className:"v10-pca-card-warn",children:"⚠ Couldn’t verify which of this node’s wallets are approved — retry. Until then, whether this account discounts your publishes is unconfirmed."}):Y?null:e.jsx("p",{className:"v10-pca-card-warn",children:"⚠ 0 of this node’s wallets are approved here — it discounts nothing yet. Approve this node’s operational wallets to start saving."}),e.jsxs("p",{className:"v10-pca-card-meta",children:[T,e.jsx("span",{className:"v10-pca-card-meta-sep",children:" · "}),e.jsxs("span",{title:`Expiry epoch ${u.expiresAtEpoch}`,children:["epoch ",u.expiresAtEpoch," ⓘ"]})]}),e.jsxs("div",{className:"v10-pca-card-actions",children:[l&&e.jsx("button",{type:"button",className:"v10-pca-card-btn primary",onClick:()=>l(v),children:m==="external"?"View details":"Manage"}),m==="external"?x&&e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>x(v),children:"Stop tracking"}):e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>h==null?void 0:h(v),disabled:!k||!h,title:R,children:"Approve wallets"})]})]})})}const U=t.walletCount>0&&t.approvedCount===t.walletCount,B=t.probesInconclusive;return e.jsx("div",{className:"card v10-pca-card","data-state":"approved","data-account":v,"data-testid":"pca-account-card",children:e.jsxs("div",{className:"card-body",children:[e.jsxs("div",{className:"v10-pca-card-title",children:[e.jsxs("span",{className:"v10-pca-card-id",children:["PCA #",v]}),e.jsx("span",{className:"v10-pca-card-sponsor",children:"(approved for this node)"}),e.jsxs("span",{className:"badge badge-info v10-pca-card-discount",children:["◉ ",re(u.discountBps)]}),e.jsx("span",{className:"v10-pca-card-spacer"}),B?e.jsx("span",{className:"badge badge-warn",children:"⚠ couldn’t verify approvals"}):!U&&t.walletCount>0?e.jsxs("span",{className:"badge badge-warn",children:["⚠ ",t.approvedCount," of ",t.walletCount," wallets approved"]}):null]}),A,e.jsxs("p",{className:"v10-pca-card-meta",children:[T,e.jsx("span",{className:"v10-pca-card-meta-sep",children:" · "}),e.jsxs("span",{title:`Expiry epoch ${u.expiresAtEpoch}`,children:["epoch ",u.expiresAtEpoch," ⓘ"]})]}),e.jsx("p",{className:"v10-pca-card-summary",children:B?"Approval coverage could not be fully verified.":`${t.approvedCount} of ${t.walletCount} node publishing wallet${t.walletCount===1?"":"s"} approved.`}),B?e.jsx("p",{className:"v10-pca-card-warn",children:"Couldn’t verify which wallets are approved — retry."}):!U&&t.walletCount>0?e.jsx("p",{className:"v10-pca-card-warn",children:"Publishes from the un-approved wallet(s) will quietly pay the direct cost."}):null,e.jsxs("div",{className:"v10-pca-card-actions",children:[l&&e.jsx("button",{type:"button",className:"v10-pca-card-btn primary",onClick:()=>l(v),children:"View details"}),d&&e.jsx("button",{type:"button",className:"v10-pca-card-btn primary",onClick:()=>d(v),children:"Use for publishing"})]})]})})}const Ke={84532:"https://www.alchemy.com/faucets/base-sepolia",11155111:"https://www.alchemy.com/faucets/ethereum-sepolia",10200:"https://faucet.chiadochain.net/"};function Qe(t){if(t==null)return;const s=String(t),c=s.includes(":")?s.split(":").pop():s;return Ke[c]}function Xe(t){switch(t.outcome){case"covers":return{text:"approved",tone:"success"};case"uncovered":return{text:"approved, but that PCA is expired, swept, or out of budget - publishes will not get the discount",tone:"warn"};case"unregistered":return{text:"not approved - ask the PCA owner to approve it",tone:"danger"};case"inconclusive":return{text:"unknown",tone:"neutral"}}}function Ze({onClose:t}){const{data:s,loading:c,error:l,refresh:h}=ee(pe,[],0),d=(s==null?void 0:s.wallets)??[],x=(s==null?void 0:s.balances)??[],n=typeof(s==null?void 0:s.error)=="string"&&s.error.length>0?s.error:null,p=l||n,o=(s==null?void 0:s.chainId)??null,v=je(o),u=Ne(o)?Qe(o):void 0,C=_(r=>r.trackAccount),{copied:g,copy:N}=Fe(),T=d.join(","),{data:S}=ee(async()=>{const r=(s==null?void 0:s.wallets)??[];if(r.length===0)return[];const w=await Promise.all(r.map(j=>ue(j).then(f=>f.accountId).catch(()=>null)));return Array.from(new Set(w.filter(j=>j!=null)))},[T],0),[m,y]=i.useState(""),[k,b]=i.useState(!1),[R,W]=i.useState(null),[A,L]=i.useState(null),V=r=>{var w;return(w=x.find(j=>{var f;return((f=j.address)==null?void 0:f.toLowerCase())===r.toLowerCase()}))==null?void 0:w.eth},U=r=>{const w=V(r);return w!=null&&Number(w)>0},B=async()=>{var w;const r=m.trim();if(!/^\d+$/.test(r)){W("Enter the numeric PCA ID the owner gave you.");return}b(!0),W(null);try{const j=await Promise.all(d.map(f=>ie(r,f,{extended:!0}).then(M=>({wallet:f,coverage:Ae(M)})).catch(()=>({wallet:f,coverage:{outcome:"inconclusive",registered:null,adapterUnsupported:!1}}))));if(j.length>0&&j.every(f=>f.coverage.outcome==="inconclusive")){const f=j.every(M=>M.coverage.outcome==="inconclusive"&&M.coverage.adapterUnsupported);W(f?"PCA approval isn’t verifiable on this chain’s adapter — not supported here. You can still publish without a discount.":`Couldn’t check approval on PCA #${r} right now — the chain lookup failed. Retry.`),L(null);return}j.some(f=>f.coverage.registered===!0)&&C(r),L({accountId:r,rows:j})}catch(j){W(((w=Pe(j,{accountId:r}))==null?void 0:w.message)??"Couldn’t check approval.")}finally{b(!1)}},Y=(A==null?void 0:A.rows.filter(r=>r.coverage.registered===!0).length)??0,$=!!A&&A.rows.some(r=>r.coverage.outcome==="covers"&&U(r.wallet));return e.jsxs(De,{onClose:t,testId:"pca-get-sponsored",title:"Get added to a PCA",subtitle:"Share this node's operational publishing wallets with the PCA owner. They approve them; this node still pays its own gas.",children:[e.jsxs("div",{className:"v10-modal-body v10-pca-get-added-body",children:[e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsx("h3",{className:"v10-pca-detail-section-title",children:"Your operational wallets (signers / msg.sender)"}),e.jsx("div",{className:"v10-pca-detail-agentlist",children:c&&!s?e.jsx("p",{className:"v10-pca-handshake-empty",role:"status",children:"Loading your wallets…"}):p&&d.length===0?e.jsxs("p",{className:"v10-modal-error",role:"alert",children:["Couldn’t load your wallets."," ",e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>h(),children:"Retry"})]}):d.length===0?e.jsx("p",{className:"v10-pca-handshake-empty",children:"No operational wallets detected on this node."}):d.map(r=>{const w=V(r),j=U(r);return e.jsx(q,{address:r,gas:w!=null?e.jsxs("span",{title:ke(w),children:["gas ",ye(w)," ",v," ",j?"✓":"⚠ fund to publish"]}):void 0},r)})}),d.length>0&&e.jsx("button",{type:"button",className:"v10-pca-handshake-copyall",onClick:()=>N(d.join(`
|
|
2
|
+
`)),"aria-label":g?"Copied all wallets":"Copy all wallet addresses",children:g?"Copied":`Copy all ${d.length}`}),e.jsxs("p",{className:"v10-pca-detail-hint",children:["Share ",e.jsx("strong",{children:"all"})," wallets (the node rotates its signer per publish) or pin to one. Share the exact address - a typo can be approved by the PCA owner but never match your real signer."]})]}),e.jsxs("div",{className:"v10-modal-warning",children:["⚠ Gas is always on you. The PCA covers the TRAC publishing fee — never your gas. Fund each wallet with native ",v,".",u?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:u,target:"_blank",rel:"noreferrer",children:"Open faucet ↗"})," (testnet only)"]}):e.jsxs(e.Fragment,{children:[" ","Fund with native ",v," from your wallet."]})]}),e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsx("h3",{className:"v10-pca-detail-section-title",children:"Can't find it automatically?"}),e.jsx("p",{className:"v10-pca-detail-hint",children:"If the PCA owner gives you an account id, check it here to track whether this node's wallets are covered."}),S&&S.length>0&&e.jsxs("div",{className:"v10-pca-discovered-check",role:"status","data-testid":"pca-sponsor-discovered",children:["◉ We found your wallet(s) already approved on ",S.map(r=>`PCA #${r}`).join(", "),"."," ",e.jsxs("button",{type:"button",className:"v10-pca-card-btn compact",onClick:()=>y(S[0]),children:["Check PCA #",S[0]]})]}),e.jsxs("div",{className:"v10-pca-detail-form",children:[e.jsx("input",{className:"v10-form-input",type:"text",value:m,onChange:r=>y(r.target.value),placeholder:"PCA ID from owner (e.g. 7)","aria-label":"PCA ID from owner"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn primary",onClick:B,disabled:k,children:k?"Checking…":"Check approval"})]}),R&&e.jsx("p",{className:"v10-modal-error",role:"alert",children:R}),A&&e.jsxs("div",{className:"v10-pca-approve-results",role:"status","aria-live":"polite",children:[e.jsxs("p",{className:"v10-pca-approve-summary",children:["Approved on PCA #",A.accountId,": ",Y," of ",A.rows.length," wallets ✓"]}),A.rows.map(r=>{const w=Xe(r.coverage);return e.jsx(q,{address:r.wallet,status:w.text,statusTone:w.tone},r.wallet)})]})]}),$&&e.jsxs("div",{className:"v10-pca-create-success",role:"status",children:["Ready: at least 1 wallet is approved and gas-funded - this node can publish under PCA #",A.accountId,"."," ","Publish from any context graph — the discount applies automatically to your approved wallets."]})]}),e.jsx("div",{className:"v10-modal-footer",children:e.jsx("button",{type:"button",className:"v10-modal-btn",onClick:t,children:"Close"})})]})}function Je(){const t=Ie(a=>a.nodeStatus),s=(t==null?void 0:t.nodeRole)==="core"||(t==null?void 0:t.nodeRole)==="edge"?t.nodeRole:void 0,c=(t==null?void 0:t.blockExplorerUrl)??null,l=Se(a=>a.openTab),h=_(a=>a.trackAccount),d=_(a=>a.untrackAccount),x=_(a=>a.setScope),n=D(a=>a.setBootstrap),p=D(a=>a.initWallet);D(a=>a.bootstrap);const o=D(a=>a.address),v=D(a=>Ee(a)),u=D(a=>a.switchToExpectedChain),[C,g]=i.useState({status:"idle",error:null}),N=He(),[T,S]=i.useState(0),m=Te(3e4,N.ids),{accounts:y,loading:k,refresh:b,walletsInconclusive:R}=m,W=m.wallets[0];i.useEffect(()=>{let a=!1;async function E(){g({status:"loading",error:null});try{const I=await Re();if(a)return;x(We(I)),n(I),p(),g({status:"ready",error:null})}catch(I){if(a)return;g({status:"error",error:(I==null?void 0:I.message)??"Could not bootstrap wallet contract reads."}),p()}}return E(),()=>{a=!0}},[T,p,x,n]);const{untracked:A,ownedError:L,agentError:V,refresh:U}=qe(),B=L||V,[Y,$]=i.useState(!1),[r,w]=i.useState(null),[j,f]=i.useState(!1),[M,se]=i.useState(null),P=i.useMemo(()=>y.map(a=>{var I;const E=Ue({owner:(I=a.snapshot)==null?void 0:I.owner,primaryWallet:W,connectedWallet:o,walletWrongNetwork:v});return{...a,ownerMode:E.mode,primaryWallet:W,connectedWallet:o,walletWrongNetwork:E.mode==="wallet"&&E.wrongNetwork}}),[y,o,W,v]);i.useEffect(()=>{!M||k||P.some(a=>a.accountId===M)&&se(null)},[P,k,M]);const H=i.useMemo(()=>P.filter(a=>a.ownerMode==="daemon"),[P]),K=i.useMemo(()=>P.filter(a=>a.ownerMode==="wallet"),[P]),Q=i.useMemo(()=>P.filter(a=>a.ownerMode==="external"&&a.snapshot&&a.approvedCount===0),[P]),X=i.useMemo(()=>P.filter(a=>a.approvedCount>0||!a.snapshot&&!a.notFound),[P]),G=a=>l({id:`conviction:${a}`,label:`PCA #${a}`,closable:!0}),he=i.useMemo(()=>[...H,...K],[H,K]),Z=i.useMemo(()=>m.wallets.map(a=>{const E=P.find(O=>O.snapshot&&ce(O.snapshot)&&O.walletProbes.some(F=>J(F.wallet,a)&&F.registered===!0));if(E!=null&&E.snapshot)return{wallet:a,status:`covered by PCA #${E.accountId}`,tone:"success"};const I=P.find(O=>O.snapshot&&!ce(O.snapshot)&&O.walletProbes.some(F=>J(F.wallet,a)&&F.registered===!0));return I!=null&&I.snapshot?{wallet:a,status:`approved on inactive PCA #${I.accountId}`,tone:"warn"}:R||P.some(O=>O.walletProbes.some(F=>J(F.wallet,a)&&F.registered==null))?{wallet:a,status:"unknown - retry wallet/PCA read",tone:"warn"}:k&&y.length===0?{wallet:a,status:"checking",tone:"neutral"}:{wallet:a,status:"direct cost",tone:"danger"}}),[y.length,P,k,m.wallets,R]),ve=Z.some(a=>a.tone==="success"),me=i.useCallback(()=>S(a=>a+1),[]),z=i.useCallback(()=>{u()},[u]),we=i.useCallback(a=>{se(a),h(a)},[h]);return e.jsxs("div",{className:"v10-pca-overview","data-testid":"pca-landing",children:[e.jsxs("header",{className:"v10-pca-overview-head",children:[e.jsxs("div",{className:"v10-pca-overview-titlerow",children:[e.jsx("h2",{className:"v10-pca-overview-title",children:"Publisher Conviction"}),s&&e.jsxs("span",{className:"badge v10-pca-role-chip",children:["Node role: ",s]})]}),e.jsx("p",{className:"v10-pca-overview-explainer",children:s==="edge"?"Publisher Conviction Accounts let publishers dedicate TRAC spend in advance and receive a publishing discount by tier: 0%, 10%, 20%, 30%, 40%, 50%, or 75%, based on the committed amount. Nodes can create their own PCA or get added to an existing PCA by sharing operational publishing wallets with the PCA owner. You still pay gas; the PCA covers only the TRAC publishing fee for approved wallets.":"A Publisher Conviction Account (PCA) lets you lock TRAC up front and approve publishing wallets to publish at a discount. The discount applies to the wallet that signs the publish (on-chain msg.sender), not a peerId, admin wallet, or author identity."})]}),e.jsxs("section",{className:"v10-pca-section v10-pca-coverage-summary","data-testid":"pca-coverage-summary",children:[e.jsxs("div",{className:"v10-pca-section-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"v10-pca-section-title",children:"This node's publishing wallet coverage"}),e.jsx("p",{className:"v10-pca-overview-caveat",children:"The discount follows the operational wallet that signs a publish."})]}),e.jsxs("div",{className:"v10-pca-overview-cta-group",children:[e.jsx("button",{type:"button",className:"v10-pca-card-btn primary",onClick:()=>f(!0),children:"Get added to a PCA"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","data-testid":"pca-create-btn",onClick:()=>$(!0),children:"+ Create PCA"})]})]}),Z.length>0?e.jsx("div",{className:"v10-pca-wallet-list",children:Z.map(a=>e.jsx(q,{address:a.wallet,status:a.status,statusTone:a.tone},a.wallet))}):R?e.jsxs("p",{className:"v10-pca-overview-caveat",role:"status",children:["Couldn't read this node's wallets, so coverage can't be confirmed."," ",e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>b(),children:"Retry"})]}):e.jsx("p",{className:"v10-pca-overview-caveat",children:"No operational publishing wallets were reported by this node."}),!ve&&!k&&!R&&!B&&e.jsx("p",{className:"v10-pca-inline-status",role:"status",children:"No PCA discount is active for this node yet. Publishes from direct-cost wallets use the signing wallet."}),!k&&X.length>0&&e.jsxs("div",{className:"v10-pca-linked-pcas","data-testid":"pca-approved-section",children:[e.jsxs("div",{className:"v10-pca-account-group-head",children:[e.jsx("h3",{className:"v10-pca-account-group-title",children:"PCAs linked to this node"}),e.jsx("span",{className:"v10-pca-account-group-count",children:X.length})]}),e.jsx("p",{className:"v10-pca-overview-caveat",children:"Account summaries for PCAs that approve at least one of this node's publishing wallets. Wallet coverage above is the source of truth for publish discounts."}),e.jsx("div",{className:"v10-pca-card-grid v10-pca-card-grid-compact",children:X.map(a=>e.jsx(te,{account:a,view:"coverage",blockExplorerUrl:c,onManage:G,onApproveWallets:E=>w({accountId:E,mode:"sponsor"}),onRemove:d,onRetry:()=>b(),onSwitchNetwork:z},`approved-${a.accountId}`))})]})]}),k&&y.length===0?e.jsxs("div",{className:"v10-pca-card-grid",children:[e.jsx("div",{className:"card v10-pca-card v10-pca-card-skeleton","aria-hidden":"true"}),e.jsx("div",{className:"card v10-pca-card v10-pca-card-skeleton","aria-hidden":"true"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"v10-pca-section","data-testid":"pca-owned-section",children:[e.jsxs("div",{className:"v10-pca-section-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"v10-pca-section-title",children:"Owned by me"}),e.jsx("p",{className:"v10-pca-overview-caveat",children:"Connect an owner wallet to discover and manage wallet-owned PCAs. Node-owned PCAs use the daemon wallet."})]}),e.jsx("div",{className:"v10-pca-overview-cta-group",children:e.jsx("button",{type:"button",className:"v10-pca-card-btn","data-testid":"pca-create-owned-btn",onClick:()=>$(!0),children:"+ Create PCA"})})]}),e.jsx("div",{className:"v10-pca-overview-wallet",children:e.jsx(Le,{className:"compact"})}),he.length>0?e.jsxs("div",{className:"v10-pca-owned-groups",children:[e.jsx(le,{title:"This node (hot wallet)",description:"Daemon-owned PCAs. Owner writes use the node daemon.",accounts:H,blockExplorerUrl:c,onManage:G,onApproveWallets:a=>w({accountId:a,mode:"sponsor"}),onRemove:d,onRetry:()=>b(),onSwitchNetwork:z}),e.jsx(le,{title:o?`${ae(o)} (connected)`:"Connected wallet",description:"Wallet-managed PCAs. Owner writes are signed by the connected wallet.",accounts:K,blockExplorerUrl:c,onManage:G,onApproveWallets:a=>w({accountId:a,mode:"sponsor"}),onRemove:d,onRetry:()=>b(),onSwitchNetwork:z})]}):R?null:e.jsx("p",{className:"v10-pca-inline-status",children:"No owned PCAs are tracked yet."})]}),e.jsxs("section",{className:"v10-pca-section","data-testid":"pca-tracked-external-section",children:[e.jsxs("div",{className:"v10-pca-account-group-head",children:[e.jsx("h3",{className:"v10-pca-section-title",children:"Tracked external accounts"}),e.jsx("span",{className:"v10-pca-account-group-count",children:Q.length})]}),e.jsx("p",{className:"v10-pca-overview-caveat",children:"Read-only PCA records you track manually. Connect the owner wallet to manage one."}),Q.length>0?e.jsx("div",{className:"v10-pca-card-grid",children:Q.map(a=>e.jsx(te,{account:a,view:"owner",blockExplorerUrl:c,onManage:G,onRemove:d,onRetry:()=>b(),onSwitchNetwork:z},`external-${a.accountId}`))}):e.jsx("p",{className:"v10-pca-inline-status",children:"No external PCAs are tracked manually."}),e.jsx(aa,{onTrack:we})]})]}),M&&e.jsxs("p",{className:"v10-pca-track-status",role:"status","data-testid":"pca-track-status",children:["Checking PCA #",M,". It will appear here when the chain read returns."]}),B&&e.jsx("section",{className:"v10-pca-discovered","data-testid":"pca-discovered-error",role:"status",children:e.jsxs("p",{className:"v10-pca-overview-caveat",children:["Couldn't verify this node's Publisher Conviction Accounts; approved PCA coverage may still exist."," ",e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>U(),children:"Retry"})]})}),C.status==="error"&&e.jsx("section",{className:"v10-pca-discovered","data-testid":"pca-wallet-bootstrap-error",role:"status",children:e.jsxs("p",{className:"v10-pca-overview-caveat",children:["Note: Couldn't load wallet contract bootstrap, so connected-wallet PCA discovery is paused."," ",e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:me,children:"Retry"})]})}),N.error&&e.jsx("section",{className:"v10-pca-discovered","data-testid":"pca-wallet-discovery-error",role:"status",children:e.jsxs("p",{className:"v10-pca-overview-caveat",children:["Note: Couldn't read PCAs owned by the connected wallet. Existing tracked PCAs are still shown."," ",e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:N.refresh,children:"Retry"})]})}),N.loading&&o&&e.jsxs("p",{className:"v10-pca-overview-caveat",role:"status",children:["Reading PCAs owned by ",ae(o),"..."]}),e.jsx(ea,{items:A,onTrack:h,onManage:G}),Y&&e.jsx(Ge,{onClose:()=>{$(!1),b()},onApproveOwnWallets:a=>{$(!1),w({accountId:a,mode:"self",selfCoverage:!0})},onManage:a=>{$(!1),G(a)},onGetSponsored:()=>{$(!1),f(!0)}}),r&&e.jsx(_e,{accountId:r.accountId,initialMode:r.mode,selfCoverage:r.selfCoverage,onClose:()=>{w(null),b()}}),j&&e.jsx(Ze,{onClose:()=>{f(!1),b()}})]})}function ea({items:t,onTrack:s,onManage:c}){return t.length===0?null:e.jsxs("section",{className:"v10-pca-discovered","data-testid":"pca-discovered-strip",children:[e.jsx("h3",{className:"v10-pca-discovered-title",children:"Discovered - not tracked here"}),e.jsx("p",{className:"v10-pca-overview-caveat",children:"Found on-chain for this node's wallets or the connected wallet. Track to show them in the grid above."}),t.map(l=>{var d;const h=(d=l.basics)==null?void 0:d.discountBps;return e.jsxs("div",{className:"v10-pca-discovered-row","data-testid":"pca-discovered-row",children:[e.jsxs("span",{className:"v10-pca-discovered-label",children:[e.jsxs("button",{type:"button",className:"v10-notif-cg-link",onClick:()=>c(l.accountId),children:["PCA #",l.accountId]})," ","-"," ",l.relation==="agent"?`your wallet ${l.agentWallet?ae(l.agentWallet):""} is approved here`:l.relation==="both"?"you own this; your wallet is approved here":"you own this account",(l.relation==="agent"||l.relation==="both")&&typeof h=="number"&&h>0&&e.jsxs("span",{className:"badge badge-info",children:[" ",(h/100).toFixed(h%100===0?0:1),"%"]})]}),e.jsx("button",{type:"button",className:"v10-pca-card-btn primary","data-testid":"pca-discovered-track",onClick:()=>s(l.accountId),children:"Track"})]},l.accountId)})]})}function le({title:t,description:s,accounts:c,blockExplorerUrl:l,onManage:h,onApproveWallets:d,onRemove:x,onRetry:n,onSwitchNetwork:p}){return c.length===0?null:e.jsxs("section",{className:"v10-pca-account-group",children:[e.jsxs("div",{className:"v10-pca-account-group-head",children:[e.jsx("h3",{className:"v10-pca-account-group-title",children:t}),e.jsx("span",{className:"v10-pca-account-group-count",children:c.length})]}),e.jsx("p",{className:"v10-pca-overview-caveat",children:s}),e.jsx("div",{className:"v10-pca-card-grid",children:c.map(o=>e.jsx(te,{account:o,view:"owner",blockExplorerUrl:l,onManage:h,onApproveWallets:d,onRemove:x,onRetry:n,onSwitchNetwork:p},o.accountId))})]})}function aa({onTrack:t}){const[s,c]=i.useState(!1),[l,h]=i.useState(""),[d,x]=i.useState(null),n=i.useId(),p=()=>{const o=l.trim();if(!/^\d+$/.test(o)){x("Enter a numeric account id.");return}t(o),h(""),x(null),c(!1)};return e.jsxs("div",{className:"v10-pca-track",children:[e.jsx("button",{type:"button",className:"v10-pca-track-toggle","data-testid":"pca-track-toggle","aria-expanded":s,"aria-controls":n,onClick:()=>c(o=>!o),children:"Track PCA by ID"}),s&&e.jsxs("div",{id:n,className:"v10-pca-track-panel",children:[e.jsx("input",{type:"text",className:"v10-form-input","data-testid":"pca-track-input",value:l,onChange:o=>h(o.target.value),placeholder:"Account id (e.g. 7)","aria-label":"Account id to track",onKeyDown:o=>{o.key==="Enter"&&p()}}),e.jsx("button",{type:"button",className:"v10-pca-card-btn primary","data-testid":"pca-track-submit",onClick:p,children:"Track"}),d&&e.jsx("p",{className:"v10-pca-crux-error",role:"alert",children:d})]})]})}const ta="https://docs.origintrail.io/";function oa(){const{status:t,recheck:s}=Ve();return e.jsx("div",{"data-testid":"pca-view",children:t==="loading"?e.jsx("div",{className:"lazy-spinner",children:"Loading publisher conviction..."}):t==="unavailable"?e.jsx("div",{className:"v10-pca-unavailable","data-testid":"pca-unavailable",children:e.jsx($e,{tone:"neutral",title:"Publisher conviction isn't available on this network",description:"This deployment's chain adapter doesn't support Publisher Conviction Accounts yet.",actions:[{label:"Recheck",onClick:s,variant:"primary",testId:"pca-recheck-btn"},{label:"Learn more",onClick:()=>window.open(ta,"_blank","noopener")}]})}):e.jsx(Je,{})})}export{oa as PublishingConvictionPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aH as E,aM as $,aG as B,ad as e,aD as j,ap as i,ar as P,X as W,Y as I,M as L,Q as M,O as D,R as N,ay as C,t as O,K as U,ax as T,U as H}from"./index-DGpnb_b1.js";function F(s,r){const t=(s??"").trim();if(!t)return"TRAC";const n=(r??"").includes(":")?(r??"").split(":")[1]:r??"";return n==="84532"||n==="11155111"||n==="31337"||n==="10200"||n==="20430"?/test/i.test(t)?t:`${t} (testnet)`:t}function w(s,r=2){if(s==null)return"—";let t;if(typeof s=="number")t=s;else{const n=String(s).trim();if(!/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(n))return"—";t=Number(n)}return Number.isFinite(t)?t.toFixed(r):"—"}function A(s){if(w(s)!=="—")return`Exact: ${s}`}const k="************",_=/[A-Za-z0-9_-]{16,}/g;function q(s){if(!s)return"";let r;try{r=new URL(s)}catch{return s.replace(_,k)}(r.username||r.password)&&(r.username="",r.password="");const t=r.pathname.split("/").map(n=>n.length<16?n:/^[A-Za-z0-9_-]+$/.test(n)?k:n);if(r.pathname=t.join("/"),r.search){const n=new URLSearchParams(r.search);for(const a of Array.from(n.keys()))/key|token|secret|auth/i.test(a)&&n.set(a,k);r.search=n.toString()}return r.toString()}function K(s){if(s==null)return"—";const r=s/100;return`${r%1===0?r.toFixed(0):r.toFixed(1)}%`}function Z(){E();const s=$(u=>u.openTab),{accounts:r,covered:t,bestCoveringDiscountBps:n,walletsInconclusive:a}=B(),l=r.length;return e.jsxs("section",{className:"card",children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",children:"Publisher Conviction"})}),e.jsxs("div",{className:"card-body",children:[l===0?e.jsx("p",{className:"v10-pca-settings-line",children:"No tracked Publisher Conviction Account on this node."}):t?e.jsxs("p",{className:"v10-pca-settings-line",children:["This node’s approved publishing wallets use a ",e.jsx("strong",{children:K(n)})," discount."]}):a?e.jsx("p",{className:"v10-pca-settings-line",role:"status",children:"Couldn’t verify this node’s wallets — retry."}):e.jsxs("p",{className:"v10-pca-settings-line",children:["Tracking ",l," account",l===1?"":"s",", but none currently covers this node’s publishes."]}),e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>s({id:"conviction",label:"Publisher Conviction",closable:!0}),children:"Manage publisher conviction ->"})]})]})}function p({label:s,value:r,mono:t=!1}){return e.jsxs("div",{style:{marginBottom:14},children:[e.jsx("div",{className:"settings-field-label",children:s}),e.jsx("div",{className:`settings-field-value${t?" mono":""}`,children:r})]})}function G({rpcUrl:s}){const[r,t]=i.useState(!1),n=r?s:q(s);return e.jsxs("div",{style:{marginBottom:14},children:[e.jsxs("div",{className:"settings-field-label",style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{children:"RPC"}),e.jsx("button",{type:"button",onClick:()=>t(a=>!a),style:{background:"none",border:"1px solid var(--border)",color:"var(--text-dim)",cursor:"pointer",fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:4},"aria-label":r?"Redact RPC URL":"Reveal RPC URL",title:r?"Hide the path-token (recommended for screen-shares)":"Show full URL — careful, may contain a tenant secret",children:r?"Redact":"Reveal"})]}),e.jsx("div",{className:"settings-field-value mono",style:{wordBreak:"break-all"},children:n})]})}function Q(){const{data:s}=j(D,[],6e4),[r,t]=i.useState(!1),[n,a]=i.useState(!1),[l,u]=i.useState(null),[m,o]=i.useState(!1),h=N.useRef(null),f=N.useRef(null);i.useEffect(()=>{s!=null&&t(s.enabled)},[s]);const g=i.useCallback(()=>{n||(u(null),r?(t(!1),a(!0),C(!1).catch(()=>{t(!0),u("Couldn’t update telemetry — try again.")}).finally(()=>a(!1))):o(!0))},[r,n]),y=i.useCallback(async()=>{var c;o(!1),u(null),t(!0),a(!0);try{await C(!0)}catch{t(!1),u("Couldn’t update telemetry — try again.")}finally{a(!1),(c=f.current)==null||c.focus()}},[]);return i.useEffect(()=>{var v;if(!m)return;const c=(v=h.current)==null?void 0:v.querySelector("button");c==null||c.focus();const d=S=>{var b;S.key==="Escape"&&(o(!1),(b=f.current)==null||b.focus())};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[m]),e.jsxs("section",{className:"card",children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",children:"Network Telemetry"})}),e.jsxs("div",{className:"card-body",children:[e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginBottom:16,lineHeight:1.6},children:"Local metrics are stored in SQLite and displayed in the Observability page."}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:"10px 0"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:12,fontWeight:600},children:"Share telemetry with the network"}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:2,lineHeight:1.5},children:"When enabled, metrics and logs are streamed to the OriginTrail network dashboard for network-wide diagnostics."})]}),e.jsx("button",{ref:f,type:"button",role:"switch","aria-checked":r,"aria-busy":n,"aria-disabled":n,"aria-label":"Share telemetry with the network",onClick:g,style:{width:38,height:22,borderRadius:11,border:"none",flexShrink:0,background:r?"var(--green)":"var(--border)",transition:"background .2s",position:"relative",marginLeft:16,cursor:n?"wait":"pointer",opacity:n?.6:1},children:e.jsx("span",{style:{position:"absolute",top:3,left:r?19:3,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left .2s",display:"block"}})})]}),e.jsx("div",{"aria-live":"polite",children:l&&e.jsx("div",{style:{fontSize:11,color:"var(--red)",marginTop:4},children:l})})]}),m&&e.jsx("div",{style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,.55)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":"Enable Telemetry Streaming?",style:{background:"var(--surface)",border:"1px solid var(--border)",borderRadius:12,padding:"24px 28px",maxWidth:440,width:"90%",boxShadow:"0 8px 32px rgba(0,0,0,.3)"},children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,marginBottom:16},children:"Enable Telemetry Streaming?"}),e.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",lineHeight:1.7,marginBottom:12},children:"When enabled, the following data is streamed to the OriginTrail team:"}),e.jsxs("ul",{style:{fontSize:12,color:"var(--text)",lineHeight:1.8,margin:"0 0 14px 18px",padding:0},children:[e.jsx("li",{children:"Operation logs (publish, query, sync, gossip events)"}),e.jsx("li",{children:"Performance metrics (durations, throughput, error rates)"}),e.jsx("li",{children:"Node identity (peer ID, node name, network)"})]}),e.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)",lineHeight:1.7,marginBottom:12},children:["The following data is ",e.jsx("strong",{style:{color:"var(--text)"},children:"NEVER"})," shared via telemetry:"]}),e.jsxs("ul",{style:{fontSize:12,color:"var(--text)",lineHeight:1.8,margin:"0 0 16px 18px",padding:0},children:[e.jsx("li",{children:"Private keys or wallet credentials"}),e.jsx("li",{children:"Authentication tokens or API keys"}),e.jsx("li",{children:"Private triple content or personal data"}),e.jsx("li",{children:"File system paths or environment variables"})]}),e.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",marginBottom:20,lineHeight:1.5},children:"You can disable streaming at any time from this page."}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[e.jsx("button",{type:"button",onClick:()=>{var c;o(!1),(c=f.current)==null||c.focus()},style:{padding:"7px 18px",borderRadius:7,fontSize:12,fontWeight:600,cursor:"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:"var(--text-muted)"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:y,style:{padding:"7px 18px",borderRadius:7,fontSize:12,fontWeight:700,cursor:"pointer",border:"1px solid rgba(74,222,128,.4)",background:"rgba(74,222,128,.1)",color:"var(--green)"},children:"Enable Streaming"})]})]})})]})}function Y(){const{data:s}=j(O,[],3e4),{data:r}=j(U,[],6e4),[t,n]=i.useState(90),[a,l]=i.useState(!1),[u,m]=i.useState(null),[o,h]=i.useState(null),f=N.useRef(null);i.useEffect(()=>{r!=null&&r.retentionDays&&n(r.retentionDays)},[r]),i.useEffect(()=>{var d;o!=null&&((d=f.current)==null||d.focus())},[o]);const g=i.useCallback(async()=>{if(o==null)return;const d=o;l(!1),m(null),h(null);try{await T(d),n(d),l(!0),setTimeout(()=>l(!1),2e3)}catch{m("Couldn’t save retention — try again.")}},[o]),y=i.useCallback(d=>{m(null),d<t?(l(!1),h(d)):(l(!1),h(null),T(d).then(()=>{n(d),l(!0),setTimeout(()=>l(!1),2e3)}).catch(()=>m("Couldn’t save retention — try again.")))},[t]),c=(s==null?void 0:s.store_bytes)??null;return e.jsxs("section",{className:"card",children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",children:"Local Data Retention"})}),e.jsxs("div",{className:"card-body",children:[e.jsx("label",{htmlFor:"retention-select",className:"settings-field-label",style:{display:"block",marginBottom:5},children:"Keep local data for"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("select",{id:"retention-select",className:"input",value:o??t,onChange:d=>y(Number(d.target.value)),style:{width:160},children:[e.jsx("option",{value:7,children:"7 days"}),e.jsx("option",{value:30,children:"30 days"}),e.jsx("option",{value:90,children:"90 days"}),e.jsx("option",{value:180,children:"180 days"}),e.jsx("option",{value:365,children:"365 days"})]}),e.jsx("span",{"aria-live":"polite",children:a&&e.jsx("span",{style:{fontSize:10,color:"var(--green)",fontWeight:600},children:"Saved"})}),c!=null&&e.jsxs("span",{className:"mono",style:{fontSize:10,color:"var(--text-dim)"},children:["Store: ",H(c)]})]}),o!=null&&e.jsxs("div",{role:"group","aria-label":"Confirm retention reduction",style:{marginTop:8,padding:"10px 14px",borderRadius:8,background:"rgba(251,191,36,.06)",border:"1px solid rgba(251,191,36,.2)"},children:[e.jsxs("div",{style:{fontSize:11,color:"var(--amber)",fontWeight:600,marginBottom:4},children:["Reduce retention to ",o," days?"]}),e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",lineHeight:1.5,marginBottom:8},children:["Operations, logs, and metrics older than ",o," days will be permanently deleted."]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{ref:f,type:"button",onClick:g,style:{padding:"5px 14px",borderRadius:6,fontSize:11,fontWeight:700,cursor:"pointer",border:"1px solid rgba(251,191,36,.4)",background:"rgba(251,191,36,.1)",color:"var(--amber)"},children:"Prune & Save"}),e.jsx("button",{type:"button",onClick:()=>h(null),style:{padding:"5px 14px",borderRadius:6,fontSize:11,fontWeight:600,cursor:"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:"var(--text-muted)"},children:"Cancel"})]})]}),o==null&&e.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginTop:4},children:"Operations, logs, and metric snapshots older than this are pruned automatically."}),e.jsx("div",{"aria-live":"polite",children:u&&e.jsx("div",{style:{fontSize:11,color:"var(--red)",marginTop:4},children:u})})]})]})}function V(s){const r=Math.floor(s/1e3);if(r<60)return`${r}s`;const t=Math.floor(r/60);if(t<60)return`${t}m ${r%60}s`;const n=Math.floor(t/60);return n<24?`${n}h ${t%60}m`:`${Math.floor(n/24)}d ${n%24}h`}function X(s){return s.length<=12?s:`${s.slice(0,6)}…${s.slice(-4)}`}function J(s){if(!s)return"Unknown";const r=s.includes(":")?s.split(":")[1]:s;switch(r){case"84532":return"Base Sepolia (Testnet)";case"8453":return"Base (Mainnet)";case"1":return"Ethereum Mainnet";case"11155111":return"Sepolia (Testnet)";case"31337":return"Local (Hardhat)";default:return`Chain ${r}`}}function ne(){return e.jsxs("div",{className:"page-section",children:[e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Settings"}),e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4},children:"Node configuration and preferences"})]}),e.jsx(ee,{})]})}function ee(){var g,y,c,d,v,S,b,R;const{data:s}=j(L,[],3e4),{data:r}=j(M,[],6e4),t=s,n=r,[a,l]=i.useState(!1),[u,m]=i.useState(!1),o=(t==null?void 0:t.connectedPeers)??0,h=(t==null?void 0:t.peerId)!=null,f=i.useCallback(async()=>{if(!a){l(!0),setTimeout(()=>l(!1),5e3);return}m(!0);try{await P()}catch{m(!1),l(!1)}},[a]);return e.jsxs("div",{className:"settings-stack",children:[e.jsxs("section",{className:"card",children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",children:"Node Identity"})}),e.jsxs("div",{className:"card-body",children:[e.jsx(p,{label:"Name",value:(t==null?void 0:t.name)??"—"}),e.jsx(p,{label:"Peer ID",value:(t==null?void 0:t.peerId)??"—",mono:!0}),e.jsx(p,{label:"Role",value:(t==null?void 0:t.nodeRole)??"—"}),e.jsx(p,{label:"Network",value:(t==null?void 0:t.networkName)??(t!=null&&t.networkId?`Network ${t.networkId}`:"—")}),e.jsx(p,{label:"Store",value:(t==null?void 0:t.storeBackend)??"—",mono:!0}),e.jsxs("div",{style:{padding:"10px 14px",borderRadius:8,background:h?"var(--green-dim)":"rgba(248,113,113,.05)",border:`1px solid ${h?"rgba(74,222,128,.2)":"rgba(248,113,113,.2)"}`},children:[e.jsx("div",{className:"mono",style:{fontSize:10,color:h?"var(--green)":"var(--red)",fontWeight:700},children:h?"● ONLINE":"● OFFLINE"}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},title:"Peers = unique remote nodes. Direct + Relayed counts are libp2p connections — a single peer can hold both a direct and a relayed link, so they sum to ≥ Peers, not exactly equal to it.",children:h?`${o} peer${o!==1?"s":""} · ${((g=t==null?void 0:t.connections)==null?void 0:g.direct)??0} direct, ${((y=t==null?void 0:t.connections)==null?void 0:y.relayed)??0} relayed link${(((c=t==null?void 0:t.connections)==null?void 0:c.relayed)??0)===1?"":"s"} · up ${V((t==null?void 0:t.uptimeMs)??0)}`:"Node is not responding"})]})]})]}),e.jsxs("section",{className:"card",children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",children:"Blockchain Config"})}),e.jsxs("div",{className:"card-body",children:[e.jsx(p,{label:"Chain",value:J(n==null?void 0:n.chainId)}),((d=n==null?void 0:n.balances)==null?void 0:d.length)>0?n.balances.map((x,z)=>e.jsxs("div",{style:{marginBottom:10},children:[e.jsx(p,{label:n.balances.length>1?`Wallet ${z+1}`:"Operational Wallet",value:x.address,mono:!0}),e.jsxs("div",{style:{display:"flex",gap:16,marginTop:-6},children:[e.jsxs("span",{className:"mono",style:{fontSize:11,color:"var(--text-muted)"},title:I(x.eth),children:[W(x.eth)," ETH"]}),e.jsxs("span",{className:"mono",style:{fontSize:11,color:"var(--text-muted)"},title:A(x.trac),children:[w(x.trac)," ",F(x.symbol,n==null?void 0:n.chainId)]})]})]},x.address)):e.jsx(p,{label:"Operational Wallet",value:(v=n==null?void 0:n.wallets)!=null&&v[0]?X(n.wallets[0]):"—",mono:!0}),(n==null?void 0:n.rpcUrl)&&e.jsx(G,{rpcUrl:n.rpcUrl}),n!=null&&n.error?e.jsxs("div",{style:{padding:"8px 12px",borderRadius:8,background:"rgba(248,113,113,.05)",border:"1px solid rgba(248,113,113,.2)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--red)",marginBottom:2},children:"⚠ Error"}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)"},children:n.error})]}):(S=n==null?void 0:n.chainId)!=null&&S.includes("84532")||(b=n==null?void 0:n.chainId)!=null&&b.includes("31337")||(R=n==null?void 0:n.chainId)!=null&&R.includes("11155111")?e.jsxs("div",{style:{padding:"8px 12px",borderRadius:8,background:"var(--amber-dim)",border:"1px solid rgba(251,191,36,.2)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--amber)",marginBottom:2},children:"⚠ Testnet Mode"}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)"},children:"No real TRAC is spent. Perfect for development."})]}):null]})]}),e.jsx(Z,{}),e.jsx(Q,{}),e.jsx(Y,{}),e.jsxs("section",{className:"card",style:{borderColor:"rgba(248,113,113,.2)",background:"rgba(248,113,113,.03)"},children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",style:{color:"var(--red)"},children:"Danger Zone"})}),e.jsx("div",{className:"card-body",children:e.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"},children:[e.jsx("button",{onClick:f,disabled:u,style:{padding:"8px 16px",borderRadius:8,border:`1px solid ${a?"var(--red)":"rgba(251,191,36,.3)"}`,background:a?"rgba(248,113,113,.15)":"rgba(251,191,36,.07)",color:a?"var(--red)":"var(--amber)",fontSize:12,fontWeight:600,cursor:u?"not-allowed":"pointer",opacity:u?.5:1},children:u?"Shutting down…":a?"Confirm Shutdown":"Shutdown Node"}),e.jsx("span",{"aria-live":"polite",children:a&&e.jsx("span",{style:{fontSize:11,color:"var(--text-muted)"},children:"Click again to confirm. The node process will terminate."})})]})})]})]})}export{ne as SettingsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as u,n as b,y as k,j as R,p as M,s as S,r as $,h as A,i as T,l as C,m as w,o as E,b as p,q as G}from"./ApproveWalletsModal-9w2edv7e.js";import"./index-DGpnb_b1.js";class D extends u{constructor({callbackSelector:a,cause:t,data:f,extraData:e,sender:l,urls:i}){var o;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(o=t.metaMessages)!=null&&o.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(n=>` ${b(n)}`)],` Sender: ${l}`,` Data: ${f}`,` Callback selector: ${a}`,` Extra data: ${e}`].flat(),name:"OffchainLookupError"})}}class j extends u{constructor({result:a,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${b(t)}`,`Response: ${k(a)}`],name:"OffchainLookupResponseMalformedError"})}}class B extends u{constructor({sender:a,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${a}`],name:"OffchainLookupSenderMismatchError"})}}const _="0x556f1830",P={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function F(c,{blockNumber:a,blockTag:t,data:f,requestOptions:e,to:l}){var s;const{args:i}=R({data:f,abi:[P]}),[o,n,d,m,y]=i,{ccipRead:h}=c,r=h&&typeof(h==null?void 0:h.request)=="function"?h.request:U;try{if(!M(l,o))throw new B({sender:o,to:l});const g=n.includes(S)?await $({data:d,ccipRequest:x=>r({...x,requestOptions:e})}):await r({data:d,requestOptions:e,sender:o,urls:n}),{data:L}=await A(c,{blockNumber:a,blockTag:t,data:T([m,C([{type:"bytes"},{type:"bytes"}],[g,y])]),requestOptions:e,to:l});return L}catch(g){throw(s=e==null?void 0:e.signal)!=null&&s.aborted?w(e.signal):E(g)?g:new D({callbackSelector:m,cause:g,data:f,extraData:y,sender:o,urls:n})}}async function U({data:c,requestOptions:a,sender:t,urls:f}){var l,i,o;let e=new Error("An unknown error occurred.");for(let n=0;n<f.length;n++){if((l=a==null?void 0:a.signal)!=null&&l.aborted)throw w(a.signal);const d=f[n],m=d.includes("{data}")?"GET":"POST",y=m==="POST"?{data:c,sender:t}:void 0,h=m==="POST"?{"Content-Type":"application/json"}:{};try{const r=await fetch(d.replace("{sender}",t.toLowerCase()).replace("{data}",c),{body:JSON.stringify(y),headers:h,method:m,...a!=null&&a.signal?{signal:a.signal}:{}});let s;if((i=r.headers.get("Content-Type"))!=null&&i.startsWith("application/json")?s=(await r.json()).data:s=await r.text(),!r.ok){e=new p({body:y,details:s!=null&&s.error?k(s.error):r.statusText,headers:r.headers,status:r.status,url:d});continue}if(!G(s)){e=new j({result:s,url:d});continue}return s}catch(r){if((o=a==null?void 0:a.signal)!=null&&o.aborted)throw w(a.signal);if(E(r))throw r;e=new p({body:y,details:r.message,url:d})}}throw e}export{U as ccipRequest,F as offchainLookup,P as offchainLookupAbiItem,_ as offchainLookupSignature};
|