zframes 0.4.1 → 0.5.1

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.
Files changed (116) hide show
  1. package/README.md +30 -18
  2. package/dist/index.js +181 -21
  3. package/package.json +8 -4
  4. package/runtime/assets/{bitcoin-dominance-BHcykQ8j.js → bitcoin-dominance-C5YlmNuX.js} +1 -1
  5. package/runtime/assets/{breakeven-PNgn_Prq.js → breakeven-C6eTFJll.js} +1 -1
  6. package/runtime/assets/{breathing-DrPgIS4r.js → breathing-BK7n4R0D.js} +1 -1
  7. package/runtime/assets/{btc-blocks-mJPjO7gs.js → btc-blocks-BbO7Ju_n.js} +1 -1
  8. package/runtime/assets/{btc-difficulty-D8kmEyQb.js → btc-difficulty-CdmSS3g3.js} +1 -1
  9. package/runtime/assets/{btc-fees-Cv6K9S1L.js → btc-fees-Do_OuXGm.js} +1 -1
  10. package/runtime/assets/{btc-hashrate-DT6qyeME.js → btc-hashrate-BwHRzkT1.js} +1 -1
  11. package/runtime/assets/{btc-mempool-ftlit90k.js → btc-mempool-DdoHkxQW.js} +1 -1
  12. package/runtime/assets/{calculator-CYNDBlrv.js → calculator-njLOYaUn.js} +1 -1
  13. package/runtime/assets/{checklist-DygbP4AG.js → checklist-CJmbQeT2.js} +1 -1
  14. package/runtime/assets/{clock-D2rGZ-yo.js → clock-BQKtB_1T.js} +1 -1
  15. package/runtime/assets/{coin-movers-DpHOtUMJ.js → coin-movers-Ddx_zEYc.js} +1 -1
  16. package/runtime/assets/{countdown-DcbUf2-f.js → countdown-WQrMl1mh.js} +1 -1
  17. package/runtime/assets/{daily-analysis-D3g2BXJd.js → daily-analysis-CFBYgZOx.js} +1 -1
  18. package/runtime/assets/{day-meter-CDmmKsh5.js → day-meter-C1FlE25u.js} +1 -1
  19. package/runtime/assets/dex-volume-chart-icfmEKMe.js +1 -0
  20. package/runtime/assets/dex-volume-treemap-D325lBuo.js +1 -0
  21. package/runtime/assets/{dice-B7dy1iZP.js → dice-B5HdtbhT.js} +1 -1
  22. package/runtime/assets/{dino-game-DLEtJMnt.js → dino-game-BjpU6N3Q.js} +1 -1
  23. package/runtime/assets/{divider-CVjQeL0n.js → divider-CS5oPawt.js} +1 -1
  24. package/runtime/assets/{drawdy-DoJeRpgi.js → drawdy-DCJPBdU1.js} +1 -1
  25. package/runtime/assets/editor-BMMobjrE.css +1 -0
  26. package/runtime/assets/editor-BwFhstwV.js +68 -0
  27. package/runtime/assets/{fear-greed-zPvN2LSi.js → fear-greed-CRGU3_Op.js} +1 -1
  28. package/runtime/assets/{filings-feed-CWAGVlAW.js → filings-feed-BXtSE7kO.js} +1 -1
  29. package/runtime/assets/{financial-stress-C5-XFPqY.js → financial-stress-DbKe77Hb.js} +1 -1
  30. package/runtime/assets/{flappy-bird-CoKOL9Ib.js → flappy-bird-vVMgoHvI.js} +1 -1
  31. package/runtime/assets/{fundamentals-BYjofvJi.js → fundamentals-CcdMBkwq.js} +1 -1
  32. package/runtime/assets/funding-heatmap-Dpik5sTh.js +1 -0
  33. package/runtime/assets/{funding-rate-chart-CxBH7hVe.js → funding-rate-chart-BqZIV8Mq.js} +1 -1
  34. package/runtime/assets/fx-board-BqXLOKTL.js +1 -0
  35. package/runtime/assets/{heading-gFm9ZDY1.js → heading-tImz7ed0.js} +1 -1
  36. package/runtime/assets/{holiday-calendar-ffNyuPje.js → holiday-calendar-DWJQw_Gs.js} +1 -1
  37. package/runtime/assets/{image-D3DwdoU8.js → image-D2XDZTRg.js} +1 -1
  38. package/runtime/assets/{index-DRTPEQtR.css → index-BqHx9BjX.css} +1 -1
  39. package/runtime/assets/index-DK7jWlTL.js +1 -0
  40. package/runtime/assets/index-mNBIIbY4.js +936 -0
  41. package/runtime/assets/inflation-pulse-bzeGPdwn.js +1 -0
  42. package/runtime/assets/{journal-log-CcLb4w4A.js → journal-log-CwBIakMw.js} +1 -1
  43. package/runtime/assets/{journal-open-C0BKFgMk.js → journal-open-BVZNlpPf.js} +1 -1
  44. package/runtime/assets/{journal-results-Bpzb4REp.js → journal-results-C_uWQFb6.js} +1 -1
  45. package/runtime/assets/{journal-score-BUDUgceb.js → journal-score-40mkQn2U.js} +1 -1
  46. package/runtime/assets/{journal-ui-CJIuEcIa.js → journal-ui-BhyvPmL4.js} +1 -1
  47. package/runtime/assets/{labor-market-DJihF3Mk.js → labor-market-C4Sm9c9Q.js} +1 -1
  48. package/runtime/assets/{lightning-stats-BV14FfAY.js → lightning-stats-pONBKZD6.js} +1 -1
  49. package/runtime/assets/{link-grid-DK3kGS1q.js → link-grid-CI34yq1H.js} +1 -1
  50. package/runtime/assets/live-tick-9Q3ubPF9.js +1 -0
  51. package/runtime/assets/liveline-bcaEuskN.js +1 -0
  52. package/runtime/assets/market-cap-treemap-OPrkz91W.js +1 -0
  53. package/runtime/assets/{market-hours-D89LjpUm.js → market-hours-BgccxZWs.js} +1 -1
  54. package/runtime/assets/{marquee-ByOQSr9Q.js → marquee-CW5CHfXe.js} +1 -1
  55. package/runtime/assets/mini-line-chart-CHM5UBjJ.js +1 -0
  56. package/runtime/assets/{mining-pools-D6AnoVnf.js → mining-pools-BcmPW811.js} +1 -1
  57. package/runtime/assets/{mover-row-BTeXB98H.js → mover-row-C4XiEB55.js} +1 -1
  58. package/runtime/assets/{national-debt-CgI8LSK6.js → national-debt-idA0RoOP.js} +1 -1
  59. package/runtime/assets/news-feed-Dfo3tEp3.js +1 -0
  60. package/runtime/assets/note-BXnEnQ-K.js +1 -0
  61. package/runtime/assets/{open-interest-DgDfcYh5.js → open-interest-DU8_SF0H.js} +1 -1
  62. package/runtime/assets/{options-iv-CqDfM4IA.js → options-iv-NBS1840n.js} +1 -1
  63. package/runtime/assets/{options-oi-strike-CrIT5WTU.js → options-oi-strike-rFKn4bh2.js} +1 -1
  64. package/runtime/assets/{options-put-call--RXL3vTA.js → options-put-call-D85-OU0Z.js} +1 -1
  65. package/runtime/assets/{pomodoro-DZEEQU2X.js → pomodoro-Dr-36PxD.js} +1 -1
  66. package/runtime/assets/{portfolio-allocation-DKf6H-m6.js → portfolio-allocation-DuszANX3.js} +1 -1
  67. package/runtime/assets/{portfolio-common-CVt117Oi.js → portfolio-common-COoaTucT.js} +1 -1
  68. package/runtime/assets/{portfolio-holdings-CHtvm8aL.js → portfolio-holdings-DEalEpG7.js} +1 -1
  69. package/runtime/assets/portfolio-value-DBm_NKpj.js +1 -0
  70. package/runtime/assets/price-chart-CrlaAJDt.js +1 -0
  71. package/runtime/assets/price-compare-CbD-OBqf.js +1 -0
  72. package/runtime/assets/price-liveline-D-FbVZJb.js +1 -0
  73. package/runtime/assets/{price-ticker-BmfARqHc.js → price-ticker-BWmeIzis.js} +1 -1
  74. package/runtime/assets/protocol-fees-treemap-C5cQmzek.js +1 -0
  75. package/runtime/assets/{protocol-tvl-chart-Dl_MwJdU.js → protocol-tvl-chart-CVQec2af.js} +1 -1
  76. package/runtime/assets/protocol-tvl-treemap-fT5L8BUu.js +1 -0
  77. package/runtime/assets/{quote-BjjZrPpM.js → quote-BVU9Ij9Z.js} +1 -1
  78. package/runtime/assets/{rates-board-B_OYdW_u.js → rates-board-DtVXg72U.js} +1 -1
  79. package/runtime/assets/{returns-projector-EA7LLxnL.js → returns-projector-BRL9MWt0.js} +1 -1
  80. package/runtime/assets/{risk-reward-xhKH6ouR.js → risk-reward-CFmYwrI1.js} +1 -1
  81. package/runtime/assets/{rules-card-CrDquc56.js → rules-card-CD8_-XB7.js} +1 -1
  82. package/runtime/assets/{session-progress-BquR98Sm.js → session-progress-Bfn9CYRS.js} +1 -1
  83. package/runtime/assets/{short-volume-CYxTQG8H.js → short-volume-DBL4FAKF.js} +1 -1
  84. package/runtime/assets/{snake-9JevhL1w.js → snake-DM8RZ-EM.js} +1 -1
  85. package/runtime/assets/{spotify-embed-CNEzG2xL.js → spotify-embed-7i5uns51.js} +1 -1
  86. package/runtime/assets/{stopwatch-BuN_qlhH.js → stopwatch-DaQtonjw.js} +1 -1
  87. package/runtime/assets/top-movers-D8wxpazR.js +1 -0
  88. package/runtime/assets/{treasury-auctions-bA-385ON.js → treasury-auctions-CZXil70X.js} +1 -1
  89. package/runtime/assets/treemap-leaf-DNIoJEK-.js +1 -0
  90. package/runtime/assets/tvl-treemap-DD51z-qp.js +1 -0
  91. package/runtime/assets/{video-CUWN4TBo.js → video-DiF4EdH9.js} +1 -1
  92. package/runtime/assets/{yield-curve-BOvLIfWe.js → yield-curve-BgR-ThF_.js} +1 -1
  93. package/runtime/index.html +2 -2
  94. package/runtime/assets/dex-volume-chart-C3KHEnoK.js +0 -1
  95. package/runtime/assets/dex-volume-treemap-C-hqWu6U.js +0 -1
  96. package/runtime/assets/editor-CHAAJRb1.css +0 -1
  97. package/runtime/assets/editor-UP2LBUZ9.js +0 -68
  98. package/runtime/assets/funding-heatmap-BhL0jjq8.js +0 -1
  99. package/runtime/assets/fx-board-Cm0_zK03.js +0 -1
  100. package/runtime/assets/index-DbboK5sz.js +0 -820
  101. package/runtime/assets/index-jnySFpSv.js +0 -1
  102. package/runtime/assets/inflation-pulse-GrBWa9Z6.js +0 -1
  103. package/runtime/assets/liveline-C5zt2WuS.js +0 -1
  104. package/runtime/assets/market-cap-treemap-DpuSjWWe.js +0 -1
  105. package/runtime/assets/mini-line-chart-D-i1QqSe.js +0 -1
  106. package/runtime/assets/news-feed-CA8M5V3K.js +0 -1
  107. package/runtime/assets/note-Biu6llug.js +0 -1
  108. package/runtime/assets/portfolio-value-Dj37WMRc.js +0 -1
  109. package/runtime/assets/price-chart-hgZApQaG.js +0 -1
  110. package/runtime/assets/price-compare-BczbPKy-.js +0 -1
  111. package/runtime/assets/price-liveline-Cbor-Nv_.js +0 -1
  112. package/runtime/assets/protocol-fees-treemap-DeSBgGJ9.js +0 -1
  113. package/runtime/assets/protocol-tvl-treemap-Bvgp0EHh.js +0 -1
  114. package/runtime/assets/top-movers-D7sBm6jo.js +0 -1
  115. package/runtime/assets/treemap-leaf-DLQawrx4.js +0 -1
  116. package/runtime/assets/tvl-treemap-jrgafmGj.js +0 -1
@@ -1,820 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/unicorn-scene-DcohHRPZ.js","assets/react-qoZPGuNy.js","assets/portfolio-value-Dj37WMRc.js","assets/liveline-C5zt2WuS.js","assets/format-CfAcS4D8.js","assets/portfolio-common-CVt117Oi.js","assets/ui-Bq3RQsdJ.js","assets/portfolio-allocation-DKf6H-m6.js","assets/chart-utils-BYIZMM9J.js","assets/d3-xK4fOkBU.js","assets/portfolio-holdings-CHtvm8aL.js","assets/bitcoin-dominance-BHcykQ8j.js","assets/clock-D2rGZ-yo.js","assets/use-countdown-BmcF-qdL.js","assets/daily-analysis-D3g2BXJd.js","assets/journal-log-CcLb4w4A.js","assets/content-shared-BZ1XzrJx.js","assets/journal-store-KCRoPnI_.js","assets/journal-open-C0BKFgMk.js","assets/journal-ui-CJIuEcIa.js","assets/journal-results-Bpzb4REp.js","assets/journal-score-BUDUgceb.js","assets/dino-game-DLEtJMnt.js","assets/game-ui-Dy_QYsPr.js","assets/fear-greed-zPvN2LSi.js","assets/mini-line-chart-D-i1QqSe.js","assets/utils-DaT-yT0k.js","assets/filings-feed-CWAGVlAW.js","assets/feed-row-mVg1d5Zj.js","assets/fundamentals-BYjofvJi.js","assets/financial-stress-C5-XFPqY.js","assets/labor-market-DJihF3Mk.js","assets/national-debt-CgI8LSK6.js","assets/treasury-auctions-bA-385ON.js","assets/metric-row-BVVhjsjK.js","assets/funding-heatmap-BhL0jjq8.js","assets/funding-rate-chart-CxBH7hVe.js","assets/index-jnySFpSv.js","assets/index-XGtH5pVY.css","assets/heading-gFm9ZDY1.js","assets/image-D3DwdoU8.js","assets/inflation-pulse-GrBWa9Z6.js","assets/market-hours-D89LjpUm.js","assets/market-data-CvmpLFSo.js","assets/news-feed-CA8M5V3K.js","assets/note-Biu6llug.js","assets/price-chart-hgZApQaG.js","assets/price-compare-BczbPKy-.js","assets/price-liveline-Cbor-Nv_.js","assets/price-ticker-BmfARqHc.js","assets/mover-row-BTeXB98H.js","assets/rates-board-B_OYdW_u.js","assets/fx-board-Cm0_zK03.js","assets/short-volume-CYxTQG8H.js","assets/top-movers-D7sBm6jo.js","assets/tvl-treemap-jrgafmGj.js","assets/treemap-leaf-DLQawrx4.js","assets/yield-curve-BOvLIfWe.js","assets/dex-volume-treemap-C-hqWu6U.js","assets/dex-volume-chart-C3KHEnoK.js","assets/protocol-tvl-treemap-Bvgp0EHh.js","assets/protocol-tvl-chart-Dl_MwJdU.js","assets/protocol-fees-treemap-DeSBgGJ9.js","assets/market-cap-treemap-DpuSjWWe.js","assets/open-interest-DgDfcYh5.js","assets/snake-9JevhL1w.js","assets/flappy-bird-CoKOL9Ib.js","assets/video-CUWN4TBo.js","assets/drawdy-DoJeRpgi.js","assets/countdown-DcbUf2-f.js","assets/link-grid-DK3kGS1q.js","assets/calculator-CYNDBlrv.js","assets/quote-BjjZrPpM.js","assets/divider-CVjQeL0n.js","assets/marquee-ByOQSr9Q.js","assets/dice-B7dy1iZP.js","assets/risk-reward-xhKH6ouR.js","assets/stopwatch-BuN_qlhH.js","assets/session-progress-BquR98Sm.js","assets/btc-fees-Cv6K9S1L.js","assets/btc-shared-DeqDaCze.js","assets/btc-mempool-ftlit90k.js","assets/btc-blocks-mJPjO7gs.js","assets/btc-hashrate-DT6qyeME.js","assets/btc-difficulty-D8kmEyQb.js","assets/mining-pools-D6AnoVnf.js","assets/lightning-stats-BV14FfAY.js","assets/options-put-call--RXL3vTA.js","assets/options-iv-CqDfM4IA.js","assets/options-oi-strike-CrIT5WTU.js","assets/coin-movers-DpHOtUMJ.js","assets/holiday-calendar-ffNyuPje.js","assets/day-meter-CDmmKsh5.js","assets/returns-projector-EA7LLxnL.js","assets/breakeven-PNgn_Prq.js","assets/checklist-DygbP4AG.js","assets/pomodoro-DZEEQU2X.js","assets/rules-card-CrDquc56.js","assets/breathing-DrPgIS4r.js","assets/spotify-embed-CNEzG2xL.js","assets/editor-UP2LBUZ9.js","assets/gridstack-BxxvPIFU.js","assets/gridstack-FIb_WQSt.css","assets/editor-CHAAJRb1.css"])))=>i.map(i=>d[i]);
2
- var qo=Object.defineProperty;var Xo=(e,t,r)=>t in e?qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var E=(e,t,r)=>Xo(e,typeof t!="symbol"?t+"":t,r);import{r as b,j as p,a as Ko,c as Jo}from"./react-qoZPGuNy.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function r(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(n){if(n.ep)return;n.ep=!0;const a=r(n);fetch(n.href,a)}})();const Qo="modulepreload",en=function(e){return"/"+e},Gt={},w=function(t,r,o){let n=Promise.resolve();if(r&&r.length>0){let s=function(l){return Promise.all(l.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),c=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));n=s(r.map(l=>{if(l=en(l),l in Gt)return;Gt[l]=!0;const u=l.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":Qo,u||(d.as="script"),d.crossOrigin="",d.href=l,c&&d.setAttribute("nonce",c),document.head.appendChild(d),u)return new Promise((m,h)=>{d.addEventListener("load",m),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=s,window.dispatchEvent(i),!i.defaultPrevented)throw s}return n.then(s=>{for(const i of s||[])i.status==="rejected"&&a(i.reason);return t().catch(a)})},Fm=[{key:"markets",label:"Prices & Markets",description:"Live price charts, tickers, and market movers across stocks and crypto."},{key:"crypto",label:"Crypto & On-chain",description:"Crypto market structure and DeFi/on-chain activity — dominance, market caps, TVL, DEX volume, and fees."},{key:"bitcoin",label:"Bitcoin Network",description:"Bitcoin chain health — fees, mempool, blocks, hashrate, difficulty, mining pools, and Lightning."},{key:"derivatives",label:"Derivatives & Options",description:"Perp funding, open interest, and options positioning and volatility."},{key:"macro",label:"Macro & Rates",description:"Official macro data — rates, the yield curve, inflation, jobs, debt, Treasury auctions, and financial stress."},{key:"equities",label:"Equities & Filings",description:"Single-company fundamentals, SEC filings, and short-sale volume."},{key:"sentiment",label:"Sentiment & News",description:"Market-mood gauges and news headline feeds."},{key:"portfolio",label:"Portfolio",description:"Your own holdings and their live allocation."},{key:"journal",label:"Decision Journal",description:"Your decision journal — log market calls, watch them play out, see them graded, and track how calibrated your judgment is over time."},{key:"tools",label:"Tools & Utility",description:"Clocks, countdowns, calculators, link grids, and the daily brief."},{key:"layout",label:"Layout & Media",description:"Structural and decorative frames — headings, dividers, notes, images, video, and quotes."},{key:"games",label:"Games",description:"Idle canvas games for when the market is quiet."}];function Lm(e){return e}var qt;function y(e,t,r){function o(i,c){if(i._zod||Object.defineProperty(i,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),i._zod.traits.has(e))return;i._zod.traits.add(e),t(i,c);const l=s.prototype,u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f];d in i||(i[d]=l[d].bind(i))}}const n=(r==null?void 0:r.Parent)??Object;class a extends n{}Object.defineProperty(a,"name",{value:e});function s(i){var c;const l=r!=null&&r.Parent?new a:this;o(l,i),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:i=>{var c,l;return r!=null&&r.Parent&&i instanceof r.Parent?!0:(l=(c=i==null?void 0:i._zod)==null?void 0:c.traits)==null?void 0:l.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class De extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(qt=globalThis).__zod_globalConfig??(qt.__zod_globalConfig={});const Rt=globalThis.__zod_globalConfig;function fe(e){return Rt}function Ur(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function kt(e,t){return typeof t=="bigint"?t.toString():t}function Dt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Mt(e){return e==null}function Nt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function tn(e,t){const r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}const Xt=Symbol("evaluating");function F(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Xt)return o===void 0&&(o=Xt,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Se(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ve(...e){const t={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function Kt(e){return JSON.stringify(e)}function rn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Br="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const on=Dt(()=>{var e;if(Rt.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Me(e){if(Ke(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Ke(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Vr(e){return Me(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const nn=new Set(["string","number","symbol"]);function nt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function be(e,t,r){const o=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(o._zod.parent=e),o}function T(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function an(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const sn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function cn(e,t){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=ve(e._zod.def,{get shape(){const s={};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(s[i]=r.shape[i])}return Se(this,"shape",s),s},checks:[]});return be(e,a)}function ln(e,t){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=ve(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete s[i]}return Se(this,"shape",s),s},checks:[]});return be(e,a)}function un(e,t){if(!Me(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const a=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(a,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=ve(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Se(this,"shape",a),a}});return be(e,n)}function dn(e,t){if(!Me(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ve(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Se(this,"shape",o),o}});return be(e,r)}function fn(e,t){var o;if((o=e._zod.def.checks)!=null&&o.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=ve(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Se(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return be(e,r)}function mn(e,t,r){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=ve(t._zod.def,{get shape(){const i=t._zod.def.shape,c={...i};if(r)for(const l in r){if(!(l in i))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=e?new e({type:"optional",innerType:i[l]}):i[l])}else for(const l in i)c[l]=e?new e({type:"optional",innerType:i[l]}):i[l];return Se(this,"shape",c),c},checks:[]});return be(t,s)}function pn(e,t,r){const o=ve(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const s in r){if(!(s in a))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(a[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(const s in n)a[s]=new e({type:"nonoptional",innerType:n[s]});return Se(this,"shape",a),a}});return be(t,o)}function Ae(e,t=0){var r;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((r=e.issues[o])==null?void 0:r.continue)!==!0)return!0;return!1}function hn(e,t=0){var r;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((r=e.issues[o])==null?void 0:r.continue)===!1)return!0;return!1}function Re(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function He(e){return typeof e=="string"?e:e==null?void 0:e.message}function me(e,t,r){var c,l,u,f,d,m;const o=e.message?e.message:He((u=(l=(c=e.inst)==null?void 0:c._zod.def)==null?void 0:l.error)==null?void 0:u.call(l,e))??He((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??He((d=r.customError)==null?void 0:d.call(r,e))??He((m=r.localeError)==null?void 0:m.call(r,e))??"Invalid input",{inst:n,continue:a,input:s,...i}=e;return i.path??(i.path=[]),i.message=o,t!=null&&t.reportInput&&(i.input=s),i}function Ot(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Fe(...e){const[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}const Hr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Zr=y("$ZodError",Hr),Yr=y("$ZodError",Hr,{Parent:Error});function gn(e,t=r=>r.message){const r={},o=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function yn(e,t=r=>r.message){const r={_errors:[]},o=(n,a=[])=>{for(const s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>o({issues:i},[...a,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...a,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...a,...s.path]);else{const i=[...a,...s.path];if(i.length===0)r._errors.push(t(s));else{let c=r,l=0;for(;l<i.length;){const u=i[l];l===i.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(s))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}}};return o(e),r}const It=e=>(t,r,o,n)=>{const a=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new De;if(s.issues.length){const i=new((n==null?void 0:n.Err)??e)(s.issues.map(c=>me(c,a,fe())));throw Br(i,n==null?void 0:n.callee),i}return s.value},$t=e=>async(t,r,o,n)=>{const a=o?{...o,async:!0}:{async:!0};let s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){const i=new((n==null?void 0:n.Err)??e)(s.issues.map(c=>me(c,a,fe())));throw Br(i,n==null?void 0:n.callee),i}return s.value},at=e=>(t,r,o)=>{const n=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise)throw new De;return a.issues.length?{success:!1,error:new(e??Zr)(a.issues.map(s=>me(s,n,fe())))}:{success:!0,data:a.value}},vn=at(Yr),st=e=>async(t,r,o)=>{const n=o?{...o,async:!0}:{async:!0};let a=t._zod.run({value:r,issues:[]},n);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(s=>me(s,n,fe())))}:{success:!0,data:a.value}},bn=st(Yr),wn=e=>(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return It(e)(t,r,n)},xn=e=>(t,r,o)=>It(e)(t,r,o),_n=e=>async(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return $t(e)(t,r,n)},kn=e=>async(t,r,o)=>$t(e)(t,r,o),zn=e=>(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return at(e)(t,r,n)},Sn=e=>(t,r,o)=>at(e)(t,r,o),Tn=e=>async(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return st(e)(t,r,n)},En=e=>async(t,r,o)=>st(e)(t,r,o),Cn=/^[cC][0-9a-z]{6,}$/,Pn=/^[0-9a-z]+$/,An=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rn=/^[0-9a-vA-V]{20}$/,Dn=/^[A-Za-z0-9]{27}$/,Mn=/^[a-zA-Z0-9_-]{21}$/,Nn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,On=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Jt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,In=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$n="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fn(){return new RegExp($n,"u")}const Ln=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Un=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Bn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wr=/^[A-Za-z0-9_-]*$/,Hn=/^https?$/,Zn=/^\+[1-9]\d{6,14}$/,Gr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Yn=new RegExp(`^${Gr}$`);function qr(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wn(e){return new RegExp(`^${qr(e)}$`)}function Gn(e){const t=qr({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Gr}T(?:${o})$`)}const qn=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Xn=/^-?\d+$/,Xr=/^-?\d+(?:\.\d+)?$/,Kn=/^(?:true|false)$/i,Jn=/^[^A-Z]*$/,Qn=/^[^a-z]*$/,ee=y("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Kr={number:"number",bigint:"bigint",object:"date"},Jr=y("$ZodCheckLessThan",(e,t)=>{ee.init(e,t);const r=Kr[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,a=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qr=y("$ZodCheckGreaterThan",(e,t)=>{ee.init(e,t);const r=Kr[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,a=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ea=y("$ZodCheckMultipleOf",(e,t)=>{ee.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):tn(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ta=y("$ZodCheckNumberFormat",(e,t)=>{var s;ee.init(e,t),t.format=t.format||"float64";const r=(s=t.format)==null?void 0:s.includes("int"),o=r?"int":"number",[n,a]=sn[t.format];e._zod.onattach.push(i=>{const c=i._zod.bag;c.format=t.format,c.minimum=n,c.maximum=a,r&&(c.pattern=Xn)}),e._zod.check=i=>{const c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>a&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ra=y("$ZodCheckMaxLength",(e,t)=>{var r;ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Mt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const n=o.value;if(n.length<=t.maximum)return;const s=Ot(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),oa=y("$ZodCheckMinLength",(e,t)=>{var r;ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Mt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const n=o.value;if(n.length>=t.minimum)return;const s=Ot(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),na=y("$ZodCheckLengthEquals",(e,t)=>{var r;ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Mt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{const n=o.value,a=n.length;if(a===t.length)return;const s=Ot(n),i=a>t.length;o.issues.push({origin:s,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),it=y("$ZodCheckStringFormat",(e,t)=>{var r,o;ee.init(e,t),e._zod.onattach.push(n=>{const a=n._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),aa=y("$ZodCheckRegex",(e,t)=>{it.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),sa=y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Jn),it.init(e,t)}),ia=y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Qn),it.init(e,t)}),ca=y("$ZodCheckIncludes",(e,t)=>{ee.init(e,t);const r=nt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),la=y("$ZodCheckStartsWith",(e,t)=>{ee.init(e,t);const r=new RegExp(`^${nt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),ua=y("$ZodCheckEndsWith",(e,t)=>{ee.init(e,t);const r=new RegExp(`.*${nt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),da=y("$ZodCheckOverwrite",(e,t)=>{ee.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class fa{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
3
- `).filter(s=>s),n=Math.min(...o.map(s=>s.length-s.trimStart().length)),a=o.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(const s of a)this.content.push(s)}compile(){const t=Function,r=this==null?void 0:this.args,n=[...((this==null?void 0:this.content)??[""]).map(a=>` ${a}`)];return new t(...r,n.join(`
4
- `))}}const ma={major:4,minor:4,patch:3},H=y("$ZodType",(e,t)=>{var n;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ma;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const a of o)for(const s of a._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),(n=e._zod.deferred)==null||n.push(()=>{e._zod.run=e._zod.parse});else{const a=(i,c,l)=>{let u=Ae(i),f;for(const d of c){if(d._zod.def.when){if(hn(i)||!d._zod.def.when(i))continue}else if(u)continue;const m=i.issues.length,h=d._zod.check(i);if(h instanceof Promise&&(l==null?void 0:l.async)===!1)throw new De;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,i.issues.length!==m&&(u||(u=Ae(i,m)))});else{if(i.issues.length===m)continue;u||(u=Ae(i,m))}}return f?f.then(()=>i):i},s=(i,c,l)=>{if(Ae(i))return i.aborted=!0,i;const u=a(c,o,l);if(u instanceof Promise){if(l.async===!1)throw new De;return u.then(f=>e._zod.parse(f,l))}return e._zod.parse(u,l)};e._zod.run=(i,c)=>{if(c.skipChecks)return e._zod.parse(i,c);if(c.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(f=>s(f,i,c)):s(u,i,c)}const l=e._zod.parse(i,c);if(l instanceof Promise){if(c.async===!1)throw new De;return l.then(u=>a(u,o,c))}return a(l,o,c)}}F(e,"~standard",()=>({validate:a=>{var s;try{const i=vn(e,a);return i.success?{value:i.data}:{issues:(s=i.error)==null?void 0:s.issues}}catch{return bn(e,a).then(c=>{var l;return c.success?{value:c.data}:{issues:(l=c.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}))}),Ft=y("$ZodString",(e,t)=>{var r;H.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??qn(e._zod.bag),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),U=y("$ZodStringFormat",(e,t)=>{it.init(e,t),Ft.init(e,t)}),pa=y("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=On),U.init(e,t)}),ha=y("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Jt(o))}else t.pattern??(t.pattern=Jt());U.init(e,t)}),ga=y("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=In),U.init(e,t)}),ya=y("$ZodURL",(e,t)=>{U.init(e,t),e._zod.check=r=>{var o;try{const n=r.value.trim();if(!t.normalize&&((o=t.protocol)==null?void 0:o.source)===Hn.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const a=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=a.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),va=y("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fn()),U.init(e,t)}),ba=y("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Mn),U.init(e,t)}),wa=y("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Cn),U.init(e,t)}),xa=y("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Pn),U.init(e,t)}),_a=y("$ZodULID",(e,t)=>{t.pattern??(t.pattern=An),U.init(e,t)}),ka=y("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Rn),U.init(e,t)}),za=y("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Dn),U.init(e,t)}),Sa=y("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Gn(t)),U.init(e,t)}),Ta=y("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Yn),U.init(e,t)}),Ea=y("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Wn(t)),U.init(e,t)}),Ca=y("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Nn),U.init(e,t)}),Pa=y("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ln),U.init(e,t),e._zod.bag.format="ipv4"}),Aa=y("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=jn),U.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Ra=y("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Un),U.init(e,t)}),Da=y("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Bn),U.init(e,t),e._zod.check=r=>{const o=r.value.split("/");try{if(o.length!==2)throw new Error;const[n,a]=o;if(!a)throw new Error;const s=Number(a);if(`${s}`!==a)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function eo(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Ma=y("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Vn),U.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{eo(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Na(e){if(!Wr.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return eo(r)}const Oa=y("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Wr),U.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Na(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Ia=y("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Zn),U.init(e,t)});function $a(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[o]=r;if(!o)return!1;const n=JSON.parse(atob(o));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const Fa=y("$ZodJWT",(e,t)=>{U.init(e,t),e._zod.check=r=>{$a(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),to=y("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??Xr,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const a=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...a?{received:a}:{}}),r}}),La=y("$ZodNumberFormat",(e,t)=>{ta.init(e,t),to.init(e,t)}),ja=y("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Kn,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Ua=y("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Ba=y("$ZodNever",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Qt(e,t,r){e.issues.length&&t.issues.push(...Re(r,e.issues)),t.value[r]=e.value}const Va=y("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const a=[];for(let s=0;s<n.length;s++){const i=n[s],c=t.element._zod.run({value:i,issues:[]},o);c instanceof Promise?a.push(c.then(l=>Qt(l,r,s))):Qt(c,r,s)}return a.length?Promise.all(a).then(()=>r):r}});function Je(e,t,r,o,n,a){const s=r in o;if(e.issues.length){if(n&&a&&!s)return;t.issues.push(...Re(r,e.issues))}if(!s&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?s&&(t.value[r]=void 0):t.value[r]=e.value}function ro(e){var o,n,a,s;const t=Object.keys(e.shape);for(const i of t)if(!((s=(a=(n=(o=e.shape)==null?void 0:o[i])==null?void 0:n._zod)==null?void 0:a.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=an(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function oo(e,t,r,o,n,a){const s=[],i=n.keySet,c=n.catchall._zod,l=c.def.type,u=c.optin==="optional",f=c.optout==="optional";for(const d in t){if(d==="__proto__"||i.has(d))continue;if(l==="never"){s.push(d);continue}const m=c.run({value:t[d],issues:[]},o);m instanceof Promise?e.push(m.then(h=>Je(h,r,d,t,u,f))):Je(m,r,d,t,u,f)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}const Ha=y("$ZodObject",(e,t)=>{H.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const i=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...i};return Object.defineProperty(t,"shape",{value:c}),c}})}const o=Dt(()=>ro(t));F(e._zod,"propValues",()=>{const i=t.shape,c={};for(const l in i){const u=i[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(const f of u.values)c[l].add(f)}}return c});const n=Ke,a=t.catchall;let s;e._zod.parse=(i,c)=>{s??(s=o.value);const l=i.value;if(!n(l))return i.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),i;i.value={};const u=[],f=s.shape;for(const d of s.keys){const m=f[d],h=m._zod.optin==="optional",g=m._zod.optout==="optional",S=m._zod.run({value:l[d],issues:[]},c);S instanceof Promise?u.push(S.then(k=>Je(k,i,d,l,h,g))):Je(S,i,d,l,h,g)}return a?oo(u,l,i,c,o.value,e):u.length?Promise.all(u).then(()=>i):i}}),Za=y("$ZodObjectJIT",(e,t)=>{Ha.init(e,t);const r=e._zod.parse,o=Dt(()=>ro(t)),n=d=>{var L,Y;const m=new fa(["shape","payload","ctx"]),h=o.value,g=X=>{const $=Kt(X);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};m.write("const input = payload.value;");const S=Object.create(null);let k=0;for(const X of h.keys)S[X]=`key_${k++}`;m.write("const newResult = {};");for(const X of h.keys){const $=S[X],M=Kt(X),G=d[X],oe=((L=G==null?void 0:G._zod)==null?void 0:L.optin)==="optional",K=((Y=G==null?void 0:G._zod)==null?void 0:Y.optout)==="optional";m.write(`const ${$} = ${g(X)};`),oe&&K?m.write(`
5
- if (${$}.issues.length) {
6
- if (${M} in input) {
7
- payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
8
- ...iss,
9
- path: iss.path ? [${M}, ...iss.path] : [${M}]
10
- })));
11
- }
12
- }
13
-
14
- if (${$}.value === undefined) {
15
- if (${M} in input) {
16
- newResult[${M}] = undefined;
17
- }
18
- } else {
19
- newResult[${M}] = ${$}.value;
20
- }
21
-
22
- `):oe?m.write(`
23
- if (${$}.issues.length) {
24
- payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
25
- ...iss,
26
- path: iss.path ? [${M}, ...iss.path] : [${M}]
27
- })));
28
- }
29
-
30
- if (${$}.value === undefined) {
31
- if (${M} in input) {
32
- newResult[${M}] = undefined;
33
- }
34
- } else {
35
- newResult[${M}] = ${$}.value;
36
- }
37
-
38
- `):m.write(`
39
- const ${$}_present = ${M} in input;
40
- if (${$}.issues.length) {
41
- payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
42
- ...iss,
43
- path: iss.path ? [${M}, ...iss.path] : [${M}]
44
- })));
45
- }
46
- if (!${$}_present && !${$}.issues.length) {
47
- payload.issues.push({
48
- code: "invalid_type",
49
- expected: "nonoptional",
50
- input: undefined,
51
- path: [${M}]
52
- });
53
- }
54
-
55
- if (${$}_present) {
56
- if (${$}.value === undefined) {
57
- newResult[${M}] = undefined;
58
- } else {
59
- newResult[${M}] = ${$}.value;
60
- }
61
- }
62
-
63
- `)}m.write("payload.value = newResult;"),m.write("return payload;");const P=m.compile();return(X,$)=>P(d,X,$)};let a;const s=Ke,i=!Rt.jitless,l=i&&on.value,u=t.catchall;let f;e._zod.parse=(d,m)=>{f??(f=o.value);const h=d.value;return s(h)?i&&l&&(m==null?void 0:m.async)===!1&&m.jitless!==!0?(a||(a=n(t.shape)),d=a(d,m),u?oo([],h,d,m,f,e):d):r(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d)}});function er(e,t,r,o){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const n=e.filter(a=>!Ae(a));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(s=>me(s,o,fe())))}),t)}const Ya=y("$ZodUnion",(e,t)=>{H.init(e,t),F(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),F(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),F(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),F(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Nt(n.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let a=!1;const s=[];for(const i of t.options){const c=i._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)s.push(c),a=!0;else{if(c.issues.length===0)return c;s.push(c)}}return a?Promise.all(s).then(i=>er(i,o,e,n)):er(s,o,e,n)}}),Wa=y("$ZodIntersection",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{const n=r.value,a=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([c,l])=>tr(r,c,l)):tr(r,a,s)}});function zt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Me(e)&&Me(t)){const r=Object.keys(t),o=Object.keys(e).filter(a=>r.indexOf(a)!==-1),n={...e,...t};for(const a of o){const s=zt(e[a],t[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};n[a]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<e.length;o++){const n=e[o],a=t[o],s=zt(n,a);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function tr(e,t,r){const o=new Map;let n;for(const i of t.issues)if(i.code==="unrecognized_keys"){n??(n=i);for(const c of i.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(i);for(const i of r.issues)if(i.code==="unrecognized_keys")for(const c of i.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(i);const a=[...o].filter(([,i])=>i.l&&i.r).map(([i])=>i);if(a.length&&n&&e.issues.push({...n,keys:a}),Ae(e))return e;const s=zt(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Ga=y("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!Me(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;const a=[],s=t.keyType._zod.values;if(s){r.value={};const i=new Set;for(const l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){i.add(typeof l=="number"?l.toString():l);const u=t.keyType._zod.run({value:l,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>me(m,o,fe())),input:l,path:[l],inst:e});continue}const f=u.value,d=t.valueType._zod.run({value:n[l],issues:[]},o);d instanceof Promise?a.push(d.then(m=>{m.issues.length&&r.issues.push(...Re(l,m.issues)),r.value[f]=m.value})):(d.issues.length&&r.issues.push(...Re(l,d.issues)),r.value[f]=d.value)}let c;for(const l in n)i.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(const i of Reflect.ownKeys(n)){if(i==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,i))continue;let c=t.keyType._zod.run({value:i,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof i=="string"&&Xr.test(i)&&c.issues.length){const f=t.keyType._zod.run({value:Number(i),issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){t.mode==="loose"?r.value[i]=n[i]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>me(f,o,fe())),input:i,path:[i],inst:e});continue}const u=t.valueType._zod.run({value:n[i],issues:[]},o);u instanceof Promise?a.push(u.then(f=>{f.issues.length&&r.issues.push(...Re(i,f.issues)),r.value[c.value]=f.value})):(u.issues.length&&r.issues.push(...Re(i,u.issues)),r.value[c.value]=u.value)}}return a.length?Promise.all(a).then(()=>r):r}}),qa=y("$ZodEnum",(e,t)=>{H.init(e,t);const r=Ur(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>nn.has(typeof n)).map(n=>typeof n=="string"?nt(n):n.toString()).join("|")})$`),e._zod.parse=(n,a)=>{const s=n.value;return o.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),Xa=y("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new jr(e.constructor.name);const n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new De;return r.value=n,r.fallback=!0,r}});function rr(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const no=y("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),F(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Nt(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){const n=r.value,a=t.innerType._zod.run(r,o);return a instanceof Promise?a.then(s=>rr(s,n)):rr(a,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Ka=y("$ZodExactOptional",(e,t)=>{no.init(e,t),F(e._zod,"values",()=>t.innerType._zod.values),F(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Ja=y("$ZodNullable",(e,t)=>{H.init(e,t),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Nt(r.source)}|null)$`):void 0}),F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Qa=y("$ZodDefault",(e,t)=>{H.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(a=>or(a,t)):or(n,t)}});function or(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const es=y("$ZodPrefault",(e,t)=>{H.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),ts=y("$ZodNonOptional",(e,t)=>{H.init(e,t),F(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(a=>nr(a,e)):nr(n,e)}});function nr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const rs=y("$ZodCatch",(e,t)=>{H.init(e,t),e._zod.optin="optional",F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(s=>me(s,o,fe()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(a=>me(a,o,fe()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),ao=y("$ZodPipe",(e,t)=>{H.init(e,t),F(e._zod,"values",()=>t.in._zod.values),F(e._zod,"optin",()=>t.in._zod.optin),F(e._zod,"optout",()=>t.out._zod.optout),F(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const a=t.out._zod.run(r,o);return a instanceof Promise?a.then(s=>Ze(s,t.in,o)):Ze(a,t.in,o)}const n=t.in._zod.run(r,o);return n instanceof Promise?n.then(a=>Ze(a,t.out,o)):Ze(n,t.out,o)}});function Ze(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const os=y("$ZodPreprocess",(e,t)=>{ao.init(e,t)}),ns=y("$ZodReadonly",(e,t)=>{H.init(e,t),F(e._zod,"propValues",()=>t.innerType._zod.propValues),F(e._zod,"values",()=>t.innerType._zod.values),F(e._zod,"optin",()=>{var r,o;return(o=(r=t.innerType)==null?void 0:r._zod)==null?void 0:o.optin}),F(e._zod,"optout",()=>{var r,o;return(o=(r=t.innerType)==null?void 0:r._zod)==null?void 0:o.optout}),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(ar):ar(n)}});function ar(e){return e.value=Object.freeze(e.value),e}const as=y("$ZodCustom",(e,t)=>{ee.init(e,t),H.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(a=>sr(a,r,o,e));sr(n,r,o,e)}});function sr(e,t,r,o){if(!e){const n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Fe(n))}}var ir;class ss{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function is(){return new ss}(ir=globalThis).__zod_globalRegistry??(ir.__zod_globalRegistry=is());const $e=globalThis.__zod_globalRegistry;function cs(e,t){return new e({type:"string",...T(t)})}function ls(e,t){return new e({type:"string",coerce:!0,...T(t)})}function us(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}function cr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}function ds(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}function fs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}function ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}function ps(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}function hs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}function gs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}function ys(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}function vs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}function bs(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}function ws(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}function xs(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}function _s(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}function ks(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}function zs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}function Ss(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}function Ts(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}function Es(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}function Cs(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}function Ps(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}function As(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}function Rs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}function Ds(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}function Ms(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}function Ns(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}function Os(e,t){return new e({type:"number",checks:[],...T(t)})}function Is(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}function $s(e,t){return new e({type:"boolean",...T(t)})}function Fs(e){return new e({type:"unknown"})}function Ls(e,t){return new e({type:"never",...T(t)})}function lr(e,t){return new Jr({check:"less_than",...T(t),value:e,inclusive:!1})}function pt(e,t){return new Jr({check:"less_than",...T(t),value:e,inclusive:!0})}function ur(e,t){return new Qr({check:"greater_than",...T(t),value:e,inclusive:!1})}function ht(e,t){return new Qr({check:"greater_than",...T(t),value:e,inclusive:!0})}function dr(e,t){return new ea({check:"multiple_of",...T(t),value:e})}function so(e,t){return new ra({check:"max_length",...T(t),maximum:e})}function Qe(e,t){return new oa({check:"min_length",...T(t),minimum:e})}function io(e,t){return new na({check:"length_equals",...T(t),length:e})}function js(e,t){return new aa({check:"string_format",format:"regex",...T(t),pattern:e})}function Us(e){return new sa({check:"string_format",format:"lowercase",...T(e)})}function Bs(e){return new ia({check:"string_format",format:"uppercase",...T(e)})}function Vs(e,t){return new ca({check:"string_format",format:"includes",...T(t),includes:e})}function Hs(e,t){return new la({check:"string_format",format:"starts_with",...T(t),prefix:e})}function Zs(e,t){return new ua({check:"string_format",format:"ends_with",...T(t),suffix:e})}function Ne(e){return new da({check:"overwrite",tx:e})}function Ys(e){return Ne(t=>t.normalize(e))}function Ws(){return Ne(e=>e.trim())}function Gs(){return Ne(e=>e.toLowerCase())}function qs(){return Ne(e=>e.toUpperCase())}function Xs(){return Ne(e=>rn(e))}function Ks(e,t,r){return new e({type:"array",element:t,...T(r)})}function Js(e,t,r){return new e({type:"custom",check:"custom",fn:t,...T(r)})}function Qs(e,t){const r=ei(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Fe(n,o.value,r._zod.def));else{const a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=o.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),o.issues.push(Fe(a))}},e(o.value,o)),t);return r}function ei(e,t){const r=new ee({check:"custom",...T(t)});return r._zod.check=e,r}function et(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??$e,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function j(e,t,r={path:[],schemaPath:[]}){var u,f;var o;const n=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;const s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);const i=(f=(u=e._zod).toJSONSchema)==null?void 0:f.call(u);if(i)s.schema=i;else{const d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{const h=s.schema,g=t.processors[n.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,h,d)}const m=e._zod.parent;m&&(s.ref||(s.ref=m),j(m,t,d),t.seen.get(m).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),t.io==="input"&&Q(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function tt(e,t){var s,i,c,l;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const u of e.seen.entries()){const f=(s=e.metadataRegistry.get(u[0]))==null?void 0:s.id;if(f){const d=o.get(f);if(d&&d!==u[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(f,u[0])}}const n=u=>{var g;const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const S=(g=e.external.registry.get(u[0]))==null?void 0:g.id,k=e.external.uri??(L=>L);if(S)return{ref:k(S)};const P=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=P,{defId:P,ref:`${k("__shared")}#/${f}/${P}`}}if(u[1]===r)return{ref:"#"};const m=`#/${f}/`,h=u[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:m+h}},a=u=>{if(u[1].schema.$ref)return;const f=u[1],{ref:d,defId:m}=n(u);f.def={...f.schema},m&&(f.defId=m);const h=f.schema;for(const g in h)delete h[g];h.$ref=d};if(e.cycles==="throw")for(const u of e.seen.entries()){const f=u[1];if(f.cycle)throw new Error(`Cycle detected: #/${(i=f.cycle)==null?void 0:i.join("/")}/<root>
64
-
65
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(t===u[0]){a(u);continue}if(e.external){const m=(c=e.external.registry.get(u[0]))==null?void 0:c.id;if(t!==u[0]&&m){a(u);continue}}if((l=e.metadataRegistry.get(u[0]))==null?void 0:l.id){a(u);continue}if(f.cycle){a(u);continue}if(f.count>1&&e.reused==="ref"){a(u);continue}}}function rt(e,t){var i,c,l,u;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=f=>{const d=e.seen.get(f);if(d.ref===null)return;const m=d.def??d.schema,h={...m},g=d.ref;if(d.ref=null,g){o(g);const k=e.seen.get(g),P=k.schema;if(P.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(P)):Object.assign(m,P),Object.assign(m,h),f._zod.parent===g)for(const Y in m)Y==="$ref"||Y==="allOf"||Y in h||delete m[Y];if(P.$ref&&k.def)for(const Y in m)Y==="$ref"||Y==="allOf"||Y in k.def&&JSON.stringify(m[Y])===JSON.stringify(k.def[Y])&&delete m[Y]}const S=f._zod.parent;if(S&&S!==g){o(S);const k=e.seen.get(S);if(k!=null&&k.schema.$ref&&(m.$ref=k.schema.$ref,k.def))for(const P in m)P==="$ref"||P==="allOf"||P in k.def&&JSON.stringify(m[P])===JSON.stringify(k.def[P])&&delete m[P]}e.override({zodSchema:f,jsonSchema:m,path:d.path??[]})};for(const f of[...e.seen.entries()].reverse())o(f[0]);const n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,(i=e.external)!=null&&i.uri){const f=(c=e.external.registry.get(t))==null?void 0:c.id;if(!f)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(f)}Object.assign(n,r.def??r.schema);const a=(l=e.metadataRegistry.get(t))==null?void 0:l.id;a!==void 0&&n.id===a&&delete n.id;const s=((u=e.external)==null?void 0:u.defs)??{};for(const f of e.seen.entries()){const d=f[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,s[d.defId]=d.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{const f=JSON.parse(JSON.stringify(n));return Object.defineProperty(f,"~standard",{value:{...t["~standard"],jsonSchema:{input:ot(t,"input",e.processors),output:ot(t,"output",e.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function Q(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Q(o.element,r);if(o.type==="set")return Q(o.valueType,r);if(o.type==="lazy")return Q(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Q(o.innerType,r);if(o.type==="intersection")return Q(o.left,r)||Q(o.right,r);if(o.type==="record"||o.type==="map")return Q(o.keyType,r)||Q(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Q(o.in,r)||Q(o.out,r);if(o.type==="object"){for(const n in o.shape)if(Q(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(const n of o.options)if(Q(n,r))return!0;return!1}if(o.type==="tuple"){for(const n of o.items)if(Q(n,r))return!0;return!!(o.rest&&Q(o.rest,r))}return!1}const ti=(e,t={})=>r=>{const o=et({...r,processors:t});return j(e,o),tt(o,e),rt(o,e)},ot=(e,t,r={})=>o=>{const{libraryOptions:n,target:a}=o??{},s=et({...n??{},target:a,io:t,processors:r});return j(e,s),tt(s,e),rt(s,e)},ri={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},co=(e,t,r,o)=>{const n=r;n.type="string";const{minimum:a,maximum:s,format:i,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a=="number"&&(n.minLength=a),typeof s=="number"&&(n.maxLength=s),i&&(n.format=ri[i]??i,n.format===""&&delete n.format,i==="time"&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},lo=(e,t,r,o)=>{const n=r,{minimum:a,maximum:s,format:i,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof i=="string"&&i.includes("int")?n.type="integer":n.type="number";const f=typeof u=="number"&&u>=(a??Number.NEGATIVE_INFINITY),d=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";f?m?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof a=="number"&&(n.minimum=a),d?m?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof s=="number"&&(n.maximum=s),typeof c=="number"&&(n.multipleOf=c)},uo=(e,t,r,o)=>{r.type="boolean"},oi=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},ni=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},ai=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},si=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},ii=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},fo=(e,t,r,o)=>{r.not={}},ci=(e,t,r,o)=>{},mo=(e,t,r,o)=>{},li=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},po=(e,t,r,o)=>{const n=e._zod.def,a=Ur(n.entries);a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),r.enum=a},ui=(e,t,r,o)=>{const n=e._zod.def,a=[];for(const s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(s))}else a.push(s);if(a.length!==0)if(a.length===1){const s=a[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),a.every(s=>typeof s=="boolean")&&(r.type="boolean"),a.every(s=>s===null)&&(r.type="null"),r.enum=a},di=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},fi=(e,t,r,o)=>{const n=r,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=a.source},mi=(e,t,r,o)=>{const n=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:i,mime:c}=e._zod.bag;s!==void 0&&(a.minLength=s),i!==void 0&&(a.maxLength=i),c?c.length===1?(a.contentMediaType=c[0],Object.assign(n,a)):(Object.assign(n,a),n.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(n,a)},pi=(e,t,r,o)=>{r.type="boolean"},ho=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},hi=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},go=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},gi=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},yi=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},yo=(e,t,r,o)=>{const n=r,a=e._zod.def,{minimum:s,maximum:i}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof i=="number"&&(n.maxItems=i),n.type="array",n.items=j(a.element,t,{...o,path:[...o.path,"items"]})},vo=(e,t,r,o)=>{var l;const n=r,a=e._zod.def;n.type="object",n.properties={};const s=a.shape;for(const u in s)n.properties[u]=j(s[u],t,{...o,path:[...o.path,"properties",u]});const i=new Set(Object.keys(s)),c=new Set([...i].filter(u=>{const f=a.shape[u]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));c.size>0&&(n.required=Array.from(c)),((l=a.catchall)==null?void 0:l._zod.def.type)==="never"?n.additionalProperties=!1:a.catchall?a.catchall&&(n.additionalProperties=j(a.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},bo=(e,t,r,o)=>{const n=e._zod.def,a=n.inclusive===!1,s=n.options.map((i,c)=>j(i,t,{...o,path:[...o.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=s:r.anyOf=s},wo=(e,t,r,o)=>{const n=e._zod.def,a=j(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=j(n.right,t,{...o,path:[...o.path,"allOf",1]}),i=l=>"allOf"in l&&Object.keys(l).length===1,c=[...i(a)?a.allOf:[a],...i(s)?s.allOf:[s]];r.allOf=c},vi=(e,t,r,o)=>{const n=r,a=e._zod.def;n.type="array";const s=t.target==="draft-2020-12"?"prefixItems":"items",i=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=a.items.map((d,m)=>j(d,t,{...o,path:[...o.path,s,m]})),l=a.rest?j(a.rest,t,{...o,path:[...o.path,i,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));const{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(n.minItems=u),typeof f=="number"&&(n.maxItems=f)},xo=(e,t,r,o)=>{const n=r,a=e._zod.def;n.type="object";const s=a.keyType,i=s._zod.bag,c=i==null?void 0:i.patterns;if(a.mode==="loose"&&c&&c.size>0){const u=j(a.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(const f of c)n.patternProperties[f.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=j(a.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=j(a.valueType,t,{...o,path:[...o.path,"additionalProperties"]});const l=s._zod.values;if(l){const u=[...l].filter(f=>typeof f=="string"||typeof f=="number");u.length>0&&(n.required=u)}},_o=(e,t,r,o)=>{const n=e._zod.def,a=j(n.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},ko=(e,t,r,o)=>{const n=e._zod.def;j(n.innerType,t,o);const a=t.seen.get(e);a.ref=n.innerType},zo=(e,t,r,o)=>{const n=e._zod.def;j(n.innerType,t,o);const a=t.seen.get(e);a.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},So=(e,t,r,o)=>{const n=e._zod.def;j(n.innerType,t,o);const a=t.seen.get(e);a.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},To=(e,t,r,o)=>{const n=e._zod.def;j(n.innerType,t,o);const a=t.seen.get(e);a.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Eo=(e,t,r,o)=>{const n=e._zod.def,a=n.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?a?n.out:n.in:n.out;j(s,t,o);const i=t.seen.get(e);i.ref=s},Co=(e,t,r,o)=>{const n=e._zod.def;j(n.innerType,t,o);const a=t.seen.get(e);a.ref=n.innerType,r.readOnly=!0},bi=(e,t,r,o)=>{const n=e._zod.def;j(n.innerType,t,o);const a=t.seen.get(e);a.ref=n.innerType},Lt=(e,t,r,o)=>{const n=e._zod.def;j(n.innerType,t,o);const a=t.seen.get(e);a.ref=n.innerType},wi=(e,t,r,o)=>{const n=e._zod.innerType;j(n,t,o);const a=t.seen.get(e);a.ref=n},fr={string:co,number:lo,boolean:uo,bigint:oi,symbol:ni,null:ai,undefined:si,void:ii,never:fo,any:ci,unknown:mo,date:li,enum:po,literal:ui,nan:di,template_literal:fi,file:mi,success:pi,custom:ho,function:hi,transform:go,map:gi,set:yi,array:yo,object:vo,union:bo,intersection:wo,tuple:vi,record:xo,nullable:_o,nonoptional:ko,default:zo,prefault:So,catch:To,pipe:Eo,readonly:Co,promise:bi,optional:Lt,lazy:wi};function jm(e,t){if("_idmap"in e){const o=e,n=et({...t,processors:fr}),a={};for(const c of o._idmap.entries()){const[l,u]=c;j(u,n)}const s={},i={registry:o,uri:t==null?void 0:t.uri,defs:a};n.external=i;for(const c of o._idmap.entries()){const[l,u]=c;tt(n,u),s[l]=rt(n,u)}if(Object.keys(a).length>0){const c=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:a}}return{schemas:s}}const r=et({...t,processors:fr});return j(e,r),tt(r,e),rt(r,e)}const xi=y("ZodISODateTime",(e,t)=>{Sa.init(e,t),V.init(e,t)});function _i(e){return Rs(xi,e)}const ki=y("ZodISODate",(e,t)=>{Ta.init(e,t),V.init(e,t)});function zi(e){return Ds(ki,e)}const Si=y("ZodISOTime",(e,t)=>{Ea.init(e,t),V.init(e,t)});function Ti(e){return Ms(Si,e)}const Ei=y("ZodISODuration",(e,t)=>{Ca.init(e,t),V.init(e,t)});function Ci(e){return Ns(Ei,e)}const Pi=(e,t)=>{Zr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>yn(e,r)},flatten:{value:r=>gn(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,kt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,kt,2)}},isEmpty:{get(){return e.issues.length===0}}})},ae=y("ZodError",Pi,{Parent:Error}),Ai=It(ae),Ri=$t(ae),Di=at(ae),Mi=st(ae),Ni=wn(ae),Oi=xn(ae),Ii=_n(ae),$i=kn(ae),Fi=zn(ae),Li=Sn(ae),ji=Tn(ae),Ui=En(ae),mr=new WeakMap;function Ue(e,t,r){const o=Object.getPrototypeOf(e);let n=mr.get(o);if(n||(n=new Set,mr.set(o,n)),!n.has(t)){n.add(t);for(const a in r){const s=r[a];Object.defineProperty(o,a,{configurable:!0,enumerable:!1,get(){const i=s.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:i}),i},set(i){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:i})}})}}}const Z=y("ZodType",(e,t)=>(H.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ot(e,"input"),output:ot(e,"output")}}),e.toJSONSchema=ti(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Ai(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Di(e,r,o),e.parseAsync=async(r,o)=>Ri(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Mi(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Ni(e,r,o),e.decode=(r,o)=>Oi(e,r,o),e.encodeAsync=async(r,o)=>Ii(e,r,o),e.decodeAsync=async(r,o)=>$i(e,r,o),e.safeEncode=(r,o)=>Fi(e,r,o),e.safeDecode=(r,o)=>Li(e,r,o),e.safeEncodeAsync=async(r,o)=>ji(e,r,o),e.safeDecodeAsync=async(r,o)=>Ui(e,r,o),Ue(e,"ZodType",{check(...r){const o=this.def;return this.clone(ve(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return be(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Rc(r,o))},superRefine(r,o){return this.check(Dc(r,o))},overwrite(r){return this.check(Ne(r))},optional(){return vr(this)},exactOptional(){return vc(this)},nullable(){return br(this)},nullish(){return vr(br(this))},nonoptional(r){return zc(this,r)},array(){return B(this)},or(r){return mc([this,r])},and(r){return hc(this,r)},transform(r){return wr(this,Do(r))},default(r){return xc(this,r)},prefault(r){return kc(this,r)},catch(r){return Tc(this,r)},pipe(r){return wr(this,r)},readonly(){return Pc(this)},describe(r){const o=this.clone();return $e.add(o,{description:r}),o},meta(...r){if(r.length===0)return $e.get(this);const o=this.clone();return $e.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){var r;return(r=$e.get(e))==null?void 0:r.description},configurable:!0}),e)),Po=y("_ZodString",(e,t)=>{Ft.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(o,n,a)=>co(e,o,n);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Ue(e,"_ZodString",{regex(...o){return this.check(js(...o))},includes(...o){return this.check(Vs(...o))},startsWith(...o){return this.check(Hs(...o))},endsWith(...o){return this.check(Zs(...o))},min(...o){return this.check(Qe(...o))},max(...o){return this.check(so(...o))},length(...o){return this.check(io(...o))},nonempty(...o){return this.check(Qe(1,...o))},lowercase(o){return this.check(Us(o))},uppercase(o){return this.check(Bs(o))},trim(){return this.check(Ws())},normalize(...o){return this.check(Ys(...o))},toLowerCase(){return this.check(Gs())},toUpperCase(){return this.check(qs())},slugify(){return this.check(Xs())}})}),Ao=y("ZodString",(e,t)=>{Ft.init(e,t),Po.init(e,t),e.email=r=>e.check(us(Bi,r)),e.url=r=>e.check(hs(Vi,r)),e.jwt=r=>e.check(As(nc,r)),e.emoji=r=>e.check(gs(Hi,r)),e.guid=r=>e.check(cr(pr,r)),e.uuid=r=>e.check(ds(Ye,r)),e.uuidv4=r=>e.check(fs(Ye,r)),e.uuidv6=r=>e.check(ms(Ye,r)),e.uuidv7=r=>e.check(ps(Ye,r)),e.nanoid=r=>e.check(ys(Zi,r)),e.guid=r=>e.check(cr(pr,r)),e.cuid=r=>e.check(vs(Yi,r)),e.cuid2=r=>e.check(bs(Wi,r)),e.ulid=r=>e.check(ws(Gi,r)),e.base64=r=>e.check(Es(tc,r)),e.base64url=r=>e.check(Cs(rc,r)),e.xid=r=>e.check(xs(qi,r)),e.ksuid=r=>e.check(_s(Xi,r)),e.ipv4=r=>e.check(ks(Ki,r)),e.ipv6=r=>e.check(zs(Ji,r)),e.cidrv4=r=>e.check(Ss(Qi,r)),e.cidrv6=r=>e.check(Ts(ec,r)),e.e164=r=>e.check(Ps(oc,r)),e.datetime=r=>e.check(_i(r)),e.date=r=>e.check(zi(r)),e.time=r=>e.check(Ti(r)),e.duration=r=>e.check(Ci(r))});function z(e){return cs(Ao,e)}const V=y("ZodStringFormat",(e,t)=>{U.init(e,t),Po.init(e,t)}),Bi=y("ZodEmail",(e,t)=>{ga.init(e,t),V.init(e,t)}),pr=y("ZodGUID",(e,t)=>{pa.init(e,t),V.init(e,t)}),Ye=y("ZodUUID",(e,t)=>{ha.init(e,t),V.init(e,t)}),Vi=y("ZodURL",(e,t)=>{ya.init(e,t),V.init(e,t)}),Hi=y("ZodEmoji",(e,t)=>{va.init(e,t),V.init(e,t)}),Zi=y("ZodNanoID",(e,t)=>{ba.init(e,t),V.init(e,t)}),Yi=y("ZodCUID",(e,t)=>{wa.init(e,t),V.init(e,t)}),Wi=y("ZodCUID2",(e,t)=>{xa.init(e,t),V.init(e,t)}),Gi=y("ZodULID",(e,t)=>{_a.init(e,t),V.init(e,t)}),qi=y("ZodXID",(e,t)=>{ka.init(e,t),V.init(e,t)}),Xi=y("ZodKSUID",(e,t)=>{za.init(e,t),V.init(e,t)}),Ki=y("ZodIPv4",(e,t)=>{Pa.init(e,t),V.init(e,t)}),Ji=y("ZodIPv6",(e,t)=>{Aa.init(e,t),V.init(e,t)}),Qi=y("ZodCIDRv4",(e,t)=>{Ra.init(e,t),V.init(e,t)}),ec=y("ZodCIDRv6",(e,t)=>{Da.init(e,t),V.init(e,t)}),tc=y("ZodBase64",(e,t)=>{Ma.init(e,t),V.init(e,t)}),rc=y("ZodBase64URL",(e,t)=>{Oa.init(e,t),V.init(e,t)}),oc=y("ZodE164",(e,t)=>{Ia.init(e,t),V.init(e,t)}),nc=y("ZodJWT",(e,t)=>{Fa.init(e,t),V.init(e,t)}),Ro=y("ZodNumber",(e,t)=>{to.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(o,n,a)=>lo(e,o,n),Ue(e,"ZodNumber",{gt(o,n){return this.check(ur(o,n))},gte(o,n){return this.check(ht(o,n))},min(o,n){return this.check(ht(o,n))},lt(o,n){return this.check(lr(o,n))},lte(o,n){return this.check(pt(o,n))},max(o,n){return this.check(pt(o,n))},int(o){return this.check(hr(o))},safe(o){return this.check(hr(o))},positive(o){return this.check(ur(0,o))},nonnegative(o){return this.check(ht(0,o))},negative(o){return this.check(lr(0,o))},nonpositive(o){return this.check(pt(0,o))},multipleOf(o,n){return this.check(dr(o,n))},step(o,n){return this.check(dr(o,n))},finite(){return this}});const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function _(e){return Os(Ro,e)}const ac=y("ZodNumberFormat",(e,t)=>{La.init(e,t),Ro.init(e,t)});function hr(e){return Is(ac,e)}const sc=y("ZodBoolean",(e,t)=>{ja.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uo(e,r,o)});function W(e){return $s(sc,e)}const ic=y("ZodUnknown",(e,t)=>{Ua.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mo()});function St(){return Fs(ic)}const cc=y("ZodNever",(e,t)=>{Ba.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fo(e,r,o)});function lc(e){return Ls(cc,e)}const uc=y("ZodArray",(e,t)=>{Va.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yo(e,r,o,n),e.element=t.element,Ue(e,"ZodArray",{min(r,o){return this.check(Qe(r,o))},nonempty(r){return this.check(Qe(1,r))},max(r,o){return this.check(so(r,o))},length(r,o){return this.check(io(r,o))},unwrap(){return this.element}})});function B(e,t){return Ks(uc,e,t)}const dc=y("ZodObject",(e,t)=>{Za.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vo(e,r,o,n),F(e,"shape",()=>t.shape),Ue(e,"ZodObject",{keyof(){return N(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:St()})},loose(){return this.clone({...this._zod.def,catchall:St()})},strict(){return this.clone({...this._zod.def,catchall:lc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return un(this,r)},safeExtend(r){return dn(this,r)},merge(r){return fn(this,r)},pick(r){return cn(this,r)},omit(r){return ln(this,r)},partial(...r){return mn(Mo,this,r[0])},required(...r){return pn(No,this,r[0])}})});function v(e,t){const r={type:"object",shape:e??{},...T(t)};return new dc(r)}const fc=y("ZodUnion",(e,t)=>{Ya.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bo(e,r,o,n),e.options=t.options});function mc(e,t){return new fc({type:"union",options:e,...T(t)})}const pc=y("ZodIntersection",(e,t)=>{Wa.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wo(e,r,o,n)});function hc(e,t){return new pc({type:"intersection",left:e,right:t})}const gr=y("ZodRecord",(e,t)=>{Ga.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xo(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function yr(e,t,r){return!t||!t._zod?new gr({type:"record",keyType:z(),valueType:e,...T(t)}):new gr({type:"record",keyType:e,valueType:t,...T(r)})}const Tt=y("ZodEnum",(e,t)=>{qa.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(o,n,a)=>po(e,o,n),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{const a={};for(const s of o)if(r.has(s))a[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Tt({...t,checks:[],...T(n),entries:a})},e.exclude=(o,n)=>{const a={...t.entries};for(const s of o)if(r.has(s))delete a[s];else throw new Error(`Key ${s} not found in enum`);return new Tt({...t,checks:[],...T(n),entries:a})}});function N(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Tt({type:"enum",entries:r,...T(t)})}const gc=y("ZodTransform",(e,t)=>{Xa.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>go(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new jr(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(Fe(a,r.value,t));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(Fe(s))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function Do(e){return new gc({type:"transform",transform:e})}const Mo=y("ZodOptional",(e,t)=>{no.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lt(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function vr(e){return new Mo({type:"optional",innerType:e})}const yc=y("ZodExactOptional",(e,t)=>{Ka.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lt(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function vc(e){return new yc({type:"optional",innerType:e})}const bc=y("ZodNullable",(e,t)=>{Ja.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_o(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function br(e){return new bc({type:"nullable",innerType:e})}const wc=y("ZodDefault",(e,t)=>{Qa.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zo(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xc(e,t){return new wc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Vr(t)}})}const _c=y("ZodPrefault",(e,t)=>{es.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>So(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function kc(e,t){return new _c({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Vr(t)}})}const No=y("ZodNonOptional",(e,t)=>{ts.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ko(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function zc(e,t){return new No({type:"nonoptional",innerType:e,...T(t)})}const Sc=y("ZodCatch",(e,t)=>{rs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>To(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Tc(e,t){return new Sc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Oo=y("ZodPipe",(e,t)=>{ao.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eo(e,r,o,n),e.in=t.in,e.out=t.out});function wr(e,t){return new Oo({type:"pipe",in:e,out:t})}const Ec=y("ZodPreprocess",(e,t)=>{Oo.init(e,t),os.init(e,t)}),Cc=y("ZodReadonly",(e,t)=>{ns.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Co(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Pc(e){return new Cc({type:"readonly",innerType:e})}const Ac=y("ZodCustom",(e,t)=>{as.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ho(e,r)});function Rc(e,t={}){return Js(Ac,e,t)}function Dc(e,t){return Qs(e,t)}function Mc(e,t){return new Ec({type:"pipe",in:Do(e),out:t})}function Nc(e){return ls(Ao,e)}const xr=v({x:_().int().min(0).describe("Column offset, 0-based"),y:_().int().min(0).describe("Row offset, 0-based"),w:_().int().min(1).describe("Width in grid columns"),h:_().int().min(1).describe("Height in grid rows")}),Oc=v({id:z().describe("Unique instance id within the dashboard"),frame:z().describe("Name of a registered frame"),title:z().optional().describe(`Card title shown in the frame's chrome. Overrides the default (the frame type name) — set a meaningful per-instance label, e.g. the ticker on a price-chart ("TSLA"). Ignored by chrome-less frames like heading.`),position:xr,layouts:yr(z(),xr).optional().describe('Per-mode layout overrides keyed by grid.mode (e.g. "flow-horizontal"). `position` is the canonical flow-vertical layout; this holds the other modes\' placements so each layout mode keeps its own independent arrangement. Editor-managed — agents only need to set `position`.'),config:yr(z(),St()).default({}).describe("Frame config; validated against the frame's own schema at render time")}),Ic=v({type:N(["none","color","gradient","unicorn"]).default("none").describe("Background style: 'none' (the signature dark indigo glow — the default), 'color' (a solid colour), 'gradient' (a custom two-colour linear gradient), or 'unicorn' (an animated Unicorn Studio scene)."),color:z().default("#0a0a12").describe("Solid background colour (any CSS colour). Used when type is 'color'."),gradientFrom:z().default("#1b1e4d").describe("Gradient start colour. Used when type is 'gradient'."),gradientTo:z().default("#07070c").describe("Gradient end colour. Used when type is 'gradient'."),gradientAngle:_().min(0).max(360).default(160).describe("Gradient angle in degrees (0 = upward, 90 = rightward, 180 = downward). Used when type is 'gradient'."),projectId:z().optional().describe("Unicorn Studio public project id — required when type is 'unicorn'."),scale:_().min(.1).max(2).default(1).describe("Unicorn scene render scale."),dpi:_().min(.5).max(3).default(1.5).describe("Unicorn scene device-pixel-ratio cap (perf vs sharpness)."),opacity:_().min(0).max(1).default(.16).describe("Opacity of the unicorn scene (0–1). Keep moderate (~0.15) so the animation reads as a living backdrop in the gutters without competing with the (opaque) dashboard cards.")}).describe("Visual background rendered behind the whole dashboard."),$c=v({accentHue:_().int().min(0).max(360).default(242).describe("Brand accent hue in degrees on the HSL color wheel (0–360). Rotates the dashboard's accent — card rims, title dots, chart highlights, loading states — across the spectrum. 242 is the default zframes indigo; rough anchors: 0 red, 35 orange, 50 amber, 150 green, 190 teal, 210 blue, 280 violet, 330 pink. Semantic up/down green/red, asset logos, and per-frame chart colors stay fixed."),accentSat:_().min(0).max(100).default(90).describe("Accent saturation as an HSL percentage (0–100). 90 is the default vivid zframes accent; lower it for muted/pastel rims and dots, 0 for a near-grayscale monochrome accent. Pairs with accentHue — hue picks the color, saturation picks how vivid it is."),baseHue:_().int().min(0).max(360).default(233).describe("Hue of the dark card surface itself, in degrees (0–360). 233 is the default near-black indigo-navy; rotate it to re-temperature every card — e.g. 30 warms toward charcoal-brown, 150 toward deep forest, 210 toward cool slate. The surface stays dark (lightness is fixed); only its tint moves. Independent of accentHue, which only colours rims/highlights."),baseSat:_().min(0).max(100).default(20).describe("Saturation of the dark card surface as an HSL percentage (0–100). 20 is the default subtle navy tint; raise it for a richer coloured-black surface, drop it toward 0 for a neutral graphite/black with no colour cast. Pairs with baseHue."),upColor:z().regex(/^#[0-9a-fA-F]{6}$/,"must be a 6-digit hex colour like #3fd08f").default("#3fd08f").describe("Semantic colour for gains / positive change / bullish (up). 6-digit hex; default #3fd08f (green). Tints every gain delta, mover row, up-candle, and 'long'/'call' marker. Set this and downColor to a non-green/red pair (e.g. blue/orange) for a colourblind-friendly dashboard. Distinct from the accent (which is brand colour, not meaning) and from the error red."),downColor:z().regex(/^#[0-9a-fA-F]{6}$/,"must be a 6-digit hex colour like #ff6b81").default("#ff6b81").describe("Semantic colour for losses / negative change / bearish (down). 6-digit hex; default #ff6b81 (red). The counterpart to upColor — tints every loss delta, mover row, down-candle, and 'short'/'put' marker.")}).describe("Dashboard-wide colour identity — accent (rims/highlights), the dark card-surface tint (base), and the semantic up/down (gain/loss) colours."),Fc=v({fontFamily:N(["sans","mono","serif"]).default("sans").describe("Type family for all dashboard text. 'sans' is the default DM Sans (clean, modern); 'mono' switches to a monospaced system stack (a Bloomberg/terminal feel, numbers in fixed columns); 'serif' uses a system serif (editorial). Affects card titles, labels, and readouts alike."),numericStyle:N(["proportional","tabular"]).default("proportional").describe("How digits are spaced everywhere on the dashboard. 'proportional' is the default (natural widths); 'tabular' forces fixed-width figures (font-variant-numeric: tabular-nums) so live prices and tickers stop shifting sideways as digits change — recommended for number-dense dashboards. Hero stat numerals are always tabular regardless."),scale:_().min(.85).max(1.25).default(1).describe("Global text-size multiplier (0.85–1.25). 1 is the default. Scales all dashboard text together by setting the root font size, so chart labels, readouts, and titles grow or shrink as one — raise it for legibility on a large display, lower it to pack more in. Distinct from appearance.density, which scales card padding, not text. Grid cell heights are in pixels and stay fixed, so text can overflow a small card at high scale.")}).describe("Dashboard-wide typography — font family, numeric digit style, and global text scale."),Lc={sans:'"DM Sans", sans-serif',mono:'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace',serif:'ui-serif, Georgia, "Times New Roman", serif'},jc={proportional:"normal",tabular:"tabular-nums"},Uc=v({radius:_().min(0).default(18).describe("Frame corner radius in pixels, applied to every card via --zf-frame-radius. 0 squares the corners; the editor's Appearance rail exposes this as a slider."),borderStrength:_().min(0).max(1).default(.22).describe("Opacity of each card's accent rim (0–1) via --zf-border-alpha. 0 = borderless flat cards, 1 = a solid outlined rim; 0.22 is the default soft edge. Hover lifts it a notch automatically."),surfaceOpacity:_().min(.3).max(1).default(1).describe("Opacity of the card surface (0.3–1) via --zf-surface-opacity. 1 = opaque cards (default); lower it toward 0.5 for frosted/glassy cards that let the dashboard background show through. Kept ≥0.3 so card content stays legible."),density:_().min(.6).max(1.4).default(1).describe("Card padding scale (0.6–1.4) via --zf-density. 1 = the comfortable default; <1 tightens padding for information-dense dashboards, >1 gives roomier breathing space."),elevation:_().min(0).max(2).default(1).describe("Card shadow depth (0–2) via --zf-elevation. 0 = flat (no drop shadow), 1 = the default resting shadow, 2 = a heavier floating lift. Scales the card's drop shadow only.")}).describe("Card surface treatment — corners, border, opacity, padding density, and shadow depth. Distinct from `grid` (geometry) and `theme` (accent color)."),Bc=Mc(e=>{if(!e||typeof e!="object")return e;let t=e;const r=t.grid;if(r&&typeof r=="object"&&"radius"in r){const{radius:n,...a}=r;t={...t,grid:a,appearance:{radius:n,...t.appearance??{}}}}const o=t.background;return o&&typeof o=="object"&&o.type==="gradient"&&!("gradientFrom"in o)&&(t={...t,background:{...o,type:"none"}}),t},v({version:Nc().default("1.0.0").describe('Spec version, a semver-style string like package.json\'s ("1.0.0"). A legacy numeric `1` from an older spec is coerced to "1".'),title:z().describe("Dashboard name, like package.json's name."),author:z().optional().describe(`Who made this dashboard — a free-form credit, like package.json's author ("You" or "You <you@example.com>"). Optional.`),grid:v({mode:N(["flow-vertical","flow-horizontal","canvas"]).default("flow-vertical").describe("Layout model. 'flow-vertical' (default): a fixed number of columns fill the viewport width; the board grows downward and scrolls vertically — the classic dashboard. 'flow-horizontal': a fixed number of rows fill the viewport height; the board grows rightward and scrolls horizontally — suited to ultrawide and wall displays. 'canvas': an unbounded pan/zoom plane (not yet implemented; rendered as flow-vertical for now)."),columns:_().int().min(1).default(12).describe("Number of columns the grid is divided into across the viewport width (flow-vertical). A frame's `position` x/w are in these column units."),rowHeight:_().min(8).default(96).describe("Pixel height of each grid row (flow-vertical). A frame's `position` y/h are in these row units."),rows:_().int().min(1).default(6).describe('Number of height-bounded rows the horizontal board (flow-horizontal) fills before it scrolls sideways. A frame\'s `layouts["flow-horizontal"]` y/h are in these row units. Ignored in flow-vertical.'),gap:_().min(0).default(12).describe("Pixels of space between frames (the grid gutter). 0 makes the cards flush; the editor's Layout rail exposes this as a slider.")}).default({mode:"flow-vertical",columns:12,rowHeight:96,rows:6,gap:12}),background:Ic.default({type:"none",color:"#0a0a12",gradientFrom:"#1b1e4d",gradientTo:"#07070c",gradientAngle:160,scale:1,dpi:1.5,opacity:.16}),theme:$c.default({accentHue:242,accentSat:90,baseHue:233,baseSat:20,upColor:"#3fd08f",downColor:"#ff6b81"}),typography:Fc.default({fontFamily:"sans",numericStyle:"proportional",scale:1}),appearance:Uc.default({radius:18,borderStrength:.22,surfaceOpacity:1,density:1,elevation:1}),frames:B(Oc)})),Io=b.createContext([]);function Vc({providers:e,children:t}){const r=Array.isArray(e)?e:[e];return p.jsx(Io.Provider,{value:r,children:t})}function ct(){return b.useContext(Io)}function R(e){return ct().find(r=>r.capabilities.includes(e))??null}function D(e,t,r,o){const[n,a]=b.useState(t),[s,i]=b.useState(!0);return b.useEffect(()=>{if(!e){i(!1);return}let c=!1;a(t),i(!0);const l=()=>{e().then(d=>{c||(a(d),i(!1))}).catch(()=>{c||i(!1)})};l();let u;const f=()=>{u=setTimeout(()=>{l(),f()},o*(.85+Math.random()*.3))};return f(),()=>{c=!0,clearTimeout(u)}},r),{data:n,isLoading:s}}function Hc(e){const t=R("quote-stream"),[r,o]=b.useState({}),[n,a]=b.useState(!0),s=e.join(",");return b.useEffect(()=>{const i=s.split(",").filter(Boolean);if(o({}),!(t!=null&&t.subscribeMids)||i.length===0){a(!1);return}let c=!1,l=!1;a(!0);const u=setTimeout(()=>{!c&&!l&&a(!1)},8e3),f=t.subscribeMids(d=>{c||(l=!0,clearTimeout(u),a(!1),o(m=>{let h=!1;const g={};for(const S of i){const k=d[S];k!==void 0&&(g[S]=k,k!==m[S]&&(h=!0))}return Object.keys(m).length!==Object.keys(g).length&&(h=!0),h?g:m}))},i);return()=>{c=!0,clearTimeout(u),f()}},[t,s]),{mids:r,isLoading:n}}function Um(e){return Hc(e).mids}function Zc(e,t=3e4){const r=R("day-stats"),o=e?e.join(","):"*",n=o==="*"?void 0:o.split(",").filter(Boolean),{data:a,isLoading:s}=D(r!=null&&r.getDayStats?()=>r.getDayStats(n):null,{},[r,o,t],t);return{stats:a,isLoading:s}}function _r(e,t=3e4){return Zc(e,t).stats}function Bm(e,t,r=5*6e4){const o=R("funding-history"),n=e.join(","),a=n.split(",").filter(Boolean),{data:s,isLoading:i}=D(o!=null&&o.getFundingHistory&&a.length>0?()=>o.getFundingHistory(a,t):null,{},[o,n,t,r],r);return{history:s,isLoading:i}}function Vm(e,t,r,o=6e4){const n=R("ohlcv"),{data:a,isLoading:s}=D(n!=null&&n.getCandles&&e?()=>n.getCandles(e,t,r):null,[],[n,e,t,r,o],o);return{candles:a,isLoading:s}}function Hm(e,t,r,o=6e4){const n=R("ohlcv"),a=e.join(","),s=a.split(",").filter(Boolean),{data:i,isLoading:c}=D(n!=null&&n.getCandles&&s.length>0?async()=>{const l=await Promise.all(s.map(u=>n.getCandles(u,t,r).then(f=>[u,f]).catch(()=>[u,[]])));return Object.fromEntries(l)}:null,{},[n,a,t,r,o],o);return{candles:i,isLoading:c}}function Zm(e=10*6e4){const t=R("tvl"),{data:r,isLoading:o}=D(t!=null&&t.getTvlByChain?()=>t.getTvlByChain():null,[],[t,e],e);return{entries:r,isLoading:o}}function Ym(e=10*6e4){const t=R("dex-volume"),{data:r,isLoading:o}=D(t!=null&&t.getDexVolume?()=>t.getDexVolume():null,[],[t,e],e);return{entries:r,isLoading:o}}function Wm(e,t=5*6e4){const r=R("dex-volume"),o=e.join(","),n=o.split(",").filter(Boolean),{data:a,isLoading:s}=D(r!=null&&r.getDexVolumeHistory&&n.length>0?()=>r.getDexVolumeHistory(n):null,{},[r,o,t],t);return{history:a,isLoading:s}}function Gm(e=10*6e4){const t=R("protocol-tvl"),{data:r,isLoading:o}=D(t!=null&&t.getProtocolTvl?()=>t.getProtocolTvl():null,[],[t,e],e);return{entries:r,isLoading:o}}function qm(e,t=5*6e4){const r=R("protocol-tvl"),o=e.join(","),n=o.split(",").filter(Boolean),{data:a,isLoading:s}=D(r!=null&&r.getProtocolTvlHistory&&n.length>0?()=>r.getProtocolTvlHistory(n):null,{},[r,o,t],t);return{history:a,isLoading:s}}function Xm(e=10*6e4){const t=R("protocol-fees"),{data:r,isLoading:o}=D(t!=null&&t.getProtocolFees?()=>t.getProtocolFees():null,[],[t,e],e);return{entries:r,isLoading:o}}function Km(e=10*6e4){const t=R("coin-markets"),{data:r,isLoading:o}=D(t!=null&&t.getCoinMarkets?()=>t.getCoinMarkets():null,[],[t,e],e);return{entries:r,isLoading:o}}function Jm(e=300,t=15*6e4){const r=R("coin-movers"),{data:o,isLoading:n}=D(r!=null&&r.getCoinMovers?()=>r.getCoinMovers(e):null,[],[r,e,t],t);return{entries:o,isLoading:n}}function Qm(e,t=3e4){const r=R("open-interest"),o=e?e.join(","):"*",n=o==="*"?void 0:o.split(",").filter(Boolean),{data:a,isLoading:s}=D(r!=null&&r.getOpenInterest?()=>r.getOpenInterest(n):null,[],[r,o,t],t);return{entries:a,isLoading:s}}function ep(e=15*6e4){const t=R("global-market"),{data:r,isLoading:o}=D(t!=null&&t.getGlobalMarket?()=>t.getGlobalMarket():null,null,[t,e],e);return{market:r,isLoading:o}}function tp(e=30,t=60*6e4){const r=R("sentiment"),{data:o,isLoading:n}=D(r!=null&&r.getFearGreed?()=>r.getFearGreed(e):null,[],[r,e,t],t);return{points:o,isLoading:n}}function rp(e=15*6e4){const t=R("reference-rates"),{data:r,isLoading:o}=D(t!=null&&t.getReferenceRates?()=>t.getReferenceRates():null,[],[t,e],e);return{rates:r,isLoading:o}}function op(e,t,r=60*6e4){const o=R("fx-rates"),n=t.join(","),{data:a,isLoading:s}=D(o!=null&&o.getFxRates?()=>o.getFxRates(e,[...t]):null,[],[o,e,n,r],r);return{rates:a,isLoading:s}}function np(e=360*6e4){const t=R("treasury-rates"),{data:r,isLoading:o}=D(t!=null&&t.getTreasuryAverageRates?()=>t.getTreasuryAverageRates():null,[],[t,e],e);return{rates:r,isLoading:o}}function ap(e=360*6e4){const t=R("yield-curve"),{data:r,isLoading:o}=D(t!=null&&t.getYieldCurve?()=>t.getYieldCurve():null,null,[t,e],e);return{curve:r,isLoading:o}}function sp(e=8,t=360*6e4){const r=R("treasury-auctions"),{data:o,isLoading:n}=D(r!=null&&r.getTreasuryAuctions?()=>r.getTreasuryAuctions(e):null,[],[r,e,t],t);return{auctions:o,isLoading:n}}function ip(e=180,t=360*6e4){const r=R("national-debt"),{data:o,isLoading:n}=D(r!=null&&r.getNationalDebt?()=>r.getNationalDebt(e):null,null,[r,e,t],t);return{debt:o,isLoading:n}}function cp(e=360*6e4){const t=R("financial-stress"),{data:r,isLoading:o}=D(t!=null&&t.getFinancialStress?()=>t.getFinancialStress():null,null,[t,e],e);return{stress:r,isLoading:o}}function lp(e,t,r,o=720*6e4){const n=R("macro-series"),{data:a,isLoading:s}=D(n!=null&&n.getMacroSeries&&e?()=>n.getMacroSeries(e,t,r):null,null,[n,e,t,r,o],o);return{series:a,isLoading:s}}function up(e,t=30*6e4){const r=R("filings"),{data:o,isLoading:n}=D(r!=null&&r.getCompanyFilings&&e?()=>r.getCompanyFilings(e):null,null,[r,e,t],t);return{data:o,isLoading:n}}function dp(e,t=720*6e4){const r=R("fundamentals"),{data:o,isLoading:n}=D(r!=null&&r.getCompanyFacts&&e?()=>r.getCompanyFacts(e):null,null,[r,e,t],t);return{data:o,isLoading:n}}function fp(e,t=360*6e4){const r=R("short-volume"),o=e.join(","),n=o.split(",").filter(Boolean),{data:a,isLoading:s}=D(r!=null&&r.getShortVolume&&n.length>0?()=>r.getShortVolume(n):null,{},[r,o,t],t);return{data:a,isLoading:s}}function mp(e,t,r,o=5*6e4){const n=R("news"),a=t?t.join(","):"",{data:s,isLoading:i}=D(n!=null&&n.getNews&&e?()=>n.getNews({feed:e,symbols:a?a.split(","):void 0,limit:r}):null,[],[n,e,a,r,o],o);return{items:s,isLoading:i}}function pp(e=3e4){const t=R("btc-fees"),{data:r,isLoading:o}=D(t!=null&&t.getBtcFees?()=>t.getBtcFees():null,null,[t,e],e);return{fees:r,isLoading:o}}function hp(e=15e3){const t=R("btc-mempool"),{data:r,isLoading:o}=D(t!=null&&t.getMempoolState?()=>t.getMempoolState():null,null,[t,e],e);return{state:r,isLoading:o}}function gp(e=8,t=3e4){const r=R("btc-blocks"),{data:o,isLoading:n}=D(r!=null&&r.getBtcBlocks?()=>r.getBtcBlocks(e):null,[],[r,e,t],t);return{blocks:o,isLoading:n}}function yp(e="1y",t=30*6e4){const r=R("btc-hashrate"),{data:o,isLoading:n}=D(r!=null&&r.getNetworkHashrate?()=>r.getNetworkHashrate(e):null,null,[r,e,t],t);return{data:o,isLoading:n}}function vp(e=6e4){const t=R("btc-difficulty"),{data:r,isLoading:o}=D(t!=null&&t.getDifficultyAdjustment?()=>t.getDifficultyAdjustment():null,null,[t,e],e);return{adjustment:r,isLoading:o}}function bp(e="1w",t=5*6e4){const r=R("mining-pools"),{data:o,isLoading:n}=D(r!=null&&r.getMiningPools?()=>r.getMiningPools(e):null,null,[r,e,t],t);return{pools:o,isLoading:n}}function wp(e=30*6e4){const t=R("lightning-stats"),{data:r,isLoading:o}=D(t!=null&&t.getLightningStats?()=>t.getLightningStats():null,null,[t,e],e);return{stats:r,isLoading:o}}function xp(e,t=5*6e4){const r=R("options-summary"),o=(e||"BTC").toUpperCase(),{data:n,isLoading:a}=D(r!=null&&r.getOptionsSummary?()=>r.getOptionsSummary(o):null,null,[r,o,t],t);return{summary:n,isLoading:a}}function _p(e,t=6e4){const r=ct(),o=e?r.find(i=>{var c;return!!i.getPortfolio&&i.capabilities.includes("portfolio")&&(((c=i.portfolioKinds)==null?void 0:c.includes(e.kind))??!0)})??null:null,n=e?`${e.kind}:${e.address??""}`:"",{data:a,isLoading:s}=D(o&&e?()=>o.getPortfolio(e):null,null,[o,n,t],t);return{portfolio:a,isLoading:s}}function kp(e,t,r=43200,o=10*6e4){const n=R("volatility-index"),a=(e||"BTC").toUpperCase(),{data:s,isLoading:i}=D(n!=null&&n.getVolatilityIndex?()=>n.getVolatilityIndex(a,t,r):null,[],[n,a,t,r,o],o);return{points:s,isLoading:i}}const Yc=b.createContext(null);function zp(){return b.useContext(Yc)}const Wc=`
66
- .zf-grid {
67
- display: grid;
68
- gap: var(--zf-gap, 12px);
69
- grid-template-columns: repeat(var(--zf-cols, 12), minmax(0, 1fr));
70
- grid-auto-rows: var(--zf-row-h, 96px);
71
- /* Bridge the type family onto the dashboard subtree: redefine --font-dmsans
72
- HERE (where --zf-font-family is set inline) so the chart utilities and frame
73
- titles that read var(--font-dmsans) pick up the chosen family. Declaring it
74
- on this container — not at :root — is what makes the var() substitution see
75
- the inline --zf-font-family. (The editor mirrors this on .zf-editor.) */
76
- --font-dmsans: var(--zf-font-family, "DM Sans", sans-serif);
77
- }
78
- /* flow-horizontal: the board is bounded to the viewport height as --zf-h-rows
79
- equal bands and grows rightward, scrolling sideways. The vertical position
80
- can't be honoured here (its y runs to 100+ rows), so each frame uses its own
81
- stored horizontal layout instead: the renderer emits real --zf-col/row-start
82
- for a frame that HAS a horizontal layout (explicit placement, via the base
83
- .zf-frame rule), and OMITS them for one that doesn't (the auto var-fallback)
84
- so grid-auto-flow: column dense packs it by w/h size — the fallback for
85
- un-edited / agent-generated specs. Column tracks reuse the vertical row height
86
- (--zf-row-h) so cells stay roughly square. Gated above the phone breakpoint so
87
- phones keep the single-column reflow below. */
88
- @media (min-width: 641px) {
89
- .zf-grid.zf-flow-horizontal {
90
- grid-template-columns: none;
91
- grid-template-rows: repeat(var(--zf-h-rows, 6), minmax(0, 1fr));
92
- grid-auto-flow: column dense;
93
- grid-auto-columns: var(--zf-row-h, 96px);
94
- height: var(--zf-h-height, calc(100vh - 220px));
95
- min-height: 420px;
96
- overflow-x: auto;
97
- overflow-y: hidden;
98
- align-content: stretch;
99
- }
100
- }
101
- .zf-frame {
102
- grid-column: var(--zf-col-start, auto) / span var(--zf-col-span, 1);
103
- grid-row: var(--zf-row-start, auto) / span var(--zf-row-span, 1);
104
- position: relative;
105
- display: flex;
106
- flex-direction: column;
107
- min-height: 0;
108
- /* visible (not hidden) so the hover glow on ::after can bleed past the card
109
- edge exactly like the original box-shadow did. The card itself has nothing
110
- to clip — its surface/border are rounded by border-radius, and content lives
111
- in .zf-frame-body which carries the interior clip below. */
112
- overflow: visible;
113
- padding: calc(16px * var(--zf-density, 1)) calc(18px * var(--zf-density, 1));
114
- /* Digit spacing for everything inside the card. Default \`normal\` is a no-op;
115
- spec.typography.numericStyle="tabular" sets --zf-numeric so live prices stop
116
- jittering. Hero numerals carry their own tabular-nums regardless. */
117
- font-variant-numeric: var(--zf-numeric, normal);
118
- /* Card surface. The three dark stops are expressed off --zf-base-hue /
119
- --zf-base-sat (spec.theme) with their lightness baked, so the default
120
- hsl(233 20% …) reproduces the original navy to within ~1/255, while the base
121
- knobs let the whole surface warm, cool, or desaturate toward black. */
122
- background: var(--zf-frame-bg, linear-gradient(165deg, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 12.5% / calc(0.82 * var(--zf-surface-opacity, 1))) 0%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 7% / calc(0.86 * var(--zf-surface-opacity, 1))) 60%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 5.3% / calc(0.9 * var(--zf-surface-opacity, 1))) 100%));
123
- border: 1px solid var(--zf-frame-border, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / var(--zf-border-alpha, 0.22)));
124
- border-radius: var(--zf-frame-radius, 18px);
125
- box-shadow: var(--zf-frame-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4), 0 calc(18px * var(--zf-elevation, 1)) calc(44px * var(--zf-elevation, 1)) -26px rgba(0, 0, 0, 0.9));
126
- /* Hover animates only GPU-composited properties: \`transform\` is the lift,
127
- \`border-color\` is a cheap 1px paint. The surface brightening + accent glow
128
- are deliberately NOT transitioned here — animating the gradient \`background\`
129
- and the large-blur \`box-shadow\` re-rasterized the whole translucent card
130
- every frame over the animated backdrop, which is what made the hover lag.
131
- Those now ride the opacity-faded ::after overlay defined below. */
132
- transition:
133
- border-color 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
134
- transform 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
135
- /* Frames arrive in a soft top-down cascade on first paint. The translate
136
- property (not transform) carries the motion, so the hover lift stays
137
- independent; the backwards fill holds the hidden state through the stagger
138
- delay, then hands transform back to :hover once the entrance settles. */
139
- animation: zf-enter 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
140
- animation-delay: min(calc((var(--zf-enter-i, 0) + 1) * 35ms), 350ms);
141
- }
142
- /* The brightened surface + accent glow that appear on hover live on this overlay
143
- and cross-fade via \`opacity\` (GPU-composited) instead of transitioning the
144
- card's own gradient/box-shadow — both re-rasterize the whole translucent card
145
- every frame over the animated backdrop, which is what made the hover lag. The
146
- card is overflow:visible (above), so this layer's OUTER accent shadow bleeds
147
- past the edge exactly like the original hover did; the layer paints once, then
148
- only its opacity animates. It sits above the base surface (z-index:0) and below
149
- the card content (z-index:1) so text and charts stay crisp, and keeps the
150
- --zf-frame-bg-hover override hook. Errors keep their own red hover (see
151
- .zf-frame--error), so this is the non-error path. */
152
- .zf-frame:not(.zf-frame--error)::after {
153
- content: '';
154
- position: absolute;
155
- inset: 0;
156
- z-index: 0;
157
- border-radius: inherit;
158
- pointer-events: none;
159
- opacity: 0;
160
- background: var(--zf-frame-bg-hover, linear-gradient(165deg, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 16.5% / calc(0.88 * var(--zf-surface-opacity, 1))) 0%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 9% / calc(0.9 * var(--zf-surface-opacity, 1))) 60%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 6.3% / calc(0.92 * var(--zf-surface-opacity, 1))) 100%));
161
- /* The accent half of the original hover shadow, verbatim: brighter top inner
162
- highlight, a 1px accent ring at the edge, and the soft accent glow pooling
163
- below and around the card. */
164
- box-shadow:
165
- inset 0 1px 0 rgba(255, 255, 255, 0.09),
166
- 0 0 0 1px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.12),
167
- 0 calc(20px * var(--zf-elevation, 1)) calc(60px * var(--zf-elevation, 1)) -28px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.4);
168
- transition: opacity 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
169
- }
170
- /* Hover lift is pointer-only — on touch it would stick after a tap. The lift
171
- (transform) + brighter border transition on the card itself; the surface
172
- brightening + accent glow ride the ::after overlay's opacity above. */
173
- @media (hover: hover) {
174
- .zf-frame:hover {
175
- border-color: var(--zf-frame-border-hover, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / calc(var(--zf-border-alpha, 0.22) + 0.2)));
176
- transform: translateY(-2px);
177
- }
178
- .zf-frame:not(.zf-frame--error):hover::after {
179
- opacity: 1;
180
- }
181
- }
182
- /* Top edge sheen — inset past the corner radius so the bright line never
183
- pokes outside the rounded border (which read as a clipped corner). */
184
- .zf-frame::before {
185
- content: '';
186
- position: absolute;
187
- top: 0;
188
- left: 18px;
189
- right: 18px;
190
- height: 1px;
191
- background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
192
- pointer-events: none;
193
- z-index: 2;
194
- }
195
- .zf-frame-title {
196
- position: relative;
197
- z-index: 1;
198
- display: flex;
199
- align-items: center;
200
- gap: 7px;
201
- margin-bottom: 12px;
202
- font-family: var(--font-dmsans, inherit);
203
- /* rem (not px) so spec.typography.scale — applied as the root font size by the
204
- host — grows the card title along with the rem-based chart text it sits above.
205
- 0.625rem = 10px at the default root size, so scale 1 is a no-op. */
206
- font-size: 0.625rem;
207
- font-weight: 700;
208
- letter-spacing: 0.14em;
209
- text-transform: uppercase;
210
- color: var(--zf-frame-title, rgba(255, 255, 255, 0.5));
211
- flex: none;
212
- }
213
- .zf-frame-title::before {
214
- content: '';
215
- width: 5px;
216
- height: 5px;
217
- border-radius: 9999px;
218
- background: var(--zf-frame-title-dot, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%));
219
- box-shadow: 0 0 8px var(--zf-frame-title-dot-glow, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.9));
220
- }
221
- /* A title with a leading icon (e.g. an asset logo) drops the status dot — the
222
- logo is the card's identity marker. */
223
- .zf-frame-title--icon::before { display: none; }
224
- /* The title label takes the remaining width and truncates so a long title
225
- never shoves the source credit off the card. */
226
- .zf-frame-title-text {
227
- min-width: 0;
228
- overflow: hidden;
229
- text-overflow: ellipsis;
230
- white-space: nowrap;
231
- }
232
- /* Data-source credit — a clickable provider link pinned to the right of the
233
- title row. Brand casing is preserved (text-transform reset) so DeFiLlama /
234
- alternative.me read correctly against the uppercase title. */
235
- .zf-frame-source {
236
- margin-left: auto;
237
- padding-left: 10px;
238
- display: inline-flex;
239
- align-items: center;
240
- gap: 5px;
241
- flex: none;
242
- text-transform: none;
243
- letter-spacing: 0;
244
- font-weight: 600;
245
- }
246
- .zf-frame-source a {
247
- color: var(--zf-frame-source, rgba(255, 255, 255, 0.42));
248
- text-decoration: none;
249
- transition: color 0.2s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
250
- white-space: nowrap;
251
- }
252
- @media (hover: hover) {
253
- .zf-frame-source a:hover {
254
- color: var(--zf-frame-source-hover, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 80%));
255
- text-decoration: underline;
256
- }
257
- }
258
- .zf-frame-source-sep { color: rgba(255, 255, 255, 0.22); }
259
- .zf-frame-body {
260
- position: relative;
261
- z-index: 1;
262
- flex: 1;
263
- min-height: 0;
264
- display: flex;
265
- flex-direction: column;
266
- /* Holds the interior clip the card used to own (now overflow:visible so its
267
- hover glow can escape). The body sits inside the card's padding, so its
268
- square corners fall within the rounded card and this clip is invisible —
269
- content/charts/scroll areas clip exactly as before. */
270
- overflow: hidden;
271
- }
272
- .zf-frame-body > * {
273
- flex: 1;
274
- min-height: 0;
275
- }
276
- /* ── Error cards ────────────────────────────────────────────────────────────
277
- Unknown frame / missing capability / invalid config / runtime crash all share
278
- one centered empty-state: an alert glyph, a headline naming what's wrong, the
279
- frame's name, then the specific detail. Centered (not top-left) so the card
280
- reads as a deliberate state instead of a raw debug dump floating in a void —
281
- and a faint red top-bloom signals "error" across the whole surface, not just
282
- the 1px border. This is also the generating agent's feedback surface, so the
283
- detail stays precise (field paths, the exact missing capability/provider). */
284
- .zf-frame--error {
285
- border-color: var(--zf-frame-error-border, rgba(242, 21, 83, 0.42));
286
- background: var(
287
- --zf-frame-error-bg,
288
- radial-gradient(125% 80% at 50% -12%, rgba(242, 21, 83, 0.13), transparent 60%),
289
- linear-gradient(165deg, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 12.5% / 0.82) 0%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 7% / 0.86) 60%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 5.3% / 0.9) 100%)
290
- );
291
- /* Errors are a rare state and never hover-spammed, so they keep the original
292
- background + box-shadow cross-fade (the GPU-only ::after path is reserved
293
- for the common, non-error card). */
294
- transition:
295
- border-color 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
296
- background 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
297
- box-shadow 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
298
- transform 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
299
- }
300
- @media (hover: hover) {
301
- .zf-frame--error:hover {
302
- border-color: var(--zf-frame-error-border-hover, rgba(242, 21, 83, 0.6));
303
- background: var(
304
- --zf-frame-error-bg,
305
- radial-gradient(125% 80% at 50% -12%, rgba(242, 21, 83, 0.13), transparent 60%),
306
- linear-gradient(165deg, rgba(26, 27, 38, 0.82) 0%, rgba(14, 15, 22, 0.86) 60%, rgba(10, 11, 17, 0.9) 100%)
307
- );
308
- box-shadow: var(--zf-frame-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 44px -26px rgba(0, 0, 0, 0.9)), 0 0 0 1px rgba(242, 21, 83, 0.14), 0 20px 56px -30px rgba(242, 21, 83, 0.4);
309
- }
310
- }
311
- /* The centered stack. flex:1 lets it claim the whole card; the inner content
312
- stays its natural height and is centered around the card's middle, so a 2×1
313
- card and a 6×4 card both read as composed rather than top-anchored. */
314
- .zf-error {
315
- flex: 1;
316
- min-height: 0;
317
- display: flex;
318
- flex-direction: column;
319
- align-items: center;
320
- justify-content: center;
321
- gap: 8px;
322
- padding: 4px 2px;
323
- text-align: center;
324
- overflow: auto;
325
- }
326
- .zf-error-icon {
327
- flex: none;
328
- width: 38px;
329
- height: 38px;
330
- display: grid;
331
- place-items: center;
332
- border-radius: 12px;
333
- color: var(--zf-frame-error-text, #ff8b9d);
334
- background: rgba(242, 21, 83, 0.12);
335
- box-shadow: inset 0 0 0 1px rgba(242, 21, 83, 0.32),
336
- 0 0 24px -8px rgba(242, 21, 83, 0.6);
337
- }
338
- .zf-error-icon svg {
339
- display: block;
340
- width: 20px;
341
- height: 20px;
342
- }
343
- .zf-error-headline {
344
- font-family: var(--font-dmsans, inherit);
345
- font-size: 13px;
346
- font-weight: 700;
347
- letter-spacing: 0.01em;
348
- color: var(--zf-frame-error-headline, rgba(255, 255, 255, 0.92));
349
- }
350
- .zf-error-frame {
351
- margin-top: -3px;
352
- font-size: 10px;
353
- font-weight: 700;
354
- letter-spacing: 0.14em;
355
- text-transform: uppercase;
356
- color: var(--zf-frame-error-text, #ff8b9d);
357
- }
358
- .zf-error-detail {
359
- margin: 2px 0 0;
360
- max-width: 44ch;
361
- font-size: 12px;
362
- line-height: 1.5;
363
- color: var(--zf-frame-error-detail, rgba(255, 255, 255, 0.6));
364
- }
365
- .zf-error-detail code {
366
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
367
- font-size: 0.92em;
368
- }
369
- /* Per-issue rows for invalid config: the field path as a code chip, the Zod
370
- message beside it. Block-centered but left-aligned inside, so a one-field
371
- error sits dead-centre and a multi-field one reads as a tidy list. */
372
- .zf-error-issues {
373
- list-style: none;
374
- margin: 2px 0 0;
375
- padding: 0;
376
- max-width: 100%;
377
- display: flex;
378
- flex-direction: column;
379
- gap: 6px;
380
- text-align: left;
381
- }
382
- .zf-error-issue {
383
- display: flex;
384
- flex-wrap: wrap;
385
- align-items: baseline;
386
- gap: 7px;
387
- padding: 6px 10px;
388
- border-radius: 9px;
389
- background: rgba(0, 0, 0, 0.22);
390
- border: 1px solid rgba(242, 21, 83, 0.18);
391
- }
392
- .zf-error-field {
393
- flex: none;
394
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
395
- font-size: 11px;
396
- font-weight: 700;
397
- color: var(--zf-frame-error-text, #ff8b9d);
398
- background: rgba(242, 21, 83, 0.14);
399
- padding: 1px 6px;
400
- border-radius: 5px;
401
- }
402
- .zf-error-msg {
403
- min-width: 0;
404
- font-size: 12px;
405
- line-height: 1.4;
406
- color: var(--zf-frame-error-detail, rgba(255, 255, 255, 0.68));
407
- }
408
- /* Registered-frame list under an "unknown frame" card — quiet, it's reference. */
409
- .zf-error-list {
410
- margin-top: 4px;
411
- font-size: 11px;
412
- line-height: 1.5;
413
- color: rgba(255, 255, 255, 0.4);
414
- }
415
- /* Bare frames (headings) divide a dashboard into zones — positioned slot,
416
- no card chrome, no auto-title. */
417
- .zf-bare {
418
- grid-column: var(--zf-col-start, auto) / span var(--zf-col-span, 1);
419
- grid-row: var(--zf-row-start, auto) / span var(--zf-row-span, 1);
420
- display: flex;
421
- align-items: flex-end;
422
- min-height: 0;
423
- overflow: hidden;
424
- animation: zf-enter 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
425
- animation-delay: min(calc((var(--zf-enter-i, 0) + 1) * 35ms), 350ms);
426
- }
427
- /* Phones: the absolute x/y/w grid can't shrink below ~30px columns, so collapse
428
- to a single full-width column. Frames flow in spec order and keep their row
429
- span (height), but ignore horizontal placement. */
430
- @media (max-width: 640px) {
431
- .zf-grid {
432
- grid-template-columns: 1fr;
433
- }
434
- .zf-frame,
435
- .zf-bare {
436
- grid-column: 1 / -1;
437
- grid-row: auto / span var(--zf-row-span, 1);
438
- }
439
- .zf-frame {
440
- padding: calc(12px * var(--zf-density, 1)) calc(14px * var(--zf-density, 1));
441
- }
442
- }
443
- /* Tablets / small laptops (641-1023px): the absolute grid built for --zf-cols
444
- columns is too tight here, but a single column wastes the width. Reflow the
445
- vertical board to two columns — frames auto-place in spec order (dense, so
446
- gaps backfill), keep their row span, and a frame that spanned at least half
447
- the design grid takes both columns (--zf-col-span-sm = 2, set by the
448
- renderer), everything else takes one. flow-horizontal is excluded: it keeps
449
- its own ≥641px side-scroller. Above 1023px the editable GridStack takes over
450
- (editing is desktop-only) and the read-only renderer is only the fallback. */
451
- @media (min-width: 641px) and (max-width: 1023px) {
452
- .zf-grid:not(.zf-flow-horizontal) {
453
- grid-template-columns: repeat(2, minmax(0, 1fr));
454
- grid-auto-flow: row dense;
455
- }
456
- .zf-grid:not(.zf-flow-horizontal) .zf-frame,
457
- .zf-grid:not(.zf-flow-horizontal) .zf-bare {
458
- grid-column: auto / span var(--zf-col-span-sm, 1);
459
- grid-row: auto / span var(--zf-row-span, 1);
460
- }
461
- }
462
- @keyframes zf-enter {
463
- from { opacity: 0; translate: 0 10px; }
464
- to { opacity: 1; translate: 0 0; }
465
- }
466
- /* Reduced-motion entrance: same timing + stagger, but a plain fade with no
467
- positional movement (motion is what triggers vestibular discomfort). */
468
- @keyframes zf-fade {
469
- from { opacity: 0; }
470
- to { opacity: 1; }
471
- }
472
- @media (prefers-reduced-motion: reduce) {
473
- .zf-frame,
474
- .zf-bare {
475
- animation-name: zf-fade;
476
- }
477
- .zf-frame:hover {
478
- transform: none;
479
- }
480
- }
481
- /* Suspense fallback while a frame's component chunk loads (lazy registry). A
482
- quiet pulsing fill sized to the card body — no layout shift since the grid
483
- item already holds its slot. */
484
- .zf-frame-skeleton {
485
- width: 100%;
486
- height: 100%;
487
- border-radius: 8px;
488
- background: rgba(255, 255, 255, 0.05);
489
- animation: zf-skeleton-pulse 1.2s ease-in-out infinite;
490
- }
491
- @keyframes zf-skeleton-pulse {
492
- 0%, 100% { opacity: 0.45; }
493
- 50% { opacity: 0.85; }
494
- }
495
- @media (prefers-reduced-motion: reduce) {
496
- .zf-frame-skeleton { animation: none; }
497
- }
498
- `,$o=()=>p.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"}),p.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),p.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});function gt({outerClassName:e,style:t,headline:r,frame:o,children:n}){return p.jsx("div",{className:e,style:t,children:p.jsxs("div",{className:"zf-error",children:[p.jsx("span",{className:"zf-error-icon",children:p.jsx($o,{})}),p.jsx("div",{className:"zf-error-headline",children:r}),p.jsx("div",{className:"zf-error-frame",children:o}),n]})})}function Gc({sources:e}){return e.length===0?null:p.jsx("span",{className:"zf-frame-source",children:e.map((t,r)=>p.jsxs(b.Fragment,{children:[r>0&&p.jsx("span",{className:"zf-frame-source-sep",children:"·"}),p.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer noopener",title:`Data source: ${t.name}`,onMouseDown:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),children:t.name})]},t.url))})}class kr extends b.Component{constructor(){super(...arguments);E(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?p.jsxs("div",{className:"zf-error",children:[p.jsx("span",{className:"zf-error-icon",children:p.jsx($o,{})}),p.jsx("div",{className:"zf-error-headline",children:"Frame crashed"}),p.jsx("p",{className:"zf-error-detail",children:this.state.error.message})]}):this.props.children}}function qc({instance:e,registry:t,style:r,className:o=""}){const n=ct(),a=t.get(e.frame),s=(...m)=>m.filter(Boolean).join(" ");if(!a)return p.jsxs(gt,{outerClassName:s("zf-frame","zf-frame--error",o),style:r,headline:"Unknown frame",frame:e.frame,children:[p.jsxs("p",{className:"zf-error-detail",children:[p.jsx("code",{children:e.frame})," isn’t a registered frame."]}),p.jsxs("p",{className:"zf-error-list",children:["Available: ",[...t.keys()].join(", ")]})]});const i=new Set(n.flatMap(m=>[...m.capabilities])),c=a.capabilities.filter(m=>!i.has(m));if(c.length>0)return p.jsx(gt,{outerClassName:s("zf-frame","zf-frame--error",o),style:r,headline:"No data source",frame:e.frame,children:p.jsxs("p",{className:"zf-error-detail",children:["No registered provider supplies"," ",c.map((m,h)=>p.jsxs(b.Fragment,{children:[h>0&&", ",p.jsx("code",{children:m})]},m)),"."]})});const l=a.schema.safeParse(e.config);if(!l.success)return p.jsx(gt,{outerClassName:s("zf-frame","zf-frame--error",o),style:r,headline:"Invalid configuration",frame:e.frame,children:p.jsx("ul",{className:"zf-error-issues",children:l.error.issues.map((m,h)=>p.jsxs("li",{className:"zf-error-issue",children:[p.jsx("code",{className:"zf-error-field",children:m.path.join(".")||"(root)"}),p.jsx("span",{className:"zf-error-msg",children:m.message.replace(/^Invalid input:\s*/i,"")})]},h))})});const u=a.component,f=a.titleIcon,d=a.source?Array.isArray(a.source)?a.source:[a.source]:[];return a.chrome==="bare"?p.jsx("div",{className:s("zf-bare",o),style:r,children:p.jsx(kr,{children:p.jsx(b.Suspense,{fallback:null,children:p.jsx(u,{config:l.data})})})}):p.jsxs("div",{className:s("zf-frame",o),style:r,children:[p.jsxs("div",{className:s("zf-frame-title",f?"zf-frame-title--icon":""),children:[f?p.jsx(b.Suspense,{fallback:null,children:p.jsx(f,{config:l.data})}):null,p.jsx("span",{className:"zf-frame-title-text",children:e.title??e.frame.replace(/-/g," ")}),p.jsx(Gc,{sources:d})]}),p.jsx("div",{className:"zf-frame-body",children:p.jsx(kr,{children:p.jsx(b.Suspense,{fallback:p.jsx("div",{className:"zf-frame-skeleton"}),children:p.jsx(u,{config:l.data})})})})]})}function Xc(e,t,r,o,n){var u;const a={"--zf-enter-i":t,"--zf-col-span-sm":e.position.w>=n/2?2:1};if(r){const f=(u=e.layouts)==null?void 0:u["flow-horizontal"];return f?{...a,"--zf-col-start":f.x+1,"--zf-col-span":f.w,"--zf-row-start":f.y+1,"--zf-row-span":Math.min(f.h,o)}:{...a,"--zf-col-span":e.position.w,"--zf-row-span":Math.min(e.position.h,o)}}const{x:s,y:i,w:c,h:l}=e.position;return{...a,"--zf-col-start":s+1,"--zf-col-span":c,"--zf-row-start":i+1,"--zf-row-span":l}}function zr({spec:e,registry:t}){const r=e.grid.mode==="flow-horizontal";return p.jsxs(p.Fragment,{children:[p.jsx("style",{children:Wc}),p.jsx("div",{className:r?"zf-grid zf-flow-horizontal":"zf-grid",style:{"--zf-cols":e.grid.columns,"--zf-row-h":`${e.grid.rowHeight}px`,"--zf-h-rows":e.grid.rows,"--zf-gap":`${e.grid.gap}px`,"--zf-accent-hue":e.theme.accentHue,"--zf-accent-sat":`${e.theme.accentSat}%`,"--zf-base-hue":e.theme.baseHue,"--zf-base-sat":`${e.theme.baseSat}%`,"--zf-up":e.theme.upColor,"--zf-down":e.theme.downColor,"--zf-font-family":Lc[e.typography.fontFamily],"--zf-numeric":jc[e.typography.numericStyle],"--zf-frame-radius":`${e.appearance.radius}px`,"--zf-border-alpha":e.appearance.borderStrength,"--zf-surface-opacity":e.appearance.surfaceOpacity,"--zf-density":e.appearance.density,"--zf-elevation":e.appearance.elevation},children:e.frames.map((o,n)=>p.jsx(qc,{instance:o,registry:t,style:Xc(o,n,r,e.grid.rows,e.grid.columns)},o.id))})]})}const Kc="/__zframes/dashboard.json",Jc="/__zframes/dashboard",Qc="/__zframes/dashboards",el="/__zframes/switch",tl="/__zframes/proxy",rl="/__zframes/account/portfolio",Sp="/__zframes/account/credentials",ol="/__zframes/agents",nl="/__zframes/ask";class O{constructor(t){E(this,"entries",new Map);E(this,"inflight",new Map);E(this,"namespace");E(this,"ttlMs");E(this,"persist");E(this,"staleOnError");E(this,"revive");this.namespace=t.namespace,this.ttlMs=t.ttlMs,this.persist=t.persist??!1,this.staleOnError=t.staleOnError??!0,this.revive=t.revive}get(t,r){const o=this.read(t);if(o&&Date.now()-o.at<this.ttlMs)return Promise.resolve(o.value);const n=this.inflight.get(t);if(n)return n;const a=r().then(s=>(this.write(t,s),s)).catch(s=>{if(this.staleOnError&&o)return o.value;throw s}).finally(()=>{this.inflight.delete(t)});return this.inflight.set(t,a),a}read(t){const r=this.entries.get(t);if(r)return r;if(!this.persist||typeof localStorage>"u")return null;try{const o=localStorage.getItem(this.storageKey(t));if(!o)return null;const n=JSON.parse(o);if(typeof(n==null?void 0:n.at)!="number")return null;let a;if(this.revive){const i=this.revive(n.value);if(i===null)return null;a=i}else a=n.value;const s={at:n.at,value:a};return this.entries.set(t,s),s}catch{return null}}write(t,r){const o={at:Date.now(),value:r};if(this.entries.set(t,o),!(!this.persist||typeof localStorage>"u"))try{localStorage.setItem(this.storageKey(t),JSON.stringify(o))}catch{}}storageKey(t){return`${this.namespace}:${t}`}}const al=1e4,sl="zframes (+https://github.com/zentryhq/zframes)";async function Fo(e,{timeoutMs:t=al,init:r,proxied:o}){const n=new Headers(r==null?void 0:r.headers);typeof document>"u"&&!n.has("User-Agent")&&n.set("User-Agent",sl);const a=o&&typeof document<"u"?`${tl}?url=${encodeURIComponent(e)}`:e,s=await fetch(a,{...r,headers:n,signal:(r==null?void 0:r.signal)??AbortSignal.timeout(t)});if(!s.ok)throw new Error(`${e} failed: ${s.status}`);return s}async function I(e,t,r={}){const n=await(await Fo(e,r)).json();return t?t.parse(n):n}async function Le(e,t={}){return(await Fo(e,t)).text()}const il="https://api.alternative.me/fng/",cl=new O({namespace:"zframes:alternativeme:fng",ttlMs:45*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});class ll{constructor(){E(this,"name","alternative.me");E(this,"capabilities",["sentiment"])}async getFearGreed(t=30){return cl.get(String(t),async()=>{const r=await I(`${il}?limit=${t}`);if(!Array.isArray(r==null?void 0:r.data))throw new Error("alternative.me fng: unexpected response shape");return r.data.map(o=>({value:Number(o.value),classification:o.value_classification??"",time:Number(o.timestamp)*1e3})).filter(o=>Number.isFinite(o.value)&&Number.isFinite(o.time))})}}const ul=new O({namespace:"zframes:binance:portfolio",ttlMs:45e3,persist:!1});class dl{constructor(){E(this,"name","Binance");E(this,"capabilities",["portfolio"]);E(this,"portfolioKinds",["binance"])}async getPortfolio(t){if(t.kind!=="binance")throw new Error(`BinanceProvider can't serve source: ${t.kind}`);return ul.get("binance",async()=>{const r=await fetch(`${rl}?source=binance`,{headers:{accept:"application/json"}});if(r.status===401)throw new Error("binance: not connected");if(!r.ok)throw new Error(`binance portfolio relay ${r.status}`);return await r.json()})}}const fl="https://api.bls.gov/publicAPI/v2/timeseries/data/",ml={CUUR0000SA0:"CPI-U all items",LNS14000000:"Unemployment rate",CES0000000001:"Nonfarm payrolls",CES0500000003:"Avg hourly earnings",LNS11300000:"Labor force participation"};function pl(e){const t=Number(e);return Number.isFinite(t)?t:null}function hl(e,t){const r=/^M(0[1-9]|1[0-2])$/.exec(t??""),o=Number(e);if(!r||!Number.isFinite(o))return null;const n=Number(r[1]);return Date.UTC(o,n-1,1)}function gl(e){return new Intl.DateTimeFormat("en-US",{month:"short",year:"numeric",timeZone:"UTC"}).format(e)}const yl=new O({namespace:"zframes:macro",ttlMs:360*6e4,persist:!0,revive:e=>e&&Array.isArray(e.points)?e:null});class vl{constructor(){E(this,"name","bls");E(this,"capabilities",["macro-series"])}async getMacroSeries(t,r,o){return yl.get(`${t}:${r}:${o}`,()=>this.fetchMacroSeries(t,r,o))}async fetchMacroSeries(t,r,o){var c,l,u;const n=`${fl}${encodeURIComponent(t)}?startyear=${r}&endyear=${o}`,a=await I(n);if(a.status!=="REQUEST_SUCCEEDED")throw new Error(`bls series ${t}: ${((c=a.message)==null?void 0:c.join(", "))||"request failed"}`);const s=(u=(l=a.Results)==null?void 0:l.series)==null?void 0:u[0];if(!(s!=null&&s.data))throw new Error("bls series: unexpected response shape");const i=s.data.map(f=>{const d=pl(f.value),m=hl(f.year,f.period);return d===null||m===null?null:{time:m,date:gl(m),value:d,period:`${f.year}-${f.period}`}}).filter(f=>f!==null).sort((f,d)=>f.time-d.time);return{seriesId:s.seriesID??t,label:ml[t]??t,source:"BLS",points:i}}}const bl="https://api.coingecko.com/api/v3/global",wl="https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=50&page=1&sparkline=false&price_change_percentage=24h",xl=new O({namespace:"zframes:coingecko:global",ttlMs:12*6e4,persist:!0}),_l=new O({namespace:"zframes:coingecko:markets",ttlMs:10*6e4,persist:!0});class kl{constructor(){E(this,"name","coingecko");E(this,"capabilities",["global-market","coin-markets"])}async getGlobalMarket(){return xl.get("global",async()=>{var o;const t=await I(bl);if(!((o=t==null?void 0:t.data)!=null&&o.total_market_cap)||!t.data.market_cap_percentage)throw new Error("coingecko global: unexpected response shape");const r=Number(t.data.market_cap_change_percentage_24h_usd);return{totalMarketCapUsd:t.data.total_market_cap.usd??0,marketCapChangePct24h:Number.isFinite(r)?r:0,dominance:t.data.market_cap_percentage}})}async getCoinMarkets(){return _l.get("markets",async()=>{const t=await I(wl);if(!Array.isArray(t))throw new Error("coingecko markets: unexpected response shape");return t.filter(r=>Number.isFinite(r.market_cap)&&r.market_cap>0).map(r=>({symbol:(r.symbol??"").toUpperCase(),name:r.name,marketCapUsd:r.market_cap,changePct24h:Number.isFinite(r.price_change_percentage_24h)?r.price_change_percentage_24h:void 0}))})}}const zl=300,Sl=e=>`https://api.coinpaprika.com/v1/tickers?quotes=USD&limit=${e}`,Tl=new O({namespace:"zframes:coinpaprika:movers",ttlMs:12*6e4,persist:!0}),We=e=>Number.isFinite(e)?e:0;class El{constructor(){E(this,"name","coinpaprika");E(this,"capabilities",["coin-movers"])}async getCoinMovers(t=zl){return Tl.get(`movers:${t}`,async()=>{const r=await I(Sl(t));if(!Array.isArray(r))throw new Error("coinpaprika tickers: unexpected response shape");return r.filter(o=>{var n;return((n=o==null?void 0:o.quotes)==null?void 0:n.USD)&&Number.isFinite(o.quotes.USD.price)}).map(o=>{const n=o.quotes.USD;return{symbol:(o.symbol??"").toUpperCase(),name:o.name,rank:o.rank,priceUsd:n.price,marketCapUsd:n.market_cap,volume24hUsd:n.volume_24h,changePct:{"1h":We(n.percent_change_1h),"24h":We(n.percent_change_24h),"7d":We(n.percent_change_7d),"30d":We(n.percent_change_30d)}}})})}}const Cl="https://api.llama.fi/v2/chains",Pl="https://api.llama.fi/overview/dexs",Al="https://api.llama.fi/overview/fees",Rl="https://api.llama.fi/protocols",lt=8*6e4,Lo=30*6e4,Dl=new O({namespace:"zframes:defillama:tvl",ttlMs:lt}),Ml=new O({namespace:"zframes:defillama:dex-volume",ttlMs:lt}),Nl=new O({namespace:"zframes:defillama:protocol-tvl",ttlMs:lt}),Ol=new O({namespace:"zframes:defillama:protocol-fees",ttlMs:lt}),Il=new O({namespace:"zframes:defillama:dex-history",ttlMs:Lo}),$l=new O({namespace:"zframes:defillama:protocol-history",ttlMs:Lo}),Sr=e=>[...e].sort().join(",");function Fl(e){return Array.isArray(e)?e.map(([t,r])=>({time:t*1e3,value:Number(r)})).filter(t=>Number.isFinite(t.time)&&Number.isFinite(t.value)):[]}const yt=e=>Number.isFinite(e)?e:void 0;class Ll{constructor(){E(this,"name","defillama");E(this,"capabilities",["tvl","dex-volume","protocol-tvl","protocol-fees"])}async getTvlByChain(){return Dl.get("chains",async()=>{const t=await I(Cl);if(!Array.isArray(t))throw new Error("defillama chains: unexpected response shape");return t.filter(r=>Number.isFinite(r.tvl)&&r.tvl>0).sort((r,o)=>o.tvl-r.tvl).map(r=>({name:r.name,tvl:r.tvl}))})}async getDexVolume(){return Ml.get("overview",async()=>{const t=await I(Pl),r=t==null?void 0:t.protocols;if(!Array.isArray(r))throw new Error("defillama dexs: unexpected response shape");return r.filter(o=>Number.isFinite(o.total24h)&&(o.total24h??0)>0).map(o=>({name:o.name,volume24h:o.total24h,changePct:yt(o.change_1d)})).sort((o,n)=>n.volume24h-o.volume24h)})}async getDexVolumeHistory(t){return Il.get(Sr(t),async()=>{const r=await Promise.all(t.map(o=>I(`https://api.llama.fi/summary/dexs/${encodeURIComponent(o)}?excludeTotalDataChartBreakdown=true`).then(n=>[o,Fl(n.totalDataChart)]).catch(()=>[o,[]])));return Object.fromEntries(r)})}async getProtocolTvl(){return Nl.get("overview",async()=>{const t=await I(Rl);if(!Array.isArray(t))throw new Error("defillama protocols: unexpected response shape");return t.filter(r=>Number.isFinite(r.tvl)&&(r.tvl??0)>0).map(r=>({name:r.name,tvl:r.tvl,category:r.category,changePct:yt(r.change_1d)})).sort((r,o)=>o.tvl-r.tvl)})}async getProtocolTvlHistory(t){return $l.get(Sr(t),async()=>{const r=await Promise.all(t.map(o=>I(`https://api.llama.fi/protocol/${encodeURIComponent(o)}`).then(n=>[o,(n.tvl??[]).map(a=>({time:a.date*1e3,value:Number(a.totalLiquidityUSD)})).filter(a=>Number.isFinite(a.time)&&Number.isFinite(a.value))]).catch(()=>[o,[]])));return Object.fromEntries(r)})}async getProtocolFees(){return Ol.get("overview",async()=>{const t=await I(Al),r=t==null?void 0:t.protocols;if(!Array.isArray(r))throw new Error("defillama fees: unexpected response shape");return r.filter(o=>Number.isFinite(o.total24h)&&(o.total24h??0)>0).map(o=>({name:o.name,fees24h:o.total24h,changePct:yt(o.change_1d)})).sort((o,n)=>n.fees24h-o.fees24h)})}}const Tr="https://www.deribit.com/api/v2/public",jl=new O({namespace:"zframes:deribit:summary",ttlMs:4*6e4,persist:!0}),Ul=new O({namespace:"zframes:deribit:dvol",ttlMs:9*6e4,persist:!0}),Bl={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},Vl=/^[A-Z]+-(\d{1,2}[A-Z]{3}\d{2})-(\d+(?:\.\d+)?)-([CP])$/;function Hl(e){const t=/^(\d{1,2})([A-Z]{3})(\d{2})$/.exec(e);if(!t)return Number.POSITIVE_INFINITY;const r=Number(t[1]),o=Bl[t[2]],n=2e3+Number(t[3]);return o===void 0?Number.POSITIVE_INFINITY:Date.UTC(n,o,r,8,0,0)}class Zl{constructor(){E(this,"name","deribit");E(this,"capabilities",["options-summary","volatility-index"])}async getOptionsSummary(t){const r=t.toUpperCase();return jl.get(r,async()=>{const o=await I(`${Tr}/get_book_summary_by_currency?currency=${r}&kind=option`),n=o==null?void 0:o.result;if(!Array.isArray(n)||n.length===0)throw new Error("deribit options: unexpected response shape");let a=0,s=0,i=0,c=0,l=0,u=0,f=0;const d=new Map;for(const k of n){const P=Vl.exec(k.instrument_name);if(!P)continue;const[,L,Y,X]=P,$=Number(Y),M=k.open_interest??0,G=k.volume??0,oe=X==="C";oe?(a+=M,i+=G):(s+=M,c+=G),Number.isFinite(k.mark_iv)&&M>0&&(l+=k.mark_iv*M,u+=M),!f&&Number.isFinite(k.underlying_price)&&(f=k.underlying_price);let K=d.get(L);K||(K=new Map,d.set(L,K));let ne=K.get($);ne||(ne={callOi:0,putOi:0},K.set($,ne)),oe?ne.callOi+=M:ne.putOi+=M}const m=Date.now(),h=[...d.keys()].map(k=>({expiry:k,expiryMs:Hl(k)}));h.sort((k,P)=>k.expiryMs-P.expiryMs);const g=h.find(k=>k.expiryMs>m)??h[0]??null;let S={expiry:(g==null?void 0:g.expiry)??"",expiryMs:(g==null?void 0:g.expiryMs)??0,strikes:[]};if(g){const k=d.get(g.expiry);S={expiry:g.expiry,expiryMs:g.expiryMs,strikes:[...k.entries()].map(([P,L])=>({strike:P,callOi:L.callOi,putOi:L.putOi})).sort((P,L)=>P.strike-L.strike)}}return{currency:r,underlyingPrice:f,putCallRatioOi:a>0?s/a:0,putCallRatioVolume:i>0?c/i:0,callOi:a,putOi:s,callVolume:i,putVolume:c,avgIv:u>0?l/u:0,nearestExpiry:S,asOf:Date.now()}})}async getVolatilityIndex(t,r,o){const n=t.toUpperCase();return Ul.get(`${n}:${o}:${r}`,async()=>{var i;const a=await I(`${Tr}/get_volatility_index_data?currency=${n}&start_timestamp=${r}&end_timestamp=${Date.now()}&resolution=${o}`),s=(i=a==null?void 0:a.result)==null?void 0:i.data;if(!Array.isArray(s))throw new Error("deribit dvol: unexpected response shape");return s.map(c=>({time:c[0],value:c[4]})).sort((c,l)=>c.time-l.time)})}}const Yl=e=>`https://cdn.finra.org/equity/regsho/daily/CNMSshvol${e}.txt`,Wl=7,Gl=60*6e4,ql=new O({namespace:"zframes:finra:shortvol",ttlMs:Gl});function Xl(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function Kl(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}${String(e.getUTCDate()).padStart(2,"0")}`}function Jl(e){const t=e.split(/\r?\n/),r=new Map;let o="";for(let n=1;n<t.length;n++){const a=t[n].split("|");if(a.length<5)continue;const[s,i,c,l,u]=a;if(!i)continue;const f=Number(c),d=Number(u);!Number.isFinite(f)||!Number.isFinite(d)||(!o&&/^\d{8}$/.test(s)&&(o=`${s.slice(0,4)}-${s.slice(4,6)}-${s.slice(6,8)}`),r.set(i.toUpperCase(),{date:o||s,symbol:i,shortVolume:f,shortExemptVolume:Number(l)||0,totalVolume:d,shortPct:d>0?f/d*100:0}))}if(r.size===0)throw new Error("finra: empty or unparseable short-volume file");return{date:o,bySymbol:r}}class Ql{constructor(){E(this,"name","finra");E(this,"capabilities",["short-volume"])}async getShortVolume(t){const r=await this.loadReport(),o={};for(const n of t){const a=r.bySymbol.get(Xl(n).toUpperCase());a&&(o[n]=a)}return o}loadReport(){return ql.get("latest",()=>this.fetchLatest())}async fetchLatest(){const t=Date.now();for(let r=0;r<=Wl;r++){const o=new Date(t-r*864e5);try{return Jl(await Le(Yl(Kl(o)),{proxied:!0,timeoutMs:15e3}))}catch{}}throw new Error("finra: no recent short-volume file found")}}const eu="https://api.frankfurter.dev/v1",tu=new O({namespace:"zframes:fx",ttlMs:55*6e4,persist:!0}),ru=40;function ou(e){return new Date(Date.now()-e*864e5).toISOString().slice(0,10)}class nu{constructor(){E(this,"name","fx");E(this,"capabilities",["fx-rates"])}async getFxRates(t,r){const o=t.toUpperCase(),n=[...new Set(r.map(s=>s.toUpperCase()))].filter(s=>s&&s!==o);if(n.length===0)return[];const a=`${o}:${[...n].sort().join(",")}`;return tu.get(a,async()=>{const s=`${eu}/${ou(ru)}..?base=${o}&symbols=${n.join(",")}`,i=await I(s);if(!(i!=null&&i.rates))throw new Error("frankfurter: unexpected response shape");const c=Object.keys(i.rates).sort();return n.map(l=>{var h;const u=[];for(const g of c){const S=(h=i.rates[g])==null?void 0:h[l];typeof S=="number"&&Number.isFinite(S)&&u.push({time:new Date(`${g}T00:00:00Z`).getTime(),value:S})}if(u.length===0)return null;const f=u[u.length-1].value,d=u.length>1?u[u.length-2].value:f,m=d>0?(f-d)/d*100:0;return{symbol:l,base:o,rate:f,changePct:m,history:u}}).filter(l=>l!==null)})}}const au="wss://api.hyperliquid.xyz/ws",su="https://api.hyperliquid.xyz/info",vt=e=>e.includes(":")?e.split(":")[0]:"";async function Ge(e){return I(su,void 0,{init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}})}class iu{constructor(){E(this,"name","hyperliquid");E(this,"capabilities",["quote-stream","day-stats","funding-history","ohlcv","open-interest"]);E(this,"ws",null);E(this,"listeners",new Set);E(this,"reconnectTimer",null);E(this,"closedByUser",!1);E(this,"wantedDexes",new Set([""]));E(this,"subscribedDexes",new Set);E(this,"mergedMids",{})}subscribeMids(t,r){this.listeners.add(t);for(const o of r??[])this.wantedDexes.add(vt(o));return this.ensureSocket(),this.subscribeMissingDexes(),()=>{this.listeners.delete(t),this.listeners.size===0&&this.teardown()}}async getDayStats(t){const r=new Set,o=new Set;if(!t)r.add("");else for(const s of t)s.endsWith(":*")?r.add(s.slice(0,-2)):o.add(s);const n=new Set(r);for(const s of o)n.add(vt(s));const a={};return await Promise.all([...n].map(async s=>{const i={type:"metaAndAssetCtxs"};s&&(i.dex=s);const[c,l]=await Ge(i),u=r.has(s);c.universe.forEach((f,d)=>{if(!u&&!o.has(f.name))return;const m=l[d];if(!m)return;const h=Number(m.markPx),g=Number(m.prevDayPx);!Number.isFinite(h)||!Number.isFinite(g)||(a[f.name]={markPx:h,prevDayPx:g,changePct:g?(h-g)/g*100:0})})})),a}async getOpenInterest(t){const r=new Set,o=new Set;if(!t)r.add("");else for(const s of t)s.endsWith(":*")?r.add(s.slice(0,-2)):o.add(s);const n=new Set(r);for(const s of o)n.add(vt(s));const a=[];return await Promise.all([...n].map(async s=>{const i={type:"metaAndAssetCtxs"};s&&(i.dex=s);const[c,l]=await Ge(i),u=r.has(s);c.universe.forEach((f,d)=>{if(!u&&!o.has(f.name))return;const m=l[d];if(!m)return;const h=Number(m.markPx),g=Number(m.openInterest);!Number.isFinite(h)||!Number.isFinite(g)||a.push({symbol:f.name,openInterestUsd:g*h})})})),a.sort((s,i)=>i.openInterestUsd-s.openInterestUsd)}async getFundingHistory(t,r){const o=await Promise.all(t.map(async n=>{const s=(await Ge({type:"fundingHistory",coin:n,startTime:r})).map(i=>({time:i.time,fundingRate:Number(i.fundingRate)})).filter(i=>Number.isFinite(i.fundingRate)&&Number.isFinite(i.time));return[n,s]}));return Object.fromEntries(o)}async getCandles(t,r,o){return(await Ge({type:"candleSnapshot",req:{coin:t,interval:r,startTime:o}})).map(a=>({time:a.t,open:Number(a.o),high:Number(a.h),low:Number(a.l),close:Number(a.c),volume:Number(a.v)}))}ensureSocket(){if(this.ws)return;this.closedByUser=!1,this.subscribedDexes=new Set;const t=new WebSocket(au);this.ws=t,t.onopen=()=>{this.subscribeMissingDexes()},t.onmessage=r=>{var n;let o;try{o=JSON.parse(String(r.data))}catch{return}if(!(o.channel!=="allMids"||!((n=o.data)!=null&&n.mids))){for(const[a,s]of Object.entries(o.data.mids))this.mergedMids[a]=Number(s);for(const a of this.listeners)a(this.mergedMids)}},t.onclose=()=>{this.ws=null,!this.closedByUser&&this.listeners.size>0&&(this.reconnectTimer=setTimeout(()=>this.ensureSocket(),2e3))}}subscribeMissingDexes(){const t=this.ws;if(!(!t||t.readyState!==WebSocket.OPEN))for(const r of this.wantedDexes){if(this.subscribedDexes.has(r))continue;const o={type:"allMids"};r&&(o.dex=r),t.send(JSON.stringify({method:"subscribe",subscription:o})),this.subscribedDexes.add(r)}}teardown(){var t;this.closedByUser=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.ws)==null||t.close(),this.ws=null,this.subscribedDexes=new Set,this.mergedMids={}}}const ye="https://mempool.space/api",cu=new O({namespace:"zframes:mempool:fees",ttlMs:25e3,persist:!0}),lu=new O({namespace:"zframes:mempool:state",ttlMs:12e3,persist:!0}),uu=new O({namespace:"zframes:mempool:blocks",ttlMs:25e3,persist:!0}),du=new O({namespace:"zframes:mempool:hashrate",ttlMs:25*6e4,persist:!0}),fu=new O({namespace:"zframes:mempool:difficulty",ttlMs:5e4,persist:!0}),mu=new O({namespace:"zframes:mempool:pools",ttlMs:4*6e4,persist:!0}),pu=new O({namespace:"zframes:mempool:lightning",ttlMs:25*6e4,persist:!0});class hu{constructor(){E(this,"name","mempool");E(this,"capabilities",["btc-fees","btc-mempool","btc-blocks","btc-hashrate","btc-difficulty","mining-pools","lightning-stats"])}async getBtcFees(){return cu.get("latest",async()=>{const t=await I(`${ye}/v1/fees/recommended`);if(!t||typeof t.fastestFee!="number")throw new Error("mempool fees: unexpected response shape");return{fastest:t.fastestFee,halfHour:t.halfHourFee,hour:t.hourFee,economy:t.economyFee,minimum:t.minimumFee}})}async getMempoolState(){return lu.get("latest",async()=>{const[t,r]=await Promise.all([I(`${ye}/mempool`),I(`${ye}/v1/fees/mempool-blocks`)]);if(!t||typeof t.count!="number")throw new Error("mempool state: unexpected response shape");const o=(Array.isArray(r)?r:[]).map(n=>({medianFee:n.medianFee,feeRange:Array.isArray(n.feeRange)?n.feeRange:[],totalFees:n.totalFees,nTx:n.nTx,blockVSize:n.blockVSize}));return{count:t.count,vsize:t.vsize,totalFee:t.total_fee,projected:o}})}async getBtcBlocks(t=8){return uu.get(String(t),async()=>{const r=await I(`${ye}/v1/blocks`);if(!Array.isArray(r))throw new Error("mempool blocks: unexpected response shape");return r.slice(0,t).map(o=>{var n,a,s,i,c,l;return{id:o.id,height:o.height,time:o.timestamp*1e3,txCount:o.tx_count,size:o.size,totalFees:((n=o.extras)==null?void 0:n.totalFees)??0,medianFee:((a=o.extras)==null?void 0:a.medianFee)??0,poolName:((i=(s=o.extras)==null?void 0:s.pool)==null?void 0:i.name)??"Unknown",poolSlug:((l=(c=o.extras)==null?void 0:c.pool)==null?void 0:l.slug)??"unknown"}})})}async getNetworkHashrate(t){return du.get(t,async()=>{const r=await I(`${ye}/v1/mining/hashrate/${encodeURIComponent(t)}`);if(!r||!Array.isArray(r.hashrates))throw new Error("mempool hashrate: unexpected response shape");return{currentHashrate:r.currentHashrate,currentDifficulty:r.currentDifficulty,hashrates:r.hashrates.map(o=>({time:o.timestamp*1e3,hashrate:o.avgHashrate})),difficulty:(r.difficulty??[]).map(o=>({time:o.time*1e3,difficulty:o.difficulty}))}})}async getDifficultyAdjustment(){return fu.get("latest",async()=>{const t=await I(`${ye}/v1/difficulty-adjustment`);if(!t||typeof t.progressPercent!="number")throw new Error("mempool difficulty: unexpected response shape");return{progressPercent:t.progressPercent,difficultyChange:t.difficultyChange,previousRetarget:t.previousRetarget,remainingBlocks:t.remainingBlocks,remainingTimeMs:t.remainingTime,estimatedRetargetDate:t.estimatedRetargetDate,nextRetargetHeight:t.nextRetargetHeight,avgBlockTimeMs:t.timeAvg}})}async getMiningPools(t){return mu.get(t,async()=>{const r=await I(`${ye}/v1/mining/pools/${encodeURIComponent(t)}`);if(!r||!Array.isArray(r.pools))throw new Error("mempool pools: unexpected response shape");const o=r.blockCount||0;return{window:t,totalBlocks:o,pools:r.pools.map(n=>({name:n.name,slug:n.slug,blockCount:n.blockCount,sharePct:o>0?n.blockCount/o*100:0,rank:n.rank}))}})}async getLightningStats(){return pu.get("latest",async()=>{var o,n,a;const t=await I(`${ye}/v1/lightning/statistics/latest`),r=t==null?void 0:t.latest;if(!r||typeof r.node_count!="number")throw new Error("mempool lightning: unexpected response shape");return{nodeCount:r.node_count,channelCount:r.channel_count,totalCapacity:r.total_capacity,torNodes:r.tor_nodes,clearnetNodes:r.clearnet_nodes,medCapacity:r.med_capacity,prevNodeCount:(o=t.previous)==null?void 0:o.node_count,prevChannelCount:(n=t.previous)==null?void 0:n.channel_count,prevTotalCapacity:(a=t.previous)==null?void 0:a.total_capacity}})}}const gu={coindesk:{url:"https://www.coindesk.com/arc/outboundfeeds/rss/",source:"CoinDesk"},cointelegraph:{url:"https://cointelegraph.com/rss",source:"Cointelegraph"},decrypt:{url:"https://decrypt.co/feed",source:"Decrypt"},cnbc:{url:"https://www.cnbc.com/id/20910258/device/rss/rss.html",source:"CNBC Markets"},nasdaq:{url:"https://www.nasdaq.com/feed/rssoutbound?category=Markets",source:"Nasdaq"}},yu=e=>{const t=`(${e.join(" OR ")}) stock`;return`https://news.google.com/rss/search?q=${encodeURIComponent(t)}&hl=en-US&gl=US&ceid=US:en`},Er={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function je(e){return e.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi,(t,r)=>{const o=r.toLowerCase();if(Er[o])return Er[o];if(r[0]==="#"){const n=r[1]==="x"||r[1]==="X"?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return Number.isFinite(n)?String.fromCodePoint(n):t}return t})}const ut=e=>e.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g,"$1");function Cr(e){return je(ut(e).replace(/<[^>]+>/g," ")).replace(/\s+/g," ").trim()}function re(e,t){const r=e.match(new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)</${t}>`,"i"));return r?r[1]:void 0}function vu(e){const t=[...e.matchAll(/<link\b[^>]*\bhref="([^"]+)"[^>]*>/gi)];if(t.length>0){const o=t.find(n=>/rel="alternate"/i.test(n[0]))??t.find(n=>!/\brel=/i.test(n[0]))??t[0];return je(o[1]).trim()}const r=re(e,"link");return r?je(ut(r)).trim():void 0}function Ce(e,t){const r=e.match(new RegExp(`\\b${t}\\s*=\\s*"([^"]*)"`,"i"));return r?je(r[1]).trim():void 0}const qe=e=>!!e&&/^https:\/\//i.test(e);function bu(e){var n,a;const t=(n=e.match(/<media:thumbnail\b[^>]*>/i))==null?void 0:n[0];if(t){const s=Ce(t,"url");if(qe(s))return s}for(const s of e.matchAll(/<media:content\b[^>]*>/gi)){const i=Ce(s[0],"medium"),c=Ce(s[0],"type"),l=i==="image"||!i&&!(c!=null&&c.match(/^(audio|video)\//i)),u=Ce(s[0],"url");if(l&&qe(u))return u}for(const s of e.matchAll(/<enclosure\b[^>]*>/gi)){if(!((a=Ce(s[0],"type"))!=null&&a.startsWith("image/")))continue;const i=Ce(s[0],"url");if(qe(i))return i}const r=re(e,"content:encoded")??re(e,"description")??re(e,"content")??re(e,"summary"),o=r?ut(r).match(/<img\b[^>]*\bsrc="([^"]+)"/i):null;if(o){const s=je(o[1]).trim();if(qe(s))return s}}function wu(e){const t=re(e,"pubDate")??re(e,"published")??re(e,"updated")??re(e,"dc:date");if(!t)return;const r=Date.parse(ut(t).trim());return Number.isFinite(r)?r:void 0}function Pr(e,t,r){const o=[...e.matchAll(/<(item|entry)\b[\s\S]*?<\/\1>/gi)].map(a=>a[0]),n=[];for(const a of o){const s=re(a,"title"),i=vu(a);if(!s||!i)continue;const c=Cr(s);if(!c)continue;const l=re(a,"description")??re(a,"summary")??re(a,"content"),u=l?Cr(l).slice(0,280):void 0,f=wu(a),d=bu(a);n.push({title:c,url:i,source:t,...u?{summary:u}:{},...f?{publishedAt:f}:{},...d?{imageUrl:d}:{}})}return n.some(a=>a.publishedAt!==void 0)&&n.sort((a,s)=>(s.publishedAt??0)-(a.publishedAt??0)),n.slice(0,r)}class xu{constructor(){E(this,"name","news");E(this,"capabilities",["news"])}async getNews({feed:t,symbols:r,limit:o=12}){if(t==="stocks"){const s=(r??[]).map(c=>(c.split(":").pop()??"").toUpperCase()).filter(Boolean);if(s.length===0)return[];const i=await Le(yu(s),{proxied:!0,timeoutMs:12e3});return Pr(i,"Google News",o)}const n=gu[t];if(!n)throw new Error(`news: unknown feed "${t}"`);const a=await Le(n.url,{proxied:!0,timeoutMs:12e3});return Pr(a,n.source,o)}}const _u="https://markets.newyorkfed.org/api/rates/all/latest.json",ku={SOFR:"SOFR",SOFRAI:"SOFR averages",EFFR:"Effective fed funds",OBFR:"Overnight bank funding",TGCR:"Tri-party repo",BGCR:"Broad general collateral"},Ar=["EFFR","SOFR","TGCR","BGCR","OBFR","SOFRAI"],zu=new O({namespace:"zframes:nyfed:rates",ttlMs:12*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});function _e(e){const t=Number(e);return Number.isFinite(t)?t:null}function Su(e,t){const r=Ar.indexOf(e.code),o=Ar.indexOf(t.code);return(r===-1?99:r)-(o===-1?99:o)}class Tu{constructor(){E(this,"name","nyfed");E(this,"capabilities",["reference-rates"])}async getReferenceRates(){return zu.get("latest",async()=>{const t=await I(_u);if(!Array.isArray(t==null?void 0:t.refRates))throw new Error("ny fed rates: unexpected response shape");return t.refRates.map(r=>{const o=String(r.type??""),n=_e(r.percentRate??r.average30day);if(!o||!r.effectiveDate||n===null)return null;const a={code:o,label:ku[o]??o,date:r.effectiveDate,rate:n,source:"New York Fed"},s=_e(r.volumeInBillions),i=_e(r.targetRateFrom),c=_e(r.targetRateTo),l=_e(r.average30day),u=_e(r.average90day),f=_e(r.average180day);return s!==null&&(a.volumeInBillions=s),i!==null&&(a.targetRateFrom=i),c!==null&&(a.targetRateTo=c),l!==null&&(a.average30Day=l),u!==null&&(a.average90Day=u),f!==null&&(a.average180Day=f),a}).filter(r=>r!==null).sort(Su)})}}const Eu="https://www.financialresearch.gov/financial-stress-index/data/fsi.csv",Cu=60*6e4,Pu=new O({namespace:"zframes:ofr:fsi",ttlMs:Cu}),Au=[[2,"Credit"],[3,"Equity valuation"],[4,"Safe assets"],[5,"Funding"],[6,"Volatility"]];function Rr(e){const t=Number(e);return Number.isFinite(t)?t:null}function Ru(e){const t=e.split(/\r?\n/),r=[];let o=null;for(let s=1;s<t.length;s++){const i=t[s].split(",");if(i.length<7)continue;const c=i[0],l=Rr(i[1]),u=Date.parse(`${c}T00:00:00Z`);!c||l===null||!Number.isFinite(u)||(r.push({time:u,date:c,value:l}),o=i)}if(!o||r.length===0)throw new Error("ofr fsi: empty or unparseable CSV");const n=r[r.length-1],a=Au.map(([s,i])=>({label:i,value:Rr(o[s])??0}));return{value:n.value,date:n.date,categories:a,trend:r.slice(-90),source:"OFR"}}class Du{constructor(){E(this,"name","ofr");E(this,"capabilities",["financial-stress"])}async getFinancialStress(){return Pu.get("latest",()=>Le(Eu,{proxied:!0}).then(Ru))}}const Mu={A:1090872,AAPL:320193,ABBV:1551152,ABEV:1565025,ABNB:1559720,ABT:1800,ACGL:947484,ACN:1467373,ADBE:796343,ADI:6281,ADM:7084,ADP:8670,ADSK:769397,AEE:1002910,AEM:2809,AEP:4904,AFL:4977,AIG:5272,AJG:354190,ALAB:1736297,ALC:1167379,ALL:899051,ALNY:1178670,AMAT:6951,AMD:2488,AME:1037868,AMGN:318154,AMP:820027,AMRZ:2035989,AMT:1053507,AMX:1129137,AMZN:1018724,ANET:1596532,AON:315293,APD:2969,APH:820313,APO:1858681,APP:1751008,ARES:1176948,ARGX:1697862,ARM:1973239,ASML:937966,ASTS:1780312,ASX:1122411,ATEYY:1158838,ATO:731802,AU:1973832,AVGO:1730168,AXON:1069183,AXP:4962,AZN:901832,AZO:866787,B:756894,BA:12927,BABA:1577552,BAC:70858,BAESY:895564,BAM:1937926,BBD:1160330,BBVA:842180,BCS:312069,BDX:10795,BE:1664703,BHP:811809,BIDU:1329099,BIIB:875045,BKNG:1075531,BKR:1701605,BLK:2012383,BMO:927971,BMWKY:1446250,BMY:14272,BN:1001085,BNS:9631,BNY:1390777,BP:313807,"BRK-A":1067983,"BRK-B":1067983,BSBR:1471055,BSX:885725,BTI:1303523,BUD:1668717,BX:1393818,C:831001,CAH:721371,CARR:1783180,CAT:18230,CB:896159,CBOE:1374310,CBRE:1138118,CBRS:2021728,CCEP:1650107,CCI:1051470,CCJ:1009001,CCL:815097,CDNS:813672,CEG:1868275,CHT:1132924,CI:1739940,CIEN:936395,CKHGF:1469059,CL:21665,CLS:1030894,CM:1045520,CMCSA:1166691,CME:1156375,CMG:1058090,CMI:26172,CNC:1071739,CNI:16868,CNQ:1017413,COF:927628,COHR:820318,COIN:1679788,COP:1163165,COR:1140859,COST:909832,CP:16875,CPRT:900075,CQP:1383650,CRDO:1807794,CRH:849395,CRM:1108524,CRWD:1535527,CRWV:1769628,CSCO:858877,CSLLY:1274152,CSX:277948,CTAS:723254,CTVA:1755672,CVE:1475260,CVNA:1690820,CVS:64803,CVX:93410,CYATY:2070829,D:715957,DAL:27904,DASH:1792789,DB:1159508,DDOG:1561550,DE:315189,DELL:1571996,DEO:835403,DHI:882184,DHR:313616,DIA:1041130,DIS:1744489,DLMAY:2073893,DLR:1297996,DOV:29905,DTE:936340,DTEGY:946770,DUK:1326160,DVN:1090012,E:1002242,EA:712515,EBAY:1065088,EC:1444406,ECL:31462,ED:1047862,EIX:827052,EL:1001250,ELV:1156039,EME:105634,EMR:32604,ENB:895728,EOG:821189,EONGY:1136808,EPD:1061219,EQIX:1101239,EQNR:1140625,EQT:33213,ERIC:717826,ESLT:1027664,ET:1276187,ETN:1551182,ETR:65984,EW:1099800,EXC:1109357,EXR:1289490,F:37996,FANG:1539838,FAST:815556,FCX:831259,FDX:1048911,FER:1468522,FERG:2011641,FISV:798354,FITB:35527,FIX:1035983,FLEX:866374,FMX:1061736,FNV:1456346,FOX:1754301,FOXA:1754301,FRFHF:915191,FSLR:1274494,FTNT:1262039,FTS:1666175,GALDY:2021390,GD:40533,GE:40545,GEHC:1932393,GEV:1996810,GFI:1172724,GFS:1709048,GILD:882095,GLD:1222333,GLW:24741,GM:1467858,GOOG:1652044,GOOGL:1652044,GRMN:1121788,GS:886982,GSK:1131399,GWLIF:850918,GWW:277135,HAL:45012,HBAN:49196,HCA:860730,HD:354950,HDB:1144967,HEI:46619,HIG:874766,HLN:1900304,HLT:1585689,HMC:715153,HON:773840,HOOD:1783879,HPE:1645590,HSBC:1089113,HSY:47111,HTHIY:47710,HUM:49071,HWM:4281,IBKR:1381197,IBM:51143,IBN:1103838,ICE:1571949,IDXX:874716,IFNNY:1107457,IMO:49938,INFY:1067491,ING:1039765,INTC:50863,INTU:896878,IQV:1478242,IR:1699150,IRM:1020569,ISRG:1035267,ITUB:1132597,ITW:49826,IX:1070304,JBL:898293,JCI:833444,JD:1549802,JHPCY:2071868,JNJ:200406,JPM:19617,KB:1445930,KBGGY:1535759,KDP:1418135,KEYS:1601046,KGC:701818,KKR:1404912,KLAC:319201,KMB:55785,KMI:1506307,KO:21344,KR:56873,KVUE:1944048,KXIAY:2053383,LHX:202058,LIN:1707925,LITE:1633978,LLY:59478,LMT:936468,LNG:3570,LOW:60667,LRCX:707549,LSEGY:1842726,LVS:1300514,LYG:1160106,LYV:1335258,MA:1141391,MAR:1048286,MCD:63908,MCHP:827054,MCK:927653,MCO:1059556,MDLN:2046386,MDLZ:1103982,MDT:1613103,MELI:1099590,MET:1099219,META:1326801,MFC:1086888,MFG:1335730,MGCLY:2039784,MLM:916076,MMM:66740,MNST:865752,MO:764180,MPC:1510295,MPLX:1552e3,MPWR:1280452,MRK:310158,MRSH:62709,MRVL:1835632,MS:895421,MSCI:1408198,MSFT:789019,MSI:68505,MSTR:1050446,MT:1243429,MTB:36270,MTZ:15615,MU:723125,MUFG:67088,NBIS:1513845,NDAQ:1120193,NEE:753308,NEM:1164727,NET:1477333,NFLX:1065280,NGG:1004315,NKE:320187,NOC:1133421,NOK:924613,NOW:1373715,NSC:702165,NTAP:1002047,NTES:1110646,NTR:1725964,NTRA:1604821,NTRS:73124,NU:1691493,NUE:73309,NVDA:1045810,NVO:353278,NVS:1114448,NWG:844150,NWS:1564708,NWSA:1564708,NXPI:1413447,O:726728,ODFL:878927,OKE:1039684,ON:1097864,ORCL:1341439,ORLY:898173,OXY:797468,PANW:1327567,PAYX:723531,PBA:1546066,PBR:1119639,PCAR:75362,PCG:1004980,PDD:1737806,PEG:788784,PEP:77476,PFE:78003,PG:80424,PGR:80661,PH:76334,PLD:1045609,PLTR:1321655,PM:1413329,PNC:713676,PRU:1137774,PSA:1393311,PSX:1534701,PUK:1116578,PWR:1050915,PYPL:1633917,Q:2058873,QCOM:804328,QQQ:1067839,QSR:1618756,RACE:1648416,RBLX:1315098,RCL:884887,RDDT:1713445,REGN:872589,RELX:929869,RIO:863064,RJF:720005,RKLB:1819994,RKT:1805284,RMD:943819,ROK:1024478,ROP:882835,ROST:745732,RPRX:1802768,RSG:1060391,RSHGY:1447391,RTNTF:887028,RTX:101829,RVMD:1628171,RY:1000275,RYAAY:1038683,SAN:891478,SAP:1000184,SATS:1415404,SBUX:829224,SCCO:1001838,SCHW:316709,SCMWY:1069336,SE:1703399,SHEL:1306965,SHG:1263043,SHOP:1594805,SHW:89800,SLB:87347,SLF:1097362,SLV:1330568,SMERY:1830056,SMFG:1022837,SNDK:2023554,SNHIY:2098326,SNOW:1640147,SNPS:883241,SNY:1121404,SO:92122,SONY:313838,SPG:1063761,SPGI:64040,SPOT:1639920,SPY:884394,SRE:1032208,STLD:1022671,STM:932787,STT:93751,STX:1137789,SU:311337,SUNB:2083785,SYK:310764,SYY:96021,T:732717,TAK:1395064,TCOM:1269238,TD:947263,TDG:1260221,TECK:886986,TEL:1385157,TER:97210,TEVA:818686,TFC:92230,TGT:27419,TJX:109198,TKO:1973266,TM:1094517,TMO:97745,TMUS:1283699,TPR:1116132,TRGP:1389170,TRI:1075124,TRMOY:2071881,TRP:1232384,TRV:86312,TS:1190723,TSLA:1318605,TT:1466258,TTE:879764,TTWO:946581,TWLO:1447669,TXN:97476,TYHOY:2018139,UA:1336917,UAA:1336917,UAL:100517,UBER:1543151,UBS:1610520,UI:1511737,UL:217410,UMC:1033767,UNH:731766,UNP:100885,UPS:1090727,URI:1067701,USB:36104,V:1403161,VALE:917851,VG:2007855,VICI:1705696,VIK:1745201,VLO:1035002,VMC:1396009,VOD:839923,VRT:1674101,VRTX:875320,VST:1692819,VTR:740260,VZ:732712,WAB:943452,WAT:1000697,WBD:1437107,WCN:1318220,WDAY:1327811,WDC:106040,WEC:783325,WELL:766704,WFC:72971,WM:823768,WMB:107263,WMT:104169,WPM:1323404,XEL:72903,XOM:34088,XYZ:1512673,YUM:1041061,ZM:1585521,ZTS:1555280};function Et(e){return String(e).replace(/\D/g,"").padStart(10,"0")}function Dr(e){const t=e.trim(),r=/^cik[-\s]?(\d{1,10})$/i.exec(t)??/^(\d{1,10})$/.exec(t);if(r)return r[1].padStart(10,"0");const o=(t.includes(":")?t.slice(t.lastIndexOf(":")+1):t).toUpperCase().replace(/[^A-Z0-9.-]/g,""),n=Mu[o];return n===void 0?null:Et(n)}const Nu=e=>`https://data.sec.gov/submissions/CIK${e}.json`,Ou=e=>`https://data.sec.gov/api/xbrl/companyfacts/CIK${e}.json`,jo=15*6e4,Iu=new O({namespace:"zframes:sec:filings",ttlMs:jo}),$u=new O({namespace:"zframes:sec:facts",ttlMs:jo});function Fu(e,t,r){const o=String(Number(e)),n=t.replace(/-/g,""),a=`https://www.sec.gov/Archives/edgar/data/${o}/${n}`;return r?`${a}/${r}`:`${a}/`}const Lu=[{label:"Revenue",unit:"USD",taxonomy:"us-gaap",kind:"flow",concepts:["RevenueFromContractWithCustomerExcludingAssessedTax","Revenues","SalesRevenueNet"]},{label:"Net income",unit:"USD",taxonomy:"us-gaap",kind:"flow",concepts:["NetIncomeLoss"]},{label:"Total assets",unit:"USD",taxonomy:"us-gaap",kind:"instant",concepts:["Assets"]},{label:"Shareholders' equity",unit:"USD",taxonomy:"us-gaap",kind:"instant",concepts:["StockholdersEquity"]},{label:"Diluted EPS",unit:"USD/shares",taxonomy:"us-gaap",kind:"flow",concepts:["EarningsPerShareDiluted","EarningsPerShareBasic"]},{label:"Shares outstanding",unit:"shares",taxonomy:"dei",kind:"instant",concepts:["EntityCommonStockSharesOutstanding"]}];function ju(e){return e.fy?e.fp==="FY"?`FY${e.fy}`:`${e.fp??""} ${e.fy}`.trim():e.end??""}function Uu(e,t){const r=e.filter(n=>n.end&&n.form&&Number.isFinite(n.val));return(t==="flow"&&r.some(n=>n.fp==="FY")?r.filter(n=>n.fp==="FY"):r).reduce((n,a)=>!n||a.end>n.end?a:n,null)}function Bu(e){var r,o;if(!e)return[];const t=[];for(const n of Lu){const a=e[n.taxonomy];if(!a)continue;let s=null;for(const i of n.concepts){const c=(o=(r=a[i])==null?void 0:r.units)==null?void 0:o[n.unit];if(!(c!=null&&c.length))continue;const l=Uu(c,n.kind);l&&(!s||l.end>s.end)&&(s=l)}s&&t.push({label:n.label,value:s.val,unit:n.unit,end:s.end,fiscalPeriod:ju(s),form:s.form})}return t}class Vu{constructor(t){E(this,"name","sec");E(this,"capabilities",["filings","fundamentals"]);this.contact=t}nodeInit(){return this.contact&&typeof document>"u"?{init:{headers:{"User-Agent":`zframes (${this.contact})`}}}:void 0}async getCompanyFacts(t){const r=Dr(t);if(!r)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return $u.get(r,()=>this.fetchCompanyFacts(r))}async fetchCompanyFacts(t){const r=await I(Ou(t),void 0,{proxied:!0,...this.nodeInit()}),o=Bu(r.facts);if(o.length===0)throw new Error("sec companyfacts: no headline metrics found");return{cik:Et(r.cik??t),entityName:r.entityName??"",metrics:o}}async getCompanyFilings(t){const r=Dr(t);if(!r)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return Iu.get(r,()=>this.fetchFilings(r))}async fetchFilings(t){var s,i,c,l,u,f,d;const r=await I(Nu(t),void 0,this.nodeInit()),o=(s=r.filings)==null?void 0:s.recent;if(!o||!Array.isArray(o.accessionNumber))throw new Error("sec submissions: unexpected response shape");const n=o.accessionNumber.length,a=[];for(let m=0;m<n;m++){const h=o.accessionNumber[m],g=(i=o.form)==null?void 0:i[m],S=(c=o.filingDate)==null?void 0:c[m];if(!h||!g||!S)continue;const k=(l=o.reportDate)==null?void 0:l[m],P=(u=o.primaryDocDescription)==null?void 0:u[m],L=(f=o.items)==null?void 0:f[m];a.push({form:g,filingDate:S,accessionNumber:h,url:Fu(t,h,(d=o.primaryDocument)==null?void 0:d[m]),...k?{reportDate:k}:{},...P?{description:P}:{},...L?{items:L}:{}})}return{cik:Et(r.cik??t),name:r.name??"",tickers:r.tickers??[],exchanges:r.exchanges??[],filings:a,...r.sic?{sic:r.sic}:{},...r.sicDescription?{sicDescription:r.sicDescription}:{},...r.category?{category:r.category}:{},...r.fiscalYearEnd?{fiscalYearEnd:r.fiscalYearEnd}:{}}}}const Hu="https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?sort=-record_date&page%5Bsize%5D=20&format=json",Zu=e=>`https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny?sort=-record_date&page%5Bsize%5D=${e}&format=json`,Yu=e=>`https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query?sort=-auction_date&filter=bid_to_cover_ratio:gt:0&fields=auction_date,security_type,security_term,high_yield,high_discnt_rate,high_investment_rate,bid_to_cover_ratio,offering_amt,total_accepted&page%5Bsize%5D=${e}&format=json`,Wu=e=>`https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=daily_treasury_yield_curve&field_tdr_date_value_month=${e}`,dt=180*6e4,Gu=new O({namespace:"zframes:treasury:yield-curve",ttlMs:dt,persist:!0}),qu=new O({namespace:"zframes:treasury:avg-rates",ttlMs:dt,persist:!0}),Xu=new O({namespace:"zframes:treasury:national-debt",ttlMs:dt,persist:!0}),Ku=new O({namespace:"zframes:treasury:auctions",ttlMs:dt,persist:!0}),Ju=[["BC_1MONTH","1M",1],["BC_2MONTH","2M",2],["BC_3MONTH","3M",3],["BC_4MONTH","4M",4],["BC_6MONTH","6M",6],["BC_1YEAR","1Y",12],["BC_2YEAR","2Y",24],["BC_3YEAR","3Y",36],["BC_5YEAR","5Y",60],["BC_7YEAR","7Y",84],["BC_10YEAR","10Y",120],["BC_20YEAR","20Y",240],["BC_30YEAR","30Y",360]];function ce(e){const t=Number(e);return Number.isFinite(t)?t:null}function Qu(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}`}function ed(e){const t=e.match(/<m:properties>[\s\S]*?<\/m:properties>/g);if(!(t!=null&&t.length))return null;let r=null;for(const n of t){const a=/<d:NEW_DATE[^>]*>([^<]+)<\/d:NEW_DATE>/.exec(n);if(!a)continue;const s=a[1].slice(0,10);(!r||s>r.date)&&(r={date:s,raw:n})}if(!r)return null;const o=[];for(const[n,a,s]of Ju){const i=new RegExp(`<d:${n}[^>]*>([^<]*)</d:${n}>`).exec(r.raw),c=i?Number(i[1]):NaN;Number.isFinite(c)&&o.push({label:a,months:s,rate:c})}return o.length?{date:r.date,points:o}:null}class td{constructor(){E(this,"name","treasury");E(this,"capabilities",["treasury-rates","yield-curve","treasury-auctions","national-debt"])}async getYieldCurve(){return Gu.get("latest",()=>this.fetchYieldCurve())}async fetchYieldCurve(){const t=new Date;for(let r=0;r<=1;r++){const o=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-r,1)),n=await Le(Wu(Qu(o)),{proxied:!0,timeoutMs:15e3}).catch(()=>""),a=ed(n);if(a)return a}throw new Error("treasury yield curve: no recent data")}async getTreasuryAverageRates(){return qu.get("latest",()=>this.fetchTreasuryAverageRates())}async fetchTreasuryAverageRates(){var o;const t=await I(Hu,void 0,{proxied:!0});if(!Array.isArray(t==null?void 0:t.data))throw new Error("treasury average rates: unexpected response shape");const r=(o=t.data.find(n=>n.record_date))==null?void 0:o.record_date;return r?t.data.filter(n=>n.record_date===r).map(n=>{const a=ce(n.avg_interest_rate_amt);return a===null||!n.security_type_desc||!n.security_desc?null:{date:r,securityType:n.security_type_desc,security:n.security_desc,rate:a}}).filter(n=>n!==null):[]}async getNationalDebt(t=180){return Xu.get(String(t),()=>this.fetchNationalDebt(t))}async fetchNationalDebt(t){const r=Math.max(2,Math.min(t,400)),o=await I(Zu(r),void 0,{proxied:!0});if(!Array.isArray(o==null?void 0:o.data)||o.data.length===0)throw new Error("treasury debt to the penny: unexpected response shape");const n=[];for(let s=o.data.length-1;s>=0;s--){const i=o.data[s],c=ce(i.tot_pub_debt_out_amt),l=Date.parse(`${i.record_date}T00:00:00Z`);!i.record_date||c===null||!Number.isFinite(l)||n.push({time:l,date:i.record_date,total:c})}if(n.length===0)throw new Error("treasury debt to the penny: no usable rows");const a=o.data[0];return{date:a.record_date??n[n.length-1].date,total:ce(a.tot_pub_debt_out_amt)??n[n.length-1].total,heldByPublic:ce(a.debt_held_public_amt)??0,intragovernmental:ce(a.intragov_hold_amt)??0,trend:n}}async getTreasuryAuctions(t=8){return Ku.get(String(t),()=>this.fetchTreasuryAuctions(t))}async fetchTreasuryAuctions(t){const r=Math.max(1,Math.min(t,30)),o=await I(Yu(r),void 0,{proxied:!0});if(!Array.isArray(o==null?void 0:o.data))throw new Error("treasury auctions: unexpected response shape");return o.data.map(n=>{if(!n.auction_date||!n.security_type)return null;const a=ce(n.high_yield)??ce(n.high_investment_rate);return{auctionDate:n.auction_date,securityType:n.security_type,securityTerm:n.security_term??"",rate:a,bidToCover:ce(n.bid_to_cover_ratio),offeringAmount:ce(n.offering_amt),totalAccepted:ce(n.total_accepted)}}).filter(n=>n!==null)}}const rd=["https://ethereum-rpc.publicnode.com","https://rpc.ankr.com/eth"],od="https://api.coingecko.com/api/v3/simple/price",nd="0x70a08231",ad=1,sd={symbol:"ETH",address:null,decimals:18,cgId:"ethereum"},Ct=[sd,{symbol:"USDC",address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",decimals:6,cgId:"usd-coin"},{symbol:"USDT",address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",decimals:6,cgId:"tether"},{symbol:"DAI",address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",decimals:18,cgId:"dai"},{symbol:"WETH",address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",decimals:18,cgId:"weth"},{symbol:"WBTC",address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",decimals:8,cgId:"wrapped-bitcoin"},{symbol:"LINK",address:"0x514910771AF9Ca656af840dff83E8264EcF986CA",decimals:18,cgId:"chainlink"},{symbol:"UNI",address:"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",decimals:18,cgId:"uniswap"},{symbol:"AAVE",address:"0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",decimals:18,cgId:"aave"},{symbol:"LDO",address:"0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32",decimals:18,cgId:"lido-dao"},{symbol:"MKR",address:"0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",decimals:18,cgId:"maker"},{symbol:"CRV",address:"0xD533a949740bb3306d119CC777fa900bA034cd52",decimals:18,cgId:"curve-dao-token"},{symbol:"SHIB",address:"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",decimals:18,cgId:"shiba-inu"},{symbol:"PEPE",address:"0x6982508145454Ce325dDbE47a25d4ec3d2311933",decimals:18,cgId:"pepe"}],Mr=/^0x[0-9a-fA-F]{40}$/;async function id(e){const t=e.trim();if(Mr.test(t))return t;try{const r=await I(`https://api.ensideas.com/ens/resolve/${encodeURIComponent(t)}`);if(r.address&&Mr.test(r.address))return r.address}catch{}throw new Error(`couldn't resolve address: ${t}`)}function cd(e){return`${nd}000000000000000000000000${e.slice(2).toLowerCase()}`}function ld(e,t){if(!e||e==="0x")return 0;try{return Number(BigInt(e))/10**t}catch{return 0}}async function ud(e){const t=Ct.map((i,c)=>i.address===null?{jsonrpc:"2.0",id:c,method:"eth_getBalance",params:[e,"latest"]}:{jsonrpc:"2.0",id:c,method:"eth_call",params:[{to:i.address,data:cd(e)},"latest"]}),r=JSON.stringify(t);let o=null,n;for(const i of rd)try{const c=await fetch(i,{method:"POST",headers:{"content-type":"application/json"},body:r,signal:AbortSignal.timeout(12e3)});if(!c.ok)throw new Error(`rpc ${c.status}`);o=await c.json();break}catch(c){n=c}if(!o)throw new Error(`all RPC endpoints failed: ${String(n)}`);const a=new Map;for(const i of o)i.result&&a.set(i.id,i.result);const s=new Map;return Ct.forEach((i,c)=>{const l=ld(a.get(c),i.decimals);l>0&&s.set(i.symbol,l)}),s}async function dd(e){if(e.length===0)return{};const t=`${od}?ids=${e.join(",")}&vs_currencies=usd&include_24hr_change=true`;return I(t)}function fd(e){return`${e.slice(0,6)}…${e.slice(-4)}`}const md=new O({namespace:"zframes:wallet:portfolio",ttlMs:12e4,persist:!1});class pd{constructor(){E(this,"name","On-chain wallet");E(this,"capabilities",["portfolio"]);E(this,"portfolioKinds",["wallet"])}async getPortfolio(t){if(t.kind!=="wallet"||!t.address)throw new Error("wallet provider needs a wallet source with an address");return md.get(t.address,async()=>{const r=await id(t.address),o=await ud(r),n=Ct.filter(c=>o.has(c.symbol)),a=await dd(n.map(c=>c.cgId)),s=n.map(c=>{var d,m;const l=o.get(c.symbol)??0,u=(d=a[c.cgId])==null?void 0:d.usd,f=u!==void 0?l*u:void 0;return{symbol:c.symbol,amount:l,valueUsd:f,changePct24h:(m=a[c.cgId])==null?void 0:m.usd_24h_change}}).filter(c=>c.valueUsd!==void 0&&c.valueUsd>=ad).sort((c,l)=>(l.valueUsd??0)-(c.valueUsd??0)),i=s.reduce((c,l)=>c+(l.valueUsd??0),0);return{source:"wallet",label:fd(r),holdings:s,totalUsd:i,asOf:Date.now()}})}}const hd=b.lazy(()=>w(()=>import("./unicorn-scene-DcohHRPZ.js"),__vite__mapDeps([0,1]))),gd="/unicornStudio.umd.mjs",Nr="invert(1) hue-rotate(180deg) saturate(1.25)",yd="opacity 0.5s var(--zf-ease-out), filter 0.5s var(--zf-ease-out)",vd=e=>Math.min(.42,e*2.4),Uo=242,bd=e=>{const t=((e-Uo)%360+360)%360;return t>180?t-360:t},Bo=90,wd=e=>Math.round(e/Bo*1e3)/1e3;function xd({background:e,active:t=!1,thinking:r=!1,accentHue:o=Uo,accentSat:n=Bo}){if(e.type==="color"||e.type==="gradient"){const u=e.type==="color"?e.color:`linear-gradient(${e.gradientAngle}deg, ${e.gradientFrom}, ${e.gradientTo})`;return p.jsx("div",{"aria-hidden":!0,style:{position:"fixed",inset:0,zIndex:0,pointerEvents:"none",background:u}})}if(e.type!=="unicorn"||!e.projectId)return null;const a=bd(o),s=wd(n),i=[a===0?"":`hue-rotate(${a}deg)`,s===1?"":`saturate(${s})`].filter(Boolean).join(" "),c=i||"none",l=i?`${i} ${Nr}`:Nr;return p.jsx("div",{"aria-hidden":!0,style:{position:"fixed",inset:0,zIndex:0,overflow:"hidden",pointerEvents:"none"},children:p.jsx("div",{style:{position:"absolute",inset:0,opacity:t?vd(e.opacity):e.opacity,filter:t?l:c,transition:yd,willChange:"opacity, filter"},children:p.jsx("div",{className:r?"zf-bg-hue":void 0,style:{position:"absolute",inset:0},children:p.jsx("div",{className:r?"zf-bg-breathe":void 0,style:{position:"absolute",inset:0},children:p.jsx(b.Suspense,{fallback:null,children:p.jsx(hd,{projectId:e.projectId,width:"100vw",height:"100vh",scale:e.scale,dpi:e.dpi,sdkUrl:gd},e.projectId)})})})})})}function _d({currentTitle:e}){const[t,r]=b.useState(null),[o,n]=b.useState(!1),[a,s]=b.useState(null);b.useEffect(()=>{let u=!1;return fetch(Qc,{cache:"no-store"}).then(f=>f.ok?f.json():null).then(f=>{if(u||!f||typeof f!="object")return;const d=f;d.canSwitch===!0&&Array.isArray(d.dashboards)&&r({current:typeof d.current=="string"?d.current:null,dashboards:d.dashboards})}).catch(()=>{}),()=>{u=!0}},[]),b.useEffect(()=>{if(!o)return;const u=f=>{f.key==="Escape"&&n(!1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[o]);const i=p.jsx("span",{className:"body-sm text-soft",children:e});if(!t||t.dashboards.length<=1)return i;async function c(u){if(!(!t||a)){if(u===t.current){n(!1);return}s(u);try{const f=await fetch(el,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:u})});if(!f.ok)throw new Error(`HTTP ${f.status}`);window.location.reload()}catch(f){console.error("zframes: failed to switch dashboard",f),window.alert("Couldn't switch dashboard — is `zframes serve` still running?"),s(null)}}}const l="hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%)";return p.jsxs(p.Fragment,{children:[p.jsxs("button",{type:"button",onClick:()=>n(!0),"aria-haspopup":"dialog","aria-expanded":o,className:"body-sm text-soft hover:text-strong flex items-center gap-1 rounded-md border border-white/[0.08] px-1.5 py-0.5 outline-none",children:[e,p.jsx("span",{"aria-hidden":!0,className:"text-[0.7em] opacity-70",children:"▾"})]}),o&&Ko.createPortal(p.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Choose a dashboard",onClick:u=>{u.target===u.currentTarget&&n(!1)},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-6 backdrop-blur-sm",children:p.jsxs("div",{className:"w-full max-w-2xl rounded-2xl border border-white/[0.08] bg-neutral-950/95 p-5 shadow-2xl",children:[p.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[p.jsx("h2",{className:"font-dmsans text-strong text-base font-extrabold",children:"Your dashboards"}),p.jsx("button",{type:"button",onClick:()=>n(!1),"aria-label":"Close",className:"text-soft hover:text-strong rounded-md px-2 py-0.5 text-lg leading-none outline-none",children:"×"})]}),p.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:t.dashboards.map(u=>{const f=u.name===t.current;return p.jsxs("button",{type:"button",disabled:a!==null,onClick:()=>void c(u.name),style:f?{borderColor:`${l} 60%)`}:void 0,className:`flex flex-col items-start gap-1 rounded-xl border p-4 text-left outline-none transition disabled:opacity-50 ${f?"bg-white/[0.04]":"border-white/[0.08] hover:border-white/25 hover:bg-white/[0.03]"}`,children:[p.jsx("span",{className:"font-dmsans text-strong text-sm font-bold",children:u.title??u.name}),p.jsx("span",{className:"caption text-soft font-mono",children:u.name}),p.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5",children:[u.isDefault&&p.jsx("span",{className:"caption text-soft rounded-full border border-white/[0.12] px-1.5 py-0.5 leading-none",children:"default"}),f&&p.jsx("span",{className:"caption text-strong rounded-full px-1.5 py-0.5 leading-none",style:{background:`${l} 30%)`},children:"current"}),a===u.name&&p.jsx("span",{className:"caption text-soft",children:"switching…"})]})]},u.name)})})]})}),document.body)]})}const kd={"portfolio-value":{load:()=>w(()=>import("./portfolio-value-Dj37WMRc.js"),__vite__mapDeps([2,1,3,4,5,6])).then(e=>e.portfolioValueFrame)},"portfolio-allocation":{load:()=>w(()=>import("./portfolio-allocation-DKf6H-m6.js"),__vite__mapDeps([7,1,4,5,6,8,9])).then(e=>e.portfolioAllocationFrame)},"portfolio-holdings":{load:()=>w(()=>import("./portfolio-holdings-CHtvm8aL.js"),__vite__mapDeps([10,1,4,5,6])).then(e=>e.portfolioHoldingsFrame)},"bitcoin-dominance":{load:()=>w(()=>import("./bitcoin-dominance-BHcykQ8j.js"),__vite__mapDeps([11,1,4,6])).then(e=>e.bitcoinDominanceFrame)},clock:{load:()=>w(()=>import("./clock-D2rGZ-yo.js"),__vite__mapDeps([12,1,6,13])).then(e=>e.clockFrame)},"daily-analysis":{load:()=>w(()=>import("./daily-analysis-D3g2BXJd.js"),__vite__mapDeps([14,1,4,6])).then(e=>e.dailyAnalysisFrame)},"journal-log":{load:()=>w(()=>import("./journal-log-CcLb4w4A.js"),__vite__mapDeps([15,1,16,4,17,6])).then(e=>e.journalLogFrame)},"journal-open":{load:()=>w(()=>import("./journal-open-C0BKFgMk.js"),__vite__mapDeps([18,1,17,4,19,16,6])).then(e=>e.journalOpenFrame)},"journal-results":{load:()=>w(()=>import("./journal-results-Bpzb4REp.js"),__vite__mapDeps([20,1,17,4,19,16,6])).then(e=>e.journalResultsFrame)},"journal-score":{load:()=>w(()=>import("./journal-score-BUDUgceb.js"),__vite__mapDeps([21,1,4,17,19,16])).then(e=>e.journalScoreFrame)},"dino-game":{load:()=>w(()=>import("./dino-game-DLEtJMnt.js"),__vite__mapDeps([22,1,23,4])).then(e=>e.dinoGameFrame)},"fear-greed":{load:()=>w(()=>import("./fear-greed-zPvN2LSi.js"),__vite__mapDeps([24,1,6,25,9,26])).then(e=>e.fearGreedFrame)},"filings-feed":{load:()=>w(()=>import("./filings-feed-CWAGVlAW.js"),__vite__mapDeps([27,1,28,4,6])).then(e=>e.filingsFeedFrame)},fundamentals:{load:()=>w(()=>import("./fundamentals-BYjofvJi.js"),__vite__mapDeps([29,1,4,6])).then(e=>e.fundamentalsFrame)},"financial-stress":{load:()=>w(()=>import("./financial-stress-C5-XFPqY.js"),__vite__mapDeps([30,1,4,6,25,9,26])).then(e=>e.financialStressFrame)},"labor-market":{load:()=>w(()=>import("./labor-market-DJihF3Mk.js"),__vite__mapDeps([31,1,4,6,25,9,26])).then(e=>e.laborMarketFrame)},"national-debt":{load:()=>w(()=>import("./national-debt-CgI8LSK6.js"),__vite__mapDeps([32,1,4,6,25,9,26])).then(e=>e.nationalDebtFrame)},"treasury-auctions":{load:()=>w(()=>import("./treasury-auctions-bA-385ON.js"),__vite__mapDeps([33,1,4,34,6])).then(e=>e.treasuryAuctionsFrame)},"funding-heatmap":{load:()=>w(()=>import("./funding-heatmap-BhL0jjq8.js"),__vite__mapDeps([35,1,4,6,26])).then(e=>e.fundingHeatmapFrame)},"funding-rate-chart":{load:()=>w(()=>import("./funding-rate-chart-CxBH7hVe.js"),__vite__mapDeps([36,1,4,6,8,9,37,26,38])).then(e=>e.fundingRateChartFrame)},heading:{load:()=>w(()=>import("./heading-gFm9ZDY1.js"),__vite__mapDeps([39,1])).then(e=>e.headingFrame)},image:{load:()=>w(()=>import("./image-D3DwdoU8.js"),__vite__mapDeps([40,1,6])).then(e=>e.imageFrame)},"inflation-pulse":{load:()=>w(()=>import("./inflation-pulse-GrBWa9Z6.js"),__vite__mapDeps([41,1,4,6,25,9,26])).then(e=>e.inflationPulseFrame)},"market-hours":{load:()=>w(()=>import("./market-hours-D89LjpUm.js"),__vite__mapDeps([42,1,43,4,6])).then(e=>e.marketHoursFrame),titleIcon:!0},"news-feed":{load:()=>w(()=>import("./news-feed-CA8M5V3K.js"),__vite__mapDeps([44,1,28,4,6])).then(e=>e.newsFeedFrame)},note:{load:()=>w(()=>import("./note-Biu6llug.js"),__vite__mapDeps([45,1,6])).then(e=>e.noteFrame)},"price-chart":{load:()=>w(()=>import("./price-chart-hgZApQaG.js"),__vite__mapDeps([46,1,3,4,6])).then(e=>e.priceChartFrame),titleIcon:!0},"price-compare":{load:()=>w(()=>import("./price-compare-BczbPKy-.js"),__vite__mapDeps([47,1,4,6,8,9,37,26,38])).then(e=>e.priceCompareFrame)},"price-liveline":{load:()=>w(()=>import("./price-liveline-Cbor-Nv_.js"),__vite__mapDeps([48,1,3,4,8,9])).then(e=>e.priceLivelineFrame)},"price-ticker":{load:()=>w(()=>import("./price-ticker-BmfARqHc.js"),__vite__mapDeps([49,1,50,4,6])).then(e=>e.priceTickerFrame)},"rates-board":{load:()=>w(()=>import("./rates-board-B_OYdW_u.js"),__vite__mapDeps([51,1,4,34,6])).then(e=>e.ratesBoardFrame)},"fx-board":{load:()=>w(()=>import("./fx-board-Cm0_zK03.js"),__vite__mapDeps([52,1,4,6,25,9,26])).then(e=>e.fxBoardFrame)},"short-volume":{load:()=>w(()=>import("./short-volume-CYxTQG8H.js"),__vite__mapDeps([53,1,4,6])).then(e=>e.shortVolumeFrame)},"top-movers":{load:()=>w(()=>import("./top-movers-D7sBm6jo.js"),__vite__mapDeps([54,1,50,4,6])).then(e=>e.topMoversFrame)},"tvl-treemap":{load:()=>w(()=>import("./tvl-treemap-jrgafmGj.js"),__vite__mapDeps([55,1,4,56,26,9,6])).then(e=>e.tvlTreemapFrame)},"yield-curve":{load:()=>w(()=>import("./yield-curve-BOvLIfWe.js"),__vite__mapDeps([57,1,4,6])).then(e=>e.yieldCurveFrame)},"dex-volume-treemap":{load:()=>w(()=>import("./dex-volume-treemap-C-hqWu6U.js"),__vite__mapDeps([58,1,4,56,26,9,6])).then(e=>e.dexVolumeTreemapFrame)},"dex-volume-chart":{load:()=>w(()=>import("./dex-volume-chart-C3KHEnoK.js"),__vite__mapDeps([59,1,4,6,8,9,37,26,38])).then(e=>e.dexVolumeChartFrame)},"protocol-tvl-treemap":{load:()=>w(()=>import("./protocol-tvl-treemap-Bvgp0EHh.js"),__vite__mapDeps([60,1,4,56,26,9,6])).then(e=>e.protocolTvlTreemapFrame)},"protocol-tvl-chart":{load:()=>w(()=>import("./protocol-tvl-chart-Dl_MwJdU.js"),__vite__mapDeps([61,1,4,6,8,9,37,26,38])).then(e=>e.protocolTvlChartFrame)},"protocol-fees-treemap":{load:()=>w(()=>import("./protocol-fees-treemap-DeSBgGJ9.js"),__vite__mapDeps([62,1,4,56,26,9,6])).then(e=>e.protocolFeesTreemapFrame)},"market-cap-treemap":{load:()=>w(()=>import("./market-cap-treemap-DpuSjWWe.js"),__vite__mapDeps([63,1,4,56,26,9,6])).then(e=>e.marketCapTreemapFrame)},"open-interest":{load:()=>w(()=>import("./open-interest-DgDfcYh5.js"),__vite__mapDeps([64,1,4,6])).then(e=>e.openInterestFrame)},snake:{load:()=>w(()=>import("./snake-9JevhL1w.js"),__vite__mapDeps([65,1,23,4])).then(e=>e.snakeFrame)},"flappy-bird":{load:()=>w(()=>import("./flappy-bird-CoKOL9Ib.js"),__vite__mapDeps([66,1,23,4])).then(e=>e.flappyBirdFrame)},video:{load:()=>w(()=>import("./video-CUWN4TBo.js"),__vite__mapDeps([67,1,6])).then(e=>e.videoFrame)},drawdy:{load:()=>w(()=>import("./drawdy-DoJeRpgi.js"),__vite__mapDeps([68,1,6])).then(e=>e.drawdyFrame)},countdown:{load:()=>w(()=>import("./countdown-DcbUf2-f.js"),__vite__mapDeps([69,1,6,13])).then(e=>e.countdownFrame)},"link-grid":{load:()=>w(()=>import("./link-grid-DK3kGS1q.js"),__vite__mapDeps([70,1,16,6])).then(e=>e.linkGridFrame)},calculator:{load:()=>w(()=>import("./calculator-CYNDBlrv.js"),__vite__mapDeps([71,1,16,6])).then(e=>e.calculatorFrame)},quote:{load:()=>w(()=>import("./quote-BjjZrPpM.js"),__vite__mapDeps([72,1])).then(e=>e.quoteFrame)},divider:{load:()=>w(()=>import("./divider-CVjQeL0n.js"),__vite__mapDeps([73,1])).then(e=>e.dividerFrame)},marquee:{load:()=>w(()=>import("./marquee-ByOQSr9Q.js"),__vite__mapDeps([74,1])).then(e=>e.marqueeFrame)},dice:{load:()=>w(()=>import("./dice-B7dy1iZP.js"),__vite__mapDeps([75,1,16,6])).then(e=>e.diceFrame)},"risk-reward":{load:()=>w(()=>import("./risk-reward-xhKH6ouR.js"),__vite__mapDeps([76,1,16,4,6])).then(e=>e.riskRewardFrame)},stopwatch:{load:()=>w(()=>import("./stopwatch-BuN_qlhH.js"),__vite__mapDeps([77,1,16])).then(e=>e.stopwatchFrame)},"session-progress":{load:()=>w(()=>import("./session-progress-BquR98Sm.js"),__vite__mapDeps([78,1,43,6])).then(e=>e.sessionProgressFrame)},"btc-fees":{load:()=>w(()=>import("./btc-fees-Cv6K9S1L.js"),__vite__mapDeps([79,1,80,4,6])).then(e=>e.btcFeesFrame)},"btc-mempool":{load:()=>w(()=>import("./btc-mempool-ftlit90k.js"),__vite__mapDeps([81,1,80,4,6])).then(e=>e.btcMempoolFrame)},"btc-blocks":{load:()=>w(()=>import("./btc-blocks-mJPjO7gs.js"),__vite__mapDeps([82,1,4,6])).then(e=>e.btcBlocksFrame)},"btc-hashrate":{load:()=>w(()=>import("./btc-hashrate-DT6qyeME.js"),__vite__mapDeps([83,1,4,6,25,9,26])).then(e=>e.btcHashrateFrame)},"btc-difficulty":{load:()=>w(()=>import("./btc-difficulty-D8kmEyQb.js"),__vite__mapDeps([84,1,4,6])).then(e=>e.btcDifficultyFrame)},"mining-pools":{load:()=>w(()=>import("./mining-pools-D6AnoVnf.js"),__vite__mapDeps([85,1,4,56,26,9,6])).then(e=>e.miningPoolsFrame)},"lightning-stats":{load:()=>w(()=>import("./lightning-stats-BV14FfAY.js"),__vite__mapDeps([86,1,4,6])).then(e=>e.lightningStatsFrame)},"options-put-call":{load:()=>w(()=>import("./options-put-call--RXL3vTA.js"),__vite__mapDeps([87,1,4,6])).then(e=>e.optionsPutCallFrame)},"options-iv":{load:()=>w(()=>import("./options-iv-CqDfM4IA.js"),__vite__mapDeps([88,1,4,6,25,9,26])).then(e=>e.optionsIvFrame)},"options-oi-strike":{load:()=>w(()=>import("./options-oi-strike-CrIT5WTU.js"),__vite__mapDeps([89,1,4,6])).then(e=>e.optionsOiStrikeFrame)},"coin-movers":{load:()=>w(()=>import("./coin-movers-DpHOtUMJ.js"),__vite__mapDeps([90,1,50,4,6])).then(e=>e.coinMoversFrame)},"holiday-calendar":{load:()=>w(()=>import("./holiday-calendar-ffNyuPje.js"),__vite__mapDeps([91,1,43,34,6])).then(e=>e.holidayCalendarFrame)},"day-meter":{load:()=>w(()=>import("./day-meter-CDmmKsh5.js"),__vite__mapDeps([92,1,43,6])).then(e=>e.dayMeterFrame)},"returns-projector":{load:()=>w(()=>import("./returns-projector-EA7LLxnL.js"),__vite__mapDeps([93,1,16,4,25,9,26])).then(e=>e.returnsProjectorFrame)},breakeven:{load:()=>w(()=>import("./breakeven-PNgn_Prq.js"),__vite__mapDeps([94,1,16,4,6])).then(e=>e.breakevenFrame)},checklist:{load:()=>w(()=>import("./checklist-DygbP4AG.js"),__vite__mapDeps([95,1,6])).then(e=>e.checklistFrame)},pomodoro:{load:()=>w(()=>import("./pomodoro-DZEEQU2X.js"),__vite__mapDeps([96,1,16])).then(e=>e.pomodoroFrame)},"rules-card":{load:()=>w(()=>import("./rules-card-CrDquc56.js"),__vite__mapDeps([97,1,6])).then(e=>e.rulesCardFrame)},breathing:{load:()=>w(()=>import("./breathing-DrPgIS4r.js"),__vite__mapDeps([98,1])).then(e=>e.breathingFrame)},"spotify-embed":{load:()=>w(()=>import("./spotify-embed-CNEzG2xL.js"),__vite__mapDeps([99,1,6])).then(e=>e.spotifyEmbedFrame)}},x=e=>`/widget-icons/${e}.png`,A={hyperliquid:{name:"Hyperliquid",url:"https://hyperliquid.xyz"},defillama:{name:"DeFiLlama",url:"https://defillama.com"},coingecko:{name:"CoinGecko",url:"https://www.coingecko.com"},alternativeMe:{name:"alternative.me",url:"https://alternative.me/crypto/fear-and-greed-index/"},bls:{name:"BLS",url:"https://www.bls.gov"},nyFed:{name:"NY Fed",url:"https://www.newyorkfed.org/markets/reference-rates"},treasury:{name:"U.S. Treasury",url:"https://fiscaldata.treasury.gov"},secEdgar:{name:"SEC EDGAR",url:"https://www.sec.gov/edgar"},finra:{name:"FINRA",url:"https://www.finra.org/finra-data/browse-catalog/short-sale-volume-data"},ofr:{name:"OFR",url:"https://www.financialresearch.gov/financial-stress-index/"},mempool:{name:"mempool.space",url:"https://mempool.space"},deribit:{name:"Deribit",url:"https://www.deribit.com"},coinpaprika:{name:"Coinpaprika",url:"https://coinpaprika.com"},frankfurter:{name:"Frankfurter (ECB)",url:"https://frankfurter.dev"}},zd={name:"clock",category:"tools",iconUrl:x("clock"),layout:{w:3,h:2,minW:2,minH:1},description:"Digital clock showing the current time, ticking every second. Configurable IANA timezone (defaults to the viewer's local zone), 12/24-hour format, optional seconds and date, the timezone abbreviation, and a caption label. Drop several with different timezones for a trading-desk world clock. Needs no data provider.",capabilities:[],schema:v({timezone:z().default("").describe(`IANA timezone, e.g. "America/New_York", "Europe/London", "Asia/Tokyo", "UTC". Empty = the viewer's local timezone.`),label:z().default("").describe('Caption under the time, e.g. "New York" or "Local". Empty hides it.'),hour12:W().default(!1).describe("12-hour clock with AM/PM (true) or 24-hour (false)."),showSeconds:W().default(!0).describe("Show seconds (HH:MM:SS) instead of just HH:MM."),showMillis:W().default(!1).describe("Show milliseconds (HH:MM:SS.mmm), updated smoothly each animation frame. Implies seconds."),showDate:W().default(!1).describe("Show the weekday and date under the time."),showTimezone:W().default(!0).describe('Show the timezone abbreviation (e.g. "EST", "GMT+7", "UTC") in the caption. Combines with the label when set, e.g. "New York · EST".')})},Sd={name:"market-hours",category:"tools",iconUrl:x("market-hours"),layout:{w:4,h:4,minW:3,minH:3},description:"Which world stock exchanges are open right now — each row shows an open / closed / holiday status dot and a live countdown to the next open or close. Computed entirely client-side from each exchange's timezone and regular trading hours (no API); a bundled 2026 holiday list keeps the major Western exchanges accurate on market holidays. Intraday lunch breaks and half-day early closes are not modelled. Needs no data provider.",capabilities:[],schema:v({exchanges:B(z()).default([]).describe('Exchange codes to show, e.g. ["NYSE","LSE","TSE","HKEX","SET"]. Empty = a global default set. Known codes: NYSE, NASDAQ, TSX, B3, LSE, XETRA, EURONEXT, SIX, TSE, HKEX, SSE, NSE, KRX, SGX, SET, ASX, JSE, TADAWUL.'),sort:N(["region","status","name"]).default("region").describe("Order rows by world region (Americas → Europe → Asia-Pacific → Middle East/Africa), by status (open first), or alphabetically by name.")})},Td={name:"fear-greed",category:"sentiment",iconUrl:x("fear-greed"),layout:{w:3,h:3,minW:2,minH:2},description:"Crypto Fear & Greed index (0 = extreme fear, 100 = extreme greed) with a recent-history sparkline. A one-number market mood gauge from alternative.me.",capabilities:["sentiment"],source:A.alternativeMe,schema:v({sparklineDays:_().int().min(7).max(90).default(30).describe("How many days of index history to show in the sparkline.")})},Ed={name:"funding-rate-chart",category:"derivatives",iconUrl:x("funding-rate-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart comparing hourly perp funding rates across symbols over a configurable lookback window. Positive funding = longs pay shorts. Useful for spotting crowded trades.",capabilities:["funding-history"],source:A.hyperliquid,schema:v({symbols:B(z()).min(1).max(6).describe('Hyperliquid symbols to compare funding for, e.g. ["xyz:TSLA", "xyz:NVDA"]. Up to 6.'),lookback:N(["24h","7D","1M"]).default("7D").describe("History window for the funding chart.")})},Cd={name:"note",category:"layout",iconUrl:x("note"),layout:{w:4,h:3,minW:2,minH:2},description:"Free-form text note pinned to the dashboard — trading plans, reminders, watch levels. Needs no data provider.",capabilities:[],schema:v({text:z().min(1).describe("The note's text content. Plain text; newlines are preserved."),align:N(["left","center"]).default("left").describe("Text alignment inside the card.")})},Pd={name:"price-chart",category:"markets",iconUrl:x("price-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Live animated price chart (candlestick or line) for one symbol — canvas-rendered at 60fps via liveline, streaming live off the Hyperliquid WebSocket. Works for any HIP-3 perp — stocks (xyz:TSLA), indices (xyz:SP500), commodities (xyz:GOLD) — and crypto (BTC). The centerpiece frame.",capabilities:["ohlcv","quote-stream"],source:A.hyperliquid,schema:v({symbol:z().min(1).describe('Hyperliquid symbol to chart. HIP-3 cross-asset: stocks "xyz:TSLA"/"xyz:NVDA", indices "xyz:SP500"/"xyz:XYZ100", commodities "xyz:GOLD"/"xyz:CL", FX "xyz:EUR". Crypto: "BTC", "ETH".'),interval:N(["1m","5m","15m","1h","4h","1d"]).default("1h").describe("Candle interval."),mode:N(["candle","line"]).default("candle").describe("Candlestick or smooth line rendering."),color:z().default("#8b8df9").describe("Accent color (hex). The whole palette derives from it.")})},Ad={name:"price-liveline",category:"markets",iconUrl:x("price-liveline"),layout:{w:6,h:3,minW:4,minH:2},description:"Multi-asset live price liveline — several Hyperliquid symbols streaming in one canvas chart. Defaults to normalized % movement so stocks and crypto can share one axis, while the legend still shows each asset's live raw price. Use when the dashboard needs one compact live race view instead of several single-symbol charts.",capabilities:["quote-stream","day-stats"],source:A.hyperliquid,schema:v({symbols:B(z()).min(2).max(8).describe('Hyperliquid symbols to stream together — great cross-asset (the normalized view races a stock vs the index vs gold vs crude), e.g. ["xyz:NVDA", "xyz:SP500", "xyz:GOLD", "xyz:CL"], or all-equity ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"], or crypto ["BTC", "ETH", "SOL"]. 2 to 8.'),windowSec:_().int().min(10).max(300).default(30).describe("Rolling live window in seconds. 30 mirrors the zhive liveline view; use 60–300 for slower dashboards."),normalize:W().default(!0).describe("Show each asset as % movement from its first live tick (recommended when prices differ). Off = raw price overlay.")})},Rd={name:"price-ticker",category:"markets",iconUrl:x("price-ticker"),layout:{w:3,h:3,minW:2,minH:2},description:"Live watchlist streaming mid prices over the Hyperliquid WebSocket with 24h change per symbol. The bread-and-butter frame for any dashboard.",capabilities:["quote-stream","day-stats"],source:A.hyperliquid,schema:v({symbols:B(z()).min(1).describe('Hyperliquid symbols to track — mix asset classes, e.g. ["xyz:NVDA", "xyz:SP500", "xyz:GOLD", "xyz:EUR"] or all-equity ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"]. Crypto works too: "BTC", "ETH".')})},Dd={name:"top-movers",category:"markets",iconUrl:x("top-movers"),layout:{w:5,h:3,minW:3,minH:3},description:"Today's biggest stock and commodity HIP-3 gainers and losers (no bare crypto), side by side with current price and 24h change.",capabilities:["day-stats"],source:A.hyperliquid,schema:v({count:_().int().min(3).max(10).default(5).describe("How many gainers and losers to list (each).")})},Md={name:"tvl-treemap",category:"crypto",iconUrl:x("tvl-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of total value locked (TVL) across the largest blockchain ecosystems, sized by TVL. Data from DeFiLlama. Good single-glance answer to 'where does on-chain capital live right now'.",capabilities:["tvl"],source:A.defillama,schema:v({topN:_().int().min(3).max(30).default(12).describe("How many of the largest chains to show in the treemap.")})},Nd={name:"bitcoin-dominance",category:"crypto",iconUrl:x("bitcoin-dominance"),layout:{w:4,h:2,minW:3,minH:2},description:"BTC / ETH / Others market-cap dominance as a segmented bar, with optional total marketcap line. Shifts in BTC dominance hint at where the market rotates next.",capabilities:["global-market"],source:A.coingecko,schema:v({showTotalMarketCap:W().default(!0).describe("Show total crypto marketcap and its 24h change below the bar.")})},Od={name:"rates-board",category:"macro",iconUrl:x("rates-board"),layout:{w:4,h:4,minW:3,minH:3},description:"Official US rates board from free public APIs: New York Fed reference rates (SOFR, effective fed funds, repo rates) plus Treasury average interest rates by security class. Daily/reference data, not a real-time stock quote feed.",capabilities:["reference-rates","treasury-rates"],source:[A.nyFed,A.treasury],schema:v({maxReferenceRates:_().int().min(2).max(8).default(5).describe("How many New York Fed reference rates to show."),showTreasuryAverageRates:W().default(!0).describe("Also show Treasury average interest rates by security class from Fiscal Data."),maxTreasuryRates:_().int().min(1).max(8).default(4).describe("How many Treasury average-rate rows to show.")})},Id={name:"fx-board",category:"macro",iconUrl:x("fx-board"),layout:{w:4,h:4,minW:3,minH:3},description:"Foreign-exchange board from the ECB's free daily reference rates (via Frankfurter, no key): each currency's latest rate vs a base, its day-over-day change, and a short trend sparkline. Daily reference data with broader currency coverage than the handful of FX perps — not a live intraday quote feed.",capabilities:["fx-rates"],source:A.frankfurter,schema:v({base:z().length(3).default("USD").describe('Base currency (ISO 4217 code) each rate is quoted against, e.g. "USD". One unit of the base buys the shown amount of each listed currency.'),symbols:B(z().length(3)).min(1).max(12).default(["EUR","GBP","JPY","CHF","CAD","AUD"]).describe('Currencies to show (ISO 4217 codes), e.g. ["EUR","GBP","JPY"]. The ECB publishes ~30; a code equal to the base is skipped.'),showSparkline:W().default(!0).describe("Show a small ~30-day trend sparkline next to each rate.")})},$d={name:"inflation-pulse",category:"macro",iconUrl:x("inflation-pulse"),layout:{w:4,h:3,minW:3,minH:2},description:"BLS CPI pulse from the public no-key API: latest CPI-U all-items index with month-over-month and year-over-year changes plus a small trend sparkline. Monthly macro context for stock dashboards; not a live price feed.",capabilities:["macro-series"],source:A.bls,schema:v({months:_().int().min(13).max(36).default(18).describe("How many monthly CPI observations to show in the trend.")})},Fd={name:"financial-stress",category:"macro",iconUrl:x("financial-stress"),layout:{w:4,h:3,minW:3,minH:2},description:"The OFR Financial Stress Index — a daily, market-based gauge of systemic financial stress from the U.S. Office of Financial Research. One headline value where 0 is the long-run average (positive = elevated stress, negative = calmer than normal), an optional breakdown of the five contributing categories (credit, equity valuation, safe assets, funding, volatility), and a trend line. Keyless official data, updated each business day; needs the zframes runtime's data proxy (ships with `zframes serve` / `vite dev`). Not a price feed.",capabilities:["financial-stress"],source:A.ofr,schema:v({trendDays:_().int().min(20).max(90).default(60).describe("How many recent daily readings to plot in the trend line."),showCategories:W().default(!0).describe("Show the five category contributions (credit, equity valuation, safe assets, funding, volatility) under the headline.")})},Ld={name:"national-debt",category:"macro",iconUrl:x("national-debt"),layout:{w:4,h:3,minW:3,minH:2},description:"U.S. total public debt outstanding from the Treasury's keyless 'Debt to the Penny' dataset — the headline total in trillions, the change over the chosen window, an optional split into debt held by the public vs intragovernmental holdings, and a trend line. Official data updated each business day; CORS-safe (no proxy needed). Macro context, not a live price feed.",capabilities:["national-debt"],source:A.treasury,schema:v({trendDays:_().int().min(30).max(365).default(180).describe("How many business days of history to load for the trend and the change figure."),showSplit:W().default(!0).describe("Show the debt-held-by-the-public vs intragovernmental-holdings split.")})},jd={name:"labor-market",category:"macro",iconUrl:x("labor-market"),layout:{w:4,h:3,minW:3,minH:2},description:"U.S. labor-market snapshot from the BLS keyless public API: the headline unemployment rate, the latest monthly change in nonfarm payrolls (jobs added or lost), the total payroll level, and an unemployment-rate trend line. Monthly macro context for stock dashboards; updates on the BLS jobs-report schedule, not a live feed.",capabilities:["macro-series"],source:A.bls,schema:v({months:_().int().min(13).max(36).default(18).describe("How many monthly observations to show in the trend.")})},Ud={name:"treasury-auctions",category:"macro",iconUrl:x("treasury-auctions"),layout:{w:5,h:4,minW:3,minH:3},description:"Recent completed U.S. Treasury auctions from the keyless Fiscal Data API — each row shows the security (bill/note/bond + term), the high awarded yield, and the bid-to-cover ratio (demand: total bids ÷ amount accepted; higher = stronger). Newest first. Official market-plumbing data, CORS-safe; updates as auctions settle, not a live price feed.",capabilities:["treasury-auctions"],source:A.treasury,schema:v({count:_().int().min(3).max(20).default(8).describe("How many recent auctions to list (newest first).")})},Bd={name:"filings-feed",category:"equities",iconUrl:x("filings-feed"),layout:{w:5,h:4,minW:3,minH:3},description:"Recent SEC EDGAR filings for one US-listed company — each row shows the form type (10-K, 10-Q, 8-K, Form 4…), a plain-English label, the filing date, and a click-through to the document on sec.gov, under a header with the company name, exchange, and filer category. Official data from SEC's free, CORS-safe submissions endpoint; event-driven (updates when the company files), not a price feed. Resolve by ticker (a bundled snapshot of the ~500 largest US issuers) or by raw SEC CIK for anything else.",capabilities:["filings"],source:A.secEdgar,schema:v({symbol:z().min(1).describe('Company to show filings for — a ticker ("AAPL", "NVDA"), a HIP-3 symbol ("xyz:TSLA"), or a raw SEC CIK ("320193"). Tickers outside the bundled top-500 map need a CIK.'),forms:N(["important","all","insider"]).default("important").describe('Which filings to surface: "important" = periodic & material reports (10-K, 10-Q, 8-K, S-1, proxies, 13D/G…); "insider" = ownership forms (3/4/5/144); "all" = unfiltered. Always newest first.'),count:_().int().min(3).max(25).default(8).describe("How many filings to list (newest first).")})},Vd={name:"yield-curve",category:"macro",iconUrl:x("yield-curve"),layout:{w:4,h:3,minW:3,minH:3},description:"The U.S. Treasury daily par yield curve — a line from 1-month to 30-year yields, the headline 2s10s spread (10Y minus 2Y; negative = inverted, the classic recession signal), and a configurable row of key maturities. Keyless official data from the U.S. Treasury, updated each business day; not a live intraday feed.",capabilities:["yield-curve"],source:A.treasury,schema:v({maturities:B(N(["1M","2M","3M","4M","6M","1Y","2Y","3Y","5Y","7Y","10Y","20Y","30Y"])).min(2).max(8).default(["3M","2Y","5Y","10Y","30Y"]).describe("Maturities to show as labelled cells under the curve (the full curve line always shows every maturity).")})},Hd={name:"fundamentals",category:"equities",iconUrl:x("fundamentals"),layout:{w:4,h:3,minW:3,minH:3},description:"Headline financials for one US-listed company from SEC EDGAR XBRL company facts — revenue, net income, total assets, shareholders' equity, diluted EPS, and shares outstanding, each labelled with its fiscal period. Income-statement figures are the latest full fiscal year; balance-sheet figures are the latest reported quarter. Keyless official data that updates only when the company files (annual/quarterly), not a live feed. Requires the zframes runtime's data proxy (it ships with `zframes serve` / `vite dev`); resolve by ticker (bundled top-500 map) or raw SEC CIK.",capabilities:["fundamentals"],source:A.secEdgar,schema:v({symbol:z().min(1).describe('Company to show financials for — a ticker ("AAPL", "NVDA"), a HIP-3 symbol ("xyz:NVDA"), or a raw SEC CIK ("320193"). Tickers outside the bundled top-500 map need a CIK.')})},Zd={name:"short-volume",category:"equities",iconUrl:x("short-volume"),layout:{w:5,h:4,minW:3,minH:3},description:"Daily reported short-sale volume for a watchlist of US-listed stocks, from FINRA's free consolidated file — each row shows the % of the day's reported volume that was sold short, with a bar and the raw short/total share counts. IMPORTANT: this is reported short volume (sell-side short flow, which includes market-maker hedging), NOT short interest (outstanding short positions), and is not a directional signal on its own. Daily data published the next business day; not a live feed. US equities only.",capabilities:["short-volume"],source:A.finra,schema:v({symbols:B(z()).min(1).max(12).describe('US-listed stock tickers to show, e.g. ["TSLA","NVDA","AAPL"]. HIP-3 symbols ("xyz:TSLA") work too — the dex prefix is stripped. Crypto has no SEC/FINRA short-volume and is ignored.'),sort:N(["shortPct","volume","symbol"]).default("shortPct").describe("Order rows by short % of volume (highest first), by total volume (highest first), or alphabetically by symbol.")})},Yd={name:"funding-heatmap",category:"derivatives",iconUrl:x("funding-heatmap"),layout:{w:6,h:3,minW:4,minH:3},description:"Heatmap of perp funding rates — symbols as rows, daily average over the last 7 days as columns, green positive / red negative. Spots persistent funding regimes at a glance.",capabilities:["funding-history"],source:A.hyperliquid,schema:v({symbols:B(z()).min(2).max(8).describe('Hyperliquid symbols as heatmap rows — at least 2, since the heatmap compares funding across symbols, e.g. ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"].')})},Wd={name:"dino-game",category:"games",iconUrl:x("dino-game"),layout:{w:4,h:3,minW:3,minH:3},description:"Chrome-dino style runner game on canvas — jump cacti with SPACE or tap. High score persists locally. For when the market is boring. Needs no data provider.",capabilities:[],schema:v({})},Gd={name:"image",category:"layout",iconUrl:x("image"),layout:{w:3,h:3,minW:1,minH:1},description:"Displays an image from a URL — logos, memes, chart screenshots, banners. Needs no data provider.",capabilities:[],schema:v({url:z().min(1).describe("Image URL (https)."),alt:z().default("").describe("Alt text for accessibility."),fit:N(["cover","contain"]).default("cover").describe("How the image fills the frame: cover crops, contain letterboxes.")})},qd={name:"heading",category:"layout",iconUrl:x("heading"),layout:{w:12,h:1,minW:2,minH:1,maxH:1},description:"Section divider that titles a region of the dashboard ('Markets', 'On-chain', 'Desk'). Renders as a label with a hairline rule — no card. Use to group frames into zones: place full-width (w: 12) and 1 row tall (h: 1) above each group. Needs no data provider.",capabilities:[],chrome:"bare",schema:v({title:z().min(1).describe("The heading text."),subtitle:z().optional().describe("Smaller supporting line under the title.")})},Xd={name:"daily-analysis",category:"tools",iconUrl:x("daily-analysis"),layout:{w:6,h:3,minW:3,minH:2},description:"Daily market brief written by the /zframes-brief loop — a dated analysis of the symbols on your dashboard, the calls it is making today, and how yesterday's calls scored (with a running hit-rate). Reads a local log file the loop appends to; needs no market data provider. Add one per dashboard.",capabilities:[],schema:v({src:z().default("/daily-analysis.json").describe("URL of the analysis log the loop writes, served from the app's public/ dir. Leave as the default unless you renamed the file."),entries:_().int().min(1).max(5).default(1).describe("How many of the most recent daily entries to show (newest first)."),refreshSec:_().int().min(30).default(300).describe("How often (seconds) to re-fetch the log so a fresh brief appears without a manual reload.")})},Kd={name:"journal-log",category:"journal",iconUrl:x("journal-log"),layout:{w:4,h:5,minW:3,minH:4},source:A.hyperliquid,description:"Log a market read in seconds: pick a supported ticker (with its live Hyperliquid price), Long or Short, the reason (a quick pick + optional note), and how sure you are (a slider). That's it — a falsifiable call, captured at the live price, that the Open/Results frames then track and grade. The simple front door to your decision journal; pairs with the zAI orb for conversational capture. Add one alongside Journal · Open and Journal · Results.",capabilities:["quote-stream","day-stats"],schema:v({})},Jd={name:"journal-open",category:"journal",iconUrl:x("journal-open"),layout:{w:4,h:4,minW:3,minH:3},description:"Your open calls from the decision journal, each marking to the live Hyperliquid price — direction, confidence, unrealized % return, a live entry→target track, and a countdown. Calls auto-grade at their horizon (or close one early). The 'watch it play out' frame. Reads the journal you write with Journal · Log.",source:A.hyperliquid,capabilities:["quote-stream"],schema:v({max:_().int().min(1).max(20).default(8).describe("How many open calls to show (newest first).")})},Qd={name:"journal-results",category:"journal",iconUrl:x("journal-results"),layout:{w:4,h:4,minW:3,minH:3},description:"Your resolved calls from the decision journal, graded on TWO axes: did it hit, AND did the thesis actually play out — so a lucky hit reads differently from earned skill, and a near-miss from a clean miss. The reflection frame. Reads the journal you write with Journal · Log.",capabilities:[],schema:v({max:_().int().min(1).max(20).default(8).describe("How many resolved calls to show (newest first).")})},ef={name:"journal-score",category:"journal",iconUrl:x("journal-score"),layout:{w:4,h:2,minW:3,minH:2},description:"The decision-journal scoreboard — a story, not a spreadsheet: where your judgment has an edge, where it leaks, and how calibrated your confidence is, plus a one-line read from zAI. Aggregates the calls logged via Journal · Log.",capabilities:[],schema:v({})},tf={name:"price-compare",category:"markets",iconUrl:x("price-compare"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart overlaying the price history of several symbols over a lookback window — see how TSLA, NVDA and BTC moved against each other. Normalized by default to % change from the window start so symbols at very different price levels (BTC vs a $20 stock) stay comparable on one axis. Candles from Hyperliquid.",capabilities:["ohlcv"],source:A.hyperliquid,schema:v({symbols:B(z()).min(2).max(6).describe('Hyperliquid symbols to overlay, e.g. ["xyz:TSLA", "xyz:NVDA", "BTC"]. 2 to 6.'),lookback:N(["24h","7D","1M"]).default("7D").describe("History window for the comparison."),normalize:W().default(!0).describe("Rebase each series to % change from the window start (recommended — lets symbols at different price levels share one axis). Off = raw price, only sensible when comparing similarly-priced symbols.")})},jt={source:N(["binance","wallet"]).default("binance").describe('Where the holdings come from: "binance" (a connected Binance account — a read-only API key is entered in-app and stored locally, never in this file) or "wallet" (a public on-chain address, keyless).'),address:z().default("").describe('For source "wallet": the public Ethereum address (0x…) or ENS name to track. Public on-chain data, no keys. Ignored for "binance".')},rf={name:"portfolio-value",category:"portfolio",iconUrl:x("portfolio-value"),layout:{w:5,h:4,minW:3,minH:3},description:"Your connected portfolio's total USD value as a live equity line, ticking with the market. Source is a connected Binance account (read-only key, entered in-app) or a public on-chain wallet address. Shows total value + session change. Renders a connect prompt until a source is set.",capabilities:["portfolio","quote-stream"],account:!0,schema:v({...jt,windowSec:_().int().positive().default(300).describe("Seconds of live history the equity line shows; it accumulates from when the dashboard opens.")})},of={name:"portfolio-allocation",category:"portfolio",iconUrl:x("portfolio-allocation"),layout:{w:4,h:4,minW:3,minH:3},description:"Donut of your connected portfolio's allocation — each slice sized by live USD value, total in the center. Source is a connected Binance account (read-only key, in-app) or a public on-chain wallet address. Renders a connect prompt until a source is set.",capabilities:["portfolio","quote-stream"],account:!0,schema:v({...jt})},nf={name:"portfolio-holdings",category:"portfolio",iconUrl:x("portfolio-holdings"),layout:{w:4,h:4,minW:3,minH:3},description:"Table of your connected portfolio's positions — asset, amount, live USD value, share of total, 24h change. Source is a connected Binance account (read-only key, in-app) or a public on-chain wallet address. Renders a connect prompt until a source is set.",capabilities:["portfolio","quote-stream"],account:!0,schema:v({...jt})},af={name:"news-feed",category:"sentiment",iconUrl:x("news-feed"),layout:{w:4,h:4,minW:3,minH:3},description:'Scrolling feed of the latest news headlines from a chosen outlet — each row is a clickable headline with its publish time, newest first. Free, keyless RSS sources: crypto press (CoinDesk, Cointelegraph, Decrypt), broad markets/macro (CNBC, Nasdaq), or — source "stocks" — per-company headlines (via Google News) scoped to the specific tickers in `symbols`. IMPORTANT: news feeds are CORS-blocked, so this frame reads them through the zframes runtime\'s data proxy (it ships with `zframes serve` / `vite dev`); on a fully static host with no runtime it shows an empty state.',capabilities:["news"],schema:v({source:N(["coindesk","cointelegraph","decrypt","cnbc","nasdaq","stocks"]).default("coindesk").describe('Which feed to show. Crypto press: "coindesk", "cointelegraph", "decrypt". Markets/macro: "cnbc", "nasdaq". "stocks" = per-company headlines (Google News) for the tickers in `symbols`.'),symbols:B(z()).default([]).describe('Only used when source is "stocks": stock tickers to pull headlines for, e.g. ["TSLA","NVDA","AAPL"]. HIP-3 symbols ("xyz:TSLA") work too — the dex prefix is stripped. Ignored for the other sources.'),count:_().int().min(3).max(20).default(8).describe("How many headlines to list (newest first).")})},sf={name:"dex-volume-treemap",category:"crypto",iconUrl:x("dex-volume-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of decentralized-exchange (DEX) protocols sized by trailing-24h trading volume, tiles colored green/red by 1-day change. Data from DeFiLlama. One-glance read on where on-chain trading flow is concentrated right now.",capabilities:["dex-volume"],source:A.defillama,schema:v({topN:_().int().min(3).max(30).default(12).describe("How many of the highest-volume DEX protocols to show.")})},cf={name:"dex-volume-chart",category:"crypto",iconUrl:x("dex-volume-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart of daily DEX trading volume for several protocols over a lookback window — compare how Uniswap, PancakeSwap, Aerodrome etc. trend against each other. Data from DeFiLlama (daily granularity).",capabilities:["dex-volume"],source:A.defillama,schema:v({protocols:B(z()).min(1).max(6).describe('DeFiLlama DEX protocol slugs (lowercase, hyphenated), e.g. ["uniswap", "pancakeswap", "aerodrome-slipstream"]. 1 to 6.'),lookback:N(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},lf={name:"protocol-tvl-treemap",category:"crypto",iconUrl:x("protocol-tvl-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of DeFi protocols sized by current total value locked (TVL), tiles colored green/red by 1-day change. Data from DeFiLlama. Unlike tvl-treemap (which groups by blockchain), this ranks individual protocols (Lido, Aave, EigenLayer…).",capabilities:["protocol-tvl"],source:A.defillama,schema:v({topN:_().int().min(3).max(30).default(12).describe("How many of the largest protocols by TVL to show.")})},uf={name:"protocol-tvl-chart",category:"crypto",iconUrl:x("protocol-tvl-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart of total value locked (TVL) for several DeFi protocols over a lookback window. Data from DeFiLlama (daily granularity).",capabilities:["protocol-tvl"],source:A.defillama,schema:v({protocols:B(z()).min(1).max(6).describe('DeFiLlama protocol slugs (lowercase, hyphenated), e.g. ["lido", "aave", "eigenlayer"]. 1 to 6.'),lookback:N(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},df={name:"protocol-fees-treemap",category:"crypto",iconUrl:x("protocol-fees-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of protocols sized by the fees they generated in the last 24h, tiles colored green/red by 1-day change. Data from DeFiLlama. Shows where on-chain users are actually paying for blockspace and services right now.",capabilities:["protocol-fees"],source:A.defillama,schema:v({topN:_().int().min(3).max(30).default(12).describe("How many of the highest fee-earning protocols to show.")})},ff={name:"market-cap-treemap",category:"crypto",iconUrl:x("market-cap-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of the largest cryptocurrencies sized by market capitalisation, tiles colored green/red by 24h price change. Data from CoinGecko (free tier). A heat-map of the whole crypto market at a glance.",capabilities:["coin-markets"],source:A.coingecko,schema:v({topN:_().int().min(5).max(50).default(12).describe("How many of the largest coins by market cap to show (up to 50).")})},mf={name:"open-interest",category:"derivatives",iconUrl:x("open-interest"),layout:{w:4,h:3,minW:3,minH:2},description:'Live open interest across a watchlist of Hyperliquid perps — each symbol is a horizontal bar sized by USD notional, largest first, refreshed on a ~30s poll. Single-venue (Hyperliquid only), so read it as a relative gauge across your symbols, not a market-wide total. Stocks (HIP-3, e.g. "xyz:TSLA") and crypto both work.',capabilities:["open-interest"],source:A.hyperliquid,schema:v({symbols:B(z()).min(1).max(20).describe(`Hyperliquid symbols to compare open interest for, e.g. ["BTC", "ETH", "xyz:TSLA"]. A "<dex>:*" wildcard (e.g. "xyz:*") pulls that dex's entire universe.`)})},pf={name:"snake",category:"games",iconUrl:x("snake"),layout:{w:4,h:4,minW:3,minH:3},description:"Classic snake game on canvas — steer with the arrow keys (or swipe), eat dots to grow, avoid the walls and your own tail. High score persists locally. For when the market is flat. Needs no data provider.",capabilities:[],schema:v({})},hf={name:"flappy-bird",category:"games",iconUrl:x("flappy-bird"),layout:{w:4,h:4,minW:3,minH:3},description:"Flappy-bird style game on canvas — tap or press SPACE to flap through the gaps between pipes. High score persists locally. Needs no data provider.",capabilities:[],schema:v({})},gf={name:"video",category:"layout",iconUrl:x("video"),layout:{w:4,h:3,minW:2,minH:2},description:"Embeds a video from a YouTube or Vimeo link (or any direct embed URL) as an iframe — a livestream, a market-news clip, a focus playlist. Needs no data provider.",capabilities:[],schema:v({url:z().min(1).describe("Video URL — a YouTube watch/share link, a Vimeo link, or a direct embeddable URL (https)."),title:z().default("Video").describe("Accessible title for the embedded player (iframe title).")})},yf={name:"drawdy",category:"layout",iconUrl:x("drawdy"),layout:{w:8,h:6,minW:2,minH:2},description:"Embeds drawdy.io as an interactive whiteboard canvas. No configuration needed.",capabilities:[],schema:v({})},vf={name:"countdown",category:"tools",iconUrl:x("countdown"),layout:{w:3,h:2,minW:2,minH:1},description:"Live countdown to a target date and time — FOMC decisions, CPI prints, options expiry, earnings, a token unlock, the next market open. Counts down in days / hours / minutes / seconds, ticking every second, and flips to a 'reached' state once the moment passes. Needs no data provider.",capabilities:[],schema:v({target:z().default("").describe(`The moment to count down to, as an ISO 8601 string. Add a timezone for an unambiguous instant, e.g. "2026-07-30T18:00:00-04:00" or "2026-12-31T23:59:59Z"; a bare "2026-07-30T18:00" is read in the viewer's local timezone. Empty shows a "set a target" prompt.`),label:z().default("").describe('Caption above the countdown, e.g. "FOMC Decision". Empty hides it.'),showTarget:W().default(!0).describe("Show the formatted target date and time under the countdown.")})},bf={name:"link-grid",category:"tools",iconUrl:x("link-grid"),layout:{w:3,h:2,minW:2,minH:1},description:"A grid of quick-launch tiles linking to your favourite sites — TradingView, exchanges, news, docs, your own dashboards. Each tile opens in a new tab and shows the destination site's favicon by default (fetched keyless from a public favicon service), with an optional per-link icon override and a first-letter fallback. Needs no data provider.",capabilities:[],schema:v({links:B(v({label:z().min(1).describe('Tile caption, e.g. "TradingView".'),url:z().min(1).describe("Destination URL (https). Opens in a new tab."),icon:z().default("").describe(`Optional icon override: an emoji (e.g. "📈") or an https image URL. Empty uses the destination site's favicon, falling back to the label's first letter.`)})).min(1).default([{label:"TradingView",url:"https://www.tradingview.com",icon:"📈"},{label:"Hyperliquid",url:"https://app.hyperliquid.xyz",icon:"⚡"}]).describe("The links to show as tiles. At least one."),columns:_().int().min(1).max(4).default(2).describe("How many tiles per row.")})},wf={name:"calculator",category:"tools",iconUrl:x("calculator"),layout:{w:3,h:3,minW:2,minH:2},description:"Position-size & risk calculator. Enter account size, risk-per-trade %, entry and stop price; it computes the dollars at risk, the per-unit risk, the position size (units) that respects that risk budget, the resulting position value, and whether the setup is long or short. All math runs client-side — no data provider. Inputs are editable live; the configured values are the starting point.",capabilities:[],schema:v({account:_().positive().default(1e4).describe("Account size used as the risk base, in the quote currency."),riskPct:_().positive().max(100).default(1).describe("Percent of the account risked on the trade, e.g. 1 = 1%."),entry:_().positive().default(100).describe("Entry price."),stop:_().positive().default(95).describe("Stop-loss price. Its distance from entry sets the per-unit risk; below entry = long, above = short."),currency:z().default("$").describe("Currency symbol shown next to money values.")})},xf={name:"quote",category:"layout",iconUrl:x("quote"),layout:{w:4,h:2,minW:2,minH:1},description:'Displays a market or trading quote, centered — set one or rotate through several. A calm bit of wall-art for the dashboard: trading maxims, reminders of your own rules, mantras. Write any attribution into the text itself (e.g. "… — Buffett"). Needs no data provider.',capabilities:[],schema:v({quotes:B(z().min(1)).min(1).default(["Be fearful when others are greedy, and greedy when others are fearful. — Warren Buffett","The trend is your friend until the end when it bends.","Plan the trade, trade the plan."]).describe("One or more quotes. With more than one, the frame rotates through them."),intervalSec:_().int().min(0).default(12).describe("Seconds between rotations when there are multiple quotes. 0 shows the first quote, fixed.")})},_f={name:"divider",category:"layout",iconUrl:x("divider"),layout:{w:12,h:1,minW:1,minH:1},description:"A plain rule that separates regions of the dashboard, with an optional centered label. Renders chrome-less (no card) — lighter than a heading. Use a horizontal divider full-width between stacked zones, or set orientation to vertical for a 1-column-wide column separator. Needs no data provider.",capabilities:[],chrome:"bare",schema:v({label:z().default("").describe("Optional text shown in the middle of the rule. Empty = a clean line."),orientation:N(["horizontal","vertical"]).default("horizontal").describe("Horizontal rule (spans the width) or vertical rule (spans the height)."),style:N(["solid","dashed","dotted"]).default("solid").describe("Line style.")})},kf={name:"dice",category:"tools",iconUrl:x("dice"),layout:{w:2,h:2,minW:1,minH:1},description:"A click-to-decide widget — a random decision-maker with no data provider. Flip a coin (heads/tails), roll a die (1–6), or pick at random from your own list of options. Click the surface to re-roll. Use it to break a tie, pick what to trade, or settle any small decision.",capabilities:[],schema:v({mode:N(["coin","dice","list"]).default("coin").describe("coin = heads/tails, dice = 1–6, list = random pick from options."),options:B(z()).default(["Yes","No"]).describe("Choices used in list mode."),label:z().default("").describe("Optional caption, e.g. the question being decided.")})},zf={name:"risk-reward",category:"tools",iconUrl:x("risk-reward"),layout:{w:3,h:3,minW:2,minH:2},description:"Risk:reward planner. Enter entry, stop-loss and profit-target prices; it computes the per-unit risk and reward, their percentages of entry, and the resulting R:R ratio, shown large above a two-segment bar (red risk leg vs green reward leg, sized to scale). Pure client-side math — no data provider. Complements the calculator frame by adding the target/reward leg the position sizer leaves out.",capabilities:[],schema:v({entry:_().default(100).describe("Planned entry price."),stop:_().default(95).describe("Stop-loss price."),target:_().default(115).describe("Profit target price."),direction:N(["long","short"]).default("long").describe("Trade direction. Long expects stop < entry < target; short expects target < entry < stop — used for labels and to flag a mismatched setup."),label:z().default("").describe("Optional caption.")})},Sf={name:"marquee",category:"layout",iconUrl:x("marquee"),layout:{w:6,h:1,minW:2,minH:1},description:"A chrome-less scrolling banner that glides custom text continuously right-to-left across the frame (think stadium ticker / news crawl). Renders with no card — it fills the whole frame. Use for a slogan, a reminder, or a hype line. Needs no data provider.",capabilities:[],chrome:"bare",schema:v({text:z().default("LFG").describe("The text that scrolls across the banner."),speed:N(["slow","normal","fast"]).default("normal").describe("Scroll speed."),accent:W().default(!0).describe("Tint the text with the dashboard accent color.")})},Tf={name:"stopwatch",layout:{w:3,h:2,minW:2,minH:1},category:"tools",iconUrl:x("stopwatch"),description:"A count-up stopwatch — time-in-trade, a focus session, how long a setup has been live. Start / Pause / Reset, ticking up in H:MM:SS, and it persists across reloads (the running state is saved into the dashboard, so it keeps counting where it left off). Runs entirely client-side — needs no data provider.",capabilities:[],schema:v({label:z().default("Session").describe("Caption above the timer."),startedAt:_().default(0).describe("Epoch ms when the timer was last started; 0 = paused. Persisted automatically by the frame."),accumulatedMs:_().default(0).describe("Milliseconds banked before the current run. Persisted automatically by the frame.")})},Ef={name:"session-progress",category:"tools",iconUrl:x("session-progress"),layout:{w:3,h:2,minW:2,minH:1},description:"A horizontal progress bar showing how far through today's trading session an exchange is — fills from open to close with a percent readout, and a 'closes in …' / 'opens in …' countdown. Pick any exchange code (NYSE, NASDAQ, LSE, TSX, B3, …); sessions are computed client-side from the exchange's timezone and hours, so it needs no data provider.",capabilities:[],schema:v({exchange:z().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),label:z().default("").describe("Optional caption shown by the exchange code."),showCountdown:W().default(!0).describe("Show the time-to-open / time-to-close countdown.")})},Cf={name:"holiday-calendar",category:"tools",iconUrl:x("holiday-calendar"),layout:{w:3,h:4,minW:2,minH:2},description:"Upcoming market holidays (full closures) for a chosen exchange — the next few dates with their weekday and a countdown ('in 9d'). Pick any exchange code (NYSE, NASDAQ, LSE, TSX, B3, …); dates come from a bundled holiday table and are computed client-side, so it needs no data provider. Note: the bundled table currently covers 2026.",capabilities:[],schema:v({exchange:z().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),count:_().int().min(1).max(20).default(5).describe("How many upcoming holidays to list."),label:z().default("").describe("Optional caption shown above the list.")})},Pf={name:"day-meter",category:"tools",iconUrl:x("day-meter"),layout:{w:4,h:2,minW:2,minH:1},description:"A strip of the current week's days for a chosen exchange — today highlighted, market holidays flagged in amber, and (optionally) non-trading days greyed. Computed client-side from the exchange's trading days + a bundled holiday table; needs no data provider.",capabilities:[],schema:v({exchange:z().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),weekdaysOnly:W().default(!0).describe("Show only the exchange's trading days; off shows the full 7-day week with weekends greyed."),label:z().default("").describe("Optional caption shown by the strip.")})},Af={name:"returns-projector",category:"tools",iconUrl:x("returns-projector"),layout:{w:3,h:4,minW:2,minH:3},description:"A compound-growth projector — enter a starting principal, a percent return per period, the number of periods, and an optional per-period contribution; it charts the projected balance curve and shows the ending value and total gain. Pure client-side math, no data provider; complements the position-size/risk `calculator`.",capabilities:[],schema:v({principal:_().default(1e3).describe("Starting balance."),ratePct:_().default(5).describe("Return per period, in percent (e.g. 5 = 5%)."),periods:_().int().min(1).max(600).default(12).describe("Number of compounding periods to project."),contribution:_().default(0).describe("Amount added at the end of each period."),label:z().default("").describe("Optional caption.")})},Rf={name:"breakeven",category:"tools",iconUrl:x("breakeven"),layout:{w:3,h:4,minW:2,minH:2},description:"A break-even / average-cost calculator — add your fills (price + size) and it computes the size-weighted average entry; set an optional current price to see the unrealized P&L %. Pure client-side math, no data provider.",capabilities:[],schema:v({fills:B(v({price:_().describe("Fill price."),size:_().describe("Fill size, in units.")})).default([{price:100,size:1}]).describe("Your entry fills; their size-weighted average is the break-even."),currentPrice:_().default(0).describe("Optional current price; greater than 0 shows the unrealized P&L %."),label:z().default("").describe("Optional caption.")})},Df={name:"checklist",category:"tools",iconUrl:x("checklist"),layout:{w:3,h:3,minW:2,minH:2},description:"A tickable checklist — a pre-trade routine, a daily ritual, anything. Tap items to check them off; the checked state persists across reloads (saved into the dashboard). Client-side only, no data provider.",capabilities:[],schema:v({title:z().default("Pre-trade checklist").describe("Heading shown above the list."),items:B(z()).default(["Trend & bias aligned","Stop level set","Risk sized correctly"]).describe("The checklist items, top to bottom."),checked:B(W()).default([]).describe("Per-item checked state (by index); persisted automatically by the frame.")})},Mf={name:"pomodoro",category:"tools",iconUrl:x("pomodoro"),layout:{w:3,h:3,minW:2,minH:2},description:"A Pomodoro focus timer — alternating work and break intervals with Start / Pause / Reset and a cycle counter, counting down in MM:SS. Runs entirely client-side with no data provider; timer state is in-session (not persisted).",capabilities:[],schema:v({workMin:_().min(1).max(180).default(25).describe("Work interval length, in minutes."),breakMin:_().min(1).max(120).default(5).describe("Break interval length, in minutes."),cycles:_().int().min(1).max(20).default(4).describe("Work/break cycles before the counter loops."),label:z().default("").describe("Optional caption.")})},Nf={name:"rules-card",category:"layout",iconUrl:x("rules-card"),layout:{w:3,h:3,minW:2,minH:2},description:"A pinned, auto-numbered list of your trading rules (or any principles) — always fully visible, unlike the rotating `quote` frame. Static text, client-side, no data provider.",capabilities:[],schema:v({title:z().default("My rules").describe("Heading shown above the list."),rules:B(z()).default(["Cut losers fast, let winners run","No trade without a stop","One setup at a time"]).describe("The rules, in order; rendered as a numbered list.")})},Of={name:"breathing",category:"layout",iconUrl:x("breathing"),chrome:"bare",layout:{w:2,h:2,minW:1,minH:1},description:"A chrome-less breathing pacer — a circle that expands and contracts through configurable inhale / hold / exhale / hold phases to steady your breathing between trades. Renders with no card; client-side only, no data provider.",capabilities:[],schema:v({inhale:_().min(1).max(60).default(4).describe("Inhale seconds."),hold:_().min(0).max(60).default(4).describe("Hold-after-inhale seconds."),exhale:_().min(1).max(60).default(4).describe("Exhale seconds."),holdAfter:_().min(0).max(60).default(4).describe("Hold-after-exhale seconds.")})},If={name:"spotify-embed",category:"layout",iconUrl:x("spotify-embed"),layout:{w:3,h:4,minW:2,minH:2},description:"Embeds a Spotify track, album, playlist, artist, or show from its public open.spotify.com share link (same embed approach as the `video` frame), using Spotify's official keyless iframe player. Needs an internet connection to play.",capabilities:[],schema:v({url:z().default("https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M").describe("A Spotify share URL (open.spotify.com/track|album|playlist|artist/…)."),compact:W().default(!1).describe("Use Spotify's compact (single-row) player height.")})},$f={name:"btc-fees",category:"bitcoin",iconUrl:x("btc-fees"),layout:{w:3,h:2,minW:2,minH:2},description:"Recommended Bitcoin on-chain fee rates (sat/vB) from mempool.space — the next-block ('fastest'), ~30-minute, ~1-hour, economy, and minimum tiers, as a compact gauge. Live mempool data, keyless; updates every ~30s.",capabilities:["btc-fees"],source:A.mempool,schema:v({tiers:B(N(["fastest","halfHour","hour","economy","minimum"])).min(1).max(5).default(["fastest","halfHour","hour","economy"]).describe('Which fee tiers to show, in order. "fastest" = next block, "halfHour"/"hour" = within ~30/60 min, "economy"/"minimum" = cheapest relayable.')})},Ff={name:"btc-mempool",category:"bitcoin",iconUrl:x("btc-mempool"),layout:{w:5,h:3,minW:3,minH:2},description:"Bitcoin mempool congestion at a glance — unconfirmed transaction count, total pending vsize, and a row of projected ('template') blocks the network will likely mine next, each labelled with its median fee rate (sat/vB) and tx count. Live mempool data from mempool.space, keyless.",capabilities:["btc-mempool"],source:A.mempool,schema:v({projectedBlocks:_().int().min(1).max(8).default(5).describe("How many projected (yet-to-be-mined) blocks to show, next-to-mine first.")})},Lf={name:"btc-blocks",category:"bitcoin",iconUrl:x("btc-blocks"),layout:{w:5,h:4,minW:3,minH:3},description:"Feed of the most recently mined Bitcoin blocks — each row shows the height, how long ago it was mined, transaction count, the mining pool that found it, total fees (BTC), and size. Live data from mempool.space, keyless; newest first.",capabilities:["btc-blocks"],source:A.mempool,schema:v({count:_().int().min(3).max(15).default(8).describe("How many recent blocks to list (newest first).")})},jf={name:"btc-hashrate",category:"bitcoin",iconUrl:x("btc-hashrate"),layout:{w:6,h:3,minW:3,minH:2},description:"Bitcoin network hashrate over time as a line chart, with the current hashrate (EH/s) and difficulty as headline figures. Shows the long-run security trend of the network. Data from mempool.space (daily granularity), keyless.",capabilities:["btc-hashrate"],source:A.mempool,schema:v({window:N(["1y","2y","3y"]).default("1y").describe("History window for the hashrate line.")})},Uf={name:"btc-difficulty",category:"bitcoin",iconUrl:x("btc-difficulty"),layout:{w:4,h:3,minW:3,minH:2},description:"Countdown to the next Bitcoin difficulty adjustment — a progress bar through the current 2016-block epoch, the estimated change (+ = mining gets harder), blocks remaining, and the estimated retarget date. Also shows the previous adjustment. Data from mempool.space, keyless.",capabilities:["btc-difficulty"],source:A.mempool,schema:v({showPrevious:W().default(!0).describe("Also show the percentage change applied at the previous retarget.")})},Bf={name:"mining-pools",category:"bitcoin",iconUrl:x("mining-pools"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of Bitcoin mining-pool dominance over a window — each tile is a pool sized by the share of blocks it mined, so you can see how concentrated hashpower is right now (Foundry, AntPool, ViaBTC…). Data from mempool.space, keyless.",capabilities:["mining-pools"],source:A.mempool,schema:v({window:N(["24h","3d","1w","1m"]).default("1w").describe("Window over which to measure each pool's block share."),topN:_().int().min(3).max(25).default(12).describe("How many of the largest pools to show; the rest fold into 'Other'.")})},Vf={name:"lightning-stats",category:"bitcoin",iconUrl:x("lightning-stats"),layout:{w:4,h:3,minW:3,minH:2},description:"Bitcoin Lightning Network snapshot — public node count, channel count, and total network capacity (BTC), with a day-over-day delta and the Tor/clearnet node split. Data from mempool.space, keyless; updates roughly daily.",capabilities:["lightning-stats"],source:A.mempool,schema:v({showSplit:W().default(!0).describe("Show the Tor vs clearnet node split under the headline stats.")})},Hf={name:"options-put-call",category:"derivatives",iconUrl:x("options-put-call"),layout:{w:4,h:3,minW:3,minH:2},description:"Deribit options put/call ratio for BTC or ETH — the headline ratio (by open interest or 24h volume), a call-vs-put open-interest split bar, and the open-interest-weighted average implied volatility. A ratio above 1 means puts outweigh calls (defensive positioning). Keyless Deribit market data.",capabilities:["options-summary"],source:A.deribit,schema:v({currency:N(["BTC","ETH"]).default("BTC").describe("Which Deribit options book to summarise — BTC or ETH (the only deeply liquid books)."),basis:N(["oi","volume"]).default("oi").describe('Headline put/call ratio basis: "oi" = by open interest (positioning), "volume" = by 24h traded volume (flow). The other is shown smaller.')})},Zf={name:"options-iv",category:"derivatives",iconUrl:x("options-iv"),layout:{w:6,h:3,minW:3,minH:2},description:"Deribit DVOL implied-volatility index for BTC or ETH over time — the crypto equivalent of the VIX, as a line chart with the current reading and its change over the window. Rising DVOL = the market is pricing bigger expected swings. Keyless Deribit market data.",capabilities:["volatility-index"],source:A.deribit,schema:v({currency:N(["BTC","ETH"]).default("BTC").describe("Which DVOL volatility index to plot — BTC or ETH."),lookback:N(["7D","1M","3M"]).default("1M").describe("History window for the volatility-index line.")})},Yf={name:"options-oi-strike",category:"derivatives",iconUrl:x("options-oi-strike"),layout:{w:6,h:4,minW:4,minH:3},description:"Open interest by strike for the nearest Deribit options expiry (BTC or ETH) — a grouped histogram of call vs put open interest across strikes, with the current spot marked. Surfaces the strike 'walls' where positioning is concentrated. Keyless Deribit market data.",capabilities:["options-summary"],source:A.deribit,schema:v({currency:N(["BTC","ETH"]).default("BTC").describe("Which Deribit options book — BTC or ETH."),strikes:_().int().min(6).max(30).default(14).describe("How many strikes nearest the current spot to show (centered on the underlying price).")})},Wf={name:"coin-movers",category:"markets",iconUrl:x("coin-movers"),layout:{w:5,h:4,minW:3,minH:3},description:"Broad-market crypto gainers and losers across the top ~300 coins by market cap, over a selectable window (1h / 24h / 7d / 30d) — the biggest movers side by side with price and % change. Unlike a top-coins heatmap, this surfaces mid- and small-caps that ripped or dumped, not just the megacaps. Keyless data from Coinpaprika. Crypto only.",capabilities:["coin-movers"],source:A.coinpaprika,schema:v({window:N(["1h","24h","7d","30d"]).default("24h").describe("Which price-change window ranks the movers: 1h (intraday momentum), 24h (daily), 7d (weekly), 30d (monthly)."),count:_().int().min(3).max(15).default(6).describe("How many gainers and how many losers to list (each side)."),minRank:_().int().min(20).max(300).default(150).describe("Only consider coins ranked at or above this market-cap rank — a liquidity floor that keeps illiquid micro-cap dust (which posts absurd % moves on no volume) out of the list. Lower = stricter (megacaps only); higher = includes more small-caps.")})},Gf=[af,rf,of,nf,Nd,zd,Xd,Wd,Td,Bd,Hd,Fd,jd,Ld,Ud,Yd,Ed,qd,Gd,$d,Sd,Cd,Pd,tf,Ad,Rd,Od,Id,Zd,Dd,Md,Vd,sf,cf,lf,uf,df,ff,mf,pf,hf,gf,yf,vf,bf,wf,xf,_f,$f,Ff,Lf,jf,Uf,Bf,Vf,Hf,Zf,Yf,Wf],qf=[...Gf,Rf,Of,Df,Pf,kf,Cf,Kd,Jd,Qd,ef,Sf,Mf,Af,zf,Nf,Ef,If,Tf],Xf=()=>null;function Kf(){const e=new Map;for(const t of qf){const r=kd[t.name];if(!r){console.warn(`[zframes] frame "${t.name}" has metadata but no lazy loader — it won't render`);continue}let o=null;const n=()=>o??(o=r.load().catch(i=>{throw o=null,i})),a=b.lazy(()=>n().then(i=>({default:i.component}))),s=r.titleIcon?b.lazy(()=>n().then(i=>(i.titleIcon||console.warn(`[zframes] frame "${t.name}" is flagged titleIcon but its module exports none`),{default:i.titleIcon??Xf}))):void 0;e.set(t.name,{...t,component:a,titleIcon:s})}return e}function Ut(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function Vo(e){return e.includes(":")}function Jf(e){const t=Ut(e);return Vo(e)?`https://assets.parqet.com/logos/symbol/${encodeURIComponent(t)}?format=png`:`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}const Or=["#5b6cff","#9b59ff","#e0608f","#e08a3c","#3fb6a8","#4f93e8","#7a8c52","#c0556b"];function Qf(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)|0;return Or[Math.abs(t)%Or.length]}function em({symbol:e,size:t=18,className:r=""}){const o=Ut(e),n=Vo(e),[a,s]=b.useState(!1);b.useEffect(()=>s(!1),[e]);const i=n?"rounded-[5px]":"rounded-full",c={width:t,height:t};return a?p.jsx("span",{"aria-hidden":!0,className:`inline-flex shrink-0 items-center justify-center font-bold leading-none text-white ${i} ${r}`,style:{...c,background:Qf(o),fontSize:Math.round(t*.42)},children:o.slice(0,2).toUpperCase()}):p.jsx("img",{src:Jf(e),width:t,height:t,alt:"","aria-hidden":!0,draggable:!1,loading:"lazy",onError:()=>s(!0),className:`shrink-0 object-contain ${i} ${n?"bg-white p-px":""} ${r}`,style:c})}const tm=["xyz:*"],rm=200,om="var(--zf-up, #3fd08f)",nm="var(--zf-down, #ff6b81)";function Ir(e){return e>=1e3?`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`:e>=1?`$${e.toLocaleString("en-US",{maximumFractionDigits:2})}`:`$${e.toPrecision(4)}`}const am=`
499
- .zf-tape {
500
- position: fixed;
501
- left: 0;
502
- right: 0;
503
- bottom: 0;
504
- z-index: 30;
505
- height: 36px;
506
- display: flex;
507
- align-items: center;
508
- overflow: hidden;
509
- background: rgba(10, 11, 17, 0.86);
510
- border-top: 1px solid rgba(255, 255, 255, 0.08);
511
- font-family: var(--font-dmsans, system-ui, sans-serif);
512
- -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
513
- mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
514
- }
515
- .zf-tape-track {
516
- display: flex;
517
- flex-shrink: 0;
518
- align-items: center;
519
- white-space: nowrap;
520
- will-change: transform;
521
- animation-name: zf-tape-scroll;
522
- animation-timing-function: linear;
523
- animation-iteration-count: infinite;
524
- }
525
- .zf-tape:hover .zf-tape-track { animation-play-state: paused; }
526
- .zf-tape-item {
527
- display: inline-flex;
528
- align-items: center;
529
- gap: 7px;
530
- padding: 0 15px;
531
- border-right: 1px solid rgba(255, 255, 255, 0.06);
532
- font-size: 12px;
533
- line-height: 1;
534
- }
535
- .zf-tape-sym { font-weight: 700; color: rgba(255, 255, 255, 0.92); letter-spacing: 0.02em; }
536
- .zf-tape-px { color: rgba(255, 255, 255, 0.58); font-variant-numeric: tabular-nums; }
537
- .zf-tape-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
538
- @keyframes zf-tape-scroll {
539
- from { transform: translateX(0); }
540
- to { transform: translateX(-50%); }
541
- }
542
- @media (prefers-reduced-motion: reduce) {
543
- .zf-tape { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
544
- .zf-tape-track { animation: none; }
545
- }
546
- `;function sm(){const e=_r(tm,6e4),t=_r(void 0,6e4),{symbols:r,stats:o}=b.useMemo(()=>{const l=f=>Object.entries(f).filter(([,d])=>d.markPx>0&&d.prevDayPx>0).map(([d])=>d).sort();return{symbols:[...l(e),...l(t)].slice(0,rm),stats:{...t,...e}}},[e,t]),n=R("quote-stream"),a=b.useRef(null),s=r.join(",");if(b.useEffect(()=>{const l=a.current;if(!l||!(n!=null&&n.subscribeMids)||r.length===0)return;let u={};const f=()=>{for(const g of l.querySelectorAll("[data-zf-px]")){const S=u[g.dataset.zfPx??""];if(S===void 0)continue;const k=Ir(S);g.textContent!==k&&(g.textContent=k)}},d=n.subscribeMids(g=>{u=g},r),m=window.setTimeout(f,400),h=window.setInterval(f,1500);return()=>{d(),clearTimeout(m),clearInterval(h)}},[n,s]),r.length===0)return null;const i=Math.max(40,r.length*2.2),c=l=>r.map(u=>{const f=o[u];if(!f)return null;const d=f.changePct>=0?om:nm,m=f.changePct>=0?"+":"";return p.jsxs("span",{className:"zf-tape-item",children:[p.jsx(em,{symbol:u,size:15}),p.jsx("span",{className:"zf-tape-sym",children:Ut(u)}),p.jsx("span",{className:"zf-tape-px","data-zf-px":u,children:Ir(f.markPx)}),p.jsxs("span",{className:"zf-tape-chg",style:{color:d},children:[m,f.changePct.toFixed(2),"%"]})]},`${l}-${u}`)});return p.jsxs(p.Fragment,{children:[p.jsx("style",{children:am}),p.jsx("div",{className:"zf-tape","aria-label":"live ticker tape",children:p.jsxs("div",{ref:a,className:"zf-tape-track",style:{animationDuration:`${i}s`},children:[c("a"),p.jsx("span",{"aria-hidden":!0,style:{display:"contents"},children:c("b")})]})})]})}const $r="(min-width: 1024px)";function im(){const[e,t]=b.useState(()=>window.matchMedia($r).matches);return b.useEffect(()=>{const r=window.matchMedia($r),o=()=>t(r.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),e}const cm="/unicornStudio.legacy.umd.mjs";let Pe=null;function lm(){return typeof window>"u"||typeof document>"u"?Promise.reject(new Error("UnicornStudio needs a browser")):Pe||(Pe=(async()=>{const t=`const module={exports:{}};const exports=module.exports;
547
- `+await fetch(cm).then(o=>{if(!o.ok)throw new Error(`failed to load UnicornStudio (${o.status})`);return o.text()})+`
548
- export default module.exports;`,r=URL.createObjectURL(new Blob([t],{type:"text/javascript"}));try{const n=(await import(r)).default;if(!(n!=null&&n.addScene))throw new Error("UnicornStudio engine missing addScene");return n}finally{URL.revokeObjectURL(r)}})(),Pe.catch(()=>{Pe=null}),Pe)}class um{constructor(t){E(this,"_url");this._raw=t;const r=URL.createObjectURL(new Blob([JSON.stringify(this._raw)],{type:"application/json"}));this._url=r}get url(){return this._url}}const Fr=new um({history:[{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"gradient",usesPingPong:!1,speed:.25,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
549
- precision highp float;in vec2 vTextureCoord;uniform vec2 uMousePos;vec3 getColor(int index) { switch(index) { case 0: return vec3(1, 1, 1); case 1: return vec3(0, 0, 0); case 2: return vec3(0, 0, 0); case 3: return vec3(0, 0, 0); case 4: return vec3(0, 0, 0); case 5: return vec3(0, 0, 0); case 6: return vec3(0, 0, 0); case 7: return vec3(0, 0, 0); case 8: return vec3(0, 0, 0); case 9: return vec3(0, 0, 0); case 10: return vec3(0, 0, 0); case 11: return vec3(0, 0, 0); case 12: return vec3(0, 0, 0); case 13: return vec3(0, 0, 0); case 14: return vec3(0, 0, 0); case 15: return vec3(0, 0, 0); default: return vec3(0.0); } }const float PI = 3.14159265;vec2 rotate(vec2 coord, float angle) { float s = sin(angle); float c = cos(angle); return vec2( coord.x * c - coord.y * s, coord.x * s + coord.y * c ); }out vec4 fragColor;vec3 getColor(vec2 uv) {return vec3(1, 1, 1); }void main() {vec2 uv = vTextureCoord; vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); uv -= pos; uv /= (0.5000*2.); uv = rotate(uv, (0.0000 - 0.5) * 2. * PI); vec4 color = vec4(getColor(uv), 1.); fragColor = color; }`],compiledVertexShaders:[`#version 300 es
550
- precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = aTextureCoord; }`],data:{downSample:.5,depth:!1,uniforms:{},isBackground:!0},id:"effect"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:1.0793650793650795,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"NORMAL",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.49660178547135064,widthMode:"relative",height:.4600869483043395,heightMode:"auto",left:.35409161821999585,leftMode:"relative",top:.6850280273460352,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.49660178547135064,0],[.49660178547135064,.4600869483043395],[0,.4600869483043395]],fill:["#7001D7"],fitToCanvas:!1,gradientType:"linear",type:"circle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
551
- precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform sampler2D uBgTexture; uniform sampler2D uTexture; uniform vec2 uMousePos; uniform int uSampleBg;out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000);uv = uv - pos;vec4 color = texture(uTexture, uv); vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); }color = mix(background, color / max(color.a, 0.0001), color.a * 1.0000);fragColor = color; }`],compiledVertexShaders:[`#version 300 es
552
- precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:1.0158730158730158,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"MULTIPLY",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.46738991573774175,widthMode:"relative",height:.46008694830433955,heightMode:"auto",left:.7457263018329404,leftMode:"relative",top:.5757566919333954,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.46738991573774175,0],[.46738991573774175,.46008694830433955],[0,.46008694830433955]],fill:["#4E21AC"],fitToCanvas:!1,gradientType:"linear",type:"circle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
553
- precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform vec2 uResolution; uniform vec2 uMousePos; uniform sampler2D uBgTexture; uniform sampler2D uPreviousLayerTexture; uniform sampler2D uTexture; uniform int uSampleBg;vec3 blend (int blendMode, vec3 src, vec3 dst) { return src * dst; }const float STEPS = 24.0; const float PI = 3.1415926;vec2 perspectiveUV(vec2 uv) { float aspectRatio = uResolution.x/uResolution.y; vec2 centeredUV = uv - 0.5; centeredUV.x *= aspectRatio; float strength = 1.0 + (vVertexPosition.z * 0.0000); vec2 perspectiveUV = centeredUV / strength; perspectiveUV.x /= aspectRatio; perspectiveUV += 0.5; return perspectiveUV; }out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000); uv = perspectiveUV(uv) - pos; vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); } vec4 color = texture(uTexture, uv);if (0.0000 == 1.00) { if(0 == 2) { background *= (1. - color.a); color = background; } else { background *= color.a; color.rgb = background.rgb; color.rgb = 0.0000 > 0. ? mix(vec3(0, 0, 0), color.rgb, color.a) : color.rgb; color.a = min(1., color.a + 0.0000); if(0 == 1) { vec4 previousLayer = texture(uPreviousLayerTexture, vTextureCoord); color = mix(previousLayer, color/max(color.a, 0.0001), color.a * 1.0000); } } fragColor = color; return; }if (3 > 0) { vec3 unpremultColor = color.rgb / max(color.a, 0.0001); vec3 blendedColor = blend(3, unpremultColor, background.rgb); color = vec4(blendedColor, 1.0) * (color.a * 1.0000); color = color + background * (1.0 - color.a); } else { color = mix(background, color + background * (1.0 - color.a), 1.0000); }fragColor = color; }`],compiledVertexShaders:[`#version 300 es
554
- precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape1"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:.996031746031746,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"MULTIPLY",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.45826120644598894,widthMode:"relative",height:.4600869483043395,heightMode:"auto",left:.49185679854495884,leftMode:"relative",top:.35992750274551055,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.45826120644598894,0],[.45826120644598894,.4600869483043395],[0,.4600869483043395]],fill:["#FFC7E6"],fitToCanvas:!1,gradientType:"linear",type:"rectangle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
555
- precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform vec2 uResolution; uniform vec2 uMousePos; uniform sampler2D uBgTexture; uniform sampler2D uPreviousLayerTexture; uniform sampler2D uTexture; uniform int uSampleBg;vec3 blend (int blendMode, vec3 src, vec3 dst) { return src * dst; }const float STEPS = 24.0; const float PI = 3.1415926;vec2 perspectiveUV(vec2 uv) { float aspectRatio = uResolution.x/uResolution.y; vec2 centeredUV = uv - 0.5; centeredUV.x *= aspectRatio; float strength = 1.0 + (vVertexPosition.z * 0.0000); vec2 perspectiveUV = centeredUV / strength; perspectiveUV.x /= aspectRatio; perspectiveUV += 0.5; return perspectiveUV; }out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000); uv = perspectiveUV(uv) - pos; vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); } vec4 color = texture(uTexture, uv);if (0.0000 == 1.00) { if(0 == 2) { background *= (1. - color.a); color = background; } else { background *= color.a; color.rgb = background.rgb; color.rgb = 0.0000 > 0. ? mix(vec3(0, 0, 0), color.rgb, color.a) : color.rgb; color.a = min(1., color.a + 0.0000); if(0 == 1) { vec4 previousLayer = texture(uPreviousLayerTexture, vTextureCoord); color = mix(previousLayer, color/max(color.a, 0.0001), color.a * 1.0000); } } fragColor = color; return; }if (3 > 0) { vec3 unpremultColor = color.rgb / max(color.a, 0.0001); vec3 blendedColor = blend(3, unpremultColor, background.rgb); color = vec4(blendedColor, 1.0) * (color.a * 1.0000); color = color + background * (1.0 - color.a); } else { color = mix(background, color + background * (1.0 - color.a), 1.0000); }fragColor = color; }`],compiledVertexShaders:[`#version 300 es
556
- precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape2"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"blur",usesPingPong:!1,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
557
- precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 0 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 0 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
558
- precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 1 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 1 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
559
- precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 2 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 2 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
560
- precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; } uvec2 pcg2d(uvec2 v) { v = v * 1664525u + 1013904223u; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; v ^= v >> 16; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; return v; }float randFibo(vec2 p) { uvec2 v = floatBitsToUint(p); v = pcg2d(v); uint r = v.x ^ v.y; return float(r) / float(0xffffffffu); }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 3 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 3 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction);float dither = (randFibo(gl_FragCoord.xy) - 0.5) / 255.0; color.rgb += dither; fragColor = color;}`],compiledVertexShaders:[`#version 300 es
561
- precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{downSample:.25,depth:!1,uniforms:{},isBackground:!1,passes:[{prop:"vertical",value:1,downSample:.25},{prop:"vertical",value:2,downSample:.5},{prop:"vertical",value:3,downSample:.5}]},id:"effect1"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"sdf_shape",usesPingPong:!1,texture:!1,speed:1,trackMouseMove:0,mouseMomentum:1,trackMouse:.15,animating:!0,isMask:0,compiledFragmentShaders:[`#version 300 es
562
- precision highp float; precision highp int;in vec2 vTextureCoord; uniform sampler2D uTexture;uniform float uTime;uniform vec2 uMousePos; uniform vec2 uResolution;uvec2 pcg2d(uvec2 v) { v = v * 1664525u + 1013904223u; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; v ^= v >> 16; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; return v; }float randFibo(vec2 p) { uvec2 v = floatBitsToUint(p); v = pcg2d(v); uint r = v.x ^ v.y; return float(r) / float(0xffffffffu); }const float PI = 3.141592653; const float PI2 = 6.283185306; const int DISP_STEPS = 12; const vec3 viewDir = vec3(0,0, -4.25);ivec2 customTexSize; float customTexAspect;const mat3 ROT_Y_90 = mat3( 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, -1.0, 0.0, 0.0 );const mat3 ROT_Z_90 = mat3( 0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 );const mat3 ROT_X_90 = mat3( 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 );mat3 rotY(float ang) { float c = cos(ang), s = sin(ang); return mat3(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); }mat3 rotX(float ang) { float c = cos(ang), s = sin(ang); return mat3(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); }mat3 rotZ(float ang) { float c = cos(ang), s = sin(ang); return mat3(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); }mat2 rot(float a) { float s = sin(a); float c = cos(a); return mat2(c, -s, s, c); }vec3 twistY(vec3 p, float amount) { float c = cos(amount * p.y); float s = sin(amount * p.y); mat2 m = mat2(c, -s, s, c); return vec3(m * p.xz, p.y); }vec3 twistX(vec3 p, float amount) { float c = cos(amount * p.x); float s = sin(amount * p.x); mat2 m = mat2(c, -s, s, c); return vec3(p.x, m * p.yz); }float smin(float a, float b, float k) { float h = max(k - abs(a - b), 0.0); return min(a, b) - h * h * 0.25 / k; }float sphere(vec3 p, float r) { return length(p) - r; }float sdfCylinder(vec3 p, float radius, float height) { vec2 d = abs(vec2(length(p.xz) - radius, p.y)) - vec2(radius, height * 0.5); return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); }float sdStar5(vec2 p, float r, float rf) { const vec2 k1 = vec2(0.809016994375, -0.587785252292); const vec2 k2 = vec2(-k1.x,k1.y); p.x = abs(p.x); p -= 2.0*max(dot(k1,p),0.0)*k1; p -= 2.0*max(dot(k2,p),0.0)*k2; p.x = abs(p.x); p.y -= r; vec2 ba = rf*vec2(-k1.y,k1.x) - vec2(0,1); float h = clamp( dot(p,ba)/dot(ba,ba), 0.0, r ); return length(p-ba*h) * sign(p.y*ba.x-p.x*ba.y); }float mergedDiscs(vec3 p) { float result = sdfCylinder(p, 0.7, 0.01 + 0.0000 * 0.5);for(float i = 1.; i < 4.; i++) { float angle = (i * 45.)/360. * 2.0 * PI; mat2 rotZMat = rot(angle); vec3 rotatedP = vec3(rotZMat * p.xy, p.z);result = smin( result, sdfCylinder(rotatedP, 0.7, 0.01 + 0.0000 * 0.5), 0.2 ); }return max(result, sphere(p, 1.4)); }vec3 getRepeat(vec3 p) { float spacing = (0.5000 + 0.4800 * 0.38) * 8.; return p; }vec3 getThreeDRepeat(vec3 p) { float spacing = (0.5000 + 0.4800 * 0.38) * 8.; return p; }vec3 getAdjustedP(vec3 p) { float scale = max(0.2600, 0.000000001); float scaleFactor = 1.0/scale; vec3 adjustedP = p * scaleFactor;vec2 twist = vec2(0.7, 0.82);adjustedP.xy *= vec2(uResolution.x / uResolution.y, 1);adjustedP *= (1. + (0.4800 + 0.01));vec2 mousePos = mix(vec2(0), uMousePos - 0.5, 0.1500); vec2 axis = vec2(-1. * vec3(0.48503740648379057, 0.5187032418952618, 0.6966).y - 1. + mousePos.y/PI, vec3(0.48503740648379057, 0.5187032418952618, 0.6966).x + mousePos.x/PI) * 2.;adjustedP = getRepeat(adjustedP);float baseTime = uTime * 0.02; float timeX = vec3(0, 1.2, 0).x * baseTime; float timeY = vec3(0, 1.2, 0).y * baseTime; float timeZ = vec3(0, 1.2, 0).z * baseTime;mat3 rotYMat = rotY(axis.y * PI); mat3 rotXMat = rotX(axis.x * PI); mat3 rotZMat = rotZ(vec3(0.48503740648379057, 0.5187032418952618, 0.6966).z * 2.0 * PI);mat3 combinedRotation = rotZMat * rotYMat * rotXMat; mat3 combinedAnimation = rotZ(timeZ) * rotX(timeX) * rotY(timeY);adjustedP = combinedRotation * adjustedP; adjustedP = combinedAnimation * adjustedP; adjustedP = getThreeDRepeat(adjustedP); adjustedP = mix(adjustedP, twistY(adjustedP, -1.0 * twist.y), step(0.0, abs(twist.y))); adjustedP = mix(adjustedP, twistX(adjustedP, -1.0 * twist.x), step(0.0, abs(twist.x)));return adjustedP; }float getMergedSDF(vec3 p) { p = getAdjustedP(p); return mergedDiscs(p); }float fresnel(vec3 eyeVector, vec3 worldNormal, float power) { float NdotV = abs(dot(eyeVector, worldNormal)); float width = fwidth(dot(eyeVector, worldNormal)); float threshold = 0.2; float edgeDampFactor = smoothstep(threshold, -threshold, width); float fresnelFactor = 1.0 - NdotV; return pow(fresnelFactor, power) * mix(1., edgeDampFactor * 2., 0.5); }vec3 noFrostOrDispersion(vec3 rd, vec3 normal) { float ior = 1.0 / (1.0 + 0.7000 * 0.25); vec3 refractedRay = refract(rd, normal, ior); return texture(uTexture, vTextureCoord - refractedRay.xy).rgb; }vec3 frostOrDispersion(vec3 rd, vec3 normal) { vec3 refractionColor = vec3(0); float iorBase = 1. + 0.7000 * 0.25;vec3 dispCoefficients = vec3(0.03, 0.06, 0.1) * 0.2500 * 1.2;for (int i = 0; i < DISP_STEPS; ++i) { float step = float(i) / float(DISP_STEPS); vec3 disp = step * dispCoefficients; vec3 ior = 1.0 / (iorBase + disp);vec3 refractedRayR = refract(rd, normal, ior.r); vec3 refractedRayG = refract(rd, normal, ior.g); vec3 refractedRayB = refract(rd, normal, ior.b);refractionColor.r += texture(uTexture, vTextureCoord - refractedRayR.xy).r; refractionColor.g += texture(uTexture, vTextureCoord - refractedRayG.xy).g; refractionColor.b += texture(uTexture, vTextureCoord - refractedRayB.xy).b; }return clamp(refractionColor / float(DISP_STEPS), 0.0, 1.0); }vec3 calculateNormal(vec3 p, float eps) { vec2 e = vec2(1.0, -1.0) * eps * 0.5; return normalize( e.xyy * getMergedSDF(p + e.xyy) + e.yyx * getMergedSDF(p + e.yyx) + e.yxy * getMergedSDF(p + e.yxy) + e.xxx * getMergedSDF(p + e.xxx) ); }vec3 sampleTexture(vec3 rd, vec3 normal) {return frostOrDispersion(rd, normal); return noFrostOrDispersion(rd, normal); }float scene(vec3 p) { return max(0.0000000001, getMergedSDF(p) - (0.4800 + 0.005)) * max(0.2600, 0.000000001); }const int STEPS = 128; const float MAX_DISTANCE = 100.0;vec4 rayMarch(vec3 ro, vec3 rd) { float pixelSize = 0.0025; float traveled = 0.; vec3 entryPoint = vec3(0.0); vec3 entryNormal = vec3(0.0); float partialAlpha = 0.0; float lastDistance = 0.0; float smoothing = mix(1., 4., 1.0000);for (int i = 0; i < STEPS; ++i) { vec3 currentPos = ro + rd * traveled; float distance = scene(currentPos); float progress = float(i)/float(STEPS); float step = distance * mix(1., 1.5, progress);if (distance > MAX_DISTANCE) break;if (distance < pixelSize) { partialAlpha = 1.; entryPoint = currentPos; entryNormal = calculateNormal(entryPoint, pixelSize * smoothing); break; }lastDistance = distance;traveled += max(step, pixelSize); if (traveled > MAX_DISTANCE) break; }if (partialAlpha == 0.0) { return texture(uTexture, vTextureCoord); }vec3 samplePosition = mix(rd, entryPoint, 0.0000);vec3 refractionColor = vec3(0.0);refractionColor = sampleTexture(samplePosition, entryNormal); vec3 lightDir = vec3(((vec2(vec3(0.25, 0.25, -3).x, 1.-vec3(0.25, 0.25, -3).y) - 0.333) * 3.) - vec2(0.5, 0.5), vec3(0.25, 0.25, -3).z); vec3 normLightDir = normalize(lightDir);float lightAndShadow = dot(entryNormal, normLightDir); vec3 lightColor = mix(vec3(1), vec3(1, 1, 1), 1. - 0.0000); vec3 fresnelEffect = vec3(0.0);fresnelEffect = fresnel(rd, entryNormal, 8.0) * 0.3000 * vec3(1, 1, 1);vec3 specularEffect = vec3(0.0);vec3 halfwayDir = normalize(lightDir + rd); float specFactor = pow(max(dot(entryNormal, halfwayDir), 0.0), 64.0 * 0.3000 + 0.01); specularEffect = specFactor * 0.3000 * lightColor;vec3 combinedEffects = fresnelEffect + specularEffect; vec3 finalColor = mix(refractionColor, vec3(1, 1, 1) * lightAndShadow, 0.0000); finalColor += combinedEffects;vec4 outputColor = vec4(finalColor, 1.);return outputColor; }out vec4 fragColor;void main() { vec4 col = vec4(0); vec4 bg = texture(uTexture, vTextureCoord);if(0.2600 <= 0.0001 || 0.5000 <= 0.0001) { col = vec4(0); if(1 == 1) { col = bg; } fragColor = col; return; }vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); vec2 uv = vTextureCoord - pos; float fovFactor = tan(radians(20.) * 0.5); vec3 rd = vec3(uv * fovFactor, 0.5); col = rayMarch(viewDir, rd); float dither = (randFibo(vTextureCoord.xy) - 0.5) / 255.0; col += dither;col = mix(bg, col, 0.5000); fragColor = col;}`],compiledVertexShaders:[`#version 300 es
563
- precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{depth:!1,uniforms:{},isBackground:!1},id:"effect2"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"sphere",usesPingPong:!1,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
564
- precision mediump float; in vec3 vVertexPosition; in vec2 vTextureCoord; uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution;const float STEPS = 16.0; const float PI = 3.1415926;vec3 chromaticAbberation(vec2 st, float angle, float amount, float blend) { float aspectRatio = uResolution.x/uResolution.y; float rotation = angle * 360.0 * PI / 180.0; vec2 aberrated = amount * vec2(0.1 * sin(rotation) * aspectRatio, 0.1 * cos(rotation)); aberrated *= distance(st, vec2(0.5)) * 2.0; vec4 red = vec4(0); vec4 blue = vec4(0); vec4 green = vec4(0); float invSteps = 1.0 / STEPS; float invStepsHalf = invSteps * 0.5; for(float i = 1.0; i <= STEPS; i++) { vec2 offset = aberrated * (i * invSteps); red += texture(uTexture, st - offset) * invSteps; blue += texture(uTexture, st + offset) * invSteps; }for (float i = 0.0; i <= STEPS; i++) { vec2 offset = aberrated * ((i * invSteps) - 0.5); green += texture(uTexture, st + offset) * invSteps; } return vec3(red.r, green.g, blue.b); }vec2 sphericalTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float tau) { float aspectRatio = uResolution.x/uResolution.y; u -= uCenter; v -= vCenter;float s = sqrt(u * u + v * v); if (s > lensRadius) return vec2(u + uCenter, v + vCenter);float z = sqrt(lensRadius * lensRadius - s * s);float uAlpha = (1.0 - (1.0 / tau)) * asin(u / lensRadius); float vAlpha = (1.0 - (1.0 / tau)) * asin(v / lensRadius);u = uCenter + z * sin(uAlpha); v = vCenter + z * sin(vAlpha);return vec2(u/aspectRatio, v); }float circularIn(float t) { return 1.0 - sqrt(1.0 - t * t); }vec2 fisheyeTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float distortionScale ) { float aspectRatio = uResolution.x / uResolution.y;vec2 dir = vec2(u - uCenter, v - vCenter);dir.x /= lensRadius; dir.y /= lensRadius;float dist = length(dir) * 0.15;if (dist < 1.0) { float theta = atan(dir.y, dir.x);float r = dist * 2.0 * PI; float z = sqrt(1.0 - r * r) + 0.25; float rDist = atan(r, z) / PI; float newDist = mix(dist, rDist, 5.);dir.x = newDist * cos(theta); dir.y = newDist * sin(theta); }dir.x *= lensRadius; dir.y *= lensRadius;return mix(vec2(u/aspectRatio, v), vec2(uCenter/aspectRatio, vCenter) + dir, 1.0000); }vec2 discTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float distortionScale) { float aspectRatio = uResolution.x/uResolution.y; u -= uCenter; v -= vCenter;float s = sqrt(u * u + v * v); if (s > lensRadius) return vec2(u + uCenter, v + vCenter); float r = sqrt(u * u + v * v) / lensRadius; if(r == 0.0) return vec2(uCenter, vCenter);r = pow(r, distortionScale); float theta = atan(r); float rad = theta / r;u = rad * u + uCenter; v = rad * v + vCenter;return vec2(u/aspectRatio, v); }out vec4 fragColor; void main() { vec2 uv = vTextureCoord; vec4 color = texture(uTexture, uv); float aspectRatio = uResolution.x/uResolution.y; uv.x = uv.x * aspectRatio; vec2 sphereCoords = uv; vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); pos.x *= aspectRatio;float radius = 0.5000 * uResolution.x/max(uResolution.x, uResolution.y);if(1 == 0) { sphereCoords = sphericalTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); } else if(1 == 1) { sphereCoords = discTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); } else if(1 == 2) { sphereCoords = fisheyeTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); }vec2 scaledCoords = (sphereCoords - 0.5) + 0.5; vec4 sphere = texture(uTexture, clamp(scaledCoords, 0.0, 1.0)); float distFromPos = distance(uv, pos); float edgeSmooth = 0.001; float insideSphere = 1.0 - smoothstep(radius/2.0 - edgeSmooth, radius/2.0, distFromPos); float insideSphereAlpha = 1.0 - smoothstep(radius/2.0 + 0.002 - edgeSmooth, radius/2.0 + 0.002, distFromPos); sphere.rgb = chromaticAbberation(scaledCoords, atan(scaledCoords.y, scaledCoords.x), distFromPos * 1.0000, 1.0); color = mix(color, sphere, insideSphere); color.rgb += vec3((0.5000-0.5)*2.) * mix(0., circularIn(smoothstep(0., radius, distFromPos)), insideSphere); if(1 == 1) { color.a = insideSphereAlpha; color.rgb = mix(vec3(0), color.rgb, insideSphereAlpha); } fragColor = color;}`],compiledVertexShaders:[`#version 300 es
565
- precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{depth:!1,uniforms:{},isBackground:!1},id:"effect3"}],options:{name:"zAI Orb final",fps:60,dpi:1.5,scale:1,includeLogo:!1,isProduction:!1},version:"1.4.29",id:"l9tOlEGo3rE5cxAzUCHg"});function dm({className:e,dpi:t=2,scale:r=1,fps:o=60,onScene:n,onError:a}){const s=b.useRef(null),i=b.useId();return b.useEffect(()=>{if(!s.current)return;let c=!1,l=null;return(async()=>{try{const u=await lm();if(c||!s.current)return;s.current.setAttribute("data-us-project-src",Fr.url),l=u.addScene({filePath:Fr.url,elementId:i,dpi:t,scale:r,fps:o});const f=await l;if(c){f.destroy();return}n(f)}catch{c||a()}})(),()=>{c=!0,n(null),l==null||l.then(u=>u.destroy()).catch(()=>{})}},[i,t,r,o]),p.jsx("div",{ref:s,id:i,className:e,role:"img","aria-hidden":!0})}const bt=80,Pt=40,ke=6,fm=1e4,mm=5e3;function wt(e,t){return e.find(r=>r.capabilities.includes(t))??null}function pm(e,t){return Promise.race([e.then(r=>r).catch(()=>null),new Promise(r=>setTimeout(()=>r(null),t))])}function de(e){if(!Number.isFinite(e))return"—";const t=Math.abs(e);return t>=1e12?`$${(e/1e12).toFixed(2)}T`:t>=1e9?`$${(e/1e9).toFixed(2)}B`:t>=1e6?`$${(e/1e6).toFixed(2)}M`:t>=1e3?`$${Math.round(e).toLocaleString("en-US")}`:`$${e.toFixed(2)}`}function ze(e,t=1){return Number.isFinite(e)?`${e>=0?"+":""}${e.toFixed(t)}%`:"—"}function hm(e){if(!Number.isFinite(e))return"—";const t=Math.abs(e),r=t>=1e3?0:t>=1?2:t>=.01?4:6;return`$${e.toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function gm(e){const t=[];if(typeof e.symbol=="string"&&t.push(e.symbol),Array.isArray(e.symbols))for(const r of e.symbols)typeof r=="string"&&t.push(r);return t}function xt(e){return e.filter(t=>t&&t!=="*"&&!t.endsWith(":*"))}function ym(e,t){for(const r of t){const o=e[r];if(typeof o=="string"&&o.trim())return o.trim()}return null}function Bt(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function vm(e,t){return e.frames.map(r=>{const o=t.get(r.frame);let n=r.config??{};if(o){const a=o.schema.safeParse(n);a.success&&(n=a.data)}return{type:r.frame,title:r.title,capabilities:(o==null?void 0:o.capabilities)??[],config:n,symbols:gm(n)}})}function bm(e){const t=[];for(const r of e.slice(0,bt)){let o=`- ${r.type}`;if(r.title&&(o+=` "${r.title}"`),r.symbols.length&&(o+=` [${r.symbols.slice(0,Pt).join(", ")}]`),r.symbols.length===0){const n=ym(r.config,["text","content","body","label","timezone","feed"]);n&&(o+=`: ${Bt(n,80)}`)}t.push(o)}return e.length>bt&&t.push(`- …and ${e.length-bt} more frames`),t}function _t(e,t){const r=new Set;for(const o of e)if(o.capabilities.some(n=>t.includes(n)))for(const n of o.symbols)r.add(n);return[...r]}async function wm(e,t){const r=new Set;for(const d of t)for(const m of d.capabilities)r.add(m);const o=d=>r.has(d)&&wt(e,d),n=[],a=(d,m,h)=>{const g=o(m);g&&n.push(pm(h(g),mm).then(S=>S?[d,S]:null))},s=xt(_t(t,["day-stats","quote-stream","ohlcv"])).slice(0,Pt);s.length&&a(1,"day-stats",async d=>{const m=await d.getDayStats(s),h=s.map(g=>{const S=m[g];return S?`${g} ${hm(S.markPx)} (${ze(S.changePct)})`:null}).filter(Boolean);return h.length?`Prices: ${h.join(" · ")}`:null});const i=t.find(d=>d.capabilities.includes("sentiment")),c=typeof(i==null?void 0:i.config.sparklineDays)=="number"?i.config.sparklineDays:30;a(2,"sentiment",async d=>{const h=(await d.getFearGreed(c))[0];return h?`Fear & Greed: ${h.value} (${h.classification})`:null}),a(3,"global-market",async d=>{const m=await d.getGlobalMarket(),h=Object.entries(m.dominance).sort((g,S)=>S[1]-g[1]).slice(0,3).map(([g,S])=>`${g.toUpperCase()} ${S.toFixed(1)}%`).join(", ");return`Global crypto: total mcap ${de(m.totalMarketCapUsd)} (${ze(m.marketCapChangePct24h)} 24h); dominance ${h}`});const l=xt(_t(t,["funding-history"])).slice(0,Pt);l.length&&a(4,"funding-history",async d=>{const m=await d.getFundingHistory(l,Date.now()-864e5),h=l.map(g=>{const S=m[g],k=S&&S[S.length-1];return k?`${g} ${ze(k.fundingRate*100,4)}`:null}).filter(Boolean);return h.length?`Funding (latest): ${h.join(" · ")}`:null});const u=xt(_t(t,["open-interest"]));if(a(5,"open-interest",async d=>{const h=(await d.getOpenInterest(u.length?u:void 0)).slice(0,ke).map(g=>`${g.symbol} ${de(g.openInterestUsd)}`);return h.length?`Open interest: ${h.join(" · ")}`:null}),a(6,"tvl",async d=>{const h=(await d.getTvlByChain()).slice(0,ke).map(g=>`${g.name} ${de(g.tvl)}`);return h.length?`TVL by chain: ${h.join(" · ")}`:null}),a(7,"protocol-tvl",async d=>{const h=(await d.getProtocolTvl()).slice(0,ke).map(g=>`${g.name} ${de(g.tvl)}`);return h.length?`Protocol TVL: ${h.join(" · ")}`:null}),a(8,"dex-volume",async d=>{const h=(await d.getDexVolume()).slice(0,ke).map(g=>`${g.name} ${de(g.volume24h)}`);return h.length?`DEX volume (24h): ${h.join(" · ")}`:null}),a(9,"protocol-fees",async d=>{const h=(await d.getProtocolFees()).slice(0,ke).map(g=>`${g.name} ${de(g.fees24h)}`);return h.length?`Protocol fees (24h): ${h.join(" · ")}`:null}),a(10,"coin-markets",async d=>{const h=(await d.getCoinMarkets()).slice(0,ke).map(g=>`${g.symbol} ${de(g.marketCapUsd)}${g.changePct24h!=null?` (${ze(g.changePct24h)})`:""}`);return h.length?`Top coins by mcap: ${h.join(" · ")}`:null}),a(11,"coin-movers",async d=>{const h=[...await d.getCoinMovers(300)].sort((k,P)=>(P.changePct["24h"]??0)-(k.changePct["24h"]??0)),g=h.slice(0,3).map(k=>`${k.symbol} ${ze(k.changePct["24h"]??0)}`),S=h.slice(-3).reverse().map(k=>`${k.symbol} ${ze(k.changePct["24h"]??0)}`);return h.length?`Movers (24h): up ${g.join(", ")} · down ${S.join(", ")}`:null}),o("news")){const d=wt(e,"news"),m=new Set;for(const h of t){if(!h.capabilities.includes("news"))continue;const g=typeof h.config.feed=="string"?h.config.feed:null;if(!g||m.has(g))continue;m.add(g);const S=h.symbols.length?[...h.symbols]:void 0;a(12,"news",async()=>{const P=(await d.getNews({feed:g,symbols:S,limit:4})).slice(0,4).map(L=>`“${Bt(L.title,90)}”`);return P.length?`News (${g}): ${P.join("; ")}`:null})}}if(a(13,"btc-fees",async d=>{const m=await d.getBtcFees();return`BTC fees: fastest ${m.fastest}, 1h ${m.hour}, economy ${m.economy} sat/vB`}),a(14,"btc-mempool",async d=>{const m=await d.getMempoolState();return`Mempool: ${m.count.toLocaleString("en-US")} txs, ${m.projected.length} blocks pending`}),a(15,"btc-blocks",async d=>{const h=(await d.getBtcBlocks(1))[0];return h?`Latest block: #${h.height} (${h.poolName}, ${h.txCount} txs)`:null}),a(16,"btc-difficulty",async d=>{const m=await d.getDifficultyAdjustment();return`Difficulty: ${ze(m.difficultyChange)} expected in ${m.remainingBlocks} blocks`}),a(17,"mining-pools",async d=>{const h=(await d.getMiningPools("1w")).pools[0];return h?`Mining pools (1w): ${h.name} ${h.sharePct.toFixed(1)}%`:null}),a(18,"lightning-stats",async d=>{const m=await d.getLightningStats();return`Lightning: ${m.nodeCount.toLocaleString("en-US")} nodes, ${m.channelCount.toLocaleString("en-US")} channels`}),a(19,"yield-curve",async d=>{const m=await d.getYieldCurve(),h=S=>m.points.find(k=>k.label===S),g=["3M","2Y","10Y","30Y"].map(S=>{const k=h(S);return k?`${S} ${k.rate.toFixed(2)}%`:null}).filter(Boolean);return g.length?`Yield curve (${m.date}): ${g.join(", ")}`:null}),a(20,"reference-rates",async d=>{const h=(await d.getReferenceRates()).slice(0,3).map(g=>`${g.code} ${g.rate.toFixed(2)}%`);return h.length?`Reference rates: ${h.join(", ")}`:null}),a(21,"financial-stress",async d=>{const m=await d.getFinancialStress();return`Financial stress (OFR): ${m.value.toFixed(2)} (${m.date})`}),a(22,"national-debt",async d=>{const m=await d.getNationalDebt();return`US national debt: ${de(m.total)} (${m.date})`}),o("options-summary")){const d=new Set;for(const h of t)h.capabilities.includes("options-summary")&&d.add(typeof h.config.currency=="string"?h.config.currency:"BTC");const m=wt(e,"options-summary");for(const h of d)a(23,"options-summary",async()=>{const g=await m.getOptionsSummary(h);return`Options ${g.currency}: put/call ${g.putCallRatioOi.toFixed(2)} (OI), avg IV ${g.avgIv.toFixed(1)}%`})}if(o("portfolio"))for(const d of t){if(!d.capabilities.includes("portfolio"))continue;const m=d.config.source;if(!m||typeof m.kind!="string")continue;const h=e.find(g=>g.getPortfolio&&(g.portfolioKinds??[]).includes(m.kind));h&&a(24,"portfolio",async()=>{const g=await h.getPortfolio(m),S=g.totalUsd??g.holdings.reduce((P,L)=>P+(L.valueUsd??0),0),k=[...g.holdings].sort((P,L)=>(L.valueUsd??0)-(P.valueUsd??0)).slice(0,ke).map(P=>P.symbol).join(", ");return`Portfolio (${g.label??g.source}): ${de(S)}${k?`, top: ${k}`:""}`})}return(await Promise.all(n)).filter(d=>d!==null).sort((d,m)=>d[0]-m[0]).map(d=>d[1])}function xm(e,t){const r=ct();return b.useCallback(async()=>{try{const o=vm(e,t);if(o.length===0)return null;const n=bm(o),a=await wm(r,o),s=[];n.length&&s.push(`Frames on the dashboard:
566
- ${n.join(`
567
- `)}`),a.length&&s.push(`Live readings right now:
568
- ${a.join(`
569
- `)}`);const i=s.join(`
570
-
571
- `);return i?Bt(i,fm):null}catch{return null}},[r,e,t])}const _m=1,km=5,zm="effect2",Lr=["what's going on?","what's moving today?","how's BTC funding looking?","what should I be watching?","summarize the market for me","explain my dashboard","is it fear or greed right now?","anything unusual today?"],Sm=3600,At=320;function Tm(e){return e===503?"No assistant is set up to answer yet — install Claude, Codex, or Kimi.":e===413?"That question was too long — try a shorter one.":e>=500?"zAI ran into a problem answering — give it another try.":e===200?"zAI sent back an unexpected response. If you just updated zframes, restart the server.":`zAI couldn't answer right now (error ${e}).`}const Em=`
572
- /* Focus scrim: opening the orb blurs + dims the dashboard behind so attention
573
- lands on the conversation. Sits below the orb dock (z 40) and above the
574
- ticker tape (z 30), so the orb + chat stay sharp while everything else
575
- recedes. Clicking it dismisses the orb (click-away-to-close). */
576
- .zai-scrim {
577
- position: fixed;
578
- inset: 0;
579
- z-index: 35;
580
- opacity: 0;
581
- pointer-events: none;
582
- background: radial-gradient(
583
- 135% 135% at 100% 100%,
584
- rgba(7, 8, 16, 0.08),
585
- rgba(7, 8, 16, 0.5) 72%
586
- );
587
- backdrop-filter: blur(0px) saturate(1);
588
- -webkit-backdrop-filter: blur(0px) saturate(1);
589
- transition:
590
- opacity 0.42s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
591
- backdrop-filter 0.42s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
592
- -webkit-backdrop-filter 0.42s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
593
- }
594
- .zai-scrim[data-open="true"] {
595
- opacity: 1;
596
- pointer-events: auto;
597
- backdrop-filter: blur(1.75px) saturate(1.06);
598
- -webkit-backdrop-filter: blur(1.75px) saturate(1.06);
599
- }
600
- .zai-dock {
601
- position: fixed;
602
- right: 18px;
603
- bottom: 50px;
604
- z-index: 40;
605
- display: flex;
606
- align-items: center;
607
- gap: 10px;
608
- font-family: var(--font-dmsans, system-ui, sans-serif);
609
- }
610
- .zai-panel {
611
- display: flex;
612
- align-items: center;
613
- width: 0;
614
- opacity: 0;
615
- overflow: hidden;
616
- transition:
617
- width 0.34s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
618
- opacity 0.22s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
619
- }
620
- .zai-dock[data-open="true"] .zai-panel {
621
- width: 330px;
622
- opacity: 1;
623
- }
624
- .zai-input-wrap {
625
- display: flex;
626
- align-items: center;
627
- gap: 8px;
628
- width: 330px;
629
- padding: 9px 10px 9px 14px;
630
- border-radius: 9999px;
631
- background: rgba(12, 13, 20, 0.72);
632
- backdrop-filter: blur(12px);
633
- -webkit-backdrop-filter: blur(12px);
634
- border: 1px solid hsla(263, 80%, 72%, 0.24);
635
- /* Negative spread keeps the drop shadow hugging the pill instead of bleeding
636
- a wide dark halo into the blurred scrim behind it. */
637
- box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.45);
638
- }
639
- /* The input and its animated placeholder share one box: the placeholder is an
640
- absolutely-positioned layer behind the (transparent) input, so the real
641
- caret/text sit on top while the hint cross-fades underneath. */
642
- .zai-input-field {
643
- position: relative;
644
- flex: 1;
645
- min-width: 0;
646
- display: flex;
647
- align-items: center;
648
- }
649
- .zai-input {
650
- position: relative;
651
- z-index: 1;
652
- flex: 1;
653
- min-width: 0;
654
- background: transparent;
655
- border: 0;
656
- outline: 0;
657
- color: #e7e9f3;
658
- font-size: 13px;
659
- }
660
- .zai-ph {
661
- position: absolute;
662
- left: 0;
663
- right: 0;
664
- top: 50%;
665
- pointer-events: none;
666
- color: rgba(255, 255, 255, 0.4);
667
- font-size: 13px;
668
- white-space: nowrap;
669
- overflow: hidden;
670
- text-overflow: ellipsis;
671
- opacity: 0;
672
- transform: translateY(-50%) translateY(5px);
673
- transition:
674
- opacity ${At}ms var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
675
- transform ${At}ms var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
676
- }
677
- .zai-ph[data-show="true"] {
678
- opacity: 1;
679
- transform: translateY(-50%) translateY(0);
680
- }
681
- /* While thinking, the hint shimmers instead of cycling (overrides opacity). */
682
- .zai-ph-busy {
683
- animation: zai-ph-pulse 1.5s ease-in-out infinite;
684
- }
685
- @keyframes zai-ph-pulse {
686
- 0%, 100% { opacity: 0.34; }
687
- 50% { opacity: 0.7; }
688
- }
689
- .zai-agent {
690
- flex: none;
691
- font-size: 10px;
692
- font-weight: 700;
693
- letter-spacing: 0.05em;
694
- text-transform: uppercase;
695
- color: hsla(263, 85%, 82%, 0.95);
696
- background: hsla(263, 80%, 60%, 0.16);
697
- border-radius: 7px;
698
- padding: 4px 7px;
699
- cursor: pointer;
700
- user-select: none;
701
- white-space: nowrap;
702
- transition: background 0.15s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
703
- }
704
- .zai-agent:hover { background: hsla(263, 80%, 60%, 0.28); }
705
-
706
- /* The WebGL orb scene IS the orb — clipped to a circle and faded in once ready.
707
- The button is just a transparent container; nothing is drawn behind the orb. */
708
- .zai-orb-canvas {
709
- position: absolute;
710
- inset: 0;
711
- border-radius: 9999px;
712
- overflow: hidden;
713
- opacity: 0;
714
- transition: opacity 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
715
- pointer-events: none;
716
- }
717
- .zai-orb[data-webgl="true"] .zai-orb-canvas { opacity: 1; }
718
- .zai-orb-canvas canvas {
719
- width: 100% !important;
720
- height: 100% !important;
721
- display: block;
722
- }
723
-
724
- .zai-orb {
725
- position: relative;
726
- width: 60px;
727
- height: 60px;
728
- flex: none;
729
- padding: 0;
730
- border: 0;
731
- border-radius: 9999px;
732
- cursor: pointer;
733
- background: transparent;
734
- transition: transform 0.2s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
735
- }
736
- .zai-orb:hover { transform: scale(1.06); }
737
- .zai-orb:active { transform: scale(0.97); }
738
- /* Minimal fallback gradient, shown only if the WebGL scene fails to load, so
739
- the orb stays visible + clickable instead of being an invisible button. */
740
- .zai-orb[data-fallback="true"] {
741
- background:
742
- radial-gradient(circle at 34% 28%, hsla(263, 95%, 86%, 0.95), transparent 45%),
743
- radial-gradient(circle at 62% 70%, #7a17e0 0%, #4a0a92 55%, #2c0560 100%);
744
- }
745
-
746
- .zai-history {
747
- position: absolute;
748
- right: 70px;
749
- bottom: 72px;
750
- width: 344px;
751
- display: flex;
752
- flex-direction: column;
753
- gap: 8px;
754
- max-height: 52vh;
755
- overflow-y: auto;
756
- overscroll-behavior: contain;
757
- pointer-events: auto;
758
- scrollbar-width: none;
759
- }
760
- .zai-history::-webkit-scrollbar {
761
- display: none;
762
- }
763
- /* The top fade is a "more above" affordance — only painted once the thread has
764
- scrolled up off the top. Applying it unconditionally clipped the top edge of
765
- even a single short chip, so it's gated on scroll position (see onScroll). */
766
- .zai-history[data-masked="true"] {
767
- -webkit-mask-image: linear-gradient(180deg, transparent, #000 16%);
768
- mask-image: linear-gradient(180deg, transparent, #000 16%);
769
- }
770
- /* Bottom-pin short threads (the conversation floats just above the input):
771
- margin-top:auto on the first chip pushes the group down while there's slack,
772
- then yields to scrolling once the thread outgrows max-height — so a long
773
- answer scrolls up instead of hard-clipping the oldest message off the top. */
774
- .zai-history > :first-child {
775
- margin-top: auto;
776
- }
777
- .zai-msg {
778
- width: fit-content;
779
- max-width: 100%;
780
- padding: 8px 12px;
781
- border-radius: 14px;
782
- font-size: 13px;
783
- line-height: 1.45;
784
- white-space: pre-wrap;
785
- word-break: break-word;
786
- backdrop-filter: blur(10px);
787
- -webkit-backdrop-filter: blur(10px);
788
- animation: zai-rise 0.28s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) both;
789
- }
790
- .zai-msg-user {
791
- align-self: flex-end;
792
- background: hsla(263, 70%, 55%, 0.28);
793
- border: 1px solid hsla(263, 80%, 75%, 0.3);
794
- color: #f0ecff;
795
- }
796
- .zai-msg-zai {
797
- align-self: flex-start;
798
- background: rgba(12, 13, 20, 0.66);
799
- border: 1px solid rgba(255, 255, 255, 0.08);
800
- color: #dfe3ef;
801
- }
802
- .zai-msg-error {
803
- color: #ffb4bd;
804
- border-color: rgba(255, 107, 129, 0.4);
805
- }
806
- @keyframes zai-rise {
807
- from { opacity: 0; transform: translateY(6px); }
808
- to { opacity: 1; transform: translateY(0); }
809
- }
810
-
811
- @media (prefers-reduced-motion: reduce) {
812
- .zai-msg { animation: none; }
813
- .zai-panel { transition: none; }
814
- .zai-ph { transition: opacity 0.15s linear; transform: translateY(-50%); }
815
- .zai-ph[data-show="true"] { transform: translateY(-50%); }
816
- .zai-ph-busy { animation: none; opacity: 0.5; }
817
- .zai-scrim { transition: opacity 0.2s linear; }
818
- }
819
- `;function Cm({onOpenChange:e,onThinkingChange:t,spec:r,registry:o}){var Zt;const[n,a]=b.useState(null),[s,i]=b.useState(null),[c,l]=b.useState(!1),[u,f]=b.useState(""),[d,m]=b.useState(!1),[h,g]=b.useState([]),[S,k]=b.useState(!1),[P,L]=b.useState(!1),[Y,X]=b.useState(0),[$,M]=b.useState(!0),[G,oe]=b.useState(!1),K=b.useRef(null),ne=b.useRef(null),J=b.useRef(null),Be=xm(r,o),pe=b.useCallback((C,q)=>{var ue;const te=(ue=C.layers)==null?void 0:ue.find(Ee=>Ee.id===zm&&Ee.layerType==="effect");te&&te.layerType==="effect"&&(te.speed=q?km:_m)},[]),le=b.useCallback(C=>{J.current=C,C?(pe(C,!1),L(!1),k(!0)):k(!1)},[pe]),Oe=b.useCallback(()=>{k(!1),L(!0)},[]);b.useEffect(()=>{J.current&&pe(J.current,d)},[d,pe]),b.useEffect(()=>{let C=!1;return fetch(ol,{cache:"no-store"}).then(q=>q.ok?q.json():{agents:[]}).then(q=>{var ue;if(C)return;const te=q.agents??[];a(te),i(((ue=te[0])==null?void 0:ue.id)??null)}).catch(()=>{C||a([])}),()=>{C=!0}},[]),b.useEffect(()=>{var C;c&&((C=K.current)==null||C.focus())},[c]),b.useEffect(()=>{const C=ne.current;C&&(C.scrollTop=C.scrollHeight,oe(C.scrollTop>1))},[h,c]),b.useEffect(()=>{if(!c||d){M(!0);return}let C;const q=setInterval(()=>{M(!1),C=setTimeout(()=>{X(te=>(te+1)%Lr.length),M(!0)},At)},Sm);return()=>{clearInterval(q),clearTimeout(C)}},[c,d]),b.useEffect(()=>{e==null||e(c)},[c,e]),b.useEffect(()=>{t==null||t(d)},[d,t]);const Te=C=>g(q=>[...q,C].slice(-8));async function Zo(){var Yt;const C=u.trim();if(!C||d)return;const q=h.filter(se=>!se.error).map(se=>({role:se.role,text:se.text}));Te({role:"user",text:C}),f(""),m(!0);let te=!1,ue="";const Ee=()=>{te||(te=!0,Te({role:"zai",text:""}))},Ve=(se,he=!1)=>g(ft=>{const we=[...ft];for(let xe=we.length-1;xe>=0;xe--)if(we[xe].role==="zai"){we[xe]={...we[xe],text:se,error:he};break}return we});try{const se=await Be(),he=await fetch(nl,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({question:C,agent:s,context:se??void 0,history:q.length?q:void 0})}),ft=he.headers.get("content-type")??"";if(!he.body||!ft.includes("application/x-ndjson")){const ie=await he.json().catch(()=>null);if(he.ok&&typeof(ie==null?void 0:ie.answer)=="string"&&ie.answer.trim()){Te({role:"zai",text:ie.answer.trim()});return}Te({role:"zai",text:(ie==null?void 0:ie.error)??Tm(he.status),error:!0});return}const we=he.body.getReader(),xe=new TextDecoder;let Ie="";for(;;){const{value:ie,done:Go}=await we.read();if(Go)break;Ie+=xe.decode(ie,{stream:!0});let mt;for(;(mt=Ie.indexOf(`
820
- `))!==-1;){const Wt=Ie.slice(0,mt).trim();if(Ie=Ie.slice(mt+1),!Wt)continue;let ge;try{ge=JSON.parse(Wt)}catch{continue}ge.type==="delta"&&typeof ge.text=="string"?(Ee(),ue+=ge.text,Ve(ue)):ge.type==="done"?(Ee(),Ve(ge.answer||ue)):ge.type==="error"&&(Ee(),Ve(ge.error||"zAI couldn't finish that answer — try again.",!0))}}te||Te({role:"zai",text:"zAI didn't return anything — try again.",error:!0})}catch{const se="zAI couldn't be reached — check that the zframes server is running.";te?Ve(se,!0):Te({role:"zai",text:se,error:!0})}finally{m(!1),(Yt=K.current)==null||Yt.focus()}}function Yo(C){C.key==="Enter"&&!C.shiftKey?(C.preventDefault(),Zo()):C.key==="Escape"&&l(!1)}function Wo(){if(!n||n.length<2||!s)return;const C=n.findIndex(q=>q.id===s);i(n[(C+1)%n.length].id)}if(!n||n.length===0)return null;const Ht=((Zt=n.find(C=>C.id===s))==null?void 0:Zt.label)??n[0].label;return p.jsxs(p.Fragment,{children:[p.jsx("style",{children:Em}),p.jsx("div",{className:"zai-scrim","data-open":c,onClick:()=>l(!1),"aria-hidden":"true"}),p.jsxs("div",{className:"zai-dock","data-open":c,"data-busy":d,children:[c&&h.length>0&&p.jsx("div",{className:"zai-history",ref:ne,"data-masked":G,onScroll:C=>oe(C.currentTarget.scrollTop>1),"aria-live":"polite",children:h.map((C,q)=>p.jsx("div",{className:C.role==="user"?"zai-msg zai-msg-user":`zai-msg zai-msg-zai${C.error?" zai-msg-error":""}`,children:C.text},q))}),p.jsx("div",{className:"zai-panel",children:p.jsxs("div",{className:"zai-input-wrap",children:[p.jsxs("div",{className:"zai-input-field",children:[p.jsx("input",{ref:K,className:"zai-input",value:u,onChange:C=>f(C.target.value),onKeyDown:Yo,placeholder:"",disabled:d,"aria-label":"Ask zAI"}),p.jsx("span",{className:`zai-ph${d?" zai-ph-busy":""}`,"data-show":!u&&(d||$),"aria-hidden":"true",children:d?"thinking…":Lr[Y]})]}),p.jsx("span",{className:"zai-agent",onClick:Wo,title:n.length>1?"Click to switch agent":`Answered by ${Ht}`,children:Ht})]})}),p.jsx("button",{type:"button",className:"zai-orb","data-webgl":S,"data-fallback":P,onClick:()=>l(C=>!C),"aria-label":c?"Close zAI":"Ask zAI","aria-expanded":c,children:p.jsx(dm,{className:"zai-orb-canvas",onScene:le,onError:Oe})})]})]})}const Pm=b.lazy(()=>w(()=>import("./editor-UP2LBUZ9.js"),__vite__mapDeps([100,1,101,102,103])).then(e=>({default:e.DashboardEditor}))),Xe=Kf(),Am=[new iu,new Ll,new ll,new kl,new El,new Tu,new td,new vl,new Vu,new Ql,new Du,new nu,new xu,new hu,new Zl,new dl,new pd];function Vt({children:e}){return p.jsx("main",{className:"mx-auto max-w-2xl px-6 py-16",children:e})}function Rm(){return p.jsx(Vt,{children:p.jsx("p",{className:"body-sm text-soft",children:"loading dashboard…"})})}function Dm({message:e}){return p.jsxs(Vt,{children:[p.jsx("h1",{className:"font-dmsans text-strong mb-2 text-lg font-extrabold",children:"couldn’t load your dashboard"}),p.jsxs("p",{className:"body-sm text-soft mb-4",children:["The zframes runtime couldn’t read ",p.jsx("code",{children:"dashboard.json"}),". Make sure you’re running ",p.jsx("code",{children:"zframes serve"})," next to it."]}),p.jsx("p",{className:"caption text-soft",children:p.jsx("code",{children:e})})]})}function Mm({issues:e}){return p.jsxs(Vt,{children:[p.jsx("h1",{className:"font-dmsans text-strong mb-2 text-lg font-extrabold",children:"dashboard.json is not a valid spec"}),p.jsxs("p",{className:"body-sm text-soft mb-4",children:["Fix the issues below (or run ",p.jsx("code",{children:"zframes lint dashboard.json"}),"), then reload."]}),p.jsx("ul",{className:"body-sm text-normal list-disc space-y-1 pl-5",children:e.map((t,r)=>p.jsxs("li",{children:[p.jsx("code",{children:t.path.join(".")||"(root)"}),": ",t.message]},r))})]})}async function Nm(e){try{const t=await fetch(Jc,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`HTTP ${t.status}`);window.location.reload()}catch(t){console.error("zframes: failed to save dashboard.json",t),window.alert("Couldn't save dashboard.json — is `zframes serve` still running? Your edits are still on screen; try Save again.")}}function Om(){const[e,t]=b.useState({status:"loading"}),[r,o]=b.useState(null),[n,a]=b.useState(null),[s,i]=b.useState(null),[c,l]=b.useState(null),[u,f]=b.useState(null),[d,m]=b.useState(null),[h,g]=b.useState(null),[S,k]=b.useState(null),P=im(),[L,Y]=b.useState(!1),[X,$]=b.useState(!1),M=n??(e.status==="ready"?e.spec.theme.accentHue:null),G=s??(e.status==="ready"?e.spec.theme.accentSat:null),oe=c??(e.status==="ready"?e.spec.typography.scale:null),K=u??(e.status==="ready"?e.spec.theme.upColor:null),ne=d??(e.status==="ready"?e.spec.theme.downColor:null);if(b.useEffect(()=>{M!=null&&document.documentElement.style.setProperty("--zf-accent-hue",String(M))},[M]),b.useEffect(()=>{G!=null&&document.documentElement.style.setProperty("--zf-accent-sat",`${G}%`)},[G]),b.useEffect(()=>{oe!=null&&(document.documentElement.style.fontSize=`${oe*100}%`)},[oe]),b.useEffect(()=>{K!=null&&document.documentElement.style.setProperty("--zf-up",K)},[K]),b.useEffect(()=>{ne!=null&&document.documentElement.style.setProperty("--zf-down",ne)},[ne]),b.useEffect(()=>{let pe=!1;return fetch(Kc,{cache:"no-store"}).then(le=>{if(!le.ok)throw new Error(`HTTP ${le.status}`);return le.json()}).then(le=>{if(pe)return;const Oe=Bc.safeParse(le);t(Oe.success?{status:"ready",spec:Oe.data}:{status:"invalid",issues:Oe.error.issues})}).catch(le=>{pe||t({status:"error",message:String(le)})}),()=>{pe=!0}},[]),e.status==="loading")return p.jsx(Rm,{});if(e.status==="error")return p.jsx(Dm,{message:e.message});if(e.status==="invalid")return p.jsx(Mm,{issues:e.issues});const J=e.spec,Be=(h??J.grid.mode)==="flow-horizontal";return p.jsxs(Vc,{providers:Am,children:[p.jsx(xd,{background:S??J.background,active:L,thinking:X,accentHue:M??J.theme.accentHue,accentSat:G??J.theme.accentSat}),p.jsxs("main",{className:`relative z-10 mx-auto pt-5 ${Be?"h-[100dvh] max-w-none overflow-hidden px-0":"max-w-[1320px] px-4 pb-24 sm:px-6"}`,style:{"--zf-accent-hue":M??J.theme.accentHue,"--zf-accent-sat":`${G??J.theme.accentSat}%`},children:[p.jsxs("header",{className:`mb-5 flex flex-col gap-2 border-b border-white/[0.06] pb-4 sm:flex-row sm:items-center sm:justify-between ${Be?"px-4 sm:px-6":""}`,children:[p.jsxs("div",{className:"flex items-baseline gap-3",children:[p.jsxs("h1",{className:"font-dmsans text-strong text-lg font-extrabold tracking-tight",children:["/",p.jsx("span",{style:{color:"hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%)"},children:"zframes"})]}),p.jsx(_d,{currentTitle:J.title}),p.jsxs("span",{className:"caption text-soft rounded-full border border-white/[0.08] px-1.5 py-0.5 font-mono leading-none",title:"zframes runtime version",children:["v","0.4.1"]})]}),p.jsx("div",{ref:o,className:"flex min-h-9 items-center justify-end"})]}),P?p.jsx(b.Suspense,{fallback:p.jsx(zr,{spec:J,registry:Xe}),children:p.jsx(Pm,{spec:J,registry:Xe,onSave:Nm,customiseButtonTarget:r,onAccentHueChange:a,onAccentSatChange:i,onFontScaleChange:l,onUpColorChange:f,onDownColorChange:m,onModeChange:g,onBackgroundChange:k})}):p.jsx(zr,{spec:J,registry:Xe})]}),p.jsx(sm,{}),p.jsx(Cm,{onOpenChange:Y,onThinkingChange:$,spec:J,registry:Xe})]})}const Ho=document.getElementById("root");if(!Ho)throw new Error("missing #root element");Jo.createRoot(Ho).render(p.jsx(b.StrictMode,{children:p.jsx(Om,{})}));export{Pd as $,em as A,Td as B,tp as C,Bd as D,up as E,Fm as F,Hd as G,dp as H,Fd as I,cp as J,jd as K,lp as L,Ld as M,jc as N,ip as O,Ud as P,sp as Q,Yd as R,Bm as S,Ed as T,qd as U,Gd as V,$d as W,Sd as X,af as Y,mp as Z,Cd as _,Vc as a,xp as a$,Vm as a0,tf as a1,Hm as a2,Jf as a3,Ad as a4,Rd as a5,Hc as a6,Zc as a7,Od as a8,rp as a9,gf as aA,yf as aB,vf as aC,bf as aD,wf as aE,xf as aF,_f as aG,Sf as aH,kf as aI,zf as aJ,Tf as aK,Ef as aL,$f as aM,pp as aN,Ff as aO,hp as aP,Lf as aQ,gp as aR,jf as aS,yp as aT,Uf as aU,vp as aV,Bf as aW,bp as aX,Vf as aY,wp as aZ,Hf as a_,np as aa,Id as ab,op as ac,Zd as ad,fp as ae,Dd as af,Md as ag,Zm as ah,Vd as ai,ap as aj,sf as ak,Ym as al,cf as am,Wm as an,lf as ao,Gm as ap,uf as aq,qm as ar,df as as,Xm as at,ff as au,Km as av,mf as aw,Qm as ax,pf as ay,hf as az,Yc as b,Zf as b0,kp as b1,Yf as b2,Wf as b3,Jm as b4,Cf as b5,Pf as b6,Af as b7,Rf as b8,Df as b9,Mf as ba,Nf as bb,Of as bc,If as bd,qc as c,Wc as d,Lc as e,Lm as f,of as g,Ut as h,nf as i,_p as j,Um as k,Sp as l,zp as m,Nd as n,ep as o,rf as p,zd as q,Xd as r,Kd as s,jm as t,ct as u,_r as v,Jd as w,Qd as x,ef as y,Wd as z};