PageSourceSearch

https://arenberg-holdings.web.app/assets/CommodityCurvesPanel-BSBY6mWq.js

js arenberg-holdings.web.app collected 2026-10-03 12:17:56 UTC 7,979 bytes, 1 lines download raw bytes

1import{s as W}from"./rolldown-runtime-aoxQmdZa.js";import{or as _,rr as E}from"./vendor-C44JUHxF.js";import{P as k}from"./api-w9bwcNej.js";import{c as l,r as e}from"./theme-Cmxze0rk.js";import{c as M}from"./feedManager-CZ33L40p.js";var b=W(_(),1),n=E(),O={"Crude Oil":e.amber,Energy:e.amber,"Natural Gas":e.amber,Precious:e.gold,"Precious Metals":e.gold,Base:e.teal,"Base Metals":e.teal,Industrial:e.teal,Grains:e.green,Softs:e.orange,Livestock:e.pink};function R(r){if(O[r])return O[r];var t=(r||"").toLowerCase();return t.indexOf("oil")!==-1||t.indexOf("energy")!==-1||t.indexOf("gas")!==-1?e.amber:t.indexOf("precious")!==-1||t.indexOf("gold")!==-1||t.indexOf("silver")!==-1?e.gold:t.indexOf("base")!==-1||t.indexOf("metal")!==-1||t.indexOf("copper")!==-1?e.teal:t.indexOf("grain")!==-1||t.indexOf("agri")!==-1?e.green:t.indexOf("soft")!==-1?e.orange:e.t3}function I(r,t){if(r==null||r===""||isNaN(parseFloat(r)))return"—";var i=parseFloat(r);return Math.abs(i)>=1e9?(i/1e9).toFixed(2)+"B":Math.abs(i)>=1e6?(i/1e6).toFixed(2)+"M":Math.abs(i)>=1e3?(i/1e3).toFixed(2)+"K":i.toFixed(t!==void 0?t:2)}function A(r){if(r==null||r===""||isNaN(parseFloat(r)))return"—";var t=parseFloat(r);return Math.abs(t)<1&&t!==0&&(t=t*100),(t>=0?"+":"")+t.toFixed(2)+"%"}function L(r){try{window.dispatchEvent(new CustomEvent("xyron:open-security",{detail:{symbol:r}}))}catch{}}function z(r,t){return r?t?{symbol:r.symbol,price:t.price!=null?t.price:r.price,change:t.change!=null?t.change:r.change,percent_change:t.changePercent!=null?t.changePercent:r.percent_change,direction:t.direction||0,isLive:!0}:r:null}function C({label:r,symbol:t,data:i,color:a,livePrices:o}){var c=o[t],s=z(i,c),p=s&&s.price!=null?parseFloat(s.price):null,f=s&&s.change!=null?parseFloat(s.change):0,m=s&&s.percent_change!=null?parseFloat(s.percent_change):0,g=f>=0?e.green:e.red;return(0,n.jsxs)("div",{onClick:function(){L(t)},style:{display:"flex",alignItems:"baseline",gap:10,padding:"5px 12px",border:"1px solid "+e.b3,borderLeft:"3px solid "+a,borderRadius:3,background:"#05050c",cursor:"pointer"},children:[(0,n.jsx)("span",{style:{fontSize:9,color:e.t5,fontFamily:l,letterSpacing:".12em"},children:r}),(0,n.jsx)("span",{style:{fontSize:20,color:a,fontFamily:l,fontWeight:700,fontVariantNumeric:"tabular-nums"},children:p!=null?p.toFixed(2):"—"}),(0,n.jsx)("span",{style:{fontSize:10,color:g,fontFamily:l,fontVariantNumeric:"tabular-nums"},children:p!=null?(f>=0?"+":"")+f.toFixed(2):""}),(0,n.jsx)("span",{style:{fontSize:10,color:g,fontFamily:l,fontWeight:700,fontVariantNumeric:"tabular-nums"},children:p!=null?A(m):""})]})}function B({item:r,livePrices:t}){if(!r)return null;var i=r.symbol,a=t[i],o=z(r,a),c=o&&o.price!=null?parseFloat(o.price):null,s=o&&o.change!=null?parseFloat(o.change):0,p=o&&o.percent_change!=null?parseFloat(o.percent_change):0,f=s>=0?e.green:e.red;return(0,n.jsxs)("tr",{onClick:function(){L(i)},style:{cursor:"pointer",borderBottom:"1px solid "+e.b1},children:[(0,n.jsxs)("td",{style:{padding:"3px 6px",fontSize:9,color:e.t3,fontFamily:l,fontWeight:600,whiteSpace:"nowrap"},children:[i,o&&o.isLive?(0,n.jsx)("span",{style:{color:e.green,marginLeft:4,fontSize:7},children:"●"}):null]}),(0,n.jsx)("td",{style:{padding:"3px 6px",fontSize:9,color:c!=null?e.t2:e.t5,fontFamily:l,textAlign:"right",fontVariantNumeric:"tabular-nums",fontWeight:600},children:c!=null?I(c,2):"—"}),(0,n.jsx)("td",{style:{padding:"3px 6px",fontSize:9,color:f,fontFamily:l,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:c!=null?(s>=0?"+":"")+s.toFixed(2):"—"}),(0,n.jsx)("td",{style:{padding:"3px 6px",fontSize:9,color:f,fontFamily:l,textAlign:"right",fontWeight:600,fontVariantNumeric:"tabular-nums"},children:c!=null?A(p):"—"})]})}function T({name:r,items:t,livePrices:i,crudeInfo:a}){var o=R(r);return(0,n.jsxs)("div",{style:{minWidth:280,flex:"1 1 280px",border:"1px solid "+e.b2,borderRadius:4,background:e.bg1,overflow:"hidden"},children:[(0,n.jsxs)("div",{style:{padding:"5px 8px",background:"#04040c",borderBottom:"1px solid "+e.b2,display:"flex",alignItems:"center",gap:6},children:[(0,n.jsx)("div",{style:{width:4,height:4,borderRadius:"50%",background:o}}),(0,n.jsx)("span",{style:{fontSize:8,color:o,fontFamily:l,fontWeight:700,letterSpacing:".1em",textTransform:"uppercase"},children:r}),(0,n.jsx)("span",{style:{flex:1}}),a?(0,n.jsxs)("span",{style:{fontSize:7,color:a.contango?e.orange:e.teal,fontFamily:l,fontWeight:700,letterSpacing:".08em",padding:"1px 5px",border:"1px solid "+(a.contango?e.orange:e.teal)+"55",borderRadius:2},children:[a.contango?"CONTANGO":"BACKWARDATION"," ",a.spread!=null?(a.spread>=0?"+":"")+a.spread.toFixed(2):""]}):(0,n.jsx)("span",{style:{fontSize:7,color:e.t5,fontFamily:l},children:(t||[]).length})]}),(0,n.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{style:{background:"#050510"},children:[(0,n.jsx)("th",{style:{padding:"3px 6px",fontSize:7,color:e.t5,fontFamily:l,textAlign:"left",fontWeight:600,letterSpacing:".08em"},children:"SYMBOL"}),(0,n.jsx)("th",{style:{padding:"3px 6px",fontSize:7,color:e.t5,fontFamily:l,textAlign:"right",fontWeight:600,letterSpacing:".08em"},children:"LAST"}),(0,n.jsx)("th",{style:{padding:"3px 6px",fontSize:7,color:e.t5,fontFamily:l,textAlign:"right",fontWeight:600,letterSpacing:".08em"},children:"CHG"}),(0,n.jsx)("th",{style:{padding:"3px 6px",fontSize:7,color:e.t5,fontFamily:l,textAlign:"right",fontWeight:600,letterSpacing:".08em"},children:"CHG%"})]})}),(0,n.jsx)("tbody",{children:(t||[]).map(function(c,s){return(0,n.jsx)(B,{item:c,livePrice
1s:i},c.symbol||s)})})]})]})}function v(r,t){if(!r)return null;for(var i=0;i<r.length;i++){var a=(r[i].symbol||"").toUpperCase();if(a===t||a.indexOf(t)!==-1)return r[i]}return null}function G(){var r=(0,b.useState)(null),t=r[0],i=r[1],a=(0,b.useState)(!0),o=a[0],c=a[1],s=(0,b.useState)(!1),p=s[0],f=s[1],m=M();if((0,b.useEffect)(function(){var d=!0;function u(){k.commodityCurves().then(function(F){if(d){if(!F){f(!0),c(!1);return}i(F),f(!1),c(!1)}}).catch(function(){d&&(f(!0),c(!1))})}u();var N=setInterval(u,5e3);return function(){d=!1,clearInterval(N)}},[]),o)return(0,n.jsx)("div",{style:{padding:30,textAlign:"center",color:e.t5,fontFamily:l,fontSize:10},children:"Loading commodity curves…"});if(p||!t||!t.families)return(0,n.jsx)("div",{style:{padding:30,textAlign:"center",color:e.t5,fontFamily:l,fontSize:10},children:"Data unavailable"});var g=t.families||{},x=null,h=null,y=null;Object.keys(g).forEach(function(d){var u=g[d]||[];x||(x=v(u,"BRENT")),y||(y=v(u,"USOIL")||v(u,"WTI")),h||(h=v(u,"XAUUSD")||v(u,"XAU"))});var S=null;if(x&&y&&x.price!=null&&y.price!=null){var j=parseFloat(x.price)-parseFloat(y.price);S={contango:j>0,spread:j}}return(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",background:e.bg0},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",background:"#04040c",borderBottom:"1px solid "+e.b2,flexShrink:0,flexWrap:"wrap"},children:[(0,n.jsx)("span",{style:{fontSize:9,color:e.amber,fontFamily:l,letterSpacing:".08em",fontWeight:700},children:"COMMODITIES"}),(0,n.jsx)("div",{style:{flex:1}}),x?(0,n.jsx)(C,{label:"BRENT",symbol:x.symbol||"BRENT",data:x,color:e.amber,livePrices:m}):null,h?(0,n.jsx)(C,{label:"XAU/USD",symbol:h.symbol||"XAUUSD",data:h,color:e.gold,livePrices:m}):null]}),(0,n.jsxs)("div",{style:{flex:1,overflow:"auto",padding:10},children:[(0,n.jsx)("div",{style:{display:"flex",gap:10,flexWrap:"wrap",alignItems:"flex-start"},children:Object.keys(g).map(function(d){var u=d.toLowerCase().indexOf("crude")!==-1||d.toLowerCase().indexOf("oil")!==-1;return(0,n.jsx)(T,{name:d,items:g[d],livePrices:m,crudeInfo:u?S:null},d)})}),(0,n.jsx)("div",{style:{marginTop:10,fontSize:7,color:e.t5,fontFamily:l,letterSpacing:".08em",textAlign:"center"},children:"CLICK SYMBOL TO OPEN SECURITY · REFRESH 15s · LIVE WS OVERLAY"})]})]})}export{G as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.