zframes 0.3.0 → 0.4.0

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 (110) hide show
  1. package/dist/index.js +533 -84
  2. package/package.json +5 -5
  3. package/runtime/assets/bitcoin-dominance-DVZsIJ3y.js +1 -0
  4. package/runtime/assets/breakeven-lskbHkqb.js +1 -0
  5. package/runtime/assets/breathing-BeUkCUAJ.js +1 -0
  6. package/runtime/assets/btc-blocks-fXBgGo4z.js +1 -0
  7. package/runtime/assets/btc-difficulty-BwyxgI0e.js +1 -0
  8. package/runtime/assets/btc-fees-Bg1rcXtN.js +1 -0
  9. package/runtime/assets/btc-hashrate-Xg8QNlTO.js +1 -0
  10. package/runtime/assets/btc-mempool-8Mfa77fO.js +1 -0
  11. package/runtime/assets/btc-shared-DeqDaCze.js +1 -0
  12. package/runtime/assets/calculator-CiXyJA9p.js +1 -0
  13. package/runtime/assets/chart-utils-BYIZMM9J.js +1 -0
  14. package/runtime/assets/checklist-D0dKSdmf.js +1 -0
  15. package/runtime/assets/clock-CNQTNh4L.js +1 -0
  16. package/runtime/assets/coin-movers-DulAF_oo.js +1 -0
  17. package/runtime/assets/content-shared-BZ1XzrJx.js +1 -0
  18. package/runtime/assets/countdown-BzZ2L6bw.js +1 -0
  19. package/runtime/assets/{d3-B3esOK0k.js → d3-xK4fOkBU.js} +1 -1
  20. package/runtime/assets/daily-analysis-RyI5KL4T.js +1 -0
  21. package/runtime/assets/day-meter-2bAj77Kz.js +1 -0
  22. package/runtime/assets/dex-volume-chart-DDPf1YAN.js +1 -0
  23. package/runtime/assets/dex-volume-treemap-jZCgRREu.js +1 -0
  24. package/runtime/assets/dice-wg979Skm.js +1 -0
  25. package/runtime/assets/dino-game-DlACWmE_.js +1 -0
  26. package/runtime/assets/divider-Chz1UsWJ.js +1 -0
  27. package/runtime/assets/drawdy-Ce7P47cx.js +1 -0
  28. package/runtime/assets/editor-BlGZ_tel.js +68 -0
  29. package/runtime/assets/editor-CHAAJRb1.css +1 -0
  30. package/runtime/assets/fear-greed-CENzXdIk.js +1 -0
  31. package/runtime/assets/feed-row-mVg1d5Zj.js +1 -0
  32. package/runtime/assets/filings-feed-2aIKzUUY.js +1 -0
  33. package/runtime/assets/financial-stress--ezsCpfR.js +1 -0
  34. package/runtime/assets/flappy-bird-DDe-IXt9.js +1 -0
  35. package/runtime/assets/format-CfAcS4D8.js +1 -0
  36. package/runtime/assets/fundamentals-v8f81ZNS.js +1 -0
  37. package/runtime/assets/funding-heatmap-DUoeFNGr.js +1 -0
  38. package/runtime/assets/funding-rate-chart-CjDA4nj7.js +1 -0
  39. package/runtime/assets/fx-board-CmXYQZi4.js +1 -0
  40. package/runtime/assets/game-ui-Dy_QYsPr.js +1 -0
  41. package/runtime/assets/heading-DMxdj9LK.js +1 -0
  42. package/runtime/assets/holiday-calendar-DxB-fxG5.js +1 -0
  43. package/runtime/assets/image-DLg33JpH.js +1 -0
  44. package/runtime/assets/index-C_O7gp2F.js +822 -0
  45. package/runtime/assets/index-DRTPEQtR.css +1 -0
  46. package/runtime/assets/index-XGtH5pVY.css +1 -0
  47. package/runtime/assets/index-jnySFpSv.js +1 -0
  48. package/runtime/assets/inflation-pulse-gcw-84PM.js +1 -0
  49. package/runtime/assets/journal-log-BX5Z_yte.js +1 -0
  50. package/runtime/assets/journal-open-XFQGIRkw.js +1 -0
  51. package/runtime/assets/journal-results-J1WCmyH2.js +1 -0
  52. package/runtime/assets/journal-score-CKhBSfYY.js +1 -0
  53. package/runtime/assets/journal-store-KCRoPnI_.js +1 -0
  54. package/runtime/assets/journal-ui-Cogk2Wkt.js +1 -0
  55. package/runtime/assets/labor-market-BV20Rl-4.js +1 -0
  56. package/runtime/assets/lightning-stats-h4fquhAg.js +1 -0
  57. package/runtime/assets/link-grid-a6NWj1Hu.js +1 -0
  58. package/runtime/assets/market-cap-treemap-CAi49oc_.js +1 -0
  59. package/runtime/assets/market-data-CvmpLFSo.js +1 -0
  60. package/runtime/assets/market-hours-6srwf0-r.js +1 -0
  61. package/runtime/assets/marquee-DDurk6bj.js +28 -0
  62. package/runtime/assets/metric-row-BVVhjsjK.js +1 -0
  63. package/runtime/assets/mini-line-chart-D-i1QqSe.js +1 -0
  64. package/runtime/assets/mining-pools-BPjCy4ZW.js +1 -0
  65. package/runtime/assets/mover-row-kQ9xt3Sp.js +1 -0
  66. package/runtime/assets/national-debt-DkOnmfd1.js +1 -0
  67. package/runtime/assets/news-feed-CFWKKqrH.js +1 -0
  68. package/runtime/assets/note-_cGEXAru.js +1 -0
  69. package/runtime/assets/open-interest-fxHh_T-V.js +1 -0
  70. package/runtime/assets/options-iv-CDArg1Op.js +1 -0
  71. package/runtime/assets/options-oi-strike-D_XIgUkk.js +1 -0
  72. package/runtime/assets/options-put-call-DG4RXjzD.js +1 -0
  73. package/runtime/assets/pomodoro-B-Jk-51G.js +1 -0
  74. package/runtime/assets/portfolio-allocation-BJepNj1X.js +1 -0
  75. package/runtime/assets/portfolio-common-D5L06PNC.js +1 -0
  76. package/runtime/assets/portfolio-holdings-DSkAZALG.js +1 -0
  77. package/runtime/assets/portfolio-value-BJw2csWV.js +1 -0
  78. package/runtime/assets/price-chart-khxI-9vJ.js +1 -0
  79. package/runtime/assets/price-compare-C-uEckke.js +1 -0
  80. package/runtime/assets/price-liveline-BDesEIbL.js +1 -0
  81. package/runtime/assets/price-ticker-BXSeNYf9.js +1 -0
  82. package/runtime/assets/protocol-fees-treemap-YtWbL1Kn.js +1 -0
  83. package/runtime/assets/protocol-tvl-chart-CEjUOIY5.js +1 -0
  84. package/runtime/assets/protocol-tvl-treemap-b31QlpnS.js +1 -0
  85. package/runtime/assets/quote-cehyepdm.js +1 -0
  86. package/runtime/assets/rates-board-Du4k0z1i.js +1 -0
  87. package/runtime/assets/returns-projector-DXnRFAES.js +1 -0
  88. package/runtime/assets/risk-reward-DZWyCrbv.js +1 -0
  89. package/runtime/assets/rules-card-BXJjNTqj.js +1 -0
  90. package/runtime/assets/session-progress-bA45Q3wk.js +1 -0
  91. package/runtime/assets/short-volume-C6cWknyR.js +1 -0
  92. package/runtime/assets/snake-DYTa97hl.js +1 -0
  93. package/runtime/assets/spotify-embed-BaH6UHeG.js +1 -0
  94. package/runtime/assets/stopwatch-CS6n0bY9.js +1 -0
  95. package/runtime/assets/top-movers-CQNx9EH5.js +1 -0
  96. package/runtime/assets/treasury-auctions-CGM8hAuU.js +1 -0
  97. package/runtime/assets/treemap-leaf-DLQawrx4.js +1 -0
  98. package/runtime/assets/tvl-treemap-C3SUFzdj.js +1 -0
  99. package/runtime/assets/ui-Bq3RQsdJ.js +1 -0
  100. package/runtime/assets/unicorn-scene-DcohHRPZ.js +1 -0
  101. package/runtime/assets/use-countdown-BmcF-qdL.js +1 -0
  102. package/runtime/assets/utils-DaT-yT0k.js +1 -0
  103. package/runtime/assets/video-WCnvLwQ_.js +1 -0
  104. package/runtime/assets/yield-curve-CpitTQ9L.js +1 -0
  105. package/runtime/index.html +2 -4
  106. package/runtime/assets/editor-DVTcqJo4.js +0 -68
  107. package/runtime/assets/editor-DnV0I9s-.css +0 -1
  108. package/runtime/assets/index-DEGnog6Q.css +0 -1
  109. package/runtime/assets/index-DPlG_EDx.js +0 -35727
  110. package/runtime/assets/index-KRy1feFG.js +0 -761
@@ -0,0 +1 @@
1
+ import{j as a}from"./react-qoZPGuNy.js";import{E as p,a as c,i as u}from"./market-data-CvmpLFSo.js";import{f,b6 as m}from"./index-C_O7gp2F.js";import{F as w}from"./ui-Bq3RQsdJ.js";m.schema;const g=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],j="#f2b066",T=864e5;function b({config:t}){const o=p[t.exchange],n=o?c(t.exchange):null;if(!o||!n)return a.jsx(w,{children:"unknown exchange"});const y=new Date,x=(n.dow+6)%7,i=[];for(let e=0;e<7;e++){const s=c(t.exchange,new Date(y.getTime()+(e-x)*T));if(!s)continue;const r=o.days.includes(s.dow),l=r&&u(t.exchange,s.ymd);i.push({ymd:s.ymd,dow:s.dow,day:Number(s.ymd.split("-")[2]),isToday:s.ymd===n.ymd,isHoliday:l,isTrading:r&&!l})}const h=t.weekdaysOnly?i.filter(e=>o.days.includes(e.dow)):i,d=t.label.trim();return a.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-1.5",children:[d&&a.jsx("div",{className:"caption text-soft shrink-0 uppercase tracking-[0.12em]",children:d}),a.jsx("div",{className:"flex min-h-0 flex-1 items-stretch gap-1",children:h.map(e=>{const s=!e.isTrading&&!e.isHoliday;return a.jsxs("div",{title:e.isHoliday?"Market holiday":e.isTrading?"Trading day":"Closed",className:`flex flex-1 flex-col items-center justify-center rounded-md border px-1 py-1 ${e.isToday?"text-strong":s?"text-disabled":"text-normal"}`,style:{borderColor:e.isToday?"var(--color-highlight)":"rgba(255,255,255,0.06)",color:e.isHoliday&&!e.isToday?j:void 0},children:[a.jsx("span",{className:"caption opacity-80",children:g[e.dow]}),a.jsx("span",{className:"metric-sm",children:e.day})]},e.ymd)})})]})}const v=f({...m,component:b});export{v as dayMeterFrame};
@@ -0,0 +1 @@
1
+ import{r as l,j as r}from"./react-qoZPGuNy.js";import{p as x,f as C}from"./format-CfAcS4D8.js";import{f as M,am as p,an as S}from"./index-C_O7gp2F.js";import{F as u}from"./ui-Bq3RQsdJ.js";import{a,C as f}from"./chart-utils-BYIZMM9J.js";import{M as D}from"./index-jnySFpSv.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";const E={"7D":{ms:10080*60*1e3,timeframe:a["7D"]},"1M":{ms:720*60*60*1e3,timeframe:a["1M"]},"3M":{ms:2160*60*60*1e3,timeframe:a["3M"]}};p.schema;function j({config:t}){const{ms:m,timeframe:c}=E[t.lookback],s=l.useMemo(()=>Date.now()-m,[m]),{history:i,isLoading:d}=S(t.protocols),n=l.useMemo(()=>t.protocols.map((e,h)=>({id:e,name:x(e),color:f[h%f.length],data:(i[e]??[]).filter(o=>o.time>=s).map(o=>({date:new Date(o.time).toISOString(),value:o.value}))})),[t.protocols,i,s]);return d?r.jsx(u,{loading:!0,children:"loading DEX volume…"}):n.every(e=>e.data.length===0)?r.jsx(u,{children:"no DEX volume data yet"}):r.jsx(D,{series:n,timeframe:c,height:250,formatValue:e=>C(e)})}const I=M({...p,component:j});export{I as dexVolumeChartFrame};
@@ -0,0 +1 @@
1
+ import{r as l,j as t}from"./react-qoZPGuNy.js";import{f as u}from"./format-CfAcS4D8.js";import{f as i,ak as n,al as p}from"./index-C_O7gp2F.js";import{T as c,a as f}from"./treemap-leaf-DLQawrx4.js";import{F as s}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";n.schema;function d({width:m,height:r,data:o}){const a=u(o.volume24h);return t.jsx(f,{width:m,height:r,label:o.id,secondary:a,title:`${o.id} · ${a} 24h volume`})}function h({config:m}){const{entries:r,isLoading:o}=p(),a=l.useMemo(()=>r.slice(0,m.topN).map(e=>({id:e.name,value:e.volume24h,volume24h:e.volume24h,changePct:e.changePct??0})),[r,m.topN]);return o?t.jsx(s,{loading:!0,children:"loading DEX volume…"}):a.length===0?t.jsx(s,{children:"no DEX volume data"}):t.jsx(c,{data:a,LeafComponent:d,getColorValue:e=>e.changePct})}const D=i({...n,component:h});export{D as dexVolumeTreemapFrame};
@@ -0,0 +1 @@
1
+ import{r as s,j as t}from"./react-qoZPGuNy.js";import{i as w}from"./content-shared-BZ1XzrJx.js";import{f as k,aI as x}from"./index-C_O7gp2F.js";import{F as b}from"./ui-Bq3RQsdJ.js";x.schema;const h="var(--color-highlight)",p={coin:"Coin flip",dice:"Dice roll",list:"Random pick"},v={1:[!1,!1,!1,!1,!0,!1,!1,!1,!1],2:[!0,!1,!1,!1,!1,!1,!1,!1,!0],3:[!0,!1,!1,!1,!0,!1,!1,!1,!0],4:[!0,!1,!0,!1,!1,!1,!0,!1,!0],5:[!0,!1,!0,!1,!0,!1,!0,!1,!0],6:[!0,!1,!0,!0,!1,!0,!0,!1,!0]};function c(r,e){return r==="coin"?Math.random()<.5?"Heads":"Tails":r==="dice"?String(Math.floor(Math.random()*6)+1):e.length===0?"":e[Math.floor(Math.random()*e.length)]??""}function N({value:r}){const e=v[r];return e?t.jsx("div",{className:"grid grid-cols-3 gap-1","aria-hidden":!0,children:e.map((a,l)=>t.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:a?h:"transparent"}},l))}):null}function E({config:r}){const{mode:e,options:a,label:l}=r,n=e==="list"&&a.length===0,[o,f]=s.useState(()=>c(e,a)),[i,u]=s.useState(!1);s.useEffect(()=>{f(c(e,a))},[e,a]),s.useEffect(()=>{if(!i)return;let d=0;const m=window.setInterval(()=>{f(c(e,a)),d+=1,d>=6&&(window.clearInterval(m),u(!1))},60);return()=>window.clearInterval(m)},[i,e,a]);const g=s.useCallback(()=>{n||u(!0)},[n]);if(n)return t.jsx(b,{children:"add options to decide"});const j=e==="list"?"metric-lg":"metric-xl";return t.jsxs("button",{type:"button",onClick:g,"aria-label":`${p[e]} — roll again`,className:`flex h-full w-full cursor-pointer flex-col items-center justify-center gap-2 px-3 py-2 ${w}`,children:[t.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:p[e]}),t.jsx("span",{"aria-live":"polite",className:`${j} max-w-full break-words text-center leading-none transition-transform`,style:{color:h,transform:i?"scale(1.08)":void 0},children:o}),e==="dice"&&t.jsx(N,{value:Number(o)}),l.trim()&&t.jsx("span",{className:"caption text-soft max-w-full text-center",children:l.trim()}),t.jsx("span",{className:"caption text-disabled uppercase tracking-[0.12em]",children:"click to roll"})]})}const F=k({...x,component:E});export{F as diceFrame};
@@ -0,0 +1 @@
1
+ import{r as s,j as M}from"./react-qoZPGuNy.js";import{a as P,d as _,G as T}from"./game-ui-Dy_QYsPr.js";import{f as k,z}from"./index-C_O7gp2F.js";import"./format-CfAcS4D8.js";const F=.6,U=-12,I=40,W=40,b=44,Y=24,X=40,H=3,q=5e-4,p={ground:"rgba(255, 255, 255, 0.1)",groundTexture:"rgba(255, 255, 255, 0.06)",dino:"rgba(255, 255, 255, 1)",eye:"rgba(0, 0, 0, 0.8)",cactus:"#25A78D"};function L(t,n,o,c){t.fillStyle=p.dino,t.fillRect(n+10,o+10,25,24),t.fillRect(n+20,o,20,16),t.fillStyle=p.eye,t.fillRect(n+32,o+4,4,4),t.fillStyle=p.dino,t.fillRect(n,o+16,14,8),t.fillRect(n-4,o+12,8,8),c===null?(t.fillRect(n+12,o+34,6,10),t.fillRect(n+24,o+34,6,10)):(t.fillRect(n+12,o+34,6,c===0?10:6),t.fillRect(n+24,o+34,6,c===1?10:6)),t.fillRect(n+30,o+18,4,10)}function B(t,n,o,c,m){const f=o-m;t.fillStyle=p.cactus,t.fillRect(n+c/2-4,f,8,m),t.fillRect(n,f+10,8,6),t.fillRect(n,f+10,4,14),t.fillRect(n+c-8,f+18,8,6),t.fillRect(n+c-4,f+18,4,12)}function N(t,n,o,c,m,f){const u=t.height-I;n.clearRect(0,0,t.width,t.height),n.fillStyle=p.ground,n.fillRect(0,u,t.width,2),L(n,50,u-b,null),n.textAlign="center",o==="idle"?(n.fillStyle=T.text,n.font='bold 14px "DM Sans", sans-serif',n.fillText("Press SPACE or tap to start",t.width/2,t.height/2-30)):(n.fillStyle=T.gameOver,n.font='bold 20px "DM Sans", sans-serif',n.fillText("GAME OVER",t.width/2,t.height/2-40),n.fillStyle=T.text,n.font='bold 14px "DM Sans", sans-serif',n.fillText(`Score: ${c}`,t.width/2,t.height/2-10),n.fillStyle=T.textSoft,n.fillText("Press SPACE or tap to restart",t.width/2,t.height/2+20)),n.textAlign="left",_(t,n,c,m,f)}function K(){const t=s.useRef(null),n=s.useRef(null),[o,c]=s.useState("idle"),[m,f]=s.useState(0),[u,V]=s.useState(()=>{if(typeof window<"u"){const e=localStorage.getItem("zframes-dino-high-score");return e?parseInt(e,10):0}return 0}),[v,J]=s.useState(!1),g=s.useRef(0),S=s.useRef(u),D=s.useRef(o),y=s.useRef(P(null));s.useEffect(()=>{S.current=u,u>0&&localStorage.setItem("zframes-dino-high-score",String(u))},[u]),s.useEffect(()=>{D.current=o},[o]);const R=s.useRef({dinoY:0,dinoVelocity:0,isJumping:!1,obstacles:[],speed:H,frameCount:0,groundOffset:0}),O=s.useCallback(()=>{const e=t.current;e&&(R.current={dinoY:e.height-I-b,dinoVelocity:0,isJumping:!1,obstacles:[],speed:H,frameCount:0,groundOffset:0},g.current=0,f(0))},[]),C=s.useCallback(()=>{var i;if((i=n.current)==null||i.focus(),o!=="playing"){O(),c("playing");return}const e=R.current;e.isJumping||(e.dinoVelocity=U,e.isJumping=!0)},[o,O]);return s.useEffect(()=>{const e=a=>{const l=a.target;l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable||(a.code==="Space"||a.code==="ArrowUp")&&(a.preventDefault(),C())},i=n.current;if(i)return i.addEventListener("keydown",e),()=>i.removeEventListener("keydown",e)},[C]),s.useLayoutEffect(()=>{const e=t.current;if(!e)return;const i=()=>{const l=e.parentElement;if(l&&l.clientWidth>0&&l.clientHeight>0){e.width=l.clientWidth,e.height=l.clientHeight,y.current=P(e),R.current.dinoY=e.height-I-b;const E=e.getContext("2d");E&&D.current!=="playing"&&N(e,E,D.current,g.current,S.current,y.current),J(A=>!A)}};i();const a=new ResizeObserver(i);return a.observe(e.parentElement),()=>a.disconnect()},[]),s.useEffect(()=>{if(o!=="playing")return;const e=t.current,i=e==null?void 0:e.getContext("2d");if(!e||!i)return;let a;const l=e.height-I,E=()=>{i.fillStyle=p.ground,i.fillRect(0,l,e.width,2),i.fillStyle=p.groundTexture;const r=R.current.groundOffset%30;for(let h=-r;h<e.width;h+=30)i.beginPath(),i.arc(h,l+12,1.5,0,Math.PI*2),i.fill(),i.beginPath(),i.arc(h+15,l+20,1,0,Math.PI*2),i.fill()},A=r=>{const w=R.current.dinoY;return 50+W-5>r.x&&55<r.x+r.width&&w+b>l-r.height&&w+5<l},G=()=>{const r=R.current;i.clearRect(0,0,e.width,e.height),r.dinoVelocity+=F,r.dinoY+=r.dinoVelocity;const h=l-b;r.dinoY>=h&&(r.dinoY=h,r.dinoVelocity=0,r.isJumping=!1),r.obstacles=r.obstacles.filter(d=>d.x>-Y),r.obstacles.forEach(d=>{d.x-=r.speed});const w=r.obstacles[r.obstacles.length-1],j=300+Math.random()*200;(!w||w.x<e.width-j)&&Math.random()<.02&&r.obstacles.push({x:e.width,width:Y,height:X});for(const d of r.obstacles)if(A(d)){g.current>S.current&&(S.current=g.current,V(g.current)),c("gameover");return}r.frameCount++,r.frameCount%6===0&&(g.current+=1,f(g.current)),r.speed+=q,r.groundOffset+=r.speed,E(),L(i,50,r.dinoY,r.isJumping?null:Math.floor(r.frameCount/5)%2),r.obstacles.forEach(d=>B(i,d.x,l,d.width,d.height)),_(e,i,g.current,S.current,y.current),a=requestAnimationFrame(G)};return a=requestAnimationFrame(G),()=>cancelAnimationFrame(a)},[o]),s.useEffect(()=>{if(o==="playing")return;const e=t.current,i=e==null?void 0:e.getContext("2d");!e||!i||N(e,i,o,m,u,y.current)},[o,m,u,v]),M.jsx("div",{ref:n,tabIndex:0,className:"relative h-full w-full cursor-pointer select-none overflow-hidden outline-none",onClick:C,onTouchStart:C,role:"application","aria-label":"Dino running game. Press space or tap to jump over obstacles.",children:M.jsx("canvas",{ref:t,className:"h-full w-full"})})}const ee=k({...z,component:K});export{ee as dinoGameFrame};
@@ -0,0 +1 @@
1
+ import{j as t}from"./react-qoZPGuNy.js";import{f as o,aG as a}from"./index-C_O7gp2F.js";a.schema;const i="rgba(255,255,255,0.16)";function n({config:r}){const e=r.orientation==="vertical",s=r.label.trim(),l=c=>t.jsx("span",{className:`shrink ${e?"w-0 flex-1":"h-0 flex-1"} `,style:e?{borderLeftWidth:1,borderLeftStyle:r.style,borderColor:i}:{borderTopWidth:1,borderTopStyle:r.style,borderColor:i}});return s?t.jsxs("div",{className:`flex h-full w-full items-center justify-center gap-3 ${e?"flex-col py-1":"px-1"}`,children:[l(),t.jsx("span",{className:"caption text-soft shrink-0 whitespace-nowrap uppercase tracking-[0.14em]",style:e?{writingMode:"vertical-rl"}:void 0,children:s}),l()]}):t.jsx("div",{className:`flex h-full w-full items-center justify-center ${e?"flex-col":""}`,children:l()})}const m=o({...a,component:n});export{m as dividerFrame};
@@ -0,0 +1 @@
1
+ import{r as t,j as a}from"./react-qoZPGuNy.js";import{f as d,aB as s}from"./index-C_O7gp2F.js";import{F as o}from"./ui-Bq3RQsdJ.js";function i(){const[r,e]=t.useState("loading");return r==="error"?a.jsx(o,{children:"canvas unavailable"}):a.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[r==="loading"&&a.jsx("div",{className:"absolute inset-0 z-10",children:a.jsx(o,{loading:!0,children:"loading canvas…"})}),a.jsx("iframe",{src:"https://drawdy.io",title:"Drawdy Canvas",className:`h-full w-full border-0 transition-opacity duration-300 ${r==="loaded"?"opacity-100":"opacity-0"}`,allow:"clipboard-read; clipboard-write",onLoad:()=>e("loaded"),onError:()=>e("error")})]})}const m=d({...s,component:i});export{m as drawdyFrame};
@@ -0,0 +1,68 @@
1
+ import{r,j as e,c as Es,a as Qt}from"./react-qoZPGuNy.js";import{G as es}from"./gridstack-BxxvPIFU.js";import{t as rt,u as Ts,F as ts,a as Fs,b as Is,c as Ls,d as $s,N as ss,e as as}from"./index-C_O7gp2F.js";const rs=[{key:"zframes",label:"zframes",description:"The signature indigo on near-black navy, DM Sans, soft rounded cards — the default look.",theme:{accentHue:242,accentSat:90,baseHue:233,baseSat:20},typography:{fontFamily:"sans",numericStyle:"proportional"},appearance:{radius:18,borderStrength:.22,surfaceOpacity:1,density:1,elevation:1}},{key:"terminal",label:"Terminal",description:"Phosphor green on black, monospaced, fixed-width digits, sharp dense flat cards — a trading-terminal feel.",theme:{accentHue:145,accentSat:85,baseHue:150,baseSat:16},typography:{fontFamily:"mono",numericStyle:"tabular"},appearance:{radius:4,borderStrength:.34,surfaceOpacity:1,density:.85,elevation:.4}},{key:"amber",label:"Amber",description:"Warm amber on charcoal, monospaced, tabular, slightly sharp cards — a retro CRT console.",theme:{accentHue:38,accentSat:95,baseHue:30,baseSat:18},typography:{fontFamily:"mono",numericStyle:"tabular"},appearance:{radius:6,borderStrength:.3,surfaceOpacity:1,density:.9,elevation:.6}},{key:"graphite",label:"Graphite",description:"Near-grayscale slate, faint rims, flat quiet cards, tabular numbers — calm and neutral.",theme:{accentHue:220,accentSat:8,baseHue:220,baseSat:4},typography:{fontFamily:"sans",numericStyle:"tabular"},appearance:{radius:14,borderStrength:.14,surfaceOpacity:1,density:1,elevation:.35}},{key:"synthwave",label:"Synthwave",description:"Hot magenta on deep violet-black, faintly glassy cards floating on a strong glow — vivid and nocturnal.",theme:{accentHue:320,accentSat:88,baseHue:280,baseSat:26},typography:{fontFamily:"sans",numericStyle:"proportional"},appearance:{radius:20,borderStrength:.3,surfaceOpacity:.9,density:1,elevation:1.7}},{key:"editorial",label:"Editorial",description:"A warm serif on soft charcoal-brown, roomy padding, gentle lift — reads like a financial broadsheet.",theme:{accentHue:22,accentSat:60,baseHue:28,baseSat:12},typography:{fontFamily:"serif",numericStyle:"proportional"},appearance:{radius:10,borderStrength:.18,surfaceOpacity:1,density:1.15,elevation:.8}}],Xe=[{key:"aurora",label:"Aurora",description:"The signature zframes scene — a slow indigo aurora drifting over near-black. The default backdrop.",projectId:"YrTzGatwjK7EoFpCSfgZ",swatch:"radial-gradient(120% 120% at 30% 20%, hsl(248 80% 60%) 0%, hsl(250 70% 22%) 45%, hsl(240 40% 6%) 100%)"},{key:"nebula",label:"Nebula",description:"A deeper violet nebula with brighter drifting cores — a touch more energy than Aurora.",projectId:"K42KSY4FXeXhjVOj9RgT",swatch:"radial-gradient(120% 120% at 70% 30%, hsl(280 75% 62%) 0%, hsl(262 65% 26%) 45%, hsl(250 45% 7%) 100%)"},{key:"ember",label:"Ember",description:"Warm ember tones drifting over charcoal.",projectId:"E4221P7lwTy049d7ISxc",swatch:"radial-gradient(120% 120% at 30% 25%, hsl(24 85% 58%) 0%, hsl(12 65% 28%) 45%, hsl(8 40% 7%) 100%)"},{key:"tide",label:"Tide",description:"Cool teal currents on deep blue-black.",projectId:"cYpXuEzDqm4r3fdp4TGx",swatch:"radial-gradient(120% 120% at 70% 25%, hsl(180 70% 55%) 0%, hsl(196 65% 26%) 45%, hsl(205 45% 7%) 100%)"},{key:"verdant",label:"Verdant",description:"Soft green light over near-black.",projectId:"PrFtFGDE5duemLmr2YKQ",swatch:"radial-gradient(120% 120% at 30% 25%, hsl(140 65% 55%) 0%, hsl(152 55% 24%) 45%, hsl(160 40% 6%) 100%)"},{key:"dusk",label:"Dusk",description:"Magenta-pink glow fading into dark.",projectId:"qpoj0wFWmgwRVXmzRMiL",swatch:"radial-gradient(120% 120% at 70% 30%, hsl(320 80% 62%) 0%, hsl(300 60% 28%) 45%, hsl(290 45% 7%) 100%)"}];/**
2
+ * @license lucide-react v1.21.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ms=(...t)=>t.filter((a,n,d)=>!!a&&a.trim()!==""&&d.indexOf(a)===n).join(" ").trim();/**
7
+ * @license lucide-react v1.21.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Hs=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
12
+ * @license lucide-react v1.21.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Os=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,n,d)=>d?d.toUpperCase():n.toLowerCase());/**
17
+ * @license lucide-react v1.21.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const ns=t=>{const a=Os(t);return a.charAt(0).toUpperCase()+a.slice(1)};/**
22
+ * @license lucide-react v1.21.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */var Ye={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
27
+ * @license lucide-react v1.21.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Ps=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},Bs=r.createContext({}),Gs=()=>r.useContext(Bs),Ds=r.forwardRef(({color:t,size:a,strokeWidth:n,absoluteStrokeWidth:d,className:v="",children:m,iconNode:h,...u},f)=>{const{size:p=24,strokeWidth:c=2,absoluteStrokeWidth:z=!1,color:N="currentColor",className:g=""}=Gs()??{},C=d??z?Number(n??c)*24/Number(a??p):n??c;return r.createElement("svg",{ref:f,...Ye,width:a??p??Ye.width,height:a??p??Ye.height,stroke:t??N,strokeWidth:C,className:ms("lucide",g,v),...!m&&!Ps(u)&&{"aria-hidden":"true"},...u},[...h.map(([T,A])=>r.createElement(T,A)),...Array.isArray(m)?m:[m]])});/**
32
+ * @license lucide-react v1.21.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const me=(t,a)=>{const n=r.forwardRef(({className:d,...v},m)=>r.createElement(Ds,{ref:m,iconNode:a,className:ms(`lucide-${Hs(ns(t))}`,`lucide-${t}`,d),...v}));return n.displayName=ns(t),n};/**
37
+ * @license lucide-react v1.21.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const _s=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ws=me("check",_s);/**
42
+ * @license lucide-react v1.21.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Us=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qs=me("chevron-down",Us);/**
47
+ * @license lucide-react v1.21.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const Ks=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Vs=me("plus",Ks);/**
52
+ * @license lucide-react v1.21.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const Xs=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ys=me("search",Xs);/**
57
+ * @license lucide-react v1.21.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const Zs=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Js=me("sliders-horizontal",Zs);/**
62
+ * @license lucide-react v1.21.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const Qs=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ie=me("x",Qs),fs=["xyz:XYZ100","xyz:SP500","xyz:NVDA","xyz:TSLA","xyz:AAPL","xyz:MSFT","xyz:GOOGL","xyz:META","xyz:AMZN","xyz:MU","xyz:AMD","xyz:AVGO","xyz:ARM","xyz:TSM","xyz:SKHX","xyz:MSTR","xyz:COIN","xyz:HOOD","xyz:PLTR","xyz:SPCX","xyz:GOLD","xyz:SILVER","xyz:CL","xyz:BRENTOIL","xyz:COPPER","xyz:EUR","xyz:JPY","xyz:SMH","BTC","ETH","SOL","HYPE","BNB","XRP","DOGE","LINK","AVAX","SUI"],hs=new Map(fs.map((t,a)=>[t,a]));function ye(t){const a=t.indexOf(":");return(a===-1?t:t.slice(a+1)).toUpperCase()}function nt(t){return t.includes(":")?"Stock":"Crypto"}function ea(t){const a=t.indexOf(":");if(a!==-1){const n=t.slice(a+1);return`https://assets.parqet.com/logos/symbol/${encodeURIComponent(n)}?format=png`}return`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}function ta(t){const a=t.trim().replace(/\s+/g,"");if(!a)return"";const n=a.indexOf(":");return n===-1?a.toUpperCase():`${a.slice(0,n).toLowerCase()}:${a.slice(n+1).toUpperCase()}`}function et(t,a,n=hs.get(t)??1e4){return{symbol:t,ticker:ye(t),kind:nt(t),markPx:a==null?void 0:a.markPx,changePct:a==null?void 0:a.changePct,rank:n}}function ps(t){if(!Number.isFinite(t))return"";const a=t;return a>=1e3?`$${a.toLocaleString(void 0,{maximumFractionDigits:0})}`:a>=100?`$${a.toFixed(2)}`:a>=1?`$${a.toFixed(3)}`:`$${a.toPrecision(3)}`}function sa(t){if(!Number.isFinite(t))return"";const a=t;return`${a>=0?"+":""}${a.toFixed(2)}%`}function gs(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function $(t,a){return t!=null&&t.type?Array.isArray(t.type)?t.type.includes(a):t.type===a:!1}function bs(t){const a=t==null?void 0:t.items;return!!a&&$(t,"array")&&$(a,"string")}function aa(t){var a,n,d;try{const m=rt(t.schema,{io:"input"}).properties??{};if($(m.symbol,"string"))return{kind:"single"};if(bs(m.symbols))return{kind:"symbols",minItems:(a=m.symbols)==null?void 0:a.minItems,maxItems:(n=m.symbols)==null?void 0:n.maxItems};const h=m.holdings,u=((d=h==null?void 0:h.items)==null?void 0:d.properties)??{};if($(h,"array")&&$(u.symbol,"string"))return{kind:"holdings",minItems:h==null?void 0:h.minItems,maxItems:h==null?void 0:h.maxItems}}catch{}return t.name==="price-chart"?{kind:"single"}:["price-liveline","price-ticker","funding-rate-chart","funding-heatmap","price-compare"].includes(t.name)?{kind:"symbols"}:null}function ra(t,a){return t.kind==="single"?typeof a.symbol=="string"&&a.symbol?[a.symbol]:[]:t.kind==="symbols"?Array.isArray(a.symbols)?a.symbols.filter(n=>typeof n=="string"):[]:Array.isArray(a.holdings)?a.holdings.map(n=>gs(n)&&typeof n.symbol=="string"?n.symbol:"").filter(Boolean):[]}const na=new Set(["symbol","symbols","holdings"]);function it(t){const a=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):t}function ia(t){let a;try{a=rt(t.schema,{io:"input"})}catch{return[]}return Object.entries(a.properties??{}).filter(([n])=>!na.has(n)).map(([n,d])=>({key:n,label:it(n),shape:d}))}const is=["xyz:TSLA","xyz:NVDA","xyz:AAPL","xyz:MSFT","xyz:SP500","xyz:GOLD","xyz:GOOGL","xyz:AMZN"];function la(t,a){return t==="symbol"?is[a%is.length]:t==="url"?"https://":t==="text"?"New note":t==="title"?"Heading":it(t)||"value"}function tt(t,a,n=0){var d;if(t.default!==void 0)return t.default;if(Array.isArray(t.enum)&&t.enum.length)return t.enum[0];if($(t,"string"))return la(a,n);if($(t,"number")||$(t,"integer"))return t.exclusiveMinimum!==void 0?t.exclusiveMinimum+1:t.minimum??0;if($(t,"boolean"))return!1;if($(t,"array")){const v=t.items??{},m=a==="symbols"?"symbol":a;return Array.from({length:t.minItems??0},(h,u)=>tt(v,m,u))}if($(t,"object")){const v={};for(const m of t.required??[]){const h=(d=t.properties)==null?void 0:d[m];h&&(v[m]=tt(h,m,n))}return v}return null}function oa(t){const a=t.schema.safeParse({});if(a.success)return a.data;let n;try{n=rt(t.schema,{io:"input"})}catch{return{}}const d={},v=new Set(n.required??[]);for(const[h,u]of Object.entries(n.properties??{}))v.has(h)&&(d[h]=tt(u,h));const m=t.schema.safeParse(d);return m.success?m.data:d}function ca(t,a){const n=r.useMemo(()=>t.find(f=>f.capabilities.includes("day-stats")),[t]),[d,v]=r.useState({}),[m,h]=r.useState(!1);return r.useEffect(()=>{if(!a||!(n!=null&&n.getDayStats)){h(!1);return}let f=!1;return h(!0),Promise.allSettled([n.getDayStats(),n.getDayStats(["xyz:*"])]).then(p=>{if(f)return;const c={};for(const z of p)z.status==="fulfilled"&&Object.assign(c,z.value);v(c)}).finally(()=>{f||h(!1)}),()=>{f=!0}},[a,n]),{options:r.useMemo(()=>{const f=new Map;return fs.forEach((p,c)=>{f.set(p,et(p,d[p],c))}),Object.entries(d).forEach(([p,c])=>{f.set(p,et(p,c,hs.get(p)??1e4))}),[...f.values()].sort((p,c)=>p.rank!==c.rank?p.rank-c.rank:p.kind!==c.kind?p.kind==="Stock"?-1:1:p.ticker.localeCompare(c.ticker))},[d]),loading:m}}function ua({instance:t,registry:a,instancesRef:n,symbolUniverse:d,accentHue:v,onApply:m,onClose:h}){const u=a.get(t.frame),f=r.useMemo(()=>u?aa(u):null,[u]),p=r.useMemo(()=>u?ia(u):[],[u]),[c,z]=r.useState(()=>({...t.config??{}})),[N,g]=r.useState(null),C=t.id,T=r.useCallback(j=>{if(z(j),u){const ce=u.schema.safeParse(j);if(!ce.success){g(ce.error.issues.map(fe=>`${fe.path.join(".")||"(root)"}: ${fe.message}`).join(`
67
+ `));return}}g(null);const E=n.current.get(C);E&&(n.current.set(C,{...E,config:j}),m(C))},[u,C,n,m]);r.useEffect(()=>{const j=E=>{E.key==="Escape"&&h()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[h]);const A=(j,E)=>T({...c,[j]:E}),y=t.frame.replace(/-/g," ");return e.jsx("div",{className:"zf-dialog-backdrop",style:{"--zf-accent-hue":v},onMouseDown:j=>{j.target===j.currentTarget&&h()},children:e.jsxs("div",{className:"zf-dialog",role:"dialog","aria-modal":"true","aria-label":`Configure ${y}`,children:[e.jsxs("header",{className:"zf-dialog-head",children:[e.jsxs("h3",{className:"zf-dialog-title",children:["Configure · ",y]}),e.jsx("button",{type:"button",className:"zf-dialog-close",onClick:h,"aria-label":"Close",title:"Close",children:e.jsx(Ie,{size:16,"aria-hidden":"true"})})]}),e.jsxs("div",{className:"zf-dialog-body",children:[f&&e.jsx(pa,{control:f,config:c,loading:d.loading,options:d.options,onChangeSymbol:j=>T({...c,symbol:j}),onChangeSymbols:j=>T({...c,symbols:j}),onChangeHoldings:j=>T({...c,holdings:j})}),p.map(j=>e.jsx(da,{field:j,value:c[j.key],onChange:E=>A(j.key,E)},j.key)),!f&&p.length===0&&e.jsx("p",{className:"zf-rail-empty",children:"This frame has no settings."}),N&&e.jsx("div",{className:"zf-config-error",children:N})]}),e.jsx("footer",{className:"zf-dialog-foot",children:e.jsx("button",{type:"button",className:"zf-btn zf-btn--primary",onClick:h,children:"Done"})})]})})}function da({field:t,value:a,onChange:n}){const{key:d,label:v,shape:m}=t,h=`zf-cfg-${d}`,u=m.description;if($(m,"boolean")){const p=typeof a=="boolean"?a:!!m.default;return e.jsxs("label",{className:"zf-checkbox",title:u,children:[e.jsx("input",{type:"checkbox",checked:p,onChange:c=>n(c.target.checked)}),v]})}const f=Array.isArray(m.enum)&&m.enum.every(p=>typeof p=="string")?m.enum:null;if(f&&f.length>0){const p=typeof m.default=="string"?m.default:f[0],c=typeof a=="string"&&f.includes(a)?a:p;return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:h,title:u,children:v}),e.jsx("select",{id:h,className:"zf-select",value:c,onChange:z=>n(z.target.value),children:f.map(z=>e.jsx("option",{value:z,children:it(z)},z))})]})}return $(m,"integer")||$(m,"number")?e.jsx(ma,{id:h,field:t,value:a,onChange:n}):bs(m)?e.jsx(ha,{id:h,field:t,value:a,onChange:n}):e.jsx(fa,{id:h,field:t,value:a,onChange:n})}function ma({id:t,field:a,value:n,onChange:d}){const{label:v,shape:m}=a,h=m.description,u=typeof m.minimum=="number"?m.minimum:void 0,f=typeof m.maximum=="number"?m.maximum:void 0,p=$(m,"integer"),c=p?1:"any",z=typeof m.default=="number"?m.default:u??0,N=typeof n=="number"&&Number.isFinite(n)?n:void 0;if(u!==void 0&&f!==void 0){const g=N??z;return e.jsxs("div",{className:"zf-field",children:[e.jsxs("div",{className:"zf-field-row",children:[e.jsx("label",{htmlFor:t,title:h,children:v}),e.jsx("span",{className:"zf-field-num",children:g})]}),e.jsx("input",{id:t,type:"range",className:"zf-range",min:u,max:f,step:c,value:g,onChange:C=>d(p?Math.round(Number(C.target.value)):Number(C.target.value))})]})}return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:h,children:v}),e.jsx("input",{id:t,type:"number",className:"zf-input",min:u,max:f,step:c,value:n==null?"":String(n),onChange:g=>d(g.target.value===""?"":Number(g.target.value))})]})}function fa({id:t,field:a,value:n,onChange:d}){const{key:v,label:m,shape:h}=a,u=h.description,f=typeof n=="string"?n:"",p=typeof h.default=="string"?h.default:"",c=typeof h.default=="string"&&/^#[0-9a-f]{6}$/i.test(h.default)?h.default:null;if(v==="color"||c){const z=/^#[0-9a-f]{6}$/i.test(f)?f:c??"#8b8df9";return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:u,children:m}),e.jsxs("div",{className:"zf-color-row",children:[e.jsx("input",{type:"color",className:"zf-color",value:z,"aria-label":`${m} swatch`,onChange:N=>d(N.target.value)}),e.jsx("input",{id:t,className:"zf-input",value:f,placeholder:p,spellCheck:!1,onChange:N=>d(N.target.value)})]})]})}return v==="text"?e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:u,children:m}),e.jsx("textarea",{id:t,className:"zf-textarea zf-textarea--prose",value:f,placeholder:p,onChange:z=>d(z.target.value)})]}):e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:u,children:m}),e.jsx("input",{id:t,className:"zf-input",value:f,placeholder:p,spellCheck:!1,onChange:z=>d(z.target.value)})]})}function ha({id:t,field:a,value:n,onChange:d}){const{label:v,shape:m}=a,h=m.description,u=Array.isArray(n)?n.filter(g=>typeof g=="string"):[],[f,p]=r.useState(""),c=typeof m.maxItems=="number"?m.maxItems:void 0,z=c!==void 0&&u.length>=c,N=g=>{const C=g.trim().toUpperCase();p(""),!(!C||u.includes(C)||z)&&d([...u,C])};return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:h,children:v}),u.length>0&&e.jsx("div",{className:"zf-taglist",children:u.map(g=>e.jsxs("span",{className:"zf-tag",children:[g,e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${g}`,onClick:()=>d(u.filter(C=>C!==g)),children:e.jsx(Ie,{size:12,"aria-hidden":"true"})})]},g))}),e.jsx("input",{id:t,className:"zf-input",value:f,disabled:z,spellCheck:!1,placeholder:z?"Maximum reached":"Type a code, Enter to add",onChange:g=>p(g.target.value),onBlur:()=>N(f),onKeyDown:g=>{g.key==="Enter"||g.key===","?(g.preventDefault(),N(f)):g.key==="Backspace"&&f===""&&u.length>0&&d(u.slice(0,-1))}})]})}function pa({control:t,config:a,loading:n,options:d,onChangeSymbol:v,onChangeSymbols:m,onChangeHoldings:h}){const u=ra(t,a);if(t.kind==="single"){const c=u[0]??"";return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(Ze,{title:"Ticker",detail:c?ye(c):"None",loading:n}),c?e.jsx(at,{symbol:c,option:st(c,d)}):null,e.jsx(Je,{loading:n,options:d,selectedSymbols:c?[c]:[],placeholder:"Search TSLA, BTC...",onSelect:v})]})}if(t.kind==="symbols"){const c=typeof t.maxItems=="number"&&u.length>=t.maxItems;return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(Ze,{title:"Tickers",detail:ls(u.length,t),loading:n}),e.jsx(ga,{symbols:u,options:d,onRemove:z=>m(u.filter(N=>N!==z))}),e.jsx(Je,{disabled:c,loading:n,options:d,selectedSymbols:u,placeholder:c?"Maximum tickers added":"Add ticker",keepOpenOnSelect:!0,onSelect:z=>{u.includes(z)||c||m([...u,z])}})]})}const f=Array.isArray(a.holdings)?a.holdings.filter(gs):[],p=typeof t.maxItems=="number"&&f.length>=t.maxItems;return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(Ze,{title:"Holding tickers",detail:ls(f.length,t),loading:n}),e.jsx("div",{className:"zf-holding-list",children:f.map((c,z)=>{const N=typeof c.symbol=="string"?c.symbol:"";return e.jsxs("div",{className:"zf-holding-row",children:[e.jsxs("div",{className:"zf-holding-main",children:[N?e.jsx(at,{symbol:N,option:st(N,d),compact:!0}):e.jsx("span",{className:"zf-symbol-empty",children:"No ticker"}),typeof c.amount=="number"&&e.jsxs("span",{className:"zf-holding-amount",children:["x ",c.amount]})]}),e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${N||"holding"}`,onClick:()=>{h(f.filter((g,C)=>C!==z))},children:e.jsx(Ie,{size:13,"aria-hidden":"true"})})]},`${N}-${z}`)})}),e.jsx(Je,{disabled:p,loading:n,options:d,selectedSymbols:u,placeholder:p?"Maximum holdings added":"Add holding",keepOpenOnSelect:!0,onSelect:c=>{p||h([...f,{symbol:c,amount:1}])}})]})}function Ze({title:t,detail:a,loading:n}){return e.jsxs("div",{className:"zf-symbol-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"zf-symbol-label",children:t}),e.jsx("div",{className:"zf-symbol-detail",children:a})]}),e.jsx("span",{className:n?"zf-symbol-source is-loading":"zf-symbol-source",children:n?"Loading":"Live list"})]})}function ls(t,a){return typeof a.maxItems=="number"?`${t}/${a.maxItems}`:typeof a.minItems=="number"&&t<a.minItems?`${t}/${a.minItems}+`:String(t)}function st(t,a){return a.find(n=>n.symbol===t)??et(t)}function ga({symbols:t,options:a,onRemove:n}){return t.length===0?e.jsx("div",{className:"zf-symbol-empty",children:"No tickers selected"}):e.jsx("div",{className:"zf-symbol-chips",children:t.map(d=>e.jsxs("span",{className:"zf-symbol-chip",children:[e.jsx(at,{symbol:d,option:st(d,a),compact:!0}),e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${d}`,onClick:()=>n(d),children:e.jsx(Ie,{size:13,"aria-hidden":"true"})})]},d))})}function at({symbol:t,option:a,compact:n=!1}){return e.jsxs("span",{className:n?"zf-selected-symbol is-compact":"zf-selected-symbol",children:[e.jsx(ys,{symbol:t}),e.jsxs("span",{className:"zf-selected-symbol-text",children:[e.jsx("strong",{children:ye(t)}),!n&&e.jsx("em",{children:t})]}),!n&&a.markPx!==void 0&&e.jsx("span",{className:"zf-selected-symbol-price",children:ps(a.markPx)})]})}function Je({disabled:t=!1,loading:a,options:n,selectedSymbols:d,placeholder:v,keepOpenOnSelect:m=!1,onSelect:h}){const[u,f]=r.useState(""),[p,c]=r.useState(!1),z=r.useMemo(()=>new Set(d),[d]),N=r.useMemo(()=>new Set(n.map(y=>y.symbol)),[n]),g=ta(u),C=r.useMemo(()=>{const y=u.trim().toLowerCase();return(y?n.filter(E=>E.ticker.toLowerCase().includes(y)||E.symbol.toLowerCase().includes(y)):n.slice(0,28)).slice().sort((E,ce)=>os(E,y)-os(ce,y)).slice(0,36)},[n,u]),T=r.useMemo(()=>{if(!g)return[];const y=g.includes(":")?[g]:[`xyz:${g}`,g];return y.filter((j,E)=>y.indexOf(j)===E&&!N.has(j)&&!z.has(j))},[N,g,z]),A=y=>{!y||m&&z.has(y)||(h(y),f(""),c(m))};return e.jsxs("div",{className:"zf-symbol-combo",onBlur:y=>{y.currentTarget.contains(y.relatedTarget)||c(!1)},children:[e.jsxs("div",{className:t?"zf-symbol-search is-disabled":"zf-symbol-search",children:[e.jsx(Ys,{size:14,"aria-hidden":"true"}),e.jsx("input",{value:u,disabled:t,placeholder:v,"aria-label":v,role:"combobox","aria-expanded":p,onFocus:()=>c(!0),onChange:y=>{f(y.target.value),c(!0)},onKeyDown:y=>{var j;y.key==="Enter"&&(y.preventDefault(),A(((j=C[0])==null?void 0:j.symbol)??T[0]??g))}}),e.jsx(qs,{size:14,"aria-hidden":"true"})]}),p&&!t&&e.jsxs("div",{className:"zf-symbol-menu",role:"listbox",children:[a&&e.jsx("div",{className:"zf-symbol-menu-status",children:"Loading live universe..."}),C.map(y=>{const j=z.has(y.symbol);return e.jsxs("button",{type:"button",className:j?"zf-symbol-option is-selected":"zf-symbol-option",disabled:m&&j,role:"option","aria-selected":j,onMouseDown:E=>{E.preventDefault(),A(y.symbol)},onClick:E=>{E.detail===0&&A(y.symbol)},children:[e.jsx(ys,{symbol:y.symbol}),e.jsxs("span",{className:"zf-symbol-option-main",children:[e.jsx("strong",{children:y.ticker}),e.jsx("em",{children:y.symbol})]}),e.jsxs("span",{className:"zf-symbol-option-meta",children:[e.jsx("span",{children:ps(y.markPx)||y.kind}),y.changePct!==void 0&&e.jsx("span",{className:y.changePct>=0?"zf-symbol-change is-up":"zf-symbol-change is-down",children:sa(y.changePct)})]}),j&&e.jsx(Ws,{size:14,"aria-hidden":"true"})]},y.symbol)}),T.map(y=>e.jsxs("button",{type:"button",className:"zf-symbol-option zf-symbol-option--custom",onMouseDown:j=>{j.preventDefault(),A(y)},onClick:j=>{j.detail===0&&A(y)},children:[e.jsx("span",{className:"zf-symbol-custom-icon",children:e.jsx(Vs,{size:13,"aria-hidden":"true"})}),e.jsxs("span",{className:"zf-symbol-option-main",children:[e.jsx("strong",{children:ye(y)}),e.jsx("em",{children:y})]}),e.jsx("span",{className:"zf-symbol-option-meta",children:e.jsx("span",{children:nt(y)})})]},y)),!a&&C.length===0&&T.length===0&&e.jsx("div",{className:"zf-symbol-menu-status",children:"No matches"})]})]})}function os(t,a){if(!a)return t.rank;const n=t.ticker.toLowerCase(),d=t.symbol.toLowerCase();return n===a||d===a?-40+t.rank/1e4:n.startsWith(a)?-20+t.rank/1e4:d.startsWith(a)?-10+t.rank/1e4:t.rank}function ys({symbol:t}){const a=nt(t).toLowerCase(),[n,d]=r.useState(!1);return r.useEffect(()=>d(!1),[t]),n?e.jsx("span",{className:`zf-symbol-avatar zf-symbol-avatar--${a}`,children:ye(t).slice(0,2)}):e.jsx("img",{className:`zf-symbol-avatar zf-symbol-avatar--logo zf-symbol-avatar--${a}`,src:ea(t),alt:"","aria-hidden":"true",draggable:!1,loading:"lazy",onError:()=>d(!0)})}const ba=24;function cs(t,a){var n;return a==="flow-horizontal"?(n=t.layouts)==null?void 0:n["flow-horizontal"]:t.position}function us(t,a){const n=t.reduce((d,v)=>d+Math.max(1,v.position.w)*Math.min(Math.max(1,v.position.h),a),0);return Math.max(ba,Math.ceil(n/a*1.25)+8)}function ds(t,a,n){var h;const d=new Set,v=(u,f,p,c)=>{for(let z=0;z<p;z++)for(let N=0;N<c;N++){const g=u+z,C=f+N;g>=0&&C>=0&&d.add(`${g},${C}`)}},m=(u,f,p,c)=>{if(u+p>a||f+c>n)return!1;for(let z=0;z<p;z++)for(let N=0;N<c;N++)if(d.has(`${u+z},${f+N}`))return!1;return!0};for(const u of t){const f=(h=u.layouts)==null?void 0:h["flow-horizontal"];f&&v(f.x,f.y,f.w,Math.min(f.h,n))}return t.map(u=>{var z;if((z=u.layouts)!=null&&z["flow-horizontal"])return u;const f=Math.min(Math.max(1,u.position.w),a),p=Math.min(Math.max(1,u.position.h),n);let c={x:0,y:0,w:f,h:p};e:for(let N=0;N<=a-f;N++)for(let g=0;g<=n-p;g++)if(m(N,g,f,p)){c={x:N,y:g,w:f,h:p};break e}return v(c.x,c.y,c.w,c.h),{...u,layouts:{...u.layouts,"flow-horizontal":c}}})}const ya='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>';function Qe(t){queueMicrotask(()=>t.unmount())}function va({spec:t,registry:a,onSave:n,customiseButtonTarget:d,onAccentHueChange:v,onAccentSatChange:m,onFontScaleChange:h,onUpColorChange:u,onDownColorChange:f,onModeChange:p,onBackgroundChange:c}){var Kt;const z=Ts(),N=r.useRef(null),g=r.useRef(null),C=r.useRef(!1),T=r.useRef(t.grid.mode),A=r.useRef(new Map),y=r.useRef(new Map),j=r.useRef(new Map),E=r.useRef([]),ce=r.useRef(t.theme.accentHue),fe=r.useRef(t.theme.accentSat),lt=r.useRef(t.theme.baseHue),ot=r.useRef(t.theme.baseSat),ct=r.useRef(t.theme.upColor),ut=r.useRef(t.theme.downColor),dt=r.useRef(t.grid.gap),mt=r.useRef(t.grid.mode),he=r.useRef(null),ft=r.useRef(t.appearance.radius),ht=r.useRef(t.appearance.borderStrength),pt=r.useRef(t.appearance.surfaceOpacity),gt=r.useRef(t.appearance.density),bt=r.useRef(t.appearance.elevation),yt=r.useRef(t.typography.fontFamily),xt=r.useRef(t.typography.numericStyle),zt=r.useRef(t.typography.scale),jt=r.useRef(t.background.type),Nt=r.useRef(t.background.projectId),vt=r.useRef(t.background.opacity),kt=r.useRef(t.background.color),wt=r.useRef(t.background.gradientFrom),St=r.useRef(t.background.gradientTo),Ct=r.useRef(t.background.gradientAngle),Rt=r.useRef(0),[F,Le]=r.useState(!1),xs=ca(z,F),[xa,pe]=r.useState(t.frames.length),[O,xe]=r.useState(t.theme.accentHue),[P,ze]=r.useState(t.theme.accentSat),[G,je]=r.useState(t.theme.baseHue),[D,Ne]=r.useState(t.theme.baseSat),[_,$e]=r.useState(t.theme.upColor),[W,He]=r.useState(t.theme.downColor),[L,At]=r.useState(t.grid.mode),[zs,Mt]=r.useState(!1),[U,Oe]=r.useState(t.grid.gap),[q,ve]=r.useState(t.appearance.radius),[K,ke]=r.useState(t.appearance.borderStrength),[V,we]=r.useState(t.appearance.surfaceOpacity),[X,Se]=r.useState(t.appearance.density),[Y,Ce]=r.useState(t.appearance.elevation),[se,Pe]=r.useState(t.typography.fontFamily),[ae,Be]=r.useState(t.typography.numericStyle),[Z,Ge]=r.useState(t.typography.scale),[B,Et]=r.useState(t.background.type),[re,Tt]=r.useState(t.background.projectId??Xe[0].projectId),[J,De]=r.useState(t.background.opacity),[Q,_e]=r.useState(t.background.color),[ne,Ft]=r.useState(t.background.gradientFrom),[ie,It]=r.useState(t.background.gradientTo),[ee,We]=r.useState(t.background.gradientAngle),js=r.useCallback(s=>{xe(s.theme.accentHue),ze(s.theme.accentSat),je(s.theme.baseHue),Ne(s.theme.baseSat),Pe(s.typography.fontFamily),Be(s.typography.numericStyle),ve(s.appearance.radius),ke(s.appearance.borderStrength),we(s.appearance.surfaceOpacity),Se(s.appearance.density),Ce(s.appearance.elevation)},[]),Lt=((Kt=rs.find(s=>s.theme.accentHue===O&&s.theme.accentSat===P&&s.theme.baseHue===G&&s.theme.baseSat===D&&s.typography.fontFamily===se&&s.typography.numericStyle===ae&&s.appearance.radius===q&&s.appearance.borderStrength===K&&s.appearance.surfaceOpacity===V&&s.appearance.density===X&&s.appearance.elevation===Y))==null?void 0:Kt.key)??null,[le,$t]=r.useState("frames"),[Ue,ue]=r.useState(null),Ht=r.useRef(null);Ht.current=Ue,r.useEffect(()=>{v==null||v(O)},[O,v]),r.useEffect(()=>{m==null||m(P)},[P,m]),r.useEffect(()=>{h==null||h(Z)},[Z,h]),r.useEffect(()=>{u==null||u(_)},[_,u]),r.useEffect(()=>{f==null||f(W)},[W,f]),r.useEffect(()=>{T.current=L,p==null||p(L)},[L,p]),r.useEffect(()=>{c==null||c({...t.background,type:B,projectId:re,opacity:J,color:Q,gradientFrom:ne,gradientTo:ie,gradientAngle:ee})},[B,re,J,Q,ne,ie,ee,t.background,c]),r.useEffect(()=>{var s;(s=g.current)==null||s.margin(U/2)},[U]);const Ot=r.useRef(z);Ot.current=z;const de=r.useRef(a);de.current=a;const Re=r.useMemo(()=>{const s=new Map;for(const l of a.values()){const x=l.category??"other",w=s.get(x);w?w.push(l):s.set(x,[l])}const o=ts.map(l=>l.key),i=ts.map(l=>({key:l.key,label:l.label,description:l.description,frames:s.get(l.key)??[]})),b=[...s.entries()].filter(([l])=>!o.includes(l)).flatMap(([,l])=>l);return b.length&&i.push({key:"other",label:"Other",description:"",frames:b}),i.filter(l=>l.frames.length>0).map(l=>({...l,frames:[...l.frames].sort((x,w)=>x.name.localeCompare(w.name))}))},[a]),[Pt,Ns]=r.useState(()=>new Set(Re[0]?[Re[0].key]:[])),vs=r.useCallback(s=>{Ns(o=>{const i=new Set(o);return i.has(s)?i.delete(s):i.add(s),i})},[]),ge=r.useCallback(s=>s?oa(s):{},[]),Ae=r.useCallback(s=>{let o=`${s}-${++Rt.current}`;for(;A.current.has(o);)o=`${s}-${++Rt.current}`;return o},[]),Me=r.useRef(null),te=r.useCallback(s=>{const o=j.current.get(s),i=A.current.get(s);if(!o||!i)return;let b=y.current.get(s);b||(o.innerHTML="",b=Es.createRoot(o),y.current.set(s,b)),b.render(e.jsx(Fs,{providers:Ot.current,children:e.jsx(Is.Provider,{value:l=>{var x;return(x=Me.current)==null?void 0:x.call(Me,s,l)},children:e.jsx(Ls,{instance:i,registry:de.current,className:"zf-fill"})})}))},[]),ks=r.useCallback((s,o)=>{const i=A.current.get(s);i&&(A.current.set(s,{...i,config:{...i.config,...o}}),te(s))},[te]);Me.current=ks;const Bt=r.useCallback(s=>{const o=g.current;if(!o)return;const i=s.getAttribute("gs-id");if(i){const b=y.current.get(i);b&&Qe(b),y.current.delete(i),j.current.delete(i),A.current.delete(i),Ht.current===i&&ue(null)}o.removeWidget(s,!0),pe(o.getGridItems().length)},[]),oe=r.useCallback(s=>{if(!s.querySelector(".zf-cfg-btn")){const o=document.createElement("button");o.className="zf-cfg-btn",o.type="button",o.title="Edit frame",o.setAttribute("aria-label","Edit frame"),o.innerHTML=ya,o.addEventListener("click",i=>{i.stopPropagation();const b=s.getAttribute("gs-id");b&&ue(b)}),s.appendChild(o)}if(!s.querySelector(".zf-del-btn")){const o=document.createElement("button");o.className="zf-del-btn",o.type="button",o.title="Remove frame",o.innerHTML="&times;",o.addEventListener("click",i=>{i.stopPropagation(),Bt(s)}),s.appendChild(o)}},[Bt]),Gt=r.useCallback(s=>{var o,i;(o=s.querySelector(".zf-cfg-btn"))==null||o.remove(),(i=s.querySelector(".zf-del-btn"))==null||i.remove()},[]),Ee=r.useCallback((s,o=!1)=>{const i=T.current,b=i==="flow-horizontal",l=cs(s,i),x=(l==null?void 0:l.w)??s.position.w,w=(l==null?void 0:l.h)??s.position.h,k=b?Math.min(w,t.grid.rows):w,M=de.current.get(s.frame),S=M==null?void 0:M.layout,R=document.createElement("div");R.className="grid-stack-item",R.setAttribute("gs-id",s.id),R.setAttribute("data-frame",s.frame),o||!l?R.setAttribute("gs-auto-position","true"):(R.setAttribute("gs-x",String(l.x)),R.setAttribute("gs-y",String(l.y))),R.setAttribute("gs-w",String(x)),R.setAttribute("gs-h",String(k)),S!=null&&S.minW&&R.setAttribute("gs-min-w",String(S.minW)),S!=null&&S.minH&&R.setAttribute("gs-min-h",String(S.minH)),S!=null&&S.maxW&&R.setAttribute("gs-max-w",String(S.maxW)),S!=null&&S.maxH&&R.setAttribute("gs-max-h",String(S.maxH));const I=document.createElement("div");return I.className="grid-stack-item-content",R.appendChild(I),j.current.set(s.id,I),R},[t.grid.rows]),be=r.useCallback(s=>{const o=g.current;if(o){y.current.forEach(Qe),y.current.clear(),j.current.clear(),A.current=new Map(s.map(i=>[i.id,i])),o.removeAll(!0),o.el.querySelectorAll(".grid-stack-item").forEach(i=>i.remove()),o.batchUpdate();for(const i of s){const b=Ee(i);o.el.appendChild(b),o.makeWidget(b),te(i.id)}o.batchUpdate(!1),pe(s.length)}},[Ee,te]),Dt=r.useCallback(s=>{var w,k;const o=g.current;if(!o)return;const i=de.current.get(s),b=Ae(s),l={id:b,frame:s,position:{x:0,y:0,w:((w=i==null?void 0:i.layout)==null?void 0:w.w)??4,h:((k=i==null?void 0:i.layout)==null?void 0:k.h)??3},config:ge(i)};A.current.set(b,l);const x=Ee(l,!0);o.el.appendChild(x),o.makeWidget(x),te(b),oe(x),pe(o.getGridItems().length),ue(b)},[Ee,oe,ge,te,Ae]),Te=r.useCallback(()=>{var b,l;const s=typeof window<"u"?window.innerHeight:800,o=((l=(b=N.current)==null?void 0:b.parentElement)==null?void 0:l.getBoundingClientRect().top)??120,i=s-o-56;return Math.max(80,Math.floor(i/t.grid.rows))},[t.grid.rows]),qe=r.useCallback(()=>{const s=g.current;if(!s)return;const o=s.el;s.off("dropped"),s.off("removed"),s.off("drag"),s.off("dragstart"),s.off("dragstop"),document.body.classList.remove("zf-dragging"),y.current.forEach(Qe),y.current.clear(),j.current.clear(),s.destroy(!1),o&&(o.querySelectorAll(".grid-stack-item").forEach(i=>i.remove()),o.style.width="",o.style.height=""),g.current=null},[]),Ke=r.useCallback((s,o)=>{const i=s==="flow-horizontal",b=i?Te():t.grid.rowHeight,l=es.init({column:i?o:t.grid.columns,cellHeight:b,margin:t.grid.gap/2,float:!0,...i?{maxRow:t.grid.rows,minRow:t.grid.rows}:{},animate:!0,acceptWidgets:!0,disableDrag:!0,disableResize:!0},N.current);return l.el.style.width=i?`${o*b}px`:"",l.on("dropped",(x,w,k)=>{var Zt,Jt;const M=k==null?void 0:k.el;if(!M)return;const S=M.querySelector(".grid-stack-item-content"),R=M.getAttribute("data-frame");if(!S||!R)return;const I=M.getAttribute("gs-id")||Ae(R);M.setAttribute("gs-id",I);const H=de.current.get(R),Vt=(k==null?void 0:k.w)??((Zt=H==null?void 0:H.layout)==null?void 0:Zt.w)??4,Xt=(k==null?void 0:k.h)??((Jt=H==null?void 0:H.layout)==null?void 0:Jt.h)??3,Yt={x:(k==null?void 0:k.x)??0,y:(k==null?void 0:k.y)??0,w:Vt,h:Xt},Ms=T.current==="flow-horizontal"?{id:I,frame:R,position:{x:0,y:0,w:Vt,h:Xt},layouts:{"flow-horizontal":Yt},config:ge(H)}:{id:I,frame:R,position:Yt,config:ge(H)};A.current.set(I,Ms),j.current.set(I,S),te(I),oe(M),pe(l.getGridItems().length),ue(I)}),l.on("removed",()=>pe(l.getGridItems().length)),l.on("dragstart",()=>document.body.classList.add("zf-dragging")),l.on("dragstop",()=>document.body.classList.remove("zf-dragging")),i&&l.on("drag",x=>{var R,I,H;const w=(R=N.current)==null?void 0:R.parentElement;if(!w)return;const k=w.getBoundingClientRect(),M=x.clientX??((H=(I=x.touches)==null?void 0:I[0])==null?void 0:H.clientX);if(M==null)return;const S=64;M<k.left+S?w.scrollLeft-=18:M>k.right-S&&(w.scrollLeft+=18)}),l},[Te,t.grid.columns,t.grid.rowHeight,t.grid.rows,t.grid.gap,Ae,ge,te,oe]);r.useEffect(()=>{if(!N.current||C.current)return;C.current=!0;const s=T.current==="flow-horizontal",o=s?us(t.frames,t.grid.rows):t.grid.columns;return g.current=Ke(T.current,o),be(s?ds(t.frames,o,t.grid.rows):t.frames),()=>{qe(),C.current=!1}},[]),r.useEffect(()=>{const s=g.current;s&&(s.enableMove(F),s.enableResize(F),F?s.getGridItems().forEach(oe):s.getGridItems().forEach(Gt))},[F,oe,Gt]),r.useEffect(()=>{const s=g.current;if(!s||T.current!=="flow-horizontal")return;const o=requestAnimationFrame(()=>{const i=Te();s.cellHeight(i),s.el.style.width=`${s.getColumn()*i}px`});return()=>cancelAnimationFrame(o)},[F,Te]),r.useEffect(()=>{!F||le!=="frames"||!g.current||es.setupDragIn(".zf-newwidget",{appendTo:"body",helper:s=>{var S;const i=(s.closest(".zf-newwidget")??s).dataset.frame??"",b=de.current.get(i),l=b==null?void 0:b.layout,x=document.createElement("div");x.className="grid-stack-item",x.setAttribute("data-frame",i),x.setAttribute("gs-w",String((l==null?void 0:l.w)??4)),x.setAttribute("gs-h",String((l==null?void 0:l.h)??3)),l!=null&&l.minW&&x.setAttribute("gs-min-w",String(l.minW)),l!=null&&l.minH&&x.setAttribute("gs-min-h",String(l.minH)),l!=null&&l.maxW&&x.setAttribute("gs-max-w",String(l.maxW)),l!=null&&l.maxH&&x.setAttribute("gs-max-h",String(l.maxH));const w=(S=N.current)==null?void 0:S.closest(".zf-editor");if(w){const R=getComputedStyle(w);for(const I of["--zf-accent-hue","--zf-accent-sat","--font-dmsans"]){const H=R.getPropertyValue(I).trim();H&&x.style.setProperty(I,H)}}const k=i.replace(/-/g," "),M=b!=null&&b.iconUrl?`<img class="zf-drag-ghost-icon" src="${b.iconUrl}" alt="" />`:"";return x.innerHTML=`<div class="grid-stack-item-content zf-drag-ghost" data-frame="${i}">${M}<span class="zf-drag-ghost-name">${k}</span></div>`,x}})},[F,le,Re,Pt]);const Fe=r.useCallback(()=>{const s=g.current,o=[];if(s)for(const i of s.getGridItems()){const b=i.getAttribute("gs-id");if(!b)continue;const l=A.current.get(b);if(!l)continue;const x=i.gridstackNode,w=cs(l,L)??l.position,k={x:(x==null?void 0:x.x)??w.x,y:(x==null?void 0:x.y)??w.y,w:(x==null?void 0:x.w)??w.w,h:(x==null?void 0:x.h)??w.h};o.push(L==="flow-horizontal"?{...l,layouts:{...l.layouts,"flow-horizontal":k}}:{...l,position:k})}return o.sort((i,b)=>i.position.y-b.position.y||i.position.x-b.position.x),{...t,grid:{...t.grid,gap:U,mode:L},background:{...t.background,type:B,projectId:re,opacity:J,color:Q,gradientFrom:ne,gradientTo:ie,gradientAngle:ee},theme:{...t.theme,accentHue:O,accentSat:P,baseHue:G,baseSat:D,upColor:_,downColor:W},typography:{...t.typography,fontFamily:se,numericStyle:ae,scale:Z},appearance:{...t.appearance,radius:q,borderStrength:K,surfaceOpacity:V,density:X,elevation:Y},frames:o}},[t,O,P,G,D,_,W,se,ae,Z,U,L,q,K,V,X,Y,B,re,J,Q,ne,ie,ee]),_t=r.useCallback(s=>{const o=new Blob([`${JSON.stringify(s,null,2)}
68
+ `],{type:"application/json"}),i=URL.createObjectURL(o),b=document.createElement("a");b.href=i,b.download="dashboard.json",b.click(),setTimeout(()=>URL.revokeObjectURL(i),0)},[]),ws=r.useCallback(()=>{E.current=Fe().frames,ce.current=O,fe.current=P,lt.current=G,ot.current=D,ct.current=_,ut.current=W,dt.current=U,mt.current=L,ft.current=q,ht.current=K,pt.current=V,gt.current=X,bt.current=Y,yt.current=se,xt.current=ae,zt.current=Z,jt.current=B,Nt.current=re,vt.current=J,kt.current=Q,wt.current=ne,St.current=ie,Ct.current=ee,Le(!0)},[Fe,O,P,G,D,_,W,U,L,q,K,V,X,Y,se,ae,Z,B,re,J,Q,ne,ie,ee]),Ss=r.useCallback(()=>{be(E.current),xe(ce.current),ze(fe.current),je(lt.current),Ne(ot.current),$e(ct.current),He(ut.current),Oe(dt.current),At(mt.current),ve(ft.current),ke(ht.current),we(pt.current),Se(gt.current),Ce(bt.current),Pe(yt.current),Be(xt.current),Ge(zt.current),Et(jt.current),Tt(Nt.current??Xe[0].projectId),De(vt.current),_e(kt.current),Ft(wt.current),It(St.current),We(Ct.current),ue(null),Le(!1)},[be]),Cs=r.useCallback(async()=>{const s=Fe();Le(!1),ue(null),n?await n(s):_t(s)},[Fe,n,_t]),Rs=r.useCallback(()=>{var s;(s=g.current)==null||s.compact(T.current==="flow-horizontal"?"list":"compact")},[]),Wt=r.useCallback(()=>{const s=g.current;if(!s)return;const o=T.current;for(const i of s.getGridItems()){const b=i.getAttribute("gs-id");if(!b)continue;const l=A.current.get(b);if(!l)continue;const x=i.gridstackNode;if(!x)continue;const w={x:x.x??0,y:x.y??0,w:x.w??1,h:x.h??1};A.current.set(b,o==="flow-horizontal"?{...l,layouts:{...l.layouts,"flow-horizontal":w}}:{...l,position:w})}},[]),Ut=r.useCallback(s=>{var b;if(s===T.current)return;const o=()=>{Wt();const l=[...A.current.values()],x=F,w=s==="flow-horizontal",k=w?us(l,t.grid.rows):t.grid.columns;qe(),T.current=s,At(s);const M=Ke(s,k);g.current=M,be(w?ds(l,k,t.grid.rows):l),x&&(M.enableMove(!0),M.enableResize(!0),M.getGridItems().forEach(oe))};if(typeof window<"u"&&((b=window.matchMedia)==null?void 0:b.call(window,"(prefers-reduced-motion: reduce)").matches)){o();return}he.current&&clearTimeout(he.current),Mt(!0),he.current=setTimeout(()=>{o(),requestAnimationFrame(()=>Mt(!1))},150)},[F,Wt,qe,Ke,be,oe,t.grid.rows,t.grid.columns]);r.useEffect(()=>()=>{he.current&&clearTimeout(he.current)},[]);const qt=()=>e.jsx("button",{type:"button",className:"zf-btn zf-btn--icon",onClick:ws,"aria-label":"Customise",title:"Customise",children:e.jsx(Js,{size:18,"aria-hidden":"true"})}),Ve=F&&Ue?A.current.get(Ue):void 0,As=L==="flow-horizontal";return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:$s}),d&&!F?Qt.createPortal(qt(),d):null,e.jsxs("div",{className:F?"zf-editor zf-customise":"zf-editor","data-mode":L,style:{"--zf-accent-hue":O,"--zf-accent-sat":`${P}%`,"--zf-base-hue":G,"--zf-base-sat":`${D}%`,"--zf-up":_,"--zf-down":W,"--zf-font-family":as[se],"--zf-numeric":ss[ae],"--zf-frame-radius":`${q}px`,"--zf-border-alpha":K,"--zf-surface-opacity":V,"--zf-density":X,"--zf-elevation":Y},children:[(F||!d)&&e.jsxs("div",{className:"zf-editor-bar",children:[e.jsx("div",{className:"zf-editor-bar-spacer"}),F?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"zf-btn zf-btn--ghost",onClick:Rs,title:"Reclaim empty grid space",children:"Tidy"}),e.jsx("button",{type:"button",className:"zf-btn zf-btn--ghost",onClick:Ss,children:"Cancel"}),e.jsx("button",{type:"button",className:"zf-btn zf-btn--primary",onClick:Cs,children:"Save"})]}):qt()]}),e.jsxs("div",{className:"zf-editor-main",children:[e.jsx("div",{className:"zf-editor-grid","data-switching":zs,children:e.jsx("div",{ref:N,className:"grid-stack"})}),e.jsx("aside",{className:"zf-rail","aria-hidden":!F,inert:!F,children:e.jsxs("div",{className:"zf-rail-inner",children:[e.jsxs("div",{className:"zf-rail-tabs",role:"tablist","aria-label":"Customise",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":le==="frames",className:le==="frames"?"zf-rail-tab is-active":"zf-rail-tab",onClick:()=>$t("frames"),children:"Frames"}),e.jsx("button",{type:"button",role:"tab","aria-selected":le==="cosmetics",className:le==="cosmetics"?"zf-rail-tab is-active":"zf-rail-tab",onClick:()=>$t("cosmetics"),children:"Cosmetics"})]}),le==="cosmetics"&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",style:{margin:0},children:"Presets"}),e.jsx("div",{className:"zf-presets",children:rs.map(s=>e.jsxs("button",{type:"button",className:Lt===s.key?"zf-preset is-active":"zf-preset",title:s.description,"aria-pressed":Lt===s.key,onClick:()=>js(s),children:[e.jsx("span",{className:"zf-preset-swatch",style:{background:`linear-gradient(135deg, hsl(${s.theme.baseHue} ${s.theme.baseSat}% 16%) 0 52%, hsl(${s.theme.accentHue} ${s.theme.accentSat}% 62%) 52% 100%)`}}),e.jsx("span",{className:"zf-preset-label",children:s.label})]},s.key))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",style:{margin:0},children:"Accent"}),e.jsxs("div",{className:"zf-theme-row",style:{margin:"10px 0 0"},children:[e.jsxs("span",{className:"zf-theme-val",children:[e.jsx("span",{className:"zf-theme-swatch"}),"Hue ",O,"°"]}),O!==242&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>xe(242),children:"Reset"})]}),e.jsx("input",{type:"range",className:"zf-hue-slider",min:0,max:360,value:O,"aria-label":"Accent hue",onChange:s=>xe(Number(s.target.value))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Saturation"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[P!==90&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ze(90),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[P,"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:100,value:P,"aria-label":"Accent saturation",onChange:s=>ze(Number(s.target.value))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Surface"}),e.jsxs("div",{className:"zf-theme-row",style:{margin:"10px 0 0"},children:[e.jsxs("span",{className:"zf-theme-val",children:[e.jsx("span",{className:"zf-theme-swatch",style:{background:`hsl(${G} ${D}% 32%)`,boxShadow:"none"}}),"Tint ",G,"°"]}),G!==233&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>je(233),children:"Reset"})]}),e.jsx("input",{type:"range",className:"zf-hue-slider",min:0,max:360,value:G,"aria-label":"Surface tint hue",onChange:s=>je(Number(s.target.value))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Tint strength"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[D!==20&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Ne(20),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[D,"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:100,value:D,"aria-label":"Surface tint strength",onChange:s=>Ne(Number(s.target.value))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Gain / Loss"}),e.jsxs("div",{className:"zf-theme-row",style:{margin:"10px 0 0"},children:[e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:_,"aria-label":"Gain (up) colour",onChange:s=>$e(s.target.value)}),"Up ",_]}),_.toLowerCase()!=="#3fd08f"&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>$e("#3fd08f"),children:"Reset"})]}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:9},children:[e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:W,"aria-label":"Loss (down) colour",onChange:s=>He(s.target.value)}),"Down ",W]}),W.toLowerCase()!=="#ff6b81"&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>He("#ff6b81"),children:"Reset"})]})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Background"}),e.jsx("div",{className:"zf-seg",role:"group","aria-label":"Background style",children:["none","color","gradient","unicorn"].map(s=>e.jsx("button",{type:"button",className:B===s?"zf-seg-btn is-active":"zf-seg-btn","aria-pressed":B===s,onClick:()=>Et(s),children:s==="none"?"Glow":s==="color"?"Color":s==="gradient"?"Gradient":"Scene"},s))}),B==="color"&&e.jsxs("div",{className:"zf-theme-row",style:{marginTop:12},children:[e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:Q,"aria-label":"Background colour",onChange:s=>_e(s.target.value)}),Q]}),Q.toLowerCase()!=="#0a0a12"&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>_e("#0a0a12"),children:"Reset"})]}),B==="gradient"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"zf-theme-row",style:{marginTop:12},children:e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:ne,"aria-label":"Gradient start colour",onChange:s=>Ft(s.target.value)}),"From ",ne]})}),e.jsx("div",{className:"zf-theme-row",style:{marginTop:9},children:e.jsxs("label",{className:"zf-theme-val",children:[e.jsx("input",{type:"color",className:"zf-color",value:ie,"aria-label":"Gradient end colour",onChange:s=>It(s.target.value)}),"To ",ie]})}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Angle"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[ee!==160&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>We(160),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[ee,"°"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:360,value:ee,"aria-label":"Gradient angle",onChange:s=>We(Number(s.target.value))})]}),B==="unicorn"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"zf-presets",style:{marginTop:12},role:"group","aria-label":"Background scene",children:Xe.map(s=>e.jsxs("button",{type:"button",className:re===s.projectId?"zf-preset is-active":"zf-preset",title:s.description,"aria-pressed":re===s.projectId,onClick:()=>Tt(s.projectId),children:[e.jsx("span",{className:"zf-preset-swatch",style:{background:s.swatch}}),e.jsx("span",{className:"zf-preset-label",children:s.label})]},s.key))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Opacity"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[J!==.16&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>De(.16),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(J*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:.6,step:.02,value:J,"aria-label":"Background scene opacity",onChange:s=>De(Math.round(Number(s.target.value)*100)/100)})]})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Layout"}),e.jsx("div",{className:"zf-theme-row",children:e.jsx("span",{className:"zf-theme-val",children:"Direction"})}),e.jsxs("div",{className:"zf-mode-seg",role:"group","aria-label":"Dashboard layout direction",children:[e.jsx("button",{type:"button",className:L==="flow-vertical"?"zf-mode-seg-btn is-active":"zf-mode-seg-btn","aria-pressed":L==="flow-vertical",onClick:()=>Ut("flow-vertical"),children:"Vertical"}),e.jsx("button",{type:"button",className:L==="flow-horizontal"?"zf-mode-seg-btn is-active":"zf-mode-seg-btn","aria-pressed":L==="flow-horizontal",onClick:()=>Ut("flow-horizontal"),children:"Horizontal"}),e.jsx("button",{type:"button",className:"zf-mode-seg-btn",disabled:!0,title:"Infinite canvas — coming soon",children:"Canvas"})]}),As&&e.jsx("p",{className:"zf-mode-seg-hint",children:"Rows fill the height; the board scrolls sideways. Arrange it freely — this layout is saved separately from Vertical."}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Frame gap"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[U!==12&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Oe(12),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[U,"px"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:12,value:U,"aria-label":"Frame gap",onChange:s=>Oe(Number(s.target.value))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Appearance"}),e.jsxs("div",{className:"zf-theme-row",children:[e.jsx("span",{className:"zf-theme-val",children:"Corner radius"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[q!==18&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ve(18),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[q,"px"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:32,value:q,"aria-label":"Corner radius",onChange:s=>ve(Number(s.target.value))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Border"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[K!==.22&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ke(.22),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(K*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:1,step:.01,value:K,"aria-label":"Border strength",onChange:s=>ke(Math.round(Number(s.target.value)*100)/100)}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Card opacity"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[V!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>we(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(V*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.3,max:1,step:.05,value:V,"aria-label":"Card opacity",onChange:s=>we(Math.round(Number(s.target.value)*100)/100)}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Density"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[X!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Se(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(X*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.6,max:1.4,step:.05,value:X,"aria-label":"Card density",onChange:s=>Se(Math.round(Number(s.target.value)*100)/100)}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Elevation"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[Y!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Ce(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Y.toFixed(1),"×"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:2,step:.1,value:Y,"aria-label":"Card elevation",onChange:s=>Ce(Math.round(Number(s.target.value)*10)/10)})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Typography"}),e.jsx("div",{className:"zf-theme-row",children:e.jsx("span",{className:"zf-theme-val",children:"Font"})}),e.jsx("div",{className:"zf-seg",role:"group","aria-label":"Font family",children:["sans","mono","serif"].map(s=>e.jsx("button",{type:"button",className:se===s?"zf-seg-btn is-active":"zf-seg-btn","aria-pressed":se===s,style:{fontFamily:as[s]},onClick:()=>Pe(s),children:s==="sans"?"Sans":s==="mono"?"Mono":"Serif"},s))}),e.jsx("div",{className:"zf-theme-row",style:{marginTop:13},children:e.jsx("span",{className:"zf-theme-val",children:"Numbers"})}),e.jsx("div",{className:"zf-seg",role:"group","aria-label":"Numeric style",children:["proportional","tabular"].map(s=>e.jsx("button",{type:"button",className:ae===s?"zf-seg-btn is-active":"zf-seg-btn","aria-pressed":ae===s,onClick:()=>Be(s),children:e.jsx("span",{style:{fontVariantNumeric:ss[s]},children:s==="proportional"?"Normal 1,071":"Tabular 1,071"})},s))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Text size"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[Z!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>Ge(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(Z*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.85,max:1.25,step:.05,value:Z,"aria-label":"Text size",onChange:s=>Ge(Math.round(Number(s.target.value)*100)/100)})]})]}),le==="frames"&&e.jsxs("section",{children:[e.jsx("h3",{className:"zf-rail-title",children:"Add a frame"}),e.jsx("p",{className:"zf-palette-hint",children:"Open a category, then click a frame to add it — or drag it onto the grid."}),e.jsx("div",{className:"zf-palette-cats",children:Re.map(s=>{const o=Pt.has(s.key);return e.jsxs("div",{className:o?"zf-palette-cat is-open":"zf-palette-cat",children:[e.jsxs("button",{type:"button",className:"zf-palette-cat-header","aria-expanded":o,onClick:()=>vs(s.key),children:[e.jsx("svg",{className:"zf-palette-cat-chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:e.jsx("path",{d:"M6 4l4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("span",{className:"zf-palette-cat-label",children:s.label}),e.jsx("span",{className:"zf-palette-cat-count",children:s.frames.length})]}),o&&e.jsxs("div",{className:"zf-palette-cat-body",children:[s.description&&e.jsx("p",{className:"zf-palette-cat-desc",children:s.description}),e.jsx("div",{className:"zf-palette",children:s.frames.map(i=>{var b,l,x,w,k,M;return e.jsxs("div",{className:"grid-stack-item zf-newwidget","data-frame":i.name,"gs-w":((b=i.layout)==null?void 0:b.w)??4,"gs-h":((l=i.layout)==null?void 0:l.h)??3,"gs-min-w":(x=i.layout)==null?void 0:x.minW,"gs-min-h":(w=i.layout)==null?void 0:w.minH,"gs-max-w":(k=i.layout)==null?void 0:k.maxW,"gs-max-h":(M=i.layout)==null?void 0:M.maxH,role:"button",tabIndex:0,title:`Drag onto the board, or click to add ${i.name.replace(/-/g," ")}`,onClick:()=>Dt(i.name),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),Dt(i.name))},children:[i.iconUrl&&e.jsx("img",{className:"zf-newwidget-icon",src:i.iconUrl,alt:"",loading:"lazy",draggable:!1}),e.jsxs("div",{className:"zf-newwidget-copy",children:[e.jsx("div",{className:"zf-newwidget-name",children:i.name.replace(/-/g," ")}),e.jsx("div",{className:"zf-newwidget-desc",children:i.description})]})]},i.name)})})]})]},s.key)})})]})]})})]})]}),Ve?Qt.createPortal(e.jsx(ua,{instance:Ve,registry:a,instancesRef:A,symbolUniverse:xs,accentHue:O,onApply:s=>te(s),onClose:()=>ue(null)},Ve.id),document.body):null]})}export{va as DashboardEditor};
@@ -0,0 +1 @@
1
+ .zf-editor{--zf-accent: hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%);--font-dmsans: var(--zf-font-family, "DM Sans", sans-serif);--zf-ease-out: cubic-bezier(.23, 1, .32, 1);--zf-ease-drawer: cubic-bezier(.32, .72, 0, 1);position:relative}.zf-editor-main{display:flex;align-items:flex-start}.zf-editor-grid{flex:1;min-width:0;min-height:360px;border-radius:18px;border:1px dashed transparent;transition:border-color .2s var(--zf-ease-out),opacity .24s var(--zf-ease-out),filter .24s var(--zf-ease-out),transform .24s var(--zf-ease-out)}.zf-editor-grid[data-switching=true]{opacity:.15;filter:blur(10px);transform:scale(.985);transition:opacity .14s var(--zf-ease-out),filter .14s var(--zf-ease-out),transform .14s var(--zf-ease-out)}@media(prefers-reduced-motion:reduce){.zf-editor-grid[data-switching=true]{filter:none;transform:none}}.zf-editor.zf-customise .zf-editor-grid{border-color:#ffffff14}.zf-editor[data-mode=flow-horizontal] .zf-editor-grid{overflow-x:auto;overflow-y:hidden}.zf-editor .grid-stack>.grid-stack-item>.grid-stack-item-content{overflow:visible}@media(hover:hover){.zf-editor:not(.zf-customise) .grid-stack-item-content:hover>.zf-frame{transform:translateY(-2px);border-color:var( --zf-frame-border-hover, hsl(var(--zf-accent-hue, 242) 90% 76% / .42) )}.zf-editor:not(.zf-customise) .grid-stack-item-content:hover>.zf-frame:not(.zf-frame--error):after{opacity:1}}.zf-fill{width:100%;height:100%}.zf-editor .zf-frame,.zf-editor .zf-bare{animation:none}.zf-editor.zf-customise .grid-stack-item>.grid-stack-item-content{outline:2px dashed rgba(255,255,255,.08);outline-offset:-2px;border-radius:18px;transition:outline-color .2s var(--zf-ease-out)}.zf-editor.zf-customise .grid-stack-item>.grid-stack-item-content>*{pointer-events:none}.zf-editor.zf-customise .grid-stack-item:hover>.grid-stack-item-content{outline-color:var(--zf-accent)}.zf-editor.zf-customise .grid-stack-item>.grid-stack-item-content{cursor:grab}body.zf-dragging,body.zf-dragging *{cursor:grabbing!important}@keyframes zf-wiggle{0%,to{transform:rotate(-.4deg)}50%{transform:rotate(.4deg)}}.zf-editor.zf-customise .grid-stack-item>.grid-stack-item-content{animation:zf-wiggle .32s ease-in-out infinite}.zf-editor.zf-customise .grid-stack-item:nth-child(2n)>.grid-stack-item-content{animation-delay:.05s;animation-duration:.28s}.zf-editor.zf-customise .grid-stack-item:nth-child(3n)>.grid-stack-item-content{animation-delay:.1s;animation-duration:.34s}.zf-editor.zf-customise .grid-stack-item:nth-child(5n)>.grid-stack-item-content{animation-delay:.15s;animation-duration:.26s}.zf-editor.zf-customise .grid-stack-item.ui-draggable-dragging>.grid-stack-item-content,.zf-editor.zf-customise .grid-stack-item.ui-resizing>.grid-stack-item-content{animation:none}@media(prefers-reduced-motion:reduce){.zf-editor.zf-customise .grid-stack-item>.grid-stack-item-content{animation:none}}.zf-del-btn{position:absolute;top:0;right:0;width:24px;height:24px;border-radius:9999px;background:linear-gradient(180deg,#f87171d1,#dc2626db);border:1px solid rgba(255,255,255,.28);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transform:scale(.8);-webkit-backdrop-filter:blur(12px) saturate(150%);backdrop-filter:blur(12px) saturate(150%);box-shadow:inset 0 1px #ffffff59,0 1px 2px #0000004d,0 8px 20px -12px #dc2626b3;transition:opacity .2s var(--zf-ease-out),transform .2s var(--zf-ease-out),background .2s var(--zf-ease-out),border-color .2s var(--zf-ease-out),box-shadow .2s var(--zf-ease-out);z-index:100;font-size:14px;font-weight:700;line-height:1;padding:0}.zf-del-btn:hover{background:linear-gradient(180deg,#f87171f2,#dc2626fa);border-color:#ffffff6b;transform:scale(1.1);box-shadow:inset 0 1px #ffffff6b,0 2px 6px #00000052,0 12px 26px -12px #dc2626d9}.zf-del-btn:active{transform:scale(.98)}.zf-editor.zf-customise .grid-stack-item:hover>.zf-del-btn{opacity:1;transform:scale(1)}.zf-cfg-btn{position:absolute;top:0;right:28px;width:24px;height:24px;border-radius:9999px;background:linear-gradient(180deg,#262838b8,#13141fc7);border:1px solid rgba(255,255,255,.16);color:#ffffffeb;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transform:scale(.8);-webkit-backdrop-filter:blur(14px) saturate(150%);backdrop-filter:blur(14px) saturate(150%);box-shadow:inset 0 1px #ffffff1a,0 1px 2px #00000052,0 8px 20px -12px #000c;transition:opacity .2s var(--zf-ease-out),transform .2s var(--zf-ease-out),color .2s var(--zf-ease-out),border-color .2s var(--zf-ease-out),box-shadow .2s var(--zf-ease-out);z-index:100;padding:0}.zf-cfg-btn:hover{color:hsl(var(--zf-accent-hue, 242) 96% 82%);border-color:hsl(var(--zf-accent-hue, 242) 90% 76% / .6);transform:scale(1.1);box-shadow:inset 0 1px #ffffff24,0 2px 6px #00000057,0 12px 26px -14px #000000d1}.zf-cfg-btn:active{transform:scale(.98)}.zf-cfg-btn>svg{display:block}.zf-editor.zf-customise .grid-stack-item:hover>.zf-cfg-btn{opacity:1;transform:scale(1)}.zf-editor .grid-stack-placeholder>.placeholder-content{background:hsl(var(--zf-accent-hue, 242) 90% 76% / .15);border:2px dashed hsl(var(--zf-accent-hue, 242) 90% 76% / .55);border-radius:18px}.ui-draggable-dragging>.zf-drag-ghost{box-sizing:border-box;width:100%;height:100%;display:flex;align-items:center;gap:10px;padding:0 14px;direction:ltr;border-radius:12px;background:linear-gradient(165deg,#222332f2,#0d0e15f5);border:1px solid hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / .55);box-shadow:inset 0 1px #ffffff14,0 22px 50px -20px #000000d9,0 0 0 1px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / .22);color:#eef1f8;font-family:var(--font-dmsans, "DM Sans", system-ui, sans-serif);-webkit-backdrop-filter:blur(10px) saturate(140%);backdrop-filter:blur(10px) saturate(140%);overflow:hidden}.ui-draggable-dragging>.zf-drag-ghost>.zf-drag-ghost-icon{width:30px;height:30px;flex:none;border-radius:7px;object-fit:cover}.ui-draggable-dragging>.zf-drag-ghost>.zf-drag-ghost-name{font-size:13px;font-weight:700;letter-spacing:.01em;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body:has(.ui-draggable-dragging),body:has(.ui-draggable-dragging) *{cursor:grabbing!important}.zf-editor-bar{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-bottom:14px}.zf-editor-bar-spacer{flex:1}.zf-btn{font:inherit;font-size:13px;font-weight:600;line-height:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 15px;border-radius:10px;cursor:pointer;border:1px solid rgba(255,255,255,.14);background:linear-gradient(180deg,#262838b8,#13141fc7);color:#ffffffeb;-webkit-backdrop-filter:blur(14px) saturate(150%);backdrop-filter:blur(14px) saturate(150%);box-shadow:inset 0 1px #ffffff14,0 1px 2px #00000052,0 10px 24px -14px #000c;transition:background .18s var(--zf-ease-out),border-color .18s var(--zf-ease-out),color .18s var(--zf-ease-out),box-shadow .18s var(--zf-ease-out),transform .18s var(--zf-ease-out)}.zf-btn:hover{background:linear-gradient(180deg,#323447d1,#1a1b29db);border-color:#ffffff38;transform:translateY(-1px);box-shadow:inset 0 1px #ffffff1a,0 2px 6px #00000057,0 16px 30px -16px #000000d1}.zf-btn:active{transform:translateY(0) scale(.97);box-shadow:inset 0 1px 3px #00000073,0 1px 2px #0000004d}.zf-btn:focus-visible{outline:none;border-color:hsl(var(--zf-accent-hue, 242) 90% 76% / .7);box-shadow:inset 0 1px #ffffff14,0 0 0 3px hsl(var(--zf-accent-hue, 242) 90% 76% / .35)}.zf-btn--primary{border-color:hsl(var(--zf-accent-hue, 242) 90% 72% / .7);background:linear-gradient(180deg,hsl(var(--zf-accent-hue, 242) 96% 81%),hsl(var(--zf-accent-hue, 242) 88% 72%));color:#0b0c13;box-shadow:inset 0 1px #fff6,0 1px 2px #0000004d,0 12px 26px -12px hsl(var(--zf-accent-hue, 242) 85% 60% / .7)}.zf-btn--primary:hover{border-color:hsl(var(--zf-accent-hue, 242) 95% 78% / .85);background:linear-gradient(180deg,hsl(var(--zf-accent-hue, 242) 100% 85%),hsl(var(--zf-accent-hue, 242) 92% 76%));box-shadow:inset 0 1px #ffffff73,0 2px 6px #0000004d,0 18px 34px -14px hsl(var(--zf-accent-hue, 242) 85% 60% / .8)}.zf-btn--primary:focus-visible{box-shadow:inset 0 1px #fff6,0 0 0 3px hsl(var(--zf-accent-hue, 242) 90% 76% / .45)}.zf-btn--danger{border-color:#f2155352;color:#ff9aab}.zf-btn--danger:hover{border-color:#f215538c;color:#ffb3bf;background:linear-gradient(180deg,#781c349e,#4a1224b8)}.zf-btn--danger:focus-visible{border-color:#f21553b3;box-shadow:inset 0 1px #ffffff14,0 0 0 3px #f2155359}.zf-btn--ghost{border-color:#ffffff1a;background:linear-gradient(180deg,#1e1f2c80,#10111a94);color:#ffffffc7}.zf-btn--ghost:hover{color:#fffffff2}.zf-btn--icon{padding:0;width:38px;height:38px;border-radius:11px;color:#ffffffd9}.zf-btn--icon:hover{color:hsl(var(--zf-accent-hue, 242) 96% 82%);border-color:hsl(var(--zf-accent-hue, 242) 90% 76% / .55)}.zf-btn--icon>svg{display:block}@media(prefers-reduced-motion:reduce){.zf-btn:hover,.zf-btn:active,.zf-del-btn:active,.zf-cfg-btn:active,.zf-rail-tab:active,.zf-dialog-close:active{transform:none}}.zf-rail{flex:none;width:0;margin-left:0;overflow:hidden;position:sticky;top:12px;transition:width .32s var(--zf-ease-drawer),margin-left .32s var(--zf-ease-drawer)}.zf-editor.zf-customise .zf-rail{width:320px;margin-left:16px}.zf-editor.zf-customise[data-mode=flow-horizontal] .zf-rail{margin-right:24px}.zf-rail-inner{box-sizing:border-box;width:320px;display:flex;flex-direction:column;gap:12px;padding:14px;border-radius:14px;background:linear-gradient(180deg,#141622b3,#0b0c13cc);border:1px solid rgba(255,255,255,.08);max-height:calc(100vh - 24px);overflow-x:hidden;overflow-y:auto;opacity:0;transition:opacity .2s var(--zf-ease-out)}.zf-editor.zf-customise .zf-rail-inner{opacity:1;transition-delay:.12s}.zf-rail-actions{display:flex;flex:none;gap:8px}.zf-rail-actions .zf-btn{flex:1}.zf-rail-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:16px}@media(prefers-reduced-motion:reduce){.zf-rail,.zf-rail-inner{transition:none}}.zf-rail-tabs{display:flex;gap:4px;padding:3px;border-radius:9px;background:#00000047;border:1px solid rgba(255,255,255,.07)}.zf-rail-tab{flex:1;font:inherit;font-size:11px;font-weight:600;letter-spacing:.04em;color:#ffffff80;background:transparent;border:0;border-radius:7px;padding:6px 8px;cursor:pointer;transition:background .15s var(--zf-ease-out),color .15s var(--zf-ease-out),box-shadow .15s var(--zf-ease-out),transform .15s var(--zf-ease-out)}.zf-rail-tab:hover{color:#ffffffd1}.zf-rail-tab:active{transform:scale(.97)}.zf-rail-tab.is-active{color:#fff;background:hsl(var(--zf-accent-hue, 242) 90% 70% / .22);box-shadow:inset 0 0 0 1px hsl(var(--zf-accent-hue, 242) 90% 76% / .4)}.zf-rail-tab:focus-visible{outline:2px solid hsl(var(--zf-accent-hue, 242) 90% 76% / .7);outline-offset:1px}.zf-mode-seg{display:flex;gap:4px;padding:3px;border-radius:9px;background:#00000047;border:1px solid rgba(255,255,255,.07)}.zf-mode-seg-btn{flex:1;font:inherit;font-size:11px;font-weight:600;letter-spacing:.04em;color:#ffffff80;background:transparent;border:0;border-radius:7px;padding:6px 8px;cursor:pointer;transition:background .15s var(--zf-ease-out),color .15s var(--zf-ease-out),box-shadow .15s var(--zf-ease-out),transform .15s var(--zf-ease-out)}.zf-mode-seg-btn:hover:not(:disabled){color:#ffffffd1}.zf-mode-seg-btn:active:not(:disabled){transform:scale(.97)}.zf-mode-seg-btn.is-active{color:#fff;background:hsl(var(--zf-accent-hue, 242) 90% 70% / .22);box-shadow:inset 0 0 0 1px hsl(var(--zf-accent-hue, 242) 90% 76% / .4)}.zf-mode-seg-btn:disabled{opacity:.4;cursor:not-allowed}.zf-mode-seg-btn:focus-visible{outline:2px solid hsl(var(--zf-accent-hue, 242) 90% 76% / .7);outline-offset:1px}.zf-mode-seg-hint{margin:8px 1px 0;font-size:10.5px;line-height:1.4;color:#ffffff6b}.zf-rail-title{font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:#ffffff75;margin:0 0 8px}.zf-palette-hint{font-size:11px;color:#fff6;margin:-4px 0 8px}.zf-palette-cats{display:flex;flex-direction:column;gap:6px}.zf-palette-cat{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#ffffff05;overflow:hidden;transition:background .15s var(--zf-ease-out),border-color .15s var(--zf-ease-out)}.zf-palette-cat.is-open{background:#ffffff09;border-color:#ffffff1a}.zf-palette-cat-header{display:flex;align-items:center;gap:9px;width:100%;font:inherit;text-align:left;cursor:pointer;padding:10px 11px;background:transparent;border:0;color:#fffc;transition:background .15s var(--zf-ease-out),color .15s var(--zf-ease-out)}.zf-palette-cat-header:hover{background:#ffffff0b;color:#fff}.zf-palette-cat-header:focus-visible{outline:2px solid hsl(var(--zf-accent-hue, 242) 90% 76% / .7);outline-offset:-2px}.zf-palette-cat-chevron{width:13px;height:13px;flex:none;color:#fff6;transition:transform .18s var(--zf-ease-out),color .15s var(--zf-ease-out)}.zf-palette-cat.is-open .zf-palette-cat-chevron{transform:rotate(90deg);color:hsl(var(--zf-accent-hue, 242) 70% 80% / .9)}.zf-palette-cat-label{flex:1;min-width:0;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.zf-palette-cat.is-open .zf-palette-cat-label{color:hsl(var(--zf-accent-hue, 242) 72% 84% / .95)}.zf-palette-cat-count{flex:none;font-size:10px;font-weight:600;font-variant-numeric:tabular-nums;color:#ffffff80;background:#ffffff12;border-radius:999px;padding:1px 7px;min-width:22px;text-align:center}.zf-palette-cat-body{padding:0 8px 9px;animation:zf-cat-in .18s var(--zf-ease-out)}@keyframes zf-cat-in{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.zf-palette-cat-body{animation:none}.zf-palette-cat-chevron{transition:none}}.zf-palette-cat-desc{font-size:10.5px;line-height:1.45;color:#ffffff61;margin:0 2px 9px}.zf-palette{display:flex;flex-direction:column;gap:6px}.zf-newwidget{display:flex;align-items:center;gap:10px;text-align:left;cursor:grab;user-select:none;-webkit-user-select:none;min-height:58px;padding:7px 10px 7px 8px;border-radius:9px;background:#ffffff0a;border:1px solid rgba(255,255,255,.07);transition:background .15s var(--zf-ease-out),border-color .15s var(--zf-ease-out)}.zf-newwidget:hover{background:#ffffff17;border-color:hsl(var(--zf-accent-hue, 242) 90% 76% / .4)}.zf-newwidget:active{cursor:grabbing}.zf-newwidget-icon{width:42px;height:42px;flex:none;border-radius:10px;object-fit:cover;background:#ffffff0d;box-shadow:inset 0 0 0 1px #ffffff14,0 8px 18px #00000038}.zf-newwidget-copy{min-width:0}.zf-newwidget-name{font-size:12px;font-weight:600;color:#ffffffe6;text-transform:capitalize}.zf-newwidget-desc{font-size:11px;color:#fff6;margin-top:2px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.zf-field{display:flex;flex-direction:column;gap:5px;margin-bottom:10px}.zf-field label{font-size:11px;color:#ffffff8c}.zf-input,.zf-textarea{font:inherit;font-size:12px;color:#ffffffe6;background:#0000004d;border:1px solid rgba(255,255,255,.12);border-radius:7px;padding:7px 9px;width:100%;box-sizing:border-box}.zf-textarea{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;min-height:120px;resize:vertical;line-height:1.45}.zf-input:focus,.zf-textarea:focus{outline:none;border-color:var(--zf-accent)}.zf-checkbox{display:flex;align-items:center;gap:7px;font-size:12px;color:#ffffffb3;margin-bottom:10px;cursor:pointer}.zf-config-error{font-size:11px;color:#ff8b9d;line-height:1.45;margin:-4px 0 10px;white-space:pre-wrap}.zf-rail-empty{font-size:12px;color:#fff6;line-height:1.5}.zf-select{font:inherit;font-size:12px;color:#ffffffe6;background:#0000004d;border:1px solid rgba(255,255,255,.12);border-radius:7px;padding:7px 28px 7px 9px;width:100%;box-sizing:border-box;cursor:pointer;-moz-appearance:none;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='0.55' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center}.zf-select:focus{outline:none;border-color:var(--zf-accent)}.zf-select option{color:#0b0c13}.zf-field-row{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.zf-field-num{font-size:12px;font-variant-numeric:tabular-nums;font-weight:700;color:#ffffffd1}.zf-range{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:6px;margin:4px 0 2px;border-radius:9999px;outline:none;cursor:pointer;background:#ffffff21}.zf-range::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:15px;height:15px;border-radius:9999px;background:var(--zf-accent);border:2px solid #fff;box-shadow:0 1px 4px #00000080;cursor:pointer}.zf-range::-moz-range-thumb{width:15px;height:15px;border-radius:9999px;background:var(--zf-accent);border:2px solid #fff;box-shadow:0 1px 4px #00000080;cursor:pointer}.zf-range:focus-visible{box-shadow:0 0 0 3px hsl(var(--zf-accent-hue, 242) 90% 76% / .3)}.zf-color-row{display:flex;gap:8px}.zf-color{flex:none;width:40px;height:34px;padding:2px;border-radius:7px;border:1px solid rgba(255,255,255,.12);background:#0000004d;cursor:pointer}.zf-textarea--prose{font-family:inherit;min-height:76px}.zf-taglist{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:2px}.zf-tag{display:inline-flex;align-items:center;gap:5px;padding:4px 5px 4px 9px;border-radius:9999px;border:1px solid rgba(255,255,255,.1);background:#0000003d;font-size:11px;font-weight:600;letter-spacing:.02em;color:#ffffffd1}.zf-symbol-editor{position:relative;display:flex;flex-direction:column;gap:9px;margin:0 0 12px;padding:10px;border-radius:11px;border:1px solid hsl(var(--zf-accent-hue, 242) 90% 76% / .16);background:linear-gradient(135deg,hsl(var(--zf-accent-hue, 242) 90% 76% / .1),#ffffff09 45%,#00000029),#ffffff08}.zf-symbol-head,.zf-holding-row,.zf-holding-main,.zf-selected-symbol,.zf-symbol-search,.zf-symbol-chip{display:flex;align-items:center}.zf-symbol-head{justify-content:space-between;gap:10px}.zf-symbol-label{font-size:10px;font-weight:700;letter-spacing:.11em;text-transform:uppercase;color:#ffffff75}.zf-symbol-detail{margin-top:2px;font-size:13px;font-weight:700;color:#ffffffe0}.zf-symbol-source{flex:none;padding:4px 7px;border-radius:9999px;border:1px solid rgba(255,255,255,.09);background:#0003;font-size:10px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:#ffffff7a}.zf-symbol-source.is-loading{color:var(--zf-accent);border-color:hsl(var(--zf-accent-hue, 242) 90% 76% / .24)}.zf-selected-symbol{min-width:0;gap:8px;padding:7px 8px;border-radius:9px;border:1px solid rgba(255,255,255,.08);background:#00000038}.zf-selected-symbol.is-compact{gap:6px;padding:0;border:0;background:transparent}.zf-selected-symbol-text{min-width:0;display:flex;flex-direction:column;gap:1px}.zf-selected-symbol-text strong,.zf-symbol-option-main strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#ffffffe6}.zf-selected-symbol-text em,.zf-symbol-option-main em{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;font-size:10px;color:#fff6}.zf-selected-symbol-price{margin-left:auto;font-variant-numeric:tabular-nums;font-size:12px;font-weight:700;color:#ffffffb8}.zf-symbol-avatar{flex:none;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;font-size:9px;font-weight:800;letter-spacing:.02em;line-height:1}.zf-symbol-avatar--stock{background:#ffffffeb;color:#151821;box-shadow:inset 0 0 0 1px #00000014}.zf-symbol-avatar--crypto{background:hsl(var(--zf-accent-hue, 242) 90% 76% / .18);color:var(--zf-accent);box-shadow:inset 0 0 0 1px hsl(var(--zf-accent-hue, 242) 90% 76% / .22)}.zf-symbol-avatar--logo{object-fit:contain}.zf-symbol-avatar--logo.zf-symbol-avatar--stock{padding:2px}.zf-symbol-avatar--logo.zf-symbol-avatar--crypto{border-radius:9999px;background:transparent;box-shadow:none}.zf-symbol-chips{display:flex;flex-wrap:wrap;gap:6px}.zf-symbol-chip{min-width:0;gap:6px;max-width:100%;padding:6px 6px 6px 7px;border-radius:9999px;border:1px solid rgba(255,255,255,.08);background:#00000038}.zf-symbol-remove{flex:none;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:9999px;padding:0;cursor:pointer;background:#ffffff0f;color:#ffffff80}.zf-symbol-remove:hover{background:#ef44442e;color:#ff8b9d}.zf-symbol-empty{padding:7px 8px;border-radius:8px;border:1px dashed rgba(255,255,255,.09);color:#ffffff5c;font-size:11px}.zf-symbol-combo{position:relative}.zf-symbol-search{gap:7px;height:34px;border-radius:9px;padding:0 9px;border:1px solid rgba(255,255,255,.11);background:#00000047;color:#ffffff7a}.zf-symbol-search:focus-within{border-color:var(--zf-accent);box-shadow:0 0 0 3px hsl(var(--zf-accent-hue, 242) 90% 76% / .12)}.zf-symbol-search.is-disabled{opacity:.55}.zf-symbol-search input{min-width:0;flex:1;border:0;outline:0;padding:0;background:transparent;color:#ffffffe6;font:inherit;font-size:12px}.zf-symbol-search input::placeholder{color:#ffffff57}.zf-symbol-menu{position:absolute;z-index:120;top:calc(100% + 6px);left:0;right:0;display:flex;flex-direction:column;gap:3px;max-height:286px;overflow-y:auto;padding:6px;border-radius:11px;border:1px solid rgba(255,255,255,.12);background:#0b0c13f5;box-shadow:0 18px 36px #00000075,0 0 0 1px #0000004d;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}.zf-symbol-option{width:100%;min-width:0;display:grid;grid-template-columns:22px minmax(0,1fr) auto 16px;align-items:center;gap:8px;min-height:40px;padding:7px;border:0;border-radius:8px;background:transparent;color:inherit;text-align:left;cursor:pointer}.zf-symbol-option:hover,.zf-symbol-option:focus-visible{outline:none;background:#ffffff13}.zf-symbol-option:disabled{cursor:default;opacity:.52}.zf-symbol-option.is-selected{background:hsl(var(--zf-accent-hue, 242) 90% 76% / .1)}.zf-symbol-option--custom{border-top:1px solid rgba(255,255,255,.06);border-radius:0 0 8px 8px}.zf-symbol-option-main{min-width:0;display:flex;flex-direction:column;gap:1px}.zf-symbol-option-meta{display:flex;flex-direction:column;align-items:flex-end;gap:1px;font-variant-numeric:tabular-nums;font-size:10px;color:#ffffff70}.zf-symbol-change{font-size:10px;font-weight:800}.zf-symbol-change.is-up{color:#42d67a}.zf-symbol-change.is-down{color:#ff637d}.zf-symbol-custom-icon{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;background:#ffffff12;color:var(--zf-accent)}.zf-symbol-menu-status{padding:10px 8px;color:#ffffff61;font-size:11px}.zf-holding-list{display:flex;flex-direction:column;gap:6px}.zf-holding-row{justify-content:space-between;gap:8px;min-width:0;padding:7px;border-radius:9px;border:1px solid rgba(255,255,255,.08);background:#0000002e}.zf-holding-main{min-width:0;gap:7px}.zf-holding-amount{flex:none;font-variant-numeric:tabular-nums;font-size:11px;color:#ffffff70}.zf-theme{margin-bottom:18px;padding-bottom:16px;border-bottom:1px solid rgba(255,255,255,.07)}.zf-theme-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}.zf-theme-val{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-variant-numeric:tabular-nums;color:#ffffff8c}.zf-theme-swatch{width:11px;height:11px;border-radius:9999px;background:var(--zf-accent);box-shadow:0 0 8px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / .9)}.zf-theme-knob-end{display:inline-flex;align-items:center;gap:10px}.zf-theme-reset{background:none;border:none;padding:0;font:inherit;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:#ffffff61;cursor:pointer}.zf-theme-reset:hover{color:var(--zf-accent)}.zf-hue-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:10px;border-radius:9999px;outline:none;cursor:pointer;border:1px solid rgba(255,255,255,.12);background:linear-gradient(to right,#f98b8b,#f9f98b,#8bf98b,#8bf9f9,#8b8bf9,#f98bf9,#f98b8b)}.zf-hue-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:16px;height:16px;border-radius:9999px;background:var(--zf-accent);border:2px solid #fff;box-shadow:0 1px 4px #00000080;cursor:pointer}.zf-hue-slider::-moz-range-thumb{width:16px;height:16px;border-radius:9999px;background:var(--zf-accent);border:2px solid #fff;box-shadow:0 1px 4px #00000080;cursor:pointer}.zf-presets{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.zf-preset{display:flex;align-items:center;gap:8px;padding:7px 9px;border-radius:10px;border:1px solid rgba(255,255,255,.1);background:#ffffff08;color:#ffffffb3;font:inherit;font-size:11px;font-weight:600;cursor:pointer;text-align:left;transition:border-color .15s var(--zf-ease-out, ease),background .15s var(--zf-ease-out, ease),color .15s var(--zf-ease-out, ease)}.zf-preset:hover{border-color:#ffffff38;color:#ffffffe6}.zf-preset.is-active{border-color:var(--zf-accent);color:#fff;box-shadow:0 0 0 1px var(--zf-accent)}.zf-preset-swatch{width:16px;height:16px;flex:none;border-radius:5px;border:1px solid rgba(255,255,255,.18)}.zf-preset-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zf-seg{display:flex;gap:6px}.zf-seg-btn{flex:1;padding:7px 6px;border-radius:9px;border:1px solid rgba(255,255,255,.1);background:#ffffff08;color:#ffffff9e;font:inherit;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap;transition:border-color .15s var(--zf-ease-out, ease),background .15s var(--zf-ease-out, ease),color .15s var(--zf-ease-out, ease)}.zf-seg-btn:hover{border-color:#ffffff38;color:#ffffffd9}.zf-seg-btn.is-active{border-color:var(--zf-accent);background:hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 60% / .14);color:#fff}.zf-color{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:22px;height:16px;padding:0;border:1px solid rgba(255,255,255,.18);border-radius:5px;background:none;cursor:pointer;vertical-align:middle}.zf-color::-webkit-color-swatch-wrapper{padding:0}.zf-color::-webkit-color-swatch{border:none;border-radius:4px}.zf-color::-moz-color-swatch{border:none;border-radius:4px}.zf-dialog-backdrop{--zf-accent: hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%);--zf-ease-out: cubic-bezier(.23, 1, .32, 1);position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:24px;background:#06070c9e;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);animation:zf-dialog-fade .16s var(--zf-ease-out)}.zf-dialog{width:min(440px,100%);max-height:calc(100vh - 48px);display:flex;flex-direction:column;border-radius:16px;border:1px solid rgba(255,255,255,.1);background:linear-gradient(180deg,#141622fa,#0b0c13fc);box-shadow:0 30px 80px -20px #000c,0 0 0 1px #0006;animation:zf-dialog-pop .18s cubic-bezier(.32,.72,0,1)}.zf-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 16px 12px;border-bottom:1px solid rgba(255,255,255,.07)}.zf-dialog-title{margin:0;font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:#ffffff9e}.zf-dialog-close{flex:none;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;border:1px solid rgba(255,255,255,.1);background:#ffffff0a;color:#ffffffb3;cursor:pointer;transition:background .15s var(--zf-ease-out),color .15s var(--zf-ease-out),border-color .15s var(--zf-ease-out),transform .15s var(--zf-ease-out)}.zf-dialog-close:hover{background:#ffffff17;border-color:#ffffff2e;color:#fff}.zf-dialog-close:active{transform:scale(.94)}.zf-dialog-close>svg{display:block}.zf-dialog-body{padding:16px;overflow-y:auto;scrollbar-gutter:stable}.zf-dialog-body>:first-child{margin-top:0}.zf-dialog-foot{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px 16px;border-top:1px solid rgba(255,255,255,.07)}@keyframes zf-dialog-fade{0%{opacity:0}to{opacity:1}}@keyframes zf-dialog-pop{0%{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.zf-dialog-backdrop,.zf-dialog{animation:none}}
@@ -0,0 +1 @@
1
+ import{r as c,j as e}from"./react-qoZPGuNy.js";import{f as u,B as l,C as m}from"./index-C_O7gp2F.js";import{F as i}from"./ui-Bq3RQsdJ.js";import{M as p}from"./mini-line-chart-D-i1QqSe.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";l.schema;function x(r){return r<=25?"#F21553":r<=45?"#F97316":r<=55?"#F59E0B":r<=75?"#84CC16":"#25A78D"}function f({config:r}){const{points:s,isLoading:o}=m(r.sparklineDays),t=s[0],d=c.useMemo(()=>[...s].reverse().map(n=>({date:new Date(n.time).toISOString(),value:n.value})),[s]);if(o)return e.jsx(i,{loading:!0,children:"loading index…"});if(!t)return e.jsx(i,{children:"no sentiment data yet"});const a=x(t.value);return e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2.5",children:[e.jsx("div",{className:"metric-xl leading-none",style:{color:a,textShadow:`0 0 28px ${a}55`},children:t.value}),e.jsx("div",{className:"body-sm rounded-full px-2.5 py-0.5 font-semibold uppercase tracking-wide",style:{color:a,background:`${a}1f`,border:`1px solid ${a}33`},children:t.classification}),e.jsxs("div",{className:"relative w-full max-w-[180px] overflow-hidden rounded-xl",children:[e.jsx("div",{className:"h-[11px] w-full opacity-40",style:{background:"linear-gradient(90deg, #FF1F5F 4.89%, #464646 34.15%, #464646 69.98%, #81FE90 100%)"}}),e.jsx("div",{className:"absolute left-0 top-0 h-full w-full",style:{background:"repeating-linear-gradient(to right, var(--color-background-terminal), var(--color-background-terminal) 2px, transparent 2px, transparent 3px)"}}),e.jsx("div",{className:"absolute top-1/2 h-3 w-[3px] -translate-x-1/2 -translate-y-1/2 rounded-xs",style:{left:`${t.value}%`,background:a}})]}),e.jsx(p,{data:d,width:150,height:30,color:a}),e.jsxs("div",{className:"caption text-soft",children:["crypto fear & greed · ",r.sparklineDays,"d"]})]})}const b=u({...l,component:f});export{b as fearGreedFrame};
@@ -0,0 +1 @@
1
+ import{j as e}from"./react-qoZPGuNy.js";function l({href:t,leading:a,title:s,subtitle:r,meta:o,titleAttr:n}){return e.jsxs("a",{href:t,target:"_blank",rel:"noreferrer noopener",title:n,className:"group relative flex min-w-0 items-start gap-3 border-b border-white/[0.06] py-2 pl-3 no-underline transition-colors last:border-b-0 before:absolute before:bottom-1.5 before:left-0 before:top-1.5 before:w-0.5 before:rounded-full before:bg-highlight before:opacity-0 before:transition-opacity hover:bg-white/[0.03] group-hover:before:opacity-100 hover:before:opacity-100",children:[a,e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"body-sm text-normal line-clamp-2 block font-medium leading-snug transition-colors group-hover:text-strong",children:s}),r&&e.jsx("span",{className:"caption text-soft mt-1 line-clamp-2 block leading-relaxed",children:r})]}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 pt-px",children:[o!=null&&e.jsx("span",{className:"caption text-soft tabular-nums",children:o}),e.jsx("span",{className:"caption text-highlight/70 -mr-0.5 w-2 opacity-0 transition-opacity group-hover:opacity-100",children:"↗"})]})]})}export{l as F};
@@ -0,0 +1 @@
1
+ import{r as x,j as t}from"./react-qoZPGuNy.js";import{f,D as p,E as h,h as u,A as F}from"./index-C_O7gp2F.js";import{F as j}from"./feed-row-mVg1d5Zj.js";import{t as b}from"./format-CfAcS4D8.js";import{F as a,s as y}from"./ui-Bq3RQsdJ.js";p.schema;const n={"10-K":"Annual report","10-Q":"Quarterly report","8-K":"Material event","20-F":"Annual report (foreign)","40-F":"Annual report (foreign)","6-K":"Foreign interim report","S-1":"Registration","S-3":"Registration","S-4":"Registration (M&A)","DEF 14A":"Proxy statement",DEFA14A:"Proxy materials","SC 13D":"Activist stake","SC 13G":"Passive stake",SD:"Specialized disclosure",3:"Initial insider ownership",4:"Insider transaction",5:"Annual insider ownership",144:"Proposed insider sale","11-K":"Employee benefit plan"},A=/^(10-K|10-Q|8-K|20-F|40-F|6-K|S-|F-|424|DEF |DEFA|DEFM|11-K|SC 13|25)/i,E=/^(3|4|5|144)(\/A)?$/;function l(e){return e.replace(/^SCHEDULE /i,"SC ").trim()}function S(e,s){return s==="all"?!0:s==="insider"?E.test(e):A.test(e)}function D(e){const s=l(e.form);if(n[s])return n[s];const r=s.replace(/\/A$/,"");return r!==s&&n[r]?`${n[r]} (amended)`:e.description&&e.description.toUpperCase()!==e.form.toUpperCase()?e.description:s}function N({filing:e}){return t.jsx(j,{href:e.url,titleAttr:e.form,leading:t.jsx("span",{className:"caption text-strong inline-flex w-16 shrink-0 justify-center truncate rounded bg-white/[0.06] px-1.5 py-1 font-bold",children:l(e.form)}),title:D(e),subtitle:e.reportDate?`period ${e.reportDate}`:e.items?`items ${e.items}`:e.accessionNumber,meta:e.filingDate?b(new Date(e.filingDate).getTime()):void 0})}function v({config:e}){const{data:s,isLoading:r}=h(e.symbol),m=x.useMemo(()=>((s==null?void 0:s.filings)??[]).filter(i=>S(l(i.form),e.forms)).slice(0,e.count),[s==null?void 0:s.filings,e.forms,e.count]);if(r)return t.jsx(a,{loading:!0,children:"loading SEC filings…"});if(!s)return t.jsxs(a,{children:["no SEC data for “",u(e.symbol),"”"]});const o=s.tickers[0],c=e.symbol.includes(":")?e.symbol:o?`xyz:${o}`:null,d=[s.exchanges[0],s.category].filter(Boolean).join(" · ");return t.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c&&t.jsx(F,{symbol:c,size:22}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"body-sm text-strong truncate font-semibold",children:s.name||o||u(e.symbol)}),d&&t.jsx("div",{className:"caption text-soft truncate",children:d})]})]}),t.jsx("div",{className:"caption text-soft shrink-0 text-right",children:"filings"})]}),t.jsx("div",{className:y,children:m.length>0?m.map(i=>t.jsx(N,{filing:i},i.accessionNumber)):t.jsxs(a,{children:["no ",e.forms==="all"?"":`${e.forms} `,"filings yet"]})})]})}const k=f({...p,component:v});export{k as filingsFeedFrame};
@@ -0,0 +1 @@
1
+ import{r as c,j as e}from"./react-qoZPGuNy.js";import{D as m,U as x}from"./format-CfAcS4D8.js";import{f as h,I as l,J as u}from"./index-C_O7gp2F.js";import{F as r}from"./ui-Bq3RQsdJ.js";import{M as f}from"./mini-line-chart-D-i1QqSe.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";l.schema;function n(t){return t>0?m:x}function p(t){return t>=2.5?"high stress":t>=1?"elevated":t>-1?"near average":"below average"}function j({config:t}){const{stress:s,isLoading:d}=u(),o=c.useMemo(()=>((s==null?void 0:s.trend)??[]).slice(-t.trendDays).map(a=>({date:new Date(a.time).toISOString(),value:a.value})),[t.trendDays,s==null?void 0:s.trend]);if(d)return e.jsx(r,{loading:!0,children:"loading stress index…"});if(!s)return e.jsx(r,{children:"no stress-index data yet"});const i=n(s.value);return e.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"caption text-soft uppercase",children:"OFR FSI"}),e.jsx("div",{className:"body-sm text-normal",children:s.date})]}),e.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),e.jsxs("div",{className:"flex items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"metric-xl leading-none",style:{color:i,textShadow:`0 0 24px ${i}44`},children:[s.value>0?"+":"",s.value.toFixed(2)]}),e.jsx("div",{className:"caption text-soft mt-1",children:p(s.value)})]}),e.jsxs("div",{className:"caption text-soft max-w-[46%] text-right leading-snug",children:["0 = long-run average",e.jsx("br",{}),"higher = more stress"]})]}),e.jsx(f,{data:o,width:210,height:42,color:i}),t.showCategories&&s.categories.length>0&&e.jsx("div",{className:"grid grid-cols-2 gap-1.5 border-t border-white/[0.08] pt-2",children:s.categories.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"caption text-soft truncate",children:a.label}),e.jsxs("span",{className:"body-sm font-bold tabular-nums",style:{color:n(a.value)},children:[a.value>0?"+":"",a.value.toFixed(2)]})]},a.label))})]})}const y=h({...l,component:j});export{y as financialStressFrame};
@@ -0,0 +1 @@
1
+ import{r as i,j as x}from"./react-qoZPGuNy.js";import{a as F,d as _,G as I}from"./game-ui-Dy_QYsPr.js";import{f as O,az as v}from"./index-C_O7gp2F.js";import"./format-CfAcS4D8.js";const z=.225,L=-3.6,b=52,A=132,j=210,U=1.3,C=64,p=12,M=28,N=28,R={bird:"rgba(255, 255, 255, 0.95)",eye:"rgba(0, 0, 0, 0.8)",pipe:"hsla(160, 64%, 40%, 0.9)",ground:"rgba(255, 255, 255, 0.1)"};function H(t,r,f,d){t.save(),t.translate(C,r),t.rotate(Math.max(-.5,Math.min(.9,f*.06))),t.fillStyle=R.bird,t.beginPath(),t.arc(0,0,p,0,Math.PI*2),t.fill(),t.fillStyle=d,t.fillRect(-p+2,0,10,5),t.fillStyle=R.eye,t.beginPath(),t.arc(5,-4,2,0,Math.PI*2),t.fill(),t.restore()}function V(t,r,f,d,y,h){r.clearRect(0,0,t.width,t.height);const c=t.height-M;r.fillStyle=R.ground,r.fillRect(0,c,t.width,2),H(r,t.height/2,0,h),r.textAlign="center",f==="idle"?(r.fillStyle=I.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText("Press SPACE or tap to fly",t.width/2,t.height/2-40)):(r.fillStyle=I.gameOver,r.font='bold 20px "DM Sans", sans-serif',r.fillText("GAME OVER",t.width/2,t.height/2-50),r.fillStyle=I.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText(`Score: ${d}`,t.width/2,t.height/2-22),r.fillStyle=I.textSoft,r.fillText("Press SPACE or tap to retry",t.width/2,t.height/2+6)),r.textAlign="left",_(t,r,d,y,h)}function X(){const t=i.useRef(null),r=i.useRef(null),[f,d]=i.useState("idle"),[y,h]=i.useState(0),[c,k]=i.useState(()=>{if(typeof window<"u"){const e=localStorage.getItem("zframes-flappy-bird-high-score");return e?parseInt(e,10):0}return 0}),[,B]=i.useState(!1),u=i.useRef(0),g=i.useRef(c),E=i.useRef(f),m=i.useRef(F(null));i.useEffect(()=>{g.current=c,c>0&&localStorage.setItem("zframes-flappy-bird-high-score",String(c))},[c]),i.useEffect(()=>{E.current=f},[f]);const w=i.useRef({birdY:0,birdVel:0,pipes:[],frameCount:0}),G=i.useCallback(e=>{const n=e.height-M,a=N,l=n-N-A;return a+Math.random()*Math.max(0,l-a)},[]),T=i.useCallback(()=>{const e=t.current;e&&(w.current={birdY:e.height/2,birdVel:0,pipes:[{x:e.width+60,gapY:G(e),passed:!1}],frameCount:0},u.current=0,h(0))},[G]),P=i.useCallback(()=>{var e;if((e=r.current)==null||e.focus(),E.current!=="playing"){T(),d("playing");return}w.current.birdVel=L},[T]);return i.useEffect(()=>{const e=a=>{const l=a.target;l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable||(a.code==="Space"||a.code==="ArrowUp")&&(a.preventDefault(),P())},n=r.current;if(n)return n.addEventListener("keydown",e),()=>n.removeEventListener("keydown",e)},[P]),i.useLayoutEffect(()=>{const e=t.current;if(!e)return;const n=()=>{const l=e.parentElement;if(l&&l.clientWidth>0&&l.clientHeight>0){e.width=l.clientWidth,e.height=l.clientHeight,m.current=F(e);const S=e.getContext("2d");E.current!=="playing"&&(w.current.birdY=e.height/2,S&&V(e,S,E.current,u.current,g.current,m.current)),B(Y=>!Y)}};n();const a=new ResizeObserver(n);return a.observe(e.parentElement),()=>a.disconnect()},[]),i.useEffect(()=>{if(f!=="playing")return;const e=t.current,n=e==null?void 0:e.getContext("2d");if(!e||!n)return;let a;const l=e.height-M,S=()=>{u.current>g.current&&(g.current=u.current,k(u.current)),d("gameover")},Y=()=>{const o=w.current;n.clearRect(0,0,e.width,e.height),o.birdVel+=z,o.birdY+=o.birdVel,o.pipes=o.pipes.filter(s=>s.x>-b),o.pipes.forEach(s=>s.x-=U);const D=o.pipes[o.pipes.length-1];if((!D||D.x<e.width-j)&&o.pipes.push({x:e.width,gapY:G(e),passed:!1}),o.birdY-p<=0||o.birdY+p>=l){S();return}for(const s of o.pipes){if(C+p>s.x&&C-p<s.x+b&&(o.birdY-p<s.gapY||o.birdY+p>s.gapY+A)){S();return}!s.passed&&s.x+b<C&&(s.passed=!0,u.current+=1,h(u.current))}n.fillStyle=R.pipe;for(const s of o.pipes)n.fillRect(s.x,0,b,s.gapY),n.fillRect(s.x,s.gapY+A,b,l-(s.gapY+A));n.fillStyle=R.ground,n.fillRect(0,l,e.width,2),H(n,o.birdY,o.birdVel,m.current),_(e,n,u.current,g.current,m.current),o.frameCount++,a=requestAnimationFrame(Y)};return a=requestAnimationFrame(Y),()=>cancelAnimationFrame(a)},[f]),i.useEffect(()=>{if(f==="playing")return;const e=t.current,n=e==null?void 0:e.getContext("2d");!e||!n||V(e,n,f,y,c,m.current)},[f,y,c]),x.jsx("div",{ref:r,tabIndex:0,className:"relative h-full w-full cursor-pointer select-none overflow-hidden outline-none",onClick:P,onTouchStart:P,role:"application","aria-label":"Flappy bird game. Press space or tap to flap.",children:x.jsx("canvas",{ref:t,className:"h-full w-full"})})}const Q=O({...v,component:X});export{Q as flappyBirdFrame};
@@ -0,0 +1 @@
1
+ function f(t){return t>=1e3?`$${t.toLocaleString("en-US",{maximumFractionDigits:0})}`:t>=1?`$${t.toLocaleString("en-US",{maximumFractionDigits:2})}`:`$${t.toPrecision(4)}`}function u(t){return`${t>=0?"+":""}${t.toFixed(2)}%`}function $(t){const n=t>=100?2:4;return t.toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}function m(t,n=2){return`${t.toFixed(n)}%`}function d(t){return`${t>=0?"+":""}${t.toFixed(4)}%`}const s="var(--zf-up, #3fd08f)",c="var(--zf-down, #ff6b81)",h="#ff6b81";function x(t){return t>=0?s:c}function a(t){const n=Math.abs(t),r=t<0?"-":"";return n>=1e12?`${r}${(n/1e12).toFixed(2)}T`:n>=1e9?`${r}${(n/1e9).toFixed(2)}B`:n>=1e6?`${r}${(n/1e6).toFixed(2)}M`:n>=1e3?`${r}${(n/1e3).toFixed(1)}K`:`${r}${n.toFixed(0)}`}function F(t){return t<0?`-$${a(-t)}`:`$${a(t)}`}function g(t){return t.split(/[-_]/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function C(t){const n=t/1e8;return n>=100?`${n.toFixed(0)} BTC`:n>=1?`${n.toFixed(2)} BTC`:n>=.001?`${n.toFixed(4)} BTC`:`${Math.round(t).toLocaleString("en-US")} sats`}function S(t){const n=["H/s","kH/s","MH/s","GH/s","TH/s","PH/s","EH/s","ZH/s"];let r=t,o=0;for(;r>=1e3&&o<n.length-1;)r/=1e3,o++;return`${r.toFixed(r>=100?0:r>=10?1:2)} ${n[o]}`}function p(t){const n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return"now";const r=Math.round(n/60);if(r<60)return`${r}m`;const o=Math.round(r/60);if(o<24)return`${o}h`;const e=Math.round(o/24);if(e<7)return`${e}d`;const i=Math.round(e/7);return i<5?`${i}w`:new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric"})}export{c as D,s as U,u as a,m as b,x as c,f as d,a as e,F as f,h as g,d as h,$ as i,C as j,S as k,g as p,p as t};
@@ -0,0 +1 @@
1
+ import{j as s}from"./react-qoZPGuNy.js";import{f as c,G as r,H as o,h as i}from"./index-C_O7gp2F.js";import{d as m,e as d,f}from"./format-CfAcS4D8.js";import{F as n,s as u}from"./ui-Bq3RQsdJ.js";r.schema;function x(a){return a.unit==="USD/shares"?m(a.value):a.unit==="shares"?d(a.value):f(a.value)}function h({config:a}){const{data:t,isLoading:l}=o(a.symbol);return l?s.jsx(n,{loading:!0,children:"loading SEC financials…"}):!t||t.metrics.length===0?s.jsxs(n,{children:["no SEC financials for “",i(a.symbol),"”"]}):s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"body-sm text-strong truncate font-semibold",children:t.entityName||i(a.symbol)}),s.jsx("div",{className:"caption text-soft truncate",children:"SEC EDGAR · XBRL company facts"})]}),s.jsx("div",{className:"caption text-soft shrink-0 text-right",children:"on filing"})]}),s.jsx("div",{className:`grid grid-cols-2 content-start gap-2 ${u}`,children:t.metrics.map(e=>s.jsxs("div",{className:"rounded bg-white/[0.04] px-3 py-2",children:[s.jsx("div",{className:"caption text-soft truncate",children:e.label}),s.jsx("div",{className:"metric-sm text-strong",children:x(e)}),s.jsx("div",{className:"caption text-soft truncate",children:e.fiscalPeriod})]},e.label))})]})}const N=c({...r,component:h});export{N as fundamentalsFrame};
@@ -0,0 +1 @@
1
+ import{r as c,j as i}from"./react-qoZPGuNy.js";import{f as k,R as N,S as L,h as X}from"./index-C_O7gp2F.js";import{h as Y}from"./format-CfAcS4D8.js";import{F as D}from"./ui-Bq3RQsdJ.js";import{c as q}from"./utils-DaT-yT0k.js";const B="4px",z=6,G=80,P=24;function K({data:u,className:_,CellComponent:R,getColorValue:g,gap:x=z,showLabels:l=!1,rowLabelWidth:p=G,columnLabelHeight:b=P}){const j=c.useRef(null),[,w]=c.useTransition(),[m,M]=c.useState({width:0,height:0});c.useEffect(()=>{const t=j.current;if(t){const e=new ResizeObserver(()=>{w(()=>{M({width:t.offsetWidth,height:t.offsetHeight})})});return e.observe(t),()=>{e.disconnect()}}},[]);const{uniqueRows:v,uniqueColumns:I,rowToIndex:C,columnToIndex:E}=c.useMemo(()=>{const t=new Set,e=new Set,n=[],r=[];for(const s of u)t.has(s.row)||(t.add(s.row),n.push(s.row)),e.has(s.column)||(e.add(s.column),r.push(s.column));const a=new Map(n.map((s,f)=>[s,f])),d=new Map(r.map((s,f)=>[s,f]));return{uniqueRows:n,uniqueColumns:r,rowToIndex:a,columnToIndex:d}},[u]),h=c.useMemo(()=>{const t=l?p:0,e=l?b:0;return{x:t,y:e,width:Math.max(0,m.width-t),height:Math.max(0,m.height-e)}},[m,l,p,b]),y=c.useMemo(()=>{const t=I.length,e=v.length,n=t>0?Math.max(0,(h.width-x*(t-1))/t):0,r=e>0?Math.max(0,(h.height-x*(e-1))/e):0;return{cellWidth:n,cellHeight:r,columnX:s=>s*(n+x),rowY:s=>s*(r+x)}},[v.length,I.length,h,x]),S=c.useMemo(()=>{const t=u.map(o=>g?g(o):o.value),e=t.filter(o=>o>=0),n=t.filter(o=>o<0),r=e.length>0?Math.min(...e):0,a=e.length>0?Math.max(...e):0,d=n.length>0?Math.min(...n):0,s=n.length>0?Math.max(...n):0,f=o=>o<0?s===d?1:(o-s)/(d-s):a===r?1:(o-r)/(a-r);return u.map(o=>{const T=g?g(o):o.value,U=f(T),W=T>=0;return{cell:o,colorValue:T,intensity:U,isPositive:W}})},[u,g]),F=(t,e)=>{if(e){const a=Math.round(34+t*16);return`hsl(152 ${Math.round(42+t*20)}% ${a}%)`}const n=Math.round(36+t*15);return`hsl(350 ${Math.round(48+t*22)}% ${n}%)`},A=c.useMemo(()=>{const{cellWidth:t,cellHeight:e,columnX:n,rowY:r}=y;return t<=0||e<=0?null:S.map(({cell:a,intensity:d,isPositive:s})=>{const f=C.get(a.row),o=E.get(a.column);if(f===void 0||o===void 0)return null;const T=F(d,s);return i.jsx("div",{className:"group absolute cursor-pointer border border-transparent hover:bg-[radial-gradient(146.13%_118.42%_at_50%_-15.5%,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0)_99.59%)] hover:bg-gradient-to-t",style:{left:h.x+n(o),top:h.y+r(f),width:t,height:e,borderRadius:B,backgroundColor:T},children:i.jsx(R,{width:t,height:e,data:a,rowIndex:f,columnIndex:o,colorIntensity:d,isPositive:s})},a.id)})},[S,y,h,C,E,R]),O=c.useMemo(()=>{if(!l)return null;const{cellHeight:t,rowY:e}=y;return v.map((n,r)=>i.jsx("div",{className:"absolute flex items-center justify-end pr-2 text-xs text-white/60",style:{left:0,top:h.y+e(r),width:p,height:t},children:i.jsx("span",{className:"truncate",children:n})},`row-${n}`))},[l,v,y,h,p]),$=c.useMemo(()=>{if(!l)return null;const{cellWidth:t,columnX:e}=y;return I.map((n,r)=>i.jsx("div",{className:"absolute flex items-end justify-center pb-1 text-xs text-white/60",style:{left:h.x+e(r),top:0,width:t,height:b},children:i.jsx("span",{className:"truncate",children:n})},`col-${n}`))},[l,I,y,h,b]);return i.jsx("div",{className:q("h-full w-full",_),ref:j,children:i.jsxs("div",{className:"relative overflow-hidden",style:{height:m.height,width:m.width},children:[O,$,A]})})}const J=K;N.schema;const H=1440*60*1e3,Q=10080*60*1e3;function Z({data:u,width:_}){return _<44?null:i.jsx("div",{className:"flex h-full w-full items-center justify-center",children:i.jsx("span",{className:"caption text-normal tabular-nums",children:Y(u.rate*100)})})}function V({config:u}){const _=c.useMemo(()=>Date.now()-Q,[]),{history:R,isLoading:g}=L(u.symbols,_),x=c.useMemo(()=>{const l=[];for(const p of u.symbols){const b=R[p]??[],j=new Map;for(const w of b){const m=Math.floor(w.time/H)*H,M=j.get(m)??{sum:0,n:0};M.sum+=w.fundingRate,M.n+=1,j.set(m,M)}for(const[w,{sum:m,n:M}]of j){const v=m/M,C=new Date(w).toLocaleDateString("en-US",{month:"short",day:"numeric"});l.push({id:`${p}-${w}`,row:X(p),column:C,value:v*1e4,rate:v})}}return l},[R,u.symbols]);return g?i.jsx(D,{loading:!0,children:"loading funding…"}):x.length===0?i.jsx(D,{children:"no funding data"}):i.jsx(J,{data:x,CellComponent:Z,gap:3,showLabels:!0,rowLabelWidth:48,columnLabelHeight:20})}const rt=k({...N,component:V});export{rt as fundingHeatmapFrame};
@@ -0,0 +1 @@
1
+ import{r as o,j as a}from"./react-qoZPGuNy.js";import{f as l,T as d,S as C,h as M}from"./index-C_O7gp2F.js";import{h as S}from"./format-CfAcS4D8.js";import{F as f}from"./ui-Bq3RQsdJ.js";import{a as r,C as u}from"./chart-utils-BYIZMM9J.js";import{M as R}from"./index-jnySFpSv.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";const x={"24h":{ms:1440*60*1e3,timeframe:r["24h"]},"7D":{ms:10080*60*1e3,timeframe:r["7D"]},"1M":{ms:720*60*60*1e3,timeframe:r["1M"]}};d.schema;function F({config:e}){const{ms:s,timeframe:h}=x[e.lookback],c=o.useMemo(()=>Date.now()-s,[s]),{history:m,isLoading:p}=C(e.symbols,c),i=o.useMemo(()=>e.symbols.map((t,g)=>({id:t,name:M(t),color:u[g%u.length],data:(m[t]??[]).map(n=>({date:new Date(n.time).toISOString(),value:n.fundingRate*100}))})),[e.symbols,m]);return p?a.jsx(f,{loading:!0,children:"loading funding rates…"}):i.every(t=>t.data.length===0)?a.jsx(f,{children:"no funding data yet"}):a.jsx(R,{series:i,timeframe:h,height:250,formatValue:t=>S(t)})}const I=l({...d,component:F});export{I as fundingRateChartFrame};
@@ -0,0 +1 @@
1
+ import{j as e}from"./react-qoZPGuNy.js";import{c as x,i as p,a as b}from"./format-CfAcS4D8.js";import{f,ab as d,ac as j}from"./index-C_O7gp2F.js";import{F as c}from"./ui-Bq3RQsdJ.js";import{M as u}from"./mini-line-chart-D-i1QqSe.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";d.schema;function g({config:a}){var n,o;const{rates:t,isLoading:h}=j(a.base,a.symbols);if(h)return e.jsx(c,{loading:!0,children:"loading FX rates…"});if(!t.length)return e.jsx(c,{children:"no FX data yet"});const r=(o=(n=t[0])==null?void 0:n.history.at(-1))==null?void 0:o.time;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"caption text-soft uppercase",children:"FX rates"}),e.jsxs("div",{className:"body-sm text-normal",children:["1 ",a.base.toUpperCase()," buys"]})]}),e.jsx("div",{className:"caption text-soft text-right",children:r?new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric"}):"ECB daily"})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:t.map(s=>{const i=x(s.changePct),l=s.history.map(m=>({date:new Date(m.time).toISOString(),value:m.value}));return e.jsxs("div",{className:"flex items-center gap-3 border-b border-white/[0.06] py-1.5 last:border-b-0",children:[e.jsx("span",{className:"body-sm w-9 font-bold text-strong",children:s.symbol}),e.jsx("div",{className:"flex-1"}),a.showSparkline&&l.length>1&&e.jsx(u,{data:l,width:72,height:20,color:i}),e.jsxs("span",{className:"whitespace-nowrap text-right tabular-nums",children:[e.jsx("span",{className:"body-sm text-strong",children:p(s.rate)}),e.jsx("span",{className:"caption ml-2 font-bold",style:{color:i},children:b(s.changePct)})]})]},s.symbol)})})]})}const B=f({...d,component:g});export{B as fxBoardFrame};
@@ -0,0 +1 @@
1
+ import{g as n}from"./format-CfAcS4D8.js";function g(e,t=70,r=1){let l="242",a="90%";if(e){const o=getComputedStyle(e);l=o.getPropertyValue("--zf-accent-hue").trim()||"242",a=o.getPropertyValue("--zf-accent-sat").trim()||"90%"}return`hsla(${l}, ${a}, ${t}%, ${r})`}const i={text:"rgba(255, 255, 255, 0.85)",textSoft:"rgba(255, 255, 255, 0.6)",gameOver:n};function s(e,t,r,l,a){t.font='bold 12px "DM Sans", monospace',t.textAlign="left",t.fillStyle=i.textSoft,t.fillText("HI",10,22),t.fillStyle=a,t.fillText(String(l).padStart(4,"0"),30,22),t.textAlign="right",t.fillStyle=i.text,t.fillText(String(r).padStart(4,"0"),e.width-10,22)}export{i as G,g as a,s as d};
@@ -0,0 +1 @@
1
+ import{j as e}from"./react-qoZPGuNy.js";import{f as l,U as s}from"./index-C_O7gp2F.js";s.schema;function n({config:a}){return e.jsxs("div",{className:"flex h-full w-full items-end gap-3 pb-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-[5px] w-[5px] shrink-0 rounded-full",style:{background:"var(--color-highlight)",boxShadow:"0 0 8px var(--color-highlight)"}}),e.jsx("h2",{className:"body-md text-strong font-extrabold uppercase leading-none tracking-[0.14em]",children:a.title})]}),a.subtitle&&e.jsx("p",{className:"caption text-soft pl-[13px] leading-none",children:a.subtitle})]}),e.jsx("span",{className:"mb-[5px] h-px flex-1",style:{background:"linear-gradient(90deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 65%, transparent)"}})]})}const i=l({...s,component:n});export{i as headingFrame};
@@ -0,0 +1 @@
1
+ import{j as n}from"./react-qoZPGuNy.js";import{E as d,a as u,n as h}from"./market-data-CvmpLFSo.js";import{M as f}from"./metric-row-BVVhjsjK.js";import{f as x,b5 as m}from"./index-C_O7gp2F.js";import{F as i,s as p}from"./ui-Bq3RQsdJ.js";m.schema;function y(e,o){const[t,a,s]=e.split("-").map(Number),[l,r,c]=o.split("-").map(Number);return Math.round((Date.UTC(l,r-1,c)-Date.UTC(t,a-1,s))/864e5)}function b(e){const[o,t,a]=e.split("-").map(Number);return new Date(Date.UTC(o,t-1,a)).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"})}function C(e){return e<=0?"today":e===1?"tomorrow":`in ${e}d`}function j({config:e}){var l;if(!d[e.exchange])return n.jsx(i,{children:"unknown exchange"});const t=(l=u(e.exchange))==null?void 0:l.ymd,a=h(e.exchange,e.count),s=e.label.trim();return!t||a.length===0?n.jsx(i,{children:"no upcoming holidays on file"}):n.jsxs("div",{className:"flex h-full w-full flex-col",children:[s&&n.jsx("div",{className:"caption text-soft mb-1 shrink-0 uppercase tracking-[0.12em]",children:s}),n.jsx("div",{className:`min-h-0 flex-1 ${p}`,children:a.map(r=>n.jsx(f,{label:b(r),value:C(y(t,r))},r))})]})}const k=x({...m,component:j});export{k as holidayCalendarFrame};
@@ -0,0 +1 @@
1
+ import{r as s,j as e}from"./react-qoZPGuNy.js";import{f as l,V as o}from"./index-C_O7gp2F.js";import{F as i}from"./ui-Bq3RQsdJ.js";o.schema;function n({config:a}){const[t,r]=s.useState("loading");return s.useEffect(()=>r("loading"),[a.url]),t==="error"?e.jsx(i,{children:"image unavailable"}):e.jsxs("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden rounded-md",children:[t==="loading"&&e.jsx("div",{className:"absolute inset-0 z-10",children:e.jsx(i,{loading:!0,children:"loading image…"})}),e.jsx("img",{src:a.url,alt:a.alt,className:`h-full w-full transition-opacity duration-300 ${t==="loaded"?"opacity-100":"opacity-0"}`,style:{objectFit:a.fit},onLoad:()=>r("loaded"),onError:()=>r("error")})]})}const c=l({...o,component:n});export{c as imageFrame};