zframes 0.2.0 → 0.3.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 (68) hide show
  1. package/dist/index.js +866 -54
  2. package/package.json +5 -5
  3. package/runtime/assets/editor-DVTcqJo4.js +68 -0
  4. package/runtime/assets/editor-DnV0I9s-.css +1 -0
  5. package/runtime/assets/index-DEGnog6Q.css +1 -0
  6. package/runtime/assets/index-KRy1feFG.js +761 -0
  7. package/runtime/index.html +3 -3
  8. package/runtime/widget-icons/breakeven.png +0 -0
  9. package/runtime/widget-icons/breathing.png +0 -0
  10. package/runtime/widget-icons/btc-blocks.png +0 -0
  11. package/runtime/widget-icons/btc-difficulty.png +0 -0
  12. package/runtime/widget-icons/btc-fees.png +0 -0
  13. package/runtime/widget-icons/btc-hashrate.png +0 -0
  14. package/runtime/widget-icons/btc-mempool.png +0 -0
  15. package/runtime/widget-icons/calculator.png +0 -0
  16. package/runtime/widget-icons/checklist.png +0 -0
  17. package/runtime/widget-icons/coin-movers.png +0 -0
  18. package/runtime/widget-icons/countdown.png +0 -0
  19. package/runtime/widget-icons/day-meter.png +0 -0
  20. package/runtime/widget-icons/dex-volume-chart.png +0 -0
  21. package/runtime/widget-icons/dex-volume-treemap.png +0 -0
  22. package/runtime/widget-icons/dice.png +0 -0
  23. package/runtime/widget-icons/divider.png +0 -0
  24. package/runtime/widget-icons/drawdy.png +0 -0
  25. package/runtime/widget-icons/filings-feed.png +0 -0
  26. package/runtime/widget-icons/financial-stress.png +0 -0
  27. package/runtime/widget-icons/flappy-bird.png +0 -0
  28. package/runtime/widget-icons/fundamentals.png +0 -0
  29. package/runtime/widget-icons/holiday-calendar.png +0 -0
  30. package/runtime/widget-icons/journal-log.png +0 -0
  31. package/runtime/widget-icons/journal-open.png +0 -0
  32. package/runtime/widget-icons/journal-results.png +0 -0
  33. package/runtime/widget-icons/journal-score.png +0 -0
  34. package/runtime/widget-icons/labor-market.png +0 -0
  35. package/runtime/widget-icons/lightning-stats.png +0 -0
  36. package/runtime/widget-icons/link-grid.png +0 -0
  37. package/runtime/widget-icons/market-cap-treemap.png +0 -0
  38. package/runtime/widget-icons/marquee.png +0 -0
  39. package/runtime/widget-icons/mining-pools.png +0 -0
  40. package/runtime/widget-icons/national-debt.png +0 -0
  41. package/runtime/widget-icons/news-feed.png +0 -0
  42. package/runtime/widget-icons/open-interest.png +0 -0
  43. package/runtime/widget-icons/options-iv.png +0 -0
  44. package/runtime/widget-icons/options-oi-strike.png +0 -0
  45. package/runtime/widget-icons/options-put-call.png +0 -0
  46. package/runtime/widget-icons/pomodoro.png +0 -0
  47. package/runtime/widget-icons/portfolio-allocation.png +0 -0
  48. package/runtime/widget-icons/portfolio-holdings.png +0 -0
  49. package/runtime/widget-icons/portfolio-value.png +0 -0
  50. package/runtime/widget-icons/protocol-fees-treemap.png +0 -0
  51. package/runtime/widget-icons/protocol-tvl-chart.png +0 -0
  52. package/runtime/widget-icons/protocol-tvl-treemap.png +0 -0
  53. package/runtime/widget-icons/quote.png +0 -0
  54. package/runtime/widget-icons/returns-projector.png +0 -0
  55. package/runtime/widget-icons/risk-reward.png +0 -0
  56. package/runtime/widget-icons/rules-card.png +0 -0
  57. package/runtime/widget-icons/session-progress.png +0 -0
  58. package/runtime/widget-icons/short-volume.png +0 -0
  59. package/runtime/widget-icons/snake.png +0 -0
  60. package/runtime/widget-icons/spotify-embed.png +0 -0
  61. package/runtime/widget-icons/stopwatch.png +0 -0
  62. package/runtime/widget-icons/treasury-auctions.png +0 -0
  63. package/runtime/widget-icons/video.png +0 -0
  64. package/runtime/widget-icons/yield-curve.png +0 -0
  65. package/runtime/assets/editor-CY2XpG9x.js +0 -68
  66. package/runtime/assets/editor-DinyMxo6.css +0 -1
  67. package/runtime/assets/index-Bpmi3x1d.js +0 -597
  68. package/runtime/assets/index-CsheOEUr.css +0 -1
@@ -8,11 +8,11 @@
8
8
  <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png" />
9
9
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
10
10
  <title>zframes runtime</title>
11
- <script type="module" crossorigin src="/assets/index-Bpmi3x1d.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-KRy1feFG.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="/assets/react-qoZPGuNy.js">
13
- <link rel="modulepreload" crossorigin href="/assets/d3-B3esOK0k.js">
14
13
  <link rel="modulepreload" crossorigin href="/assets/liveline-C5zt2WuS.js">
15
- <link rel="stylesheet" crossorigin href="/assets/index-CsheOEUr.css">
14
+ <link rel="modulepreload" crossorigin href="/assets/d3-B3esOK0k.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/index-DEGnog6Q.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,68 +0,0 @@
1
- import{r as a,c as st,j as e,a as De}from"./react-qoZPGuNy.js";import{G as Te}from"./gridstack-BxxvPIFU.js";import{u as rt,F as nt,a as at,b as it,c as ct,t as ve}from"./index-Bpmi3x1d.js";import"./d3-B3esOK0k.js";import"./liveline-C5zt2WuS.js";/**
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 _e=(...t)=>t.filter((s,n,i)=>!!s&&s.trim()!==""&&i.indexOf(s)===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 lt=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 ot=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,n,i)=>i?i.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 Oe=t=>{const s=ot(t);return s.charAt(0).toUpperCase()+s.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 pe={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 ut=t=>{for(const s in t)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1},mt=a.createContext({}),dt=()=>a.useContext(mt),ft=a.forwardRef(({color:t,size:s,strokeWidth:n,absoluteStrokeWidth:i,className:v="",children:c,iconNode:d,...o},x)=>{const{size:f=24,strokeWidth:l=2,absoluteStrokeWidth:b=!1,color:N="currentColor",className:z=""}=dt()??{},k=i??b?Number(n??l)*24/Number(s??f):n??l;return a.createElement("svg",{ref:x,...pe,width:s??f??pe.width,height:s??f??pe.height,stroke:t??N,strokeWidth:k,className:_e("lucide",z,v),...!c&&!ut(o)&&{"aria-hidden":"true"},...o},[...d.map(([A,R])=>a.createElement(A,R)),...Array.isArray(c)?c:[c]])});/**
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 q=(t,s)=>{const n=a.forwardRef(({className:i,...v},c)=>a.createElement(ft,{ref:c,iconNode:s,className:_e(`lucide-${lt(Oe(t))}`,`lucide-${t}`,i),...v}));return n.displayName=Oe(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 ht=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],pt=q("check",ht);/**
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 xt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],gt=q("chevron-down",xt);/**
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 bt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],yt=q("plus",bt);/**
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 zt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],jt=q("search",zt);/**
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 vt=[["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"}]],Nt=q("sliders-horizontal",vt);/**
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 kt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],te=q("x",kt),We=["xyz:TSLA","xyz:NVDA","xyz:AAPL","xyz:MSFT","xyz:GOOGL","xyz:AMD","xyz:META","xyz:AMZN","xyz:NFLX","xyz:AVGO","xyz:MSTR","xyz:COIN","xyz:HOOD","xyz:PLTR","BTC","ETH","SOL","HYPE","BNB","XRP","DOGE","LINK","AVAX","SUI"],Ue=new Map(We.map((t,s)=>[t,s]));function X(t){const s=t.indexOf(":");return(s===-1?t:t.slice(s+1)).toUpperCase()}function Ne(t){return t.includes(":")?"Stock":"Crypto"}function Ct(t){const s=t.indexOf(":");if(s!==-1){const n=t.slice(s+1);return`https://assets.parqet.com/logos/symbol/${encodeURIComponent(n)}?format=png`}return`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}function St(t){const s=t.trim().replace(/\s+/g,"");if(!s)return"";const n=s.indexOf(":");return n===-1?s.toUpperCase():`${s.slice(0,n).toLowerCase()}:${s.slice(n+1).toUpperCase()}`}function be(t,s,n=Ue.get(t)??1e4){return{symbol:t,ticker:X(t),kind:Ne(t),markPx:s==null?void 0:s.markPx,changePct:s==null?void 0:s.changePct,rank:n}}function Ge(t){if(!Number.isFinite(t))return"";const s=t;return s>=1e3?`$${s.toLocaleString(void 0,{maximumFractionDigits:0})}`:s>=100?`$${s.toFixed(2)}`:s>=1?`$${s.toFixed(3)}`:`$${s.toPrecision(3)}`}function wt(t){if(!Number.isFinite(t))return"";const s=t;return`${s>=0?"+":""}${s.toFixed(2)}%`}function qe(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function w(t,s){return t!=null&&t.type?Array.isArray(t.type)?t.type.includes(s):t.type===s:!1}function Ke(t){const s=t==null?void 0:t.items;return!!s&&w(t,"array")&&w(s,"string")}function At(t){var s,n,i;try{const c=ve(t.schema,{io:"input"}).properties??{};if(w(c.symbol,"string"))return{kind:"single"};if(Ke(c.symbols))return{kind:"symbols",minItems:(s=c.symbols)==null?void 0:s.minItems,maxItems:(n=c.symbols)==null?void 0:n.maxItems};const d=c.holdings,o=((i=d==null?void 0:d.items)==null?void 0:i.properties)??{};if(w(d,"array")&&w(o.symbol,"string"))return{kind:"holdings",minItems:d==null?void 0:d.minItems,maxItems:d==null?void 0:d.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"}:t.name==="allocation"?{kind:"holdings"}:null}function Rt(t,s){return t.kind==="single"?typeof s.symbol=="string"&&s.symbol?[s.symbol]:[]:t.kind==="symbols"?Array.isArray(s.symbols)?s.symbols.filter(n=>typeof n=="string"):[]:Array.isArray(s.holdings)?s.holdings.map(n=>qe(n)&&typeof n.symbol=="string"?n.symbol:"").filter(Boolean):[]}const Mt=new Set(["symbol","symbols","holdings"]);function ke(t){const s=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return s?s.charAt(0).toUpperCase()+s.slice(1):t}function Et(t){let s;try{s=ve(t.schema,{io:"input"})}catch{return[]}return Object.entries(s.properties??{}).filter(([n])=>!Mt.has(n)).map(([n,i])=>({key:n,label:ke(n),shape:i}))}const Pe=["xyz:TSLA","xyz:NVDA","xyz:AAPL","xyz:MSFT","xyz:META","xyz:AMD","xyz:GOOGL","xyz:AMZN"];function Lt(t,s){return t==="symbol"?Pe[s%Pe.length]:t==="url"?"https://":t==="text"?"New note":t==="title"?"Heading":ke(t)||"value"}function ye(t,s,n=0){var i;if(t.default!==void 0)return t.default;if(Array.isArray(t.enum)&&t.enum.length)return t.enum[0];if(w(t,"string"))return Lt(s,n);if(w(t,"number")||w(t,"integer"))return t.exclusiveMinimum!==void 0?t.exclusiveMinimum+1:t.minimum??0;if(w(t,"boolean"))return!1;if(w(t,"array")){const v=t.items??{},c=s==="symbols"?"symbol":s;return Array.from({length:t.minItems??0},(d,o)=>ye(v,c,o))}if(w(t,"object")){const v={};for(const c of t.required??[]){const d=(i=t.properties)==null?void 0:i[c];d&&(v[c]=ye(d,c,n))}return v}return null}function $t(t){const s=t.schema.safeParse({});if(s.success)return s.data;let n;try{n=ve(t.schema,{io:"input"})}catch{return{}}const i={},v=new Set(n.required??[]);for(const[d,o]of Object.entries(n.properties??{}))v.has(d)&&(i[d]=ye(o,d));const c=t.schema.safeParse(i);return c.success?c.data:i}const It='<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 Ft(t,s){const n=a.useMemo(()=>t.find(x=>x.capabilities.includes("day-stats")),[t]),[i,v]=a.useState({}),[c,d]=a.useState(!1);return a.useEffect(()=>{if(!s||!(n!=null&&n.getDayStats)){d(!1);return}let x=!1;return d(!0),Promise.allSettled([n.getDayStats(),n.getDayStats(["xyz:*"])]).then(f=>{if(x)return;const l={};for(const b of f)b.status==="fulfilled"&&Object.assign(l,b.value);v(l)}).finally(()=>{x||d(!1)}),()=>{x=!0}},[s,n]),{options:a.useMemo(()=>{const x=new Map;return We.forEach((f,l)=>{x.set(f,be(f,i[f],l))}),Object.entries(i).forEach(([f,l])=>{x.set(f,be(f,l,Ue.get(f)??1e4))}),[...x.values()].sort((f,l)=>f.rank!==l.rank?f.rank-l.rank:f.kind!==l.kind?f.kind==="Stock"?-1:1:f.ticker.localeCompare(l.ticker))},[i]),loading:c}}function Yt({spec:t,registry:s,onSave:n,customiseButtonTarget:i,onAccentHueChange:v}){const c=rt(),d=a.useRef(null),o=a.useRef(null),x=a.useRef(!1),f=a.useRef(new Map),l=a.useRef(new Map),b=a.useRef(new Map),N=a.useRef([]),z=a.useRef(t.theme.accentHue),k=a.useRef(t.theme.accentSat),A=a.useRef(t.grid.gap),R=a.useRef(t.appearance.radius),g=a.useRef(t.appearance.borderStrength),y=a.useRef(t.appearance.surfaceOpacity),C=a.useRef(t.appearance.density),_=a.useRef(t.appearance.elevation),K=a.useRef(0),[S,se]=a.useState(!1),Ye=Ft(c,S),[Wt,V]=a.useState(t.frames.length),[M,re]=a.useState(t.theme.accentHue),[$,ne]=a.useState(t.theme.accentSat),[E,ae]=a.useState(t.grid.gap),[I,ie]=a.useState(t.appearance.radius),[F,ce]=a.useState(t.appearance.borderStrength),[D,le]=a.useState(t.appearance.surfaceOpacity),[T,oe]=a.useState(t.appearance.density),[O,ue]=a.useState(t.appearance.elevation),[P,Ce]=a.useState("cosmetics"),[me,H]=a.useState(null),Se=a.useRef(null);Se.current=me,a.useEffect(()=>{v==null||v(M)},[M,v]),a.useEffect(()=>{var r;(r=o.current)==null||r.margin(E/2)},[E]);const we=a.useRef(c);we.current=c;const G=a.useRef(s);G.current=s;const Ae=a.useMemo(()=>[...s.values()].sort((r,m)=>r.name.localeCompare(m.name)),[s]),de=a.useCallback(r=>r?$t(r):{},[]),fe=a.useCallback(r=>{let m=`${r}-${++K.current}`;for(;f.current.has(m);)m=`${r}-${++K.current}`;return m},[]),J=a.useRef(null),B=a.useCallback(r=>{const m=b.current.get(r),h=f.current.get(r);if(!m||!h)return;let u=l.current.get(r);u||(m.innerHTML="",u=st.createRoot(m),l.current.set(r,u)),u.render(e.jsx(nt,{providers:we.current,children:e.jsx(at.Provider,{value:p=>{var j;return(j=J.current)==null?void 0:j.call(J,r,p)},children:e.jsx(it,{instance:h,registry:G.current,className:"zf-fill"})})}))},[]),Ze=a.useCallback((r,m)=>{const h=f.current.get(r);h&&(f.current.set(r,{...h,config:{...h.config,...m}}),B(r))},[B]);J.current=Ze;const Re=a.useCallback(r=>{var u;const m=o.current;if(!m)return;const h=r.getAttribute("gs-id");h&&((u=l.current.get(h))==null||u.unmount(),l.current.delete(h),b.current.delete(h),f.current.delete(h),Se.current===h&&H(null)),m.removeWidget(r,!0),V(m.getGridItems().length)},[]),Y=a.useCallback(r=>{if(!r.querySelector(".zf-cfg-btn")){const m=document.createElement("button");m.className="zf-cfg-btn",m.type="button",m.title="Edit frame",m.setAttribute("aria-label","Edit frame"),m.innerHTML=It,m.addEventListener("click",h=>{h.stopPropagation();const u=r.getAttribute("gs-id");u&&H(u)}),r.appendChild(m)}if(!r.querySelector(".zf-del-btn")){const m=document.createElement("button");m.className="zf-del-btn",m.type="button",m.title="Remove frame",m.innerHTML="&times;",m.addEventListener("click",h=>{h.stopPropagation(),Re(r)}),r.appendChild(m)}},[Re]),Me=a.useCallback(r=>{var m,h;(m=r.querySelector(".zf-cfg-btn"))==null||m.remove(),(h=r.querySelector(".zf-del-btn"))==null||h.remove()},[]),Q=a.useCallback((r,m=!1)=>{const h=G.current.get(r.frame),u=h==null?void 0:h.layout,p=document.createElement("div");p.className="grid-stack-item",p.setAttribute("gs-id",r.id),p.setAttribute("data-frame",r.frame),m?p.setAttribute("gs-auto-position","true"):(p.setAttribute("gs-x",String(r.position.x)),p.setAttribute("gs-y",String(r.position.y))),p.setAttribute("gs-w",String(r.position.w)),p.setAttribute("gs-h",String(r.position.h)),u!=null&&u.minW&&p.setAttribute("gs-min-w",String(u.minW)),u!=null&&u.minH&&p.setAttribute("gs-min-h",String(u.minH)),u!=null&&u.maxW&&p.setAttribute("gs-max-w",String(u.maxW)),u!=null&&u.maxH&&p.setAttribute("gs-max-h",String(u.maxH));const j=document.createElement("div");return j.className="grid-stack-item-content",p.appendChild(j),b.current.set(r.id,j),p},[]),Z=a.useCallback(r=>{const m=o.current;if(m){l.current.forEach(h=>h.unmount()),l.current.clear(),b.current.clear(),f.current=new Map(r.map(h=>[h.id,h])),m.removeAll(!0),m.el.querySelectorAll(".grid-stack-item").forEach(h=>h.remove()),m.batchUpdate();for(const h of r){const u=Q(h);m.el.appendChild(u),m.makeWidget(u),B(h.id)}m.batchUpdate(!1),V(r.length)}},[Q,B]),Ee=a.useCallback(r=>{var W,L;const m=o.current;if(!m)return;const h=G.current.get(r),u=fe(r),p={id:u,frame:r,position:{x:0,y:0,w:((W=h==null?void 0:h.layout)==null?void 0:W.w)??4,h:((L=h==null?void 0:h.layout)==null?void 0:L.h)??3},config:de(h)};f.current.set(u,p);const j=Q(p,!0);m.el.appendChild(j),m.makeWidget(j),B(u),Y(j),V(m.getGridItems().length),H(u)},[Q,Y,de,B,fe]);a.useEffect(()=>{if(!d.current||x.current)return;x.current=!0;const r=Te.init({column:t.grid.columns,cellHeight:t.grid.rowHeight,margin:t.grid.gap/2,float:!1,animate:!0,acceptWidgets:!0,disableDrag:!0,disableResize:!0},d.current);return o.current=r,Z(t.frames),r.on("dropped",(m,h,u)=>{var Ie,Fe;const p=u==null?void 0:u.el;if(!p)return;const j=p.querySelector(".grid-stack-item-content"),W=p.getAttribute("data-frame");if(!j||!W)return;const L=p.getAttribute("gs-id")||fe(W);p.setAttribute("gs-id",L);const U=G.current.get(W),tt={id:L,frame:W,position:{x:(u==null?void 0:u.x)??0,y:(u==null?void 0:u.y)??0,w:(u==null?void 0:u.w)??((Ie=U==null?void 0:U.layout)==null?void 0:Ie.w)??4,h:(u==null?void 0:u.h)??((Fe=U==null?void 0:U.layout)==null?void 0:Fe.h)??3},config:de(U)};f.current.set(L,tt),b.current.set(L,j),B(L),Y(p),V(r.getGridItems().length),H(L)}),r.on("removed",()=>V(r.getGridItems().length)),()=>{r.off("dropped"),r.off("removed"),l.current.forEach(m=>m.unmount()),l.current.clear(),b.current.clear(),r.destroy(!1),o.current=null,x.current=!1}},[]),a.useEffect(()=>{const r=o.current;r&&(r.enableMove(S),r.enableResize(S),S?r.getGridItems().forEach(Y):r.getGridItems().forEach(Me))},[S,Y,Me]),a.useEffect(()=>{!S||P!=="frames"||!o.current||Te.setupDragIn(".zf-newwidget",{appendTo:"body",helper:r=>{const h=(r.closest(".zf-newwidget")??r).dataset.frame??"",u=G.current.get(h),p=u==null?void 0:u.layout,j=document.createElement("div");return j.className="grid-stack-item",j.setAttribute("data-frame",h),j.setAttribute("gs-w",String((p==null?void 0:p.w)??4)),j.setAttribute("gs-h",String((p==null?void 0:p.h)??3)),p!=null&&p.minW&&j.setAttribute("gs-min-w",String(p.minW)),p!=null&&p.minH&&j.setAttribute("gs-min-h",String(p.minH)),p!=null&&p.maxW&&j.setAttribute("gs-max-w",String(p.maxW)),p!=null&&p.maxH&&j.setAttribute("gs-max-h",String(p.maxH)),j.innerHTML=`<div class="grid-stack-item-content" data-frame="${h}"></div>`,j}})},[S,P,Ae]);const ee=a.useCallback(()=>{const r=o.current,m=[];if(r)for(const h of r.getGridItems()){const u=h.getAttribute("gs-id");if(!u)continue;const p=f.current.get(u);if(!p)continue;const j=h.gridstackNode;m.push({...p,position:{x:(j==null?void 0:j.x)??p.position.x,y:(j==null?void 0:j.y)??p.position.y,w:(j==null?void 0:j.w)??p.position.w,h:(j==null?void 0:j.h)??p.position.h}})}return m.sort((h,u)=>h.position.y-u.position.y||h.position.x-u.position.x),{...t,grid:{...t.grid,gap:E},theme:{...t.theme,accentHue:M,accentSat:$},appearance:{...t.appearance,radius:I,borderStrength:F,surfaceOpacity:D,density:T,elevation:O},frames:m}},[t,M,$,E,I,F,D,T,O]),Le=a.useCallback(r=>{const m=new Blob([`${JSON.stringify(r,null,2)}
67
- `],{type:"application/json"}),h=URL.createObjectURL(m),u=document.createElement("a");u.href=h,u.download="dashboard.json",u.click(),setTimeout(()=>URL.revokeObjectURL(h),0)},[]),Xe=a.useCallback(()=>{N.current=ee().frames,z.current=M,k.current=$,A.current=E,R.current=I,g.current=F,y.current=D,C.current=T,_.current=O,se(!0)},[ee,M,$,E,I,F,D,T,O]),Je=a.useCallback(()=>{Z(N.current),re(z.current),ne(k.current),ae(A.current),ie(R.current),ce(g.current),le(y.current),oe(C.current),ue(_.current),H(null),se(!1)},[Z]),Qe=a.useCallback(()=>{window.confirm("Remove all frames from the dashboard?")&&(Z([]),H(null))},[Z]),et=a.useCallback(async()=>{const r=ee();se(!1),H(null),n?await n(r):Le(r)},[ee,n,Le]),$e=()=>e.jsx("button",{type:"button",className:"zf-btn zf-btn--icon",onClick:Xe,"aria-label":"Customise",title:"Customise",children:e.jsx(Nt,{size:18,"aria-hidden":"true"})}),he=S&&me?f.current.get(me):void 0;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:ct}),i&&!S?De.createPortal($e(),i):null,e.jsxs("div",{className:S?"zf-editor zf-customise":"zf-editor",style:{"--zf-accent-hue":M,"--zf-accent-sat":`${$}%`,"--zf-frame-radius":`${I}px`,"--zf-border-alpha":F,"--zf-surface-opacity":D,"--zf-density":T,"--zf-elevation":O},children:[(S||!i)&&e.jsxs("div",{className:"zf-editor-bar",children:[S&&e.jsx("span",{className:"zf-editor-hint",children:"drag to move · drag a corner to resize · hover to delete"}),e.jsx("div",{className:"zf-editor-bar-spacer"}),S?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"zf-btn zf-btn--danger",onClick:Qe,children:"Clear"}),e.jsx("button",{type:"button",className:"zf-btn zf-btn--ghost",onClick:Je,children:"Cancel"}),e.jsx("button",{type:"button",className:"zf-btn zf-btn--primary",onClick:et,children:"Save"})]}):$e()]}),e.jsxs("div",{className:"zf-editor-main",children:[e.jsx("div",{className:"zf-editor-grid",children:e.jsx("div",{ref:d,className:"grid-stack"})}),e.jsx("aside",{className:"zf-rail","aria-hidden":!S,inert:!S,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":P==="cosmetics",className:P==="cosmetics"?"zf-rail-tab is-active":"zf-rail-tab",onClick:()=>Ce("cosmetics"),children:"Cosmetics"}),e.jsx("button",{type:"button",role:"tab","aria-selected":P==="frames",className:P==="frames"?"zf-rail-tab is-active":"zf-rail-tab",onClick:()=>Ce("frames"),children:"Frames"})]}),P==="cosmetics"&&e.jsxs(e.Fragment,{children:[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 ",M,"°"]}),M!==242&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>re(242),children:"Reset"})]}),e.jsx("input",{type:"range",className:"zf-hue-slider",min:0,max:360,value:M,"aria-label":"Accent hue",onChange:r=>re(Number(r.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:[$!==90&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ne(90),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[$,"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:100,value:$,"aria-label":"Accent saturation",onChange:r=>ne(Number(r.target.value))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Layout"}),e.jsxs("div",{className:"zf-theme-row",children:[e.jsx("span",{className:"zf-theme-val",children:"Frame gap"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[E!==12&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ae(12),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[E,"px"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:12,value:E,"aria-label":"Frame gap",onChange:r=>ae(Number(r.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:[I!==18&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ie(18),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[I,"px"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:32,value:I,"aria-label":"Corner radius",onChange:r=>ie(Number(r.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:[F!==.22&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ce(.22),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(F*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:1,step:.01,value:F,"aria-label":"Border strength",onChange:r=>ce(Math.round(Number(r.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:[D!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>le(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(D*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.3,max:1,step:.05,value:D,"aria-label":"Card opacity",onChange:r=>le(Math.round(Number(r.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:[T!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>oe(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(T*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.6,max:1.4,step:.05,value:T,"aria-label":"Card density",onChange:r=>oe(Math.round(Number(r.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:[O!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ue(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[O.toFixed(1),"×"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:2,step:.1,value:O,"aria-label":"Card elevation",onChange:r=>ue(Math.round(Number(r.target.value)*10)/10)})]})]}),P==="frames"&&e.jsxs("section",{children:[e.jsx("h3",{className:"zf-rail-title",children:"Add a frame"}),e.jsx("p",{className:"zf-palette-hint",children:"Click to add, or drag onto the grid."}),e.jsx("div",{className:"zf-palette",children:Ae.map(r=>e.jsxs("div",{className:"zf-newwidget","data-frame":r.name,role:"button",tabIndex:0,title:`Add ${r.name.replace(/-/g," ")}`,onClick:()=>Ee(r.name),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),Ee(r.name))},children:[r.iconUrl&&e.jsx("img",{className:"zf-newwidget-icon",src:r.iconUrl,alt:"",loading:"lazy",draggable:!1}),e.jsxs("div",{className:"zf-newwidget-copy",children:[e.jsx("div",{className:"zf-newwidget-name",children:r.name.replace(/-/g," ")}),e.jsx("div",{className:"zf-newwidget-desc",children:r.description})]})]},r.name))})]})]})})]})]}),he?De.createPortal(e.jsx(Dt,{instance:he,registry:s,instancesRef:f,symbolUniverse:Ye,accentHue:M,onApply:r=>B(r),onClose:()=>H(null)},he.id),document.body):null]})}function Dt({instance:t,registry:s,instancesRef:n,symbolUniverse:i,accentHue:v,onApply:c,onClose:d}){const o=s.get(t.frame),x=a.useMemo(()=>o?At(o):null,[o]),f=a.useMemo(()=>o?Et(o):[],[o]),[l,b]=a.useState(()=>({...t.config??{}})),[N,z]=a.useState(null),k=t.id,A=a.useCallback(y=>{if(b(y),o){const _=o.schema.safeParse(y);if(!_.success){z(_.error.issues.map(K=>`${K.path.join(".")||"(root)"}: ${K.message}`).join(`
68
- `));return}}z(null);const C=n.current.get(k);C&&(n.current.set(k,{...C,config:y}),c(k))},[o,k,n,c]);a.useEffect(()=>{const y=C=>{C.key==="Escape"&&d()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[d]);const R=(y,C)=>A({...l,[y]:C}),g=t.frame.replace(/-/g," ");return e.jsx("div",{className:"zf-dialog-backdrop",style:{"--zf-accent-hue":v},onMouseDown:y=>{y.target===y.currentTarget&&d()},children:e.jsxs("div",{className:"zf-dialog",role:"dialog","aria-modal":"true","aria-label":`Configure ${g}`,children:[e.jsxs("header",{className:"zf-dialog-head",children:[e.jsxs("h3",{className:"zf-dialog-title",children:["Configure · ",g]}),e.jsx("button",{type:"button",className:"zf-dialog-close",onClick:d,"aria-label":"Close",title:"Close",children:e.jsx(te,{size:16,"aria-hidden":"true"})})]}),e.jsxs("div",{className:"zf-dialog-body",children:[x&&e.jsx(Bt,{control:x,config:l,loading:i.loading,options:i.options,onChangeSymbol:y=>A({...l,symbol:y}),onChangeSymbols:y=>A({...l,symbols:y}),onChangeHoldings:y=>A({...l,holdings:y})}),f.map(y=>e.jsx(Tt,{field:y,value:l[y.key],onChange:C=>R(y.key,C)},y.key)),!x&&f.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:d,children:"Done"})})]})})}function Tt({field:t,value:s,onChange:n}){const{key:i,label:v,shape:c}=t,d=`zf-cfg-${i}`,o=c.description;if(w(c,"boolean")){const f=typeof s=="boolean"?s:!!c.default;return e.jsxs("label",{className:"zf-checkbox",title:o,children:[e.jsx("input",{type:"checkbox",checked:f,onChange:l=>n(l.target.checked)}),v]})}const x=Array.isArray(c.enum)&&c.enum.every(f=>typeof f=="string")?c.enum:null;if(x&&x.length>0){const f=typeof c.default=="string"?c.default:x[0],l=typeof s=="string"&&x.includes(s)?s:f;return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:d,title:o,children:v}),e.jsx("select",{id:d,className:"zf-select",value:l,onChange:b=>n(b.target.value),children:x.map(b=>e.jsx("option",{value:b,children:ke(b)},b))})]})}return w(c,"integer")||w(c,"number")?e.jsx(Ot,{id:d,field:t,value:s,onChange:n}):Ke(c)?e.jsx(Ht,{id:d,field:t,value:s,onChange:n}):e.jsx(Pt,{id:d,field:t,value:s,onChange:n})}function Ot({id:t,field:s,value:n,onChange:i}){const{label:v,shape:c}=s,d=c.description,o=typeof c.minimum=="number"?c.minimum:void 0,x=typeof c.maximum=="number"?c.maximum:void 0,f=w(c,"integer"),l=f?1:"any",b=typeof c.default=="number"?c.default:o??0,N=typeof n=="number"&&Number.isFinite(n)?n:void 0;if(o!==void 0&&x!==void 0){const z=N??b;return e.jsxs("div",{className:"zf-field",children:[e.jsxs("div",{className:"zf-field-row",children:[e.jsx("label",{htmlFor:t,title:d,children:v}),e.jsx("span",{className:"zf-field-num",children:z})]}),e.jsx("input",{id:t,type:"range",className:"zf-range",min:o,max:x,step:l,value:z,onChange:k=>i(f?Math.round(Number(k.target.value)):Number(k.target.value))})]})}return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:d,children:v}),e.jsx("input",{id:t,type:"number",className:"zf-input",min:o,max:x,step:l,value:n==null?"":String(n),onChange:z=>i(z.target.value===""?"":Number(z.target.value))})]})}function Pt({id:t,field:s,value:n,onChange:i}){const{key:v,label:c,shape:d}=s,o=d.description,x=typeof n=="string"?n:"",f=typeof d.default=="string"?d.default:"",l=typeof d.default=="string"&&/^#[0-9a-f]{6}$/i.test(d.default)?d.default:null;if(v==="color"||l){const b=/^#[0-9a-f]{6}$/i.test(x)?x:l??"#8b8df9";return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:o,children:c}),e.jsxs("div",{className:"zf-color-row",children:[e.jsx("input",{type:"color",className:"zf-color",value:b,"aria-label":`${c} swatch`,onChange:N=>i(N.target.value)}),e.jsx("input",{id:t,className:"zf-input",value:x,placeholder:f,spellCheck:!1,onChange:N=>i(N.target.value)})]})]})}return v==="text"?e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:o,children:c}),e.jsx("textarea",{id:t,className:"zf-textarea zf-textarea--prose",value:x,placeholder:f,onChange:b=>i(b.target.value)})]}):e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:o,children:c}),e.jsx("input",{id:t,className:"zf-input",value:x,placeholder:f,spellCheck:!1,onChange:b=>i(b.target.value)})]})}function Ht({id:t,field:s,value:n,onChange:i}){const{label:v,shape:c}=s,d=c.description,o=Array.isArray(n)?n.filter(z=>typeof z=="string"):[],[x,f]=a.useState(""),l=typeof c.maxItems=="number"?c.maxItems:void 0,b=l!==void 0&&o.length>=l,N=z=>{const k=z.trim().toUpperCase();f(""),!(!k||o.includes(k)||b)&&i([...o,k])};return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:d,children:v}),o.length>0&&e.jsx("div",{className:"zf-taglist",children:o.map(z=>e.jsxs("span",{className:"zf-tag",children:[z,e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${z}`,onClick:()=>i(o.filter(k=>k!==z)),children:e.jsx(te,{size:12,"aria-hidden":"true"})})]},z))}),e.jsx("input",{id:t,className:"zf-input",value:x,disabled:b,spellCheck:!1,placeholder:b?"Maximum reached":"Type a code, Enter to add",onChange:z=>f(z.target.value),onBlur:()=>N(x),onKeyDown:z=>{z.key==="Enter"||z.key===","?(z.preventDefault(),N(x)):z.key==="Backspace"&&x===""&&o.length>0&&i(o.slice(0,-1))}})]})}function Bt({control:t,config:s,loading:n,options:i,onChangeSymbol:v,onChangeSymbols:c,onChangeHoldings:d}){const o=Rt(t,s);if(t.kind==="single"){const l=o[0]??"";return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(xe,{title:"Ticker",detail:l?X(l):"None",loading:n}),l?e.jsx(je,{symbol:l,option:ze(l,i)}):null,e.jsx(ge,{loading:n,options:i,selectedSymbols:l?[l]:[],placeholder:"Search TSLA, BTC...",onSelect:v})]})}if(t.kind==="symbols"){const l=typeof t.maxItems=="number"&&o.length>=t.maxItems;return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(xe,{title:"Tickers",detail:He(o.length,t),loading:n}),e.jsx(_t,{symbols:o,options:i,onRemove:b=>c(o.filter(N=>N!==b))}),e.jsx(ge,{disabled:l,loading:n,options:i,selectedSymbols:o,placeholder:l?"Maximum tickers added":"Add ticker",keepOpenOnSelect:!0,onSelect:b=>{o.includes(b)||l||c([...o,b])}})]})}const x=Array.isArray(s.holdings)?s.holdings.filter(qe):[],f=typeof t.maxItems=="number"&&x.length>=t.maxItems;return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(xe,{title:"Holding tickers",detail:He(x.length,t),loading:n}),e.jsx("div",{className:"zf-holding-list",children:x.map((l,b)=>{const N=typeof l.symbol=="string"?l.symbol:"";return e.jsxs("div",{className:"zf-holding-row",children:[e.jsxs("div",{className:"zf-holding-main",children:[N?e.jsx(je,{symbol:N,option:ze(N,i),compact:!0}):e.jsx("span",{className:"zf-symbol-empty",children:"No ticker"}),typeof l.amount=="number"&&e.jsxs("span",{className:"zf-holding-amount",children:["x ",l.amount]})]}),e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${N||"holding"}`,onClick:()=>{d(x.filter((z,k)=>k!==b))},children:e.jsx(te,{size:13,"aria-hidden":"true"})})]},`${N}-${b}`)})}),e.jsx(ge,{disabled:f,loading:n,options:i,selectedSymbols:o,placeholder:f?"Maximum holdings added":"Add holding",keepOpenOnSelect:!0,onSelect:l=>{f||d([...x,{symbol:l,amount:1}])}})]})}function xe({title:t,detail:s,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:s})]}),e.jsx("span",{className:n?"zf-symbol-source is-loading":"zf-symbol-source",children:n?"Loading":"Live list"})]})}function He(t,s){return typeof s.maxItems=="number"?`${t}/${s.maxItems}`:typeof s.minItems=="number"&&t<s.minItems?`${t}/${s.minItems}+`:String(t)}function ze(t,s){return s.find(n=>n.symbol===t)??be(t)}function _t({symbols:t,options:s,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(i=>e.jsxs("span",{className:"zf-symbol-chip",children:[e.jsx(je,{symbol:i,option:ze(i,s),compact:!0}),e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${i}`,onClick:()=>n(i),children:e.jsx(te,{size:13,"aria-hidden":"true"})})]},i))})}function je({symbol:t,option:s,compact:n=!1}){return e.jsxs("span",{className:n?"zf-selected-symbol is-compact":"zf-selected-symbol",children:[e.jsx(Ve,{symbol:t}),e.jsxs("span",{className:"zf-selected-symbol-text",children:[e.jsx("strong",{children:X(t)}),!n&&e.jsx("em",{children:t})]}),!n&&s.markPx!==void 0&&e.jsx("span",{className:"zf-selected-symbol-price",children:Ge(s.markPx)})]})}function ge({disabled:t=!1,loading:s,options:n,selectedSymbols:i,placeholder:v,keepOpenOnSelect:c=!1,onSelect:d}){const[o,x]=a.useState(""),[f,l]=a.useState(!1),b=a.useMemo(()=>new Set(i),[i]),N=a.useMemo(()=>new Set(n.map(g=>g.symbol)),[n]),z=St(o),k=a.useMemo(()=>{const g=o.trim().toLowerCase();return(g?n.filter(C=>C.ticker.toLowerCase().includes(g)||C.symbol.toLowerCase().includes(g)):n.slice(0,28)).slice().sort((C,_)=>Be(C,g)-Be(_,g)).slice(0,36)},[n,o]),A=a.useMemo(()=>{if(!z)return[];const g=z.includes(":")?[z]:[`xyz:${z}`,z];return g.filter((y,C)=>g.indexOf(y)===C&&!N.has(y)&&!b.has(y))},[N,z,b]),R=g=>{!g||c&&b.has(g)||(d(g),x(""),l(c))};return e.jsxs("div",{className:"zf-symbol-combo",onBlur:g=>{g.currentTarget.contains(g.relatedTarget)||l(!1)},children:[e.jsxs("div",{className:t?"zf-symbol-search is-disabled":"zf-symbol-search",children:[e.jsx(jt,{size:14,"aria-hidden":"true"}),e.jsx("input",{value:o,disabled:t,placeholder:v,"aria-label":v,role:"combobox","aria-expanded":f,onFocus:()=>l(!0),onChange:g=>{x(g.target.value),l(!0)},onKeyDown:g=>{var y;g.key==="Enter"&&(g.preventDefault(),R(((y=k[0])==null?void 0:y.symbol)??A[0]??z))}}),e.jsx(gt,{size:14,"aria-hidden":"true"})]}),f&&!t&&e.jsxs("div",{className:"zf-symbol-menu",role:"listbox",children:[s&&e.jsx("div",{className:"zf-symbol-menu-status",children:"Loading live universe..."}),k.map(g=>{const y=b.has(g.symbol);return e.jsxs("button",{type:"button",className:y?"zf-symbol-option is-selected":"zf-symbol-option",disabled:c&&y,role:"option","aria-selected":y,onMouseDown:C=>{C.preventDefault(),R(g.symbol)},onClick:C=>{C.detail===0&&R(g.symbol)},children:[e.jsx(Ve,{symbol:g.symbol}),e.jsxs("span",{className:"zf-symbol-option-main",children:[e.jsx("strong",{children:g.ticker}),e.jsx("em",{children:g.symbol})]}),e.jsxs("span",{className:"zf-symbol-option-meta",children:[e.jsx("span",{children:Ge(g.markPx)||g.kind}),g.changePct!==void 0&&e.jsx("span",{className:g.changePct>=0?"zf-symbol-change is-up":"zf-symbol-change is-down",children:wt(g.changePct)})]}),y&&e.jsx(pt,{size:14,"aria-hidden":"true"})]},g.symbol)}),A.map(g=>e.jsxs("button",{type:"button",className:"zf-symbol-option zf-symbol-option--custom",onMouseDown:y=>{y.preventDefault(),R(g)},onClick:y=>{y.detail===0&&R(g)},children:[e.jsx("span",{className:"zf-symbol-custom-icon",children:e.jsx(yt,{size:13,"aria-hidden":"true"})}),e.jsxs("span",{className:"zf-symbol-option-main",children:[e.jsx("strong",{children:X(g)}),e.jsx("em",{children:g})]}),e.jsx("span",{className:"zf-symbol-option-meta",children:e.jsx("span",{children:Ne(g)})})]},g)),!s&&k.length===0&&A.length===0&&e.jsx("div",{className:"zf-symbol-menu-status",children:"No matches"})]})]})}function Be(t,s){if(!s)return t.rank;const n=t.ticker.toLowerCase(),i=t.symbol.toLowerCase();return n===s||i===s?-40+t.rank/1e4:n.startsWith(s)?-20+t.rank/1e4:i.startsWith(s)?-10+t.rank/1e4:t.rank}function Ve({symbol:t}){const s=Ne(t).toLowerCase(),[n,i]=a.useState(!1);return a.useEffect(()=>i(!1),[t]),n?e.jsx("span",{className:`zf-symbol-avatar zf-symbol-avatar--${s}`,children:X(t).slice(0,2)}):e.jsx("img",{className:`zf-symbol-avatar zf-symbol-avatar--logo zf-symbol-avatar--${s}`,src:Ct(t),alt:"","aria-hidden":"true",draggable:!1,loading:"lazy",onError:()=>i(!0)})}export{Yt as DashboardEditor};
@@ -1 +0,0 @@
1
- .zf-editor{--zf-accent: hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%);--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)}.zf-editor.zf-customise .zf-editor-grid{border-color:#ffffff14}.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) );background:var( --zf-frame-bg-hover, linear-gradient( 165deg, rgba(34, 35, 50, .88) 0%, rgba(18, 19, 28, .9) 60%, rgba(12, 13, 20, .92) 100% ) );box-shadow:var( --zf-frame-shadow-hover, inset 0 1px 0 rgba(255, 255, 255, .09), 0 1px 2px rgba(0, 0, 0, .4), 0 26px 56px -26px rgba(0, 0, 0, .92), 0 0 0 1px hsl(var(--zf-accent-hue, 242) 90% 76% / .12), 0 20px 60px -28px hsl(var(--zf-accent-hue, 242) 90% 76% / .4) )}}.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)}@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}.zf-editor-bar{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-bottom:14px}.zf-editor-bar-spacer{flex:1}.zf-editor-hint{font-size:12px;color:#ffffff80;text-shadow:0 1px 3px rgba(0,0,0,.6)}.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-rail-inner{box-sizing:border-box;width:320px;display:flex;flex-direction:column;gap:16px;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-y:auto;opacity:0;transition:opacity .2s var(--zf-ease-out)}.zf-editor.zf-customise .zf-rail-inner{opacity:1;transition-delay:.12s}@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-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{display:flex;flex-direction:column;gap:6px}.zf-newwidget{display:flex;align-items:center;gap:10px;text-align:left;cursor:pointer;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-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-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-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}}