aegis-swap-widget 0.17.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/EngineTradeMarketChart-BM6uUT5Z.js +1 -0
- package/dist/aegis-swap-widget.js +1 -55
- package/dist/core.js +1 -15
- package/dist/hooks.js +1 -11
- package/dist/index-sKlFuUw-.js +272 -0
- package/dist/marketOrientation-Blwrvl4i.js +1 -0
- package/dist/markets-DwaaaaTH.js +2 -0
- package/dist/partner-context.js +3 -117
- package/dist/presets/thena.js +1 -22
- package/dist/presets/wolf-game.js +7 -141
- package/dist/styles.css +1 -1
- package/dist/useEngineActivity-CKXYZ7qm.js +1 -0
- package/package.json +4 -2
- package/dist/EngineTradeMarketChart-Bs5NYOGg.js +0 -1044
- package/dist/index-BcjYe1-F.js +0 -35151
- package/dist/marketOrientation-B6SD7xSk.js +0 -56
- package/dist/markets-Dea2-UUy.js +0 -166
- package/dist/useEngineActivity-BkhItrUI.js +0 -427
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.17.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- acfef57: Compact published Core and Widget JavaScript formatting while preserving comments, tree-shaking annotations and public exports. Remove superseded and unused widget styles, share identical declarations, and conservatively optimize production CSS while retaining browser fallbacks and declaration order. Tighten the package budgets to the measured sizes plus about 2 kB of headroom (Core 251 kB, Widget 312 kB JavaScript, Widget CSS 71 kB) without removing route previews or other features.
|
|
8
|
+
- 7c8c722: Recognize the alternate Ink Calamari Engine deployment and show its markets as view-only while deployment-aware quote and position reads remain unavailable.
|
|
9
|
+
- Updated dependencies [acfef57]
|
|
10
|
+
- Updated dependencies [7c8c722]
|
|
11
|
+
- @aegis-engine/core@0.13.1
|
|
12
|
+
|
|
3
13
|
## 0.17.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as h,jsx as i,Fragment as Pe}from"react/jsx-runtime";import*as E from"react";import{useState as H,useEffect as ue,useRef as F,useId as kt,useMemo as ce}from"react";import{E as St,u as _t,a as Ye,b as $t,c as Ft,d as Pt,e as Ot,F as mt,f as gt,g as ft,C as Ut,h as Ht,i as pt,j as Vt}from"./index-sKlFuUw-.js";import{enginePoolPriceSegments as Xt,splitEngineMarketCandleSegments as Yt,fetchTokenPriceHistory as jt}from"@aegis-engine/core";import{m as Wt}from"./marketOrientation-Blwrvl4i.js";function qt({title:e,titleId:t,...n},a){return/* @__PURE__ */E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},n),e?/* @__PURE__ */E.createElement("title",{id:t},e):null,/* @__PURE__ */E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"}));}const Bt=/* @__PURE__ */E.forwardRef(qt);function zt({title:e,titleId:t,...n},a){return/* @__PURE__ */E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},n),e?/* @__PURE__ */E.createElement("title",{id:t},e):null,/* @__PURE__ */E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"}));}const Zt=/* @__PURE__ */E.forwardRef(zt);function Gt({title:e,titleId:t,...n},a){return/* @__PURE__ */E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},n),e?/* @__PURE__ */E.createElement("title",{id:t},e):null,/* @__PURE__ */E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}));}const Kt=/* @__PURE__ */E.forwardRef(Gt);function Jt({title:e,titleId:t,...n},a){return/* @__PURE__ */E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},n),e?/* @__PURE__ */E.createElement("title",{id:t},e):null,/* @__PURE__ */E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59"}));}const Qt=/* @__PURE__ */E.forwardRef(Jt);function en({title:e,titleId:t,...n},a){return/* @__PURE__ */E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},n),e?/* @__PURE__ */E.createElement("title",{id:t},e):null,/* @__PURE__ */E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8.689c0-.864.933-1.406 1.683-.977l7.108 4.061a1.125 1.125 0 0 1 0 1.954l-7.108 4.061A1.125 1.125 0 0 1 3 16.811V8.69ZM12.75 8.689c0-.864.933-1.406 1.683-.977l7.108 4.061a1.125 1.125 0 0 1 0 1.954l-7.108 4.061a1.125 1.125 0 0 1-1.683-.977V8.69Z"}));}const wt=/* @__PURE__ */E.forwardRef(en);function tn({title:e,titleId:t,...n},a){return/* @__PURE__ */E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},n),e?/* @__PURE__ */E.createElement("title",{id:t},e):null,/* @__PURE__ */E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}));}const nn=/* @__PURE__ */E.forwardRef(tn);function rn({title:e,titleId:t,...n},a){return/* @__PURE__ */E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},n),e?/* @__PURE__ */E.createElement("title",{id:t},e):null,/* @__PURE__ */E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}));}const on=/* @__PURE__ */E.forwardRef(rn),an=3600,Oe=[];function sn(e,t,n){if(!Number.isFinite(t.price)||t.price<=0||!Number.isFinite(t.observedAt)||t.observedAt>n||n-t.observedAt>=St)return e;const a=t.observedAt/1e3,o=e.at(-1);return o&&a<o.time?e:o&&a===o.time?o.value===t.price?e:[...e.slice(0,-1),{time:a,value:t.price}]:[...e.filter(r=>r.time>a-an),{time:a,value:t.price}].slice(-720);}function ln(e,t,n){const[a,o]=H({context:e,points:Oe,blockedThrough:0});return ue(()=>{o(r=>{const l=r.context===e?r:{context:e,points:Oe,blockedThrough:0};if(n)return{context:e,points:Oe,blockedThrough:Math.max(l.blockedThrough,t?.observedAt??0)};if(!t||t.observedAt<=l.blockedThrough||document.visibilityState==="hidden")return l;const u=sn(l.points,t,Date.now());return u===l.points?l:{...l,points:u};});},[e,t?.observedAt,t?.price,n]),a.context===e&&!n?a.points:Oe;}const cn=15;function un(e,t){const n=e.priceReference,{coverageStart:a,completedThrough:o,requestedFrom:r}=e.coverage;if(!n||a===0||n.timestamp>o)return[];let l=Math.max(a,r),u=Math.min(o,t);for(const v of e.gaps)if(v.to<=n.timestamp)l=Math.max(l,v.to);else{if(v.from<=n.timestamp)return[];u=Math.min(u,v.from);}return u>l?[{kind:"history",points:[{time:l,value:n.price},{time:u,value:n.price}]}]:[];}function dn(e,t){if(e.priceSegments)return Xt(e).filter(o=>o.from<t).map(o=>({kind:"history",points:[{time:o.from,value:o.price},{time:Math.min(o.to,t),value:o.price}]}));if(e.candles.length===0)return un(e,t);const n=[],a=e.candles.filter(o=>o.t<t);for(const o of Yt({...e,candles:a})){const r=o.at(-1);if(!r)continue;const l=o.map(k=>({time:k.t,value:k.close})),u=e.gaps.find(k=>k.to>r.t),v=Math.min(e.coverage.completedThrough,u?.from??1/0,t);v>r.t&&l.push({time:v,value:r.close});const g=n.at(-1)?.points.at(-1);g&&n.push({kind:"bridge",points:[g,l[0]]}),n.push({kind:"history",points:l});}return n;}function hn({history:e,observations:t,reference:n}){const a=t[0],o=e?dn(e,a?.time??1/0):[],r=o.at(-1)?.points.at(-1)??null;let l=r?{...r,kind:"history"}:null;const u=r?[r]:[];n&&n.time>(r?.time??-1/0)&&(!a||n.time<a.time)&&(u.push(n),l={...n,kind:"reference"}),a&&a.time>(u.at(-1)?.time??-1/0)&&u.push(a),u.length>1&&o.push({kind:"bridge",points:u});let v=[];for(const g of t){const k=v.at(-1);k&&g.time-k.time>cn&&(o.push({kind:"live",points:v},{kind:"bridge",points:[k,g]}),v=[]),v.push(g);}return v.length>0&&(o.push({kind:"live",points:v}),l={...v.at(-1),kind:"live"}),{segments:o,latest:l};}function mn(e,t){const{points:n}=e;if(n.length===0||t<n[0].time||t>n.at(-1).time)return null;for(let a=1;a<n.length;a++){const o=n[a-1],r=n[a];if(t>r.time)continue;if(e.kind==="history")return o.value;const l=r.time-o.time;return l===0?r.value:o.value+(r.value-o.value)*(t-o.time)/l;}return n.at(-1).value;}function gn(e,t){const n=[];for(const a of e){for(const o of a.points)o.time>=t.from&&o.time<=t.to&&n.push(o.value);for(const o of[t.from,t.to]){const r=mn(a,o);r!==null&&n.push(r);}}return n;}function bt(e,t=[]){const n=[...e,...t].filter(l=>Number.isFinite(l)&&l>0);if(n.length===0)return null;const a=Math.min(...n),o=Math.max(...n),r=Math.max((o-a)*0.1,(o*5e-4-(o-a))/2,Number.EPSILON);return{low:Math.max(0,a-r),high:o+r};}const vt=[5,10,15,30,60,120,300,600,900,1800,3600,7200,10800,21600,43200,86400];function fn(e,t){const n=e.to-e.from;if(!(n>0))return[];const a=vt.find(l=>n/l<=Math.max(1,t))??vt.at(-1),o=a>=3600?-new Date(e.to*1e3).getTimezoneOffset()*60:0,r=[];for(let l=Math.ceil((e.from+o)/a)*a-o;l<=e.to;l+=a)r.push(l);return r;}const nt=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}),pn=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"});function Qe(e,t){return(t.to-t.from<600?pn:nt).format(new Date(e*1e3));}function wn({min:e,max:t,plot:n,enabled:a=!0,selectable:o=!1,contextKey:r,onSelect:l,onTimeWheel:u,onTimePan:v}){const[g,k]=H(null),[I,T]=H(null),[W,V]=H(r),[Q,Y]=H(null),[ee,p]=H(!1);W!==r&&(V(r),T(null),Y(null),p(!1));const P=a?I?.low??e:e,L=a?I?.high??t:t,c=F(null),_=F(!1),S=F(null),x=F(null),C=(d,m)=>{const w=x.current??g?.getScreenCTM();if(!g||!w)return null;const N=g.createSVGPoint();return N.x=d,N.y=m,N.matrixTransform(w.inverse());},O=d=>L-(d-n.y)/n.height*(L-P),$=(d,m)=>{const w=Math.max(Number.MIN_VALUE,e*1e-6),N=Math.max(w,d);T({low:N,high:N+m});},M=d=>{const m=Math.max((t-e)/100,Math.min((t-e)*20,(L-P)*d));$((P+L-m)/2,m),Y(null);},q=d=>d.x>=n.x&&d.x<=n.x+n.width&&d.y>=n.y&&d.y<=n.y+n.height,R=_t({wheel(d){const m=C(d.clientX,d.clientY);if(!m||!q(m))return;d.preventDefault();const w=d.deltaMode===1?16:d.deltaMode===2?n.width:1;u(d.deltaX*w,d.deltaY*w,(m.x-n.x)/n.width);},pinch(d){if(d.touches.length!==2){S.current=null;return;}const m=d.touches[0],w=d.touches[1],N=C((m.clientX+w.clientX)/2,(m.clientY+w.clientY)/2);if(!N||!q(N))return;d.preventDefault();const B=Math.hypot(m.clientX-w.clientX,m.clientY-w.clientY);S.current&&B>0&&u(0,Math.log(S.current/B)/5e-3,(N.x-n.x)/n.width),S.current=B,c.current=null,_.current=!0,p(!1);}});ue(()=>{if(!g||!a)return;const d=N=>R.current.wheel(N),m=N=>R.current.pinch(N),w=()=>{S.current=null,c.current=null,p(!1);};return g.addEventListener("wheel",d,{passive:!1}),g.addEventListener("touchstart",m,{passive:!1}),g.addEventListener("touchmove",m,{passive:!1}),g.addEventListener("touchend",w),g.addEventListener("touchcancel",w),()=>{g.removeEventListener("wheel",d),g.removeEventListener("touchstart",m),g.removeEventListener("touchmove",m),g.removeEventListener("touchend",w),g.removeEventListener("touchcancel",w);};},[g,a,R]);const G=F(null),A=F(0),de=()=>{A.current=0;const d=G.current;if(G.current=null,!d||!a)return;const m=C(d.clientX,d.clientY);if(!m)return;const w=c.current;if(w&&!_.current&&Math.hypot(d.clientX-w.clientX,d.clientY-w.clientY)>5&&(_.current=!0,p(!0),x.current||(x.current=g?.getScreenCTM()??null)),w&&_.current)v((w.x-m.x)/n.width),w.x=m.x,d.pointerType==="mouse"&&$(w.low+(m.y-w.y)/n.height*(w.high-w.low),w.high-w.low),Y(null);else{const N=d.pointerType==="mouse"&&q(m)?O(m.y):null;Y(B=>B===N?B:N);}},te=d=>{G.current=d,A.current||(A.current=requestAnimationFrame(de));};ue(()=>()=>{A.current&&cancelAnimationFrame(A.current);},[]);const re=()=>{c.current=null,x.current=null,p(!1);};return{low:P,high:L,props:{ref:k,onPointerDown(d){if(!a||d.button!==0)return;x.current=g?.getScreenCTM()??null;const m=C(d.clientX,d.clientY);!m||!q(m)||(_.current=!1,c.current={x:m.x,y:m.y,clientX:d.clientX,clientY:d.clientY,low:P,high:L},d.currentTarget.setPointerCapture(d.pointerId));},onPointerMove(d){te(d);},onPointerUp(){re();},onPointerCancel(){_.current=!0,re(),Y(null);},onPointerLeave(){c.current||Y(null);},onClick(d){if(_.current){_.current=!1;return;}if(!a||!o)return;const m=C(d.clientX,d.clientY);if(!m||!q(m))return;const w=O(m.y);Number.isFinite(w)&&w>0&&l(w);}},dragging:ee,hover:a?Q:null,manual:a&&I!==null,centerOn:d=>{!Number.isFinite(d)||d<=0||($(d-(L-P)/2,L-P),Y(null));},zoomOut:()=>M(1.5),zoomIn:()=>M(1/1.5),reset:()=>{T(null),Y(null);}};}const bn=new Intl.NumberFormat("en-US",{maximumSignificantDigits:6}),vn=new Intl.NumberFormat("en-US",{notation:"compact",maximumSignificantDigits:6}),xn="₀₁₂₃₄₅₆₇₈₉",xt=/* @__PURE__ */new Map();function Nt(e,t){if(e>0&&e<1e-4){const n=/^0\.(0+)(\d+)$/.exec(t);if(n)return`0.0${String(n[1].length).replace(/\d/g,a=>xn[Number(a)])}${n[2]}`;}return Math.abs(e)>=1e9?vn.format(e):t;}function Ce(e){return Number.isFinite(e)?Nt(e,bn.format(e)):"—";}function yn(e,t){if(!Number.isFinite(e))return"—";let n=xt.get(t);return n||(n=new Intl.NumberFormat("en-US",{minimumFractionDigits:t,maximumFractionDigits:t}),xt.set(t,n)),Nt(e,n.format(e));}const Mn=320,yt=(e,t)=>e.low===t.low&&e.high===t.high,je=e=>1-(1-e)**3;function kn(e,{immediate:t}){const[n,a]=H(e),o=F(e);return ue(()=>{const r=o.current;if(t||yt(r,e)){o.current=e,a(g=>yt(g,e)?g:e);return;}let l=0;const u=performance.now(),v=g=>{const k=Math.min(1,(g-u)/Mn),I=k===1?{low:e.low,high:e.high}:{low:r.low+(e.low-r.low)*je(k),high:r.high+(e.high-r.high)*je(k)};o.current=I,a(I),k<1&&(l=requestAnimationFrame(v));};return l=requestAnimationFrame(v),()=>cancelAnimationFrame(l);},[t,e.low,e.high]),t?e:{...e,low:n.low,high:n.high};}const Ct=180,Sn=84,Et=26,_n=10,We=18,Nn=5,rt=7,Cn=14,En=250,Tn=16,Mt=2400;function Dn(e,t=Ct){return{x:8,y:10,width:Math.max(40,e-8-Sn),height:Math.max(40,t-10-Et)};}function In(e,t,n){const a=t-e;if(!(a>0)||!Number.isFinite(a))return{values:[],decimals:0};const o=a/(n>180?5:3),r=10**Math.floor(Math.log10(o)),l=o/r,u=r*(l>=Math.sqrt(50)?10:l>=Math.sqrt(10)?5:l>=Math.sqrt(2)?2:1),v=Math.min(20,Math.max(0,-Math.floor(Math.log10(u)))),g=[];for(let k=Math.floor(t/u+1e-9);k>=e/u-1e-9;k--)g.push(Number((k*u).toFixed(v)));return{values:g,decimals:v};}const D=e=>e.toFixed(1),Ue=(e,t)=>e!==null&&t!==null&&Math.abs(e-t)<Cn,et=new Intl.NumberFormat("en-US",{maximumSignificantDigits:12});function Rn(e,t,n){let a=0;for(;a+1<e.length&&e[a+1].time<t;)a++;let o=e.length-1;for(;o>0&&e[o-1].time>n;)o--;return e.slice(a,o+1);}function An(e,t,n,a,o,r){const l=Rn(t,n,a);if(l.length<2)return"";let u=`M ${D(o(l[0].time))} ${D(r(l[0].value))}`;for(const v of l.slice(1))u+=e==="history"?` H ${D(o(v.time))} V ${D(r(v.value))}`:` L ${D(o(v.time))} ${D(r(v.value))}`;return u;}function Ae({y:e,label:t,right:n,left:a,tone:o,title:r}){const l=Math.min(n-a,t.length*6.4+2*rt);return/* @__PURE__ */h("g",{transform:`translate(0 ${D(e)})`,"data-pill":o,pointerEvents:"none",children:[/* @__PURE__ */i("rect",{x:n-l,y:-We/2,width:l,height:We,rx:Nn}),/* @__PURE__ */h("text",{x:n-rt,textAnchor:"end",dominantBaseline:"central",children:[r?/* @__PURE__ */i("title",{children:r}):null,t]})]});}function Ln({candles:e,entryPrice:t,onEntryClick:n,width:a,height:o,plot:r,segments:l,latest:u,domain:v,immediateDomain:g,hold:k,scrolling:I,selectedPrice:T,hoverPrice:W,selectable:V,emptyMessage:Q,onSelect:Y,svgProps:ee}){const p=kn(v,{immediate:g}),P=kt(),{from:L,to:c,low:_,high:S}=p,x=c>L&&S>_&&Number.isFinite(_)&&Number.isFinite(S),C=r.x+r.width-_n,O=(C-r.x)/(c-L),$=s=>r.x+(s-L)*O,M=s=>r.y+(S-s)/(S-_)*r.height,q=r.x+r.width+6,R=a-4,G=R-rt,A=F(null),de=s=>{const f=A.current;return!f||!I?u?.value??0:f.from+(f.to-f.from)*je(Math.min(1,(s-f.startedAt)/En));};Ye(()=>{const s=Date.now(),f=A.current;u&&u.kind==="live"?f?.to!==u.value&&(A.current={from:f&&I?de(s):u.value,to:u.value,startedAt:s}):u?A.current={from:u.value,to:u.value,startedAt:0}:A.current=null;});const te=de(Date.now());let re=null;if(u?.kind==="live")for(const s of l)s.kind==="live"&&(re=s);const be=re?.points.at(-2)??null,d=u&&x?M(u.value):null,m=W!==null&&x?M(W):null,w=T!==void 0&&x&&T>=_&&T<=S,N=w?M(T):null,B=t!==void 0&&Number.isFinite(t)&&t>0&&x,Le=t!==void 0&&x&&t>=_&&t<=S,Te=B?Math.min(r.y+r.height-9,Math.max(r.y+9,M(t))):null,ye=d!==null&&!Ue(d,m),$e=N!==null&&!Ue(N,m)&&!(ye&&Ue(N,d)),me=[Te,m,ye?d:null,$e?N:null],ie=T!==void 0&&x&&!w?T>S?"above":"below":null,b=x?fn({from:L,to:c+2},Math.max(2,Math.floor((C-r.x)/84))):[],ge=k!==null&&u!==null&&x&&u.time<=c,fe=ge?Math.max(r.x,$(u.time)):C,De=F(null),Ie=F(null),ve=F(null),z=F(null),Me=F(null),K=F(null),pe=_t({to:c,pxPerSecond:O,latest:u,x:$,y:M}),he=(s,f)=>{const Z=pe.current,J=`translate(${s.toFixed(2)} 0)`;De.current?.setAttribute("transform",J),Ie.current?.setAttribute("transform",J);const ne=D(Z.y(f));if(ve.current&&Z.latest&&(ve.current.setAttribute("x1",D(Math.max(r.x,Z.x(Z.latest.time)+s))),ve.current.setAttribute("y1",ne),ve.current.setAttribute("y2",ne)),z.current?.setAttribute("y2",ne),Me.current?.setAttribute("cy",ne),K.current){const we=Date.now()%Mt/Mt,Re=je(Math.min(1,we/0.7));K.current.setAttribute("cy",ne),K.current.setAttribute("r",(3.5+8*Re).toFixed(2)),K.current.setAttribute("opacity",(we<0.7?0.45*(1-Re):0).toFixed(3));}},ke=s=>{const f=pe.current;he(Math.min(0,-(s/1e3-f.to)*f.pxPerSecond),de(s));};Ye(()=>{I&&ke(Date.now());}),ue(()=>{if(!I)return;let s=0,f=0;const Z=()=>{const J=Date.now();J-f>=Tn&&(f=J,ke(J)),s=requestAnimationFrame(Z);};return s=requestAnimationFrame(Z),()=>{cancelAnimationFrame(s),he(0,A.current?.to??pe.current.latest?.value??0);};},[I]);const Be=s=>{!V||!u||(s.key==="ArrowUp"||s.key==="ArrowDown"?(s.preventDefault(),Y((T??u.value)*(s.key==="ArrowUp"?1.01:0.99))):(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),Y(u.value)));},oe=x?D(M(te)):"0",xe=In(_,S,r.height),U=Math.max(4,Math.min(12,O*240));return/* @__PURE__ */h("svg",{...ee,className:"aegis-engine-widget__price-chart",width:a,height:o,viewBox:`0 0 ${a} ${o}`,role:B?"group":V?"button":"img",tabIndex:V?0:-1,"data-selectable":V||void 0,"data-scrolling":I||void 0,"aria-label":V?"Choose target price. Click above or below the price line, or press Up and Down to adjust by 1%.":"Price chart",onKeyDown:Be,children:[/* @__PURE__ */h("defs",{children:[/* @__PURE__ */i("clipPath",{id:`${P}-plot`,children:/* @__PURE__ */i("rect",{x:r.x,y:r.y,width:r.width,height:r.height})}),/* @__PURE__ */i("clipPath",{id:`${P}-axis`,children:/* @__PURE__ */i("rect",{x:0,y:r.y+r.height,width:r.x+r.width+12,height:Et})})]}),x&&!Q?xe.values.map(s=>{const f=M(s);return/* @__PURE__ */h("g",{"data-grid":"true",children:[/* @__PURE__ */i("line",{x1:r.x,x2:r.x+r.width,y1:D(f),y2:D(f)}),me.some(Z=>Ue(Z,f))?null:/* @__PURE__ */h("text",{x:G,y:D(f),textAnchor:"end",dominantBaseline:"central","data-axis":"price",children:[/* @__PURE__ */i("title",{children:et.format(s)}),yn(s,xe.decimals)]})]},s);}):null,/* @__PURE__ */i("g",{clipPath:`url(#${P}-axis)`,children:/* @__PURE__ */i("g",{ref:Ie,"data-scroll":"ticks",children:b.map(s=>{const f=$(s);return f<r.x+26||f>r.x+r.width-26?null:/* @__PURE__ */i("text",{x:D(f),y:o-8,textAnchor:"middle","data-axis":"time",children:Qe(s,p)},s);})})}),x?/* @__PURE__ */h("g",{clipPath:`url(#${P}-plot)`,children:[d!==null?/* @__PURE__ */i("line",{x1:r.x,x2:r.x+r.width,y1:D(d),y2:D(d),"data-guide":"current"}):null,/* @__PURE__ */h("g",{ref:De,"data-scroll":"plot",children:[e?.filter(s=>s.t>=L&&s.t<=c).map(s=>{const f=s.open===s.close;return/* @__PURE__ */h("g",{"data-candle":s.close>=s.open?"up":"down",children:[/* @__PURE__ */i("line",{x1:$(s.t),x2:$(s.t),y1:M(s.high),y2:M(s.low)}),f?/* @__PURE__ */i("line",{"data-doji":"true",x1:$(s.t)-U/2,x2:$(s.t)+U/2,y1:M(s.open),y2:M(s.open),strokeWidth:2}):/* @__PURE__ */i("rect",{x:$(s.t)-U/2,y:Math.min(M(s.open),M(s.close)),width:U,height:Math.max(1,Math.abs(M(s.open)-M(s.close)))}),/* @__PURE__ */i("title",{children:`Open ${s.open} · High ${s.high} · Low ${s.low} · Close ${s.close}`})]},s.t);}),(e?l.filter(s=>s.kind==="live"):l).map((s,f)=>{const Z=s===re?s.points.slice(0,-1):s.points,J=An(s.kind,Z,L,c,$,M);if(!J)return null;const ne=s.points[0],we=s.points.at(-1);return/* @__PURE__ */i("path",{d:J,"data-segment":s.kind,fill:"none",children:s.kind==="bridge"?/* @__PURE__ */i("title",{children:`Not observed between ${Qe(ne.time,p)} and ${Qe(we.time,p)}`}):null},f);}),be&&u?/* @__PURE__ */i("line",{ref:z,"data-segment":"live",x1:D($(be.time)),y1:D(M(be.value)),x2:D($(u.time)),y2:oe}):null]}),ge?/* @__PURE__ */i("line",{ref:ve,"data-hold":k,x1:D(fe),x2:C,y1:oe,y2:oe}):null,Le?/* @__PURE__ */i("line",{x1:r.x,x2:r.x+r.width,y1:M(t),y2:M(t),"data-guide":"entry"}):null,N!==null?/* @__PURE__ */i("line",{x1:r.x,x2:r.x+r.width,y1:D(N),y2:D(N),"data-guide":"target"}):null,m!==null?/* @__PURE__ */i("line",{x1:r.x,x2:r.x+r.width,y1:D(m),y2:D(m),"data-guide":"hover"}):null,ge&&k==="live"&&I?/* @__PURE__ */i("circle",{ref:K,cx:C,cy:oe,r:3.5,opacity:0,"data-pulse":"true"}):null,ge?/* @__PURE__ */i("circle",{ref:Me,cx:C,cy:oe,r:3.5,"data-dot":k}):null]}):null,B?/* @__PURE__ */h("g",{role:"button",tabIndex:0,"aria-label":`Center chart on entry ${Ce(t)}`,style:{cursor:"pointer"},onPointerDown:s=>s.stopPropagation(),onClick:s=>{s.stopPropagation(),n();},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),s.stopPropagation(),n());},children:[/* @__PURE__ */i(Ae,{y:Math.min(r.y+r.height-14,Math.max(r.y+14,M(t))),label:`Entry ${Ce(t)}${Le?"":t>S?" ↑":" ↓"}`,left:r.x,right:r.x+Math.min(r.width,165),tone:"entry"}),/* @__PURE__ */i("rect",{x:r.x,y:Math.min(r.y+r.height-28,Math.max(r.y,M(t)-14)),width:Math.min(r.width,165),height:28,fill:"transparent",stroke:"none"})]}):null,ye&&u?/* @__PURE__ */i(Ae,{y:d,label:Ce(u.value),left:q,right:R,tone:"current",title:et.format(u.value)}):null,$e&&T!==void 0?/* @__PURE__ */i(Ae,{y:N,label:Ce(T),left:q,right:R,tone:"target",title:et.format(T)}):null,m!==null&&W!==null?/* @__PURE__ */i(Ae,{y:m,label:Ce(W),left:q,right:R,tone:"hover"}):null,ie&&T!==void 0?/* @__PURE__ */i(Ae,{y:ie==="above"?r.y+We/2:r.y+r.height-We/2,label:`${ie==="above"?"▲":"▼"} ${Ce(T)}`,left:q,right:R,tone:"edge"}):null,Q?/* @__PURE__ */i("text",{x:r.x+r.width/2,y:r.y+r.height/2,textAnchor:"middle",dominantBaseline:"central","data-empty":"true",children:Q}):null]});}const X=[30,60,300,900,3600,21600,86400],Ve=X[0],Xe=X[X.length-1],it=X.length-1,j=e=>{const t=Math.min(Xe,Math.max(Ve,e)),n=Math.max(0,X.findIndex(r=>r>=t)-1),a=X[n],o=X[n+1];return(n+Math.log(t/a)/Math.log(o/a))/it;},He=e=>{const t=Math.min(1,Math.max(0,e))*it,n=Math.min(it-1,Math.floor(t)),a=X[n],o=X[n+1];return Math.round(a*(o/a)**(t-n));};function qe(e){if(e===86400)return"1 day";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),a=e%60;return[t&&`${t}hr`,n&&`${n}min`,a&&`${a}s`].filter(Boolean).join(" ");}function $n(e){const t=e<60?1:e<3600?60:e<21600?600:3600,n=Math.round(e/t)*t;return n===e?qe(e):`≈${qe(n)}`;}function Fn({seconds:e,onChange:t,coverage:n,reduceMotion:a=!1,historical:o=!1,onScrubbingChange:r}){const l=F(!1),[u,v]=H(!1),[g,k]=H(()=>/* @__PURE__ */new Set()),I=F(/* @__PURE__ */new Map());ue(()=>()=>{for(const c of I.current.values())clearTimeout(c);},[]);const T=(c,_)=>{if(c===_)return;const S=X.filter(x=>{const C=j(x);return C>=Math.min(c,_)&&C<=Math.max(c,_);});if(S.length){k(x=>/* @__PURE__ */new Set([...x,...S]));for(const x of S)clearTimeout(I.current.get(x)),I.current.set(x,setTimeout(()=>{I.current.delete(x),k(C=>{const O=new Set(C);return O.delete(x),O;});},180));}},W=F(e),V=F(j(e));ue(()=>{l.current||(T(j(W.current),j(e)),V.current=j(e)),W.current=e;},[e]);const Q=c=>{v(c),r?.(c);},Y=()=>{l.current=!1,Q(!1);},ee=c=>X.reduce((_,S)=>Math.abs(j(S)-c)<Math.abs(j(_)-c)?S:_),p=(c,_,S=!1)=>{const x=c.getBoundingClientRect();if(!x.width)return;const C=Math.max(0,Math.min(1,(_-x.left)/x.width));T(V.current,C),V.current=C;const O=ee(C),$=X.indexOf(O),M=j(O),q=X[$+(C<M?-1:1)],R=q===void 0?0:Math.abs(j(q)-M)*0.3,G=C-M;if(S&&Math.abs(G)<=R){t(O);return;}const A=R>0&&Math.abs(G)<R?C-0.65*R/Math.PI*Math.sin(Math.PI*G/R):C;t(He(A));},P=ee(j(e)),L=c=>g.has(c)||u&&c===P&&Math.abs(j(c)-j(e))<0.035;return/* @__PURE__ */h("div",{className:"aegis-engine-widget__time-rail","data-scrubbing":u||void 0,"data-reduced-motion":a||void 0,children:[/* @__PURE__ */h("div",{className:"aegis-engine-widget__time-rail-readout","data-quiet":!o&&!u&&X.includes(e)||void 0,children:[/* @__PURE__ */i("span",{children:o?"Visible window":"Show the last"}),/* @__PURE__ */i("output",{"aria-live":"off",children:$n(e)})]}),/* @__PURE__ */h("div",{className:"aegis-engine-widget__time-rail-track",children:[/* @__PURE__ */i("div",{className:"aegis-engine-widget__time-rail-ticks","aria-hidden":"true",children:X.map(c=>/* @__PURE__ */i("i",{"data-highlighted":L(c)||e===c||void 0,style:{left:`${j(c)*100}%`}},c))}),/* @__PURE__ */i("input",{type:"range",className:"aegis-engine-widget__amount-slider",min:0,max:1e3,step:1,value:Math.round(j(e)*1e3),"aria-label":"Visible time window","aria-valuetext":qe(e),style:{"--aegis-slider-pct":`${j(e)*100}%`},onPointerDown:c=>{l.current=!0,Q(!0),c.currentTarget.setPointerCapture(c.pointerId),p(c.currentTarget,c.clientX);},onPointerMove:c=>{l.current&&p(c.currentTarget,c.clientX);},onPointerCancel:Y,onPointerUp:c=>{l.current&&(p(c.currentTarget,c.clientX,!0),Y(),c.currentTarget.releasePointerCapture(c.pointerId));},onBlur:Y,onChange:c=>{l.current||t(He(Number(c.target.value)/1e3));},onKeyDown:c=>{if(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","Home","End"].includes(c.key)){c.preventDefault();const S=c.key==="Home"?Ve:c.key==="End"?Xe:["ArrowRight","ArrowUp"].includes(c.key)?Math.max(e+1,He(j(e)+1e-3)):Math.min(e-1,He(j(e)-1e-3));t(Math.max(Ve,Math.min(Xe,S)));return;}if(c.key!=="PageUp"&&c.key!=="PageDown")return;c.preventDefault();const _=c.key==="PageUp"?X:[...X].reverse();t(_.find(S=>c.key==="PageUp"?S>e:S<e)??(c.key==="PageUp"?Xe:Ve));}})]}),/* @__PURE__ */i("div",{className:"aegis-engine-widget__time-rail-stops",role:"group","aria-label":"Time presets",children:X.map(c=>/* @__PURE__ */i("button",{type:"button","aria-pressed":e===c,"data-highlighted":e!==c&&L(c)||void 0,onClick:()=>t(c),children:/* @__PURE__ */i("span",{children:qe(c)})},c))}),n?/* @__PURE__ */i("p",{children:n}):null]});}function Pn(e,t){const n=new Map(t.map(o=>[o.timestamp,o.priceUsd])),a=Date.now()/1e3;return e.flatMap(o=>{const r=n.get(o.timestamp),l=r&&r>0?o.priceUsd/r:NaN;return Number.isFinite(o.timestamp)&&o.timestamp>0&&o.timestamp<=a+60&&Number.isFinite(l)&&l>0?[{timestamp:o.timestamp,price:l}]:[];}).sort((o,r)=>o.timestamp-r.timestamp);}async function On({market:e,baseUrl:t,headers:n,timeoutMs:a=5e3},o){if(!t)return null;const r=k=>jt({baseUrl:t,headers:n,chainId:e.chainId,tokenAddress:k.address,window:"7d",timeoutMs:a,signal:o}),[l,u]=await Promise.allSettled([r(e.token0),r(e.token1)]);if(o.aborted||l.status!=="fulfilled"||u.status!=="fulfilled"||!l.value||!u.value)return null;const v=Pn(l.value.points,u.value.points),g=v.at(-1);return g&&Date.now()/1e3-g.timestamp<=24*3600?v:null;}function Un({market:e,source:t,enabled:n}){const a=`${e.chainId}:${e.token0.address}:${e.token1.address}:${t.baseUrl}:${t.timeoutMs}:${JSON.stringify(t.headers??{})}`,o=ce(()=>n?{requestKey:a,market:e,...t}:null,[n,a]),{value:r,refreshing:l}=$t({request:o,idleValue:null,pendingValue:null,errorValue:null,warnMessage:"Pair reference history unavailable",fetchValue:On});return{points:r,loading:l};}function Hn(e,t,n){if(!e||t===null||!Number.isFinite(t)||t<=0||e.freshness.status!=="ready")return null;const a=n-86400,o={"5m":300,"1h":3600,"1d":86400}[e.resolution],r=e.candles.filter(u=>u.t+o<=a).at(-1);if(e.candles.some(u=>u.t<a&&u.t+o>a)||!r||e.coverage.coverageStart>r.t||e.coverage.completedThrough<a||e.gaps.some(u=>u.from<a&&u.to>r.t))return null;const l=t-r.close;return{absolute:l,percent:l/r.close*100};}const Vn=360,tt=60,Xn=new Intl.NumberFormat("en-US",{maximumFractionDigits:2}),Yn=new Intl.NumberFormat("en-US",{maximumSignificantDigits:6}),jn=new Intl.NumberFormat("en-US",{maximumFractionDigits:2,signDisplay:"exceptZero"}),Wn=new Intl.NumberFormat("en-US",{maximumSignificantDigits:6,signDisplay:"exceptZero"}),Ee=e=>e>=1?Xn.format(e):Yn.format(e),qn={error:"Couldn’t load price history",unavailable:"Historical prices unavailable · showing prices from this session",source:"Price history temporarily unavailable"},Bn="Price scenario is available once a current pool price loads.",zn=e=>Math.abs(e)>=1?jn.format(e):Wn.format(e);function Zn(e){return{...e,candles:e.candles.map(t=>({...t,open:1/t.open,close:1/t.close,high:1/t.low,low:1/t.high})),priceSegments:e.priceSegments?.map(t=>({...t,price:1/t.price})),priceReference:e.priceReference?{...e.priceReference,price:1/e.priceReference.price}:e.priceReference};}function Gn(e){const[t,n]=H(()=>Date.now()),a=Vt();return ue(()=>{if(!a||!e)return;n(Date.now());const o=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(o);},[a,e]),{now:t/1e3,nowMs:t,visible:a};}function nr({market:e,mark:t,state:n,onRetry:a,selectedPrice:o,onSelectPrice:r,onClearPrice:l,entryPrice:u,viewContext:v,referenceSource:g={},reduceMotion:k=!1}){const I=Wt(e),{asset:T,quote:W}=I,V=!I.assetIsToken0,[Q,Y]=H(null);n.kind==="ready"&&n.candles!==Q&&Y(n.candles);const ee=n.kind==="ready"?n.candles:Q,p=ce(()=>V&&ee?Zn(ee):ee,[V,ee]),P=ce(()=>V&&t?{...t,price:1/t.price}:t,[V,t]),L=u===void 0?void 0:Ft(I,u),c=ln(`${e.chainId}:${e.id}`,P,p?.freshness.status==="reorg_detected"),[_,S]=H(!0);ue(()=>{const y=setTimeout(()=>S(!1),15e3);return()=>clearTimeout(y);},[e.id]);const[x,C]=H(!1),O=Un({market:e,source:g,enabled:x}),$=ce(()=>(V?O.points?.map(y=>({...y,price:1/y.price})):O.points)??null,[V,O.points]),M=$?.at(-1),q=F(null),[R,G]=H("line"),[A,de]=H(tt),[te,re]=H(null),[be,d]=H(!1),[m,w]=H(!1),N=F(null),B=kt(),Le=Pt(),Te=k||Le,[ye,$e]=H(!0),me=Gn(ye),ie=ce(()=>hn({history:p,observations:c,reference:p?.priceReference?{time:p.priceReference.timestamp,value:p.priceReference.price}:null}),[p,c]),b=ie.latest,ge=Math.max(me.now,b?.time??0),fe=te??ge,De=y=>re(y>=ge?null:Math.max(ge-86400,y)),Ie=y=>De(fe+y*A),ve=(y,se,Ne)=>{if(Math.abs(y)>Math.abs(se)){Ie(y/ze.width);return;}const le=Math.max(30,Math.min(86400,Math.round(A*Math.exp(Math.max(-200,Math.min(200,se))*5e-3))));te!==null&&De(fe+(le-A)*(1-Ne)),de(le);},z=ce(()=>({from:fe-A,to:fe}),[fe,A]),Me=ce(()=>p?.candles.filter(y=>y.t>=z.from&&y.t<=z.to)??[],[p,z]),K=o!==void 0,pe=P!==null&&me.nowMs>=P.observedAt&&me.nowMs-P.observedAt<St,he=ce(()=>Hn(p,pe?b?.value??null:null,me.now),[p,pe,b,me.now]),ke=b&&b.time<=fe?b.kind==="live"&&pe?"live":"stale":null,Be=ce(()=>ie.segments.some(y=>y.kind!=="bridge"&&y.points.length>1&&y.points[0].time<z.to&&y.points.at(-1).time>z.from),[ie.segments,z]),oe=ce(()=>{const y=gn(ie.segments,z);if(R==="candles")for(const se of Me)y.push(se.low,se.high);return ke&&b&&y.push(b.value),y;},[ie.segments,z,R,Me,ke,b]),xe=!Be&&b!==null,U=oe.length>0,s=K&&b?[b.value*0.95,b.value*1.05]:[];let f=bt(oe,s);f&&o!==void 0&&(o<f.low||o>f.high)&&(f=bt(oe,[...s,o]));const Z=`${A}:${K}`,J=F(null);let ne=null;if(f){const y=[...oe,...s,...(o!==void 0?[o]:[])],se=Math.min(...y),Ne=Math.max(...y),le=J.current;le&&le.key===Z&&le.range.low<=se&&le.range.high>=Ne&&le.range.high-le.range.low<=(f.high-f.low)*1.35?f=le.range:ne={key:Z,range:f};}Ye(()=>{ne&&(J.current=ne);});const{ref:we,width:Re,height:ot}=Ot({width:Vn,height:Ct},!0);ue(()=>{const y=we.current;if(!y||typeof IntersectionObserver!="function")return;const se=new IntersectionObserver(([Ne])=>$e(Ne?Ne.isIntersecting:!0),{rootMargin:"160px"});return se.observe(y),()=>se.disconnect();},[we]);const ze=Dn(Re,ot),at=K&&U&&b!==null,ae=wn({min:f?.low??0,max:f?.high??1,plot:ze,contextKey:v,enabled:b!==null,selectable:at,onSelect:r,onTimeWheel:ve,onTimePan:Ie}),Tt={from:z.from,to:z.to,low:ae.low,high:ae.high},st=F(!1),Dt=!st.current;Ye(()=>{U&&(st.current=!0);},[U]);const It=te===null&&me.visible&&ye&&!Te&&U,Se=n.kind==="error"||n.kind==="unavailable"?n.kind:p?.freshness.status==="source_unavailable"||p?.freshness.status==="reorg_detected"?"source":null,Fe=Se?qn[Se]:null,Rt=!Se&&p!==null&&p.candles.length===0&&p.coverage.coverageStart>0,_e=!Se&&b===null&&!U&&(n.kind==="loading"||_),lt=Fe&&!U?Fe:R==="candles"&&!Me.length&&!_e?"No recorded swap candles in this period.":U||_e?null:b?"No recorded prices in this period.":"Waiting for a current price.",ct=p!==null&&z.to-p.coverage.completedThrough>600,Ze=ct&&p?`Swap history indexed through ${nt.format(new Date(p.coverage.completedThrough*1e3))} · newer swaps may be missing`:null,Ge=U?K?{text:"Tap to set a target · drag to pan",hint:!0}:n.kind==="loading"&&p?{text:"Updating history…"}:Ze?{text:Ze}:b?.kind==="live"&&!pe?{text:"Updates interrupted"}:b&&b.kind!=="live"&&!_?{text:`Last price update ${nt.format(new Date(b.time*1e3))}`}:xe?{text:"Last observed price · collecting live history"}:{text:"Drag to pan · scroll to zoom time",hint:!0}:null,Ke=U?Fe??(Rt?"No trades in this period":null):null,ut=ct&&!Se,At=ae.manual||te!==null||A!==tt,Lt=()=>{ae.reset(),re(null),de(tt);},Je=(p?.candles.length??0)>0,dt=Ke??(_e?null:b?Je?null:"Candles need recorded price history.":Bn),ht=b?!U&&te!==null?"No recorded prices in this window":R==="candles"&&p?`${p.resolution} swap candles · live line shows pool observations`:xe?"Collecting live history":c.length>0?"Recorded prices and live observations":"Available recorded prices":"Waiting for recorded prices";return/* @__PURE__ */h("section",{className:"aegis-engine-widget__trade-chart","aria-label":"Pair price chart","aria-busy":_e||void 0,children:[/* @__PURE__ */h("div",{className:"aegis-engine-widget__chart-price-row",children:[/* @__PURE__ */h("div",{className:"aegis-engine-widget__trade-chart-head",children:[/* @__PURE__ */i("output",{"aria-label":"Last chart price",children:b?Ee(b.value):_e?/* @__PURE__ */i("span",{className:"aegis-swap-widget__skeleton aegis-swap-widget__skeleton--line",style:{"--aegis-skeleton-w":"6ch","--aegis-skeleton-h":"0.8em"}}):/* @__PURE__ */h(Pe,{children:[/* @__PURE__ */i("span",{"aria-hidden":"true",children:"—"}),/* @__PURE__ */i("span",{className:"aegis-swap-widget__sr-only",children:"Price unavailable"})]})}),/* @__PURE__ */h("span",{className:"aegis-engine-widget__pair-day-change","data-direction":he?he.percent<0?"down":"up":void 0,title:he?`${zn(he.absolute)} ${W.symbol} per ${T.symbol} over 24 hours`:void 0,children:[he?`${he.percent.toLocaleString("en-US",{maximumFractionDigits:2,signDisplay:"exceptZero"})}%`:/* @__PURE__ */h(Pe,{children:[/* @__PURE__ */i("span",{"aria-hidden":"true",children:"—"}),/* @__PURE__ */i("span",{className:"aegis-swap-widget__sr-only",children:"24h change unavailable"})]})," ",/* @__PURE__ */i("small",{children:"24h"})]}),/* @__PURE__ */h("span",{className:"aegis-engine-widget__price-caption",children:[/* @__PURE__ */h("span",{children:[W.symbol," per ",T.symbol]}),/* @__PURE__ */i("span",{"aria-hidden":"true",children:"·"}),/* @__PURE__ */h("button",{ref:q,type:"button",className:"aegis-engine-widget__price-source","aria-label":"Pool price details","aria-haspopup":"dialog","aria-expanded":x,onClick:()=>C(!0),children:["Pool price",ut?/* @__PURE__ */i("span",{className:"aegis-engine-widget__price-delayed",children:"Delayed"}):null," ",/* @__PURE__ */i(mt,{"aria-hidden":"true"})]})]})]}),o!==void 0?/* @__PURE__ */h("div",{className:"aegis-engine-widget__tap-target",children:[/* @__PURE__ */h("span",{children:["Target price ",/* @__PURE__ */i("small",{children:"(preview)"})]}),/* @__PURE__ */i("button",{type:"button","aria-label":"Lower target price by 1%",onClick:()=>r(o*0.99),children:/* @__PURE__ */i(gt,{"aria-hidden":"true"})}),/* @__PURE__ */i("output",{"aria-live":"polite","aria-atomic":"true","aria-label":"Selected target price",title:`${o} ${W.symbol} per ${T.symbol}`,children:/* @__PURE__ */i("span",{children:Ee(o)},o)}),/* @__PURE__ */i("button",{type:"button","aria-label":"Raise target price by 1%",onClick:()=>r(o*1.01),children:/* @__PURE__ */i(ft,{"aria-hidden":"true"})}),/* @__PURE__ */i("button",{type:"button",onClick:l,disabled:!l,"aria-label":"Clear target price",children:/* @__PURE__ */i(on,{"aria-hidden":"true"})})]}):null]}),/* @__PURE__ */i("div",{ref:we,className:"aegis-engine-widget__chart-plot","data-cursor-only":xe||void 0,children:_e?/* @__PURE__ */i(Ut,{}):/* @__PURE__ */i(Ln,{candles:R==="candles"?p?.candles??[]:void 0,entryPrice:L,onEntryClick:()=>{L!==void 0&&ae.centerOn(L);},width:Re,height:ot,plot:ze,segments:ie.segments,latest:U?b:null,domain:Tt,immediateDomain:Te||xe||ae.dragging||Dt||m,hold:ke,scrolling:It,selectedPrice:o,hoverPrice:ae.hover,selectable:at,emptyMessage:lt,onSelect:r,svgProps:ae.props})}),/* @__PURE__ */i(Fn,{historical:te!==null,seconds:A,onChange:de,coverage:U||lt?"":ht,reduceMotion:Te,onScrubbingChange:w}),/* @__PURE__ */h("div",{className:"aegis-engine-widget__trade-chart-ranges",children:[/* @__PURE__ */h("div",{className:"aegis-engine-widget__chart-styles",role:"group","aria-label":"Chart style",children:[/* @__PURE__ */i("button",{type:"button","aria-label":"Show line chart",title:"Line chart","aria-pressed":R==="line",onClick:()=>G("line"),children:/* @__PURE__ */i("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:/* @__PURE__ */i("path",{d:"M3 17 9 11l4 3 8-10"})})}),/* @__PURE__ */i("button",{type:"button","aria-label":"Show candles","aria-pressed":R==="candles",disabled:!Je,"aria-describedby":b&&!Je&&!Ke?B:void 0,title:"Candles",onClick:()=>G("candles"),children:/* @__PURE__ */h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[/* @__PURE__ */i("path",{d:"M7 2v4m0 10v6M17 2v8m0 8v4"}),/* @__PURE__ */i("path",{d:"M4 6h6v10H4zM14 10h6v8h-6z"})]})})]}),/* @__PURE__ */h("div",{className:"aegis-engine-widget__price-mode",role:"group","aria-label":"Price selection mode",children:[/* @__PURE__ */i("button",{type:"button","aria-pressed":!K,onClick:l,children:"Current price"}),/* @__PURE__ */i("button",{type:"button","aria-pressed":K,disabled:!b,"aria-describedby":b?void 0:B,onClick:()=>{b&&r(o??b.value);},children:"Price scenario"})]}),/* @__PURE__ */h("div",{className:"aegis-engine-widget__chart-tools",children:[/* @__PURE__ */i("button",{type:"button",ref:N,"aria-label":"Chart controls",title:"Chart controls","aria-haspopup":"dialog","aria-expanded":be,onClick:()=>d(!0),children:/* @__PURE__ */i(mt,{"aria-hidden":"true"})}),te!==null?/* @__PURE__ */i("button",{type:"button","aria-label":"Jump to now",title:"Jump to now",onClick:()=>re(null),children:/* @__PURE__ */i(wt,{"aria-hidden":"true"})}):null,/* @__PURE__ */h("div",{className:"aegis-engine-widget__chart-navigation",role:"group","aria-label":"Chart navigation",children:[/* @__PURE__ */i("button",{type:"button","aria-label":"Zoom out price range",disabled:!U,title:"Zoom out price range",onClick:ae.zoomOut,children:/* @__PURE__ */i(gt,{"aria-hidden":"true"})}),/* @__PURE__ */i("button",{type:"button","aria-label":"Zoom in price range",disabled:!U,title:"Zoom in price range",onClick:ae.zoomIn,children:/* @__PURE__ */i(ft,{"aria-hidden":"true"})}),/* @__PURE__ */i("button",{type:"button",disabled:!At,"aria-label":"Reset chart",title:"Reset chart",onClick:Lt,children:/* @__PURE__ */i(Ht,{"aria-hidden":"true"})})]}),Se==="error"?/* @__PURE__ */i("button",{type:"button",className:"aegis-engine-widget__chart-retry",disabled:n.kind==="loading",onClick:a,children:n.kind==="loading"?"Refreshing…":"Retry"}):null]})]}),/* @__PURE__ */i("p",{id:B,className:"aegis-engine-widget__trade-chart-status",role:Fe?"status":void 0,"aria-hidden":!dt||void 0,children:dt??" "}),/* @__PURE__ */i("span",{className:"aegis-swap-widget__sr-only",children:b?`Last observed ${W.symbol} per ${T.symbol}: ${Ee(b.value)}`:"No price observations"}),x?/* @__PURE__ */i(pt,{title:"Price sources",restoreFocusRef:q,onClose:()=>C(!1),children:/* @__PURE__ */h("div",{className:"aegis-engine-widget__price-details",children:[/* @__PURE__ */i("dl",{children:/* @__PURE__ */h("div",{children:[/* @__PURE__ */i("dt",{children:"Pool price"}),/* @__PURE__ */i("dd",{children:b?`${Ee(b.value)} ${W.symbol} per ${T.symbol}`:"Unavailable"})]})}),b?/* @__PURE__ */h("p",{children:["Observed ",new Date(b.time*1e3).toLocaleString()]}):null,ut?/* @__PURE__ */h("div",{className:"aegis-engine-widget__price-delay",children:[/* @__PURE__ */i("p",{children:Ze}),/* @__PURE__ */i("button",{type:"button",disabled:n.kind==="loading",onClick:a,children:n.kind==="loading"?"Refreshing…":"Refresh history"})]}):null,/* @__PURE__ */i("p",{children:"Pool observations and indexed swaps form this chart. Your execution quote can differ because of swap fees and price impact."}),O.loading?/* @__PURE__ */i("p",{role:"status",children:"Loading price context…"}):M&&$?/* @__PURE__ */h(Pe,{children:[/* @__PURE__ */i("p",{children:"Independent reference unavailable."}),/* @__PURE__ */h("details",{children:[/* @__PURE__ */i("summary",{children:"Token-derived history"}),/* @__PURE__ */i("p",{children:"Aegis token USD history · 12-hour bucket estimates."}),/* @__PURE__ */i("p",{children:"Original sources and observation times are unavailable. Token USD prices may come from this pool."}),/* @__PURE__ */h("dl",{children:[/* @__PURE__ */h("div",{children:[/* @__PURE__ */i("dt",{children:"Latest bucket ratio"}),/* @__PURE__ */h("dd",{children:[Ee(M.price)," ",W.symbol," per ",T.symbol]})]}),/* @__PURE__ */h("div",{children:[/* @__PURE__ */i("dt",{children:"Bucket starting"}),/* @__PURE__ */i("dd",{children:new Date(M.timestamp*1e3).toLocaleString()})]})]}),$.length>1?/* @__PURE__ */h(Pe,{children:[/* @__PURE__ */i("p",{children:"Earlier bucket starts"}),/* @__PURE__ */i("dl",{children:$.slice(-14,-1).map(y=>/* @__PURE__ */h("div",{children:[/* @__PURE__ */i("dt",{children:new Date(y.timestamp*1e3).toLocaleString()}),/* @__PURE__ */i("dd",{children:Ee(y.price)})]},y.timestamp))})]}):null]})]}):null,/* @__PURE__ */h("p",{children:[!O.loading&&!M?"Reference price unavailable. ":null,"This price context is display-only. It does not replace the pool price or authorize a trade."]})]})}):null,be?/* @__PURE__ */h(pt,{restoreFocusRef:N,title:"Chart controls",onClose:()=>d(!1),children:[/* @__PURE__ */h("section",{"aria-label":"Chart data",children:[/* @__PURE__ */i("p",{children:ht}),Ge&&!Ge.hint&&!Ke?/* @__PURE__ */i("p",{role:"status",children:Ge.text}):null]}),/* @__PURE__ */h("dl",{className:"aegis-engine-widget__chart-help-guide",children:[/* @__PURE__ */h("div",{children:[/* @__PURE__ */h("dt",{children:[/* @__PURE__ */i(Bt,{"aria-hidden":"true"}),"Move through time"]}),/* @__PURE__ */i("dd",{children:"Drag left or right, or scroll sideways with two fingers."})]}),/* @__PURE__ */h("div",{children:[/* @__PURE__ */h("dt",{children:[/* @__PURE__ */i(nn,{"aria-hidden":"true"}),"Zoom in or out"]}),/* @__PURE__ */i("dd",{children:"Scroll up or down over the chart, or pinch with two fingers. The timeframe slider follows your zoom."})]}),/* @__PURE__ */h("div",{children:[/* @__PURE__ */h("dt",{children:[/* @__PURE__ */i(Kt,{"aria-hidden":"true"}),"Choose a timeframe"]}),/* @__PURE__ */i("dd",{children:"Drag the slider or tap a preset, from 30 seconds to 1 day."})]}),/* @__PURE__ */h("div",{children:[/* @__PURE__ */h("dt",{children:[/* @__PURE__ */i(Zt,{"aria-hidden":"true"}),"Move the price scale"]}),/* @__PURE__ */i("dd",{children:"With a mouse, drag up or down. Use − and + below the chart to zoom the price scale."})]}),/* @__PURE__ */h("div",{children:[/* @__PURE__ */h("dt",{children:[/* @__PURE__ */i(wt,{"aria-hidden":"true"}),"Return to live"]}),/* @__PURE__ */i("dd",{children:"Jump to now keeps your timeframe. Reset returns to the live 1-minute view and fits the price scale."})]}),/* @__PURE__ */h("div",{children:[/* @__PURE__ */h("dt",{children:[/* @__PURE__ */i(Qt,{"aria-hidden":"true"}),"Explore a price scenario"]}),/* @__PURE__ */i("dd",{children:"Choose Price scenario, then tap the chart to set a target. The target is a preview only; it does not change your trade or place an order."})]})]}),/* @__PURE__ */i("p",{className:"aegis-engine-widget__chart-help-keys",children:"Using a keyboard? Focus the timeframe slider and use the arrow keys. Page Up and Page Down move between presets."})]}):null]});}export{nr as EngineTradeMarketChart};
|
|
@@ -1,55 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { u as R, a as T, b as G, c as I, d as O, e as L, f as x, g as D } from "./useEngineActivity-BkhItrUI.js";
|
|
3
|
-
import { WOLF_GAME_ENGINE_WIDGET_PRESET as k, WOLF_GAME_RESOURCES as v, WOLF_GAME_RESOURCE_ORDER as w, resolveWolfGameResource as M, wolfGameResourceWidgetProps as y } from "./presets/wolf-game.js";
|
|
4
|
-
import { normalizePartnerActionRequirement as N, normalizePartnerResourceAmount as z, partnerLaunchIntentForRequirement as C, partnerResourceAssetKey as U } from "./partner-context.js";
|
|
5
|
-
export * from "@aegis-engine/core";
|
|
6
|
-
import { AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT as H, AEGIS_SWAP_TOKENS as K, fetchGlobalTokenMetadata as q, resolveTokenIconUrl as j } from "@aegis-engine/core";
|
|
7
|
-
import { a as Q, m as V } from "./marketOrientation-B6SD7xSk.js";
|
|
8
|
-
import { A as Y, a as Z, b as $ } from "./markets-Dea2-UUy.js";
|
|
9
|
-
export {
|
|
10
|
-
Y as AEGIS_SWAP_CHAIN_ID,
|
|
11
|
-
H as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,
|
|
12
|
-
Z as AEGIS_SWAP_DEFAULT_POOL_IDS,
|
|
13
|
-
$ as AEGIS_SWAP_MARKETS,
|
|
14
|
-
K as AEGIS_SWAP_TOKENS,
|
|
15
|
-
s as AegisAggregatedSwapWidget,
|
|
16
|
-
i as AegisDirectSwapWidget,
|
|
17
|
-
o as AegisEngineBalancedLend,
|
|
18
|
-
n as AegisEnginePortfolio,
|
|
19
|
-
r as AegisEngineWidget,
|
|
20
|
-
t as AegisLeverageWidget,
|
|
21
|
-
A as AegisSwapProgressRail,
|
|
22
|
-
E as AegisSwapToaster,
|
|
23
|
-
g as AegisSwapWidget,
|
|
24
|
-
u as AmplifiWordmark,
|
|
25
|
-
S as ChainLogoMark,
|
|
26
|
-
_ as STOCK_BASE_BG,
|
|
27
|
-
k as WOLF_GAME_ENGINE_WIDGET_PRESET,
|
|
28
|
-
v as WOLF_GAME_RESOURCES,
|
|
29
|
-
w as WOLF_GAME_RESOURCE_ORDER,
|
|
30
|
-
c as aegisToast,
|
|
31
|
-
Q as assetFirstPair,
|
|
32
|
-
m as default,
|
|
33
|
-
l as deriveBasePalette,
|
|
34
|
-
P as deriveReadableAccent,
|
|
35
|
-
q as fetchGlobalTokenMetadata,
|
|
36
|
-
V as marketOrientation,
|
|
37
|
-
N as normalizePartnerActionRequirement,
|
|
38
|
-
z as normalizePartnerResourceAmount,
|
|
39
|
-
C as partnerLaunchIntentForRequirement,
|
|
40
|
-
U as partnerResourceAssetKey,
|
|
41
|
-
p as permissionFamiliesFromPlan,
|
|
42
|
-
j as resolveTokenIconUrl,
|
|
43
|
-
M as resolveWolfGameResource,
|
|
44
|
-
d as summarizeAuthorizationPlan,
|
|
45
|
-
R as useEngineAccountActivity,
|
|
46
|
-
T as useEngineAccountPortfolio,
|
|
47
|
-
G as useEngineAccountTransactionStatus,
|
|
48
|
-
W as useEngineBalancedLend,
|
|
49
|
-
I as useEngineHistoryPositions,
|
|
50
|
-
O as useEnginePositionAccounting,
|
|
51
|
-
L as useEnginePositionHistory,
|
|
52
|
-
x as useEnginePositionPnl,
|
|
53
|
-
D as useEngineTransactionHistory,
|
|
54
|
-
y as wolfGameResourceWidgetProps
|
|
55
|
-
};
|
|
1
|
+
import{A as s,k as i,l as o,m as n,n as r,o as t,p as A,q as E,r as g,s as u,t as S,S as _,v as c,k as m,w as l,x as P,y as p,z as d,B as W}from"./index-sKlFuUw-.js";import{u as R,a as T,b as G,c as I,d as O,e as L,f as x,g as D}from"./useEngineActivity-CKXYZ7qm.js";import{WOLF_GAME_ENGINE_WIDGET_PRESET as k,WOLF_GAME_RESOURCES as v,WOLF_GAME_RESOURCE_ORDER as w,resolveWolfGameResource as M,wolfGameResourceWidgetProps as y}from"./presets/wolf-game.js";import{normalizePartnerActionRequirement as N,normalizePartnerResourceAmount as z,partnerLaunchIntentForRequirement as C,partnerResourceAssetKey as U}from"./partner-context.js";export*from"@aegis-engine/core";import{AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT as H,AEGIS_SWAP_TOKENS as K,fetchGlobalTokenMetadata as q,resolveTokenIconUrl as j}from"@aegis-engine/core";import{a as Q,m as V}from"./marketOrientation-Blwrvl4i.js";import{A as Y,a as Z,b as $}from"./markets-DwaaaaTH.js";export{Y as AEGIS_SWAP_CHAIN_ID,H as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,Z as AEGIS_SWAP_DEFAULT_POOL_IDS,$ as AEGIS_SWAP_MARKETS,K as AEGIS_SWAP_TOKENS,s as AegisAggregatedSwapWidget,i as AegisDirectSwapWidget,o as AegisEngineBalancedLend,n as AegisEnginePortfolio,r as AegisEngineWidget,t as AegisLeverageWidget,A as AegisSwapProgressRail,E as AegisSwapToaster,g as AegisSwapWidget,u as AmplifiWordmark,S as ChainLogoMark,_ as STOCK_BASE_BG,k as WOLF_GAME_ENGINE_WIDGET_PRESET,v as WOLF_GAME_RESOURCES,w as WOLF_GAME_RESOURCE_ORDER,c as aegisToast,Q as assetFirstPair,m as default,l as deriveBasePalette,P as deriveReadableAccent,q as fetchGlobalTokenMetadata,V as marketOrientation,N as normalizePartnerActionRequirement,z as normalizePartnerResourceAmount,C as partnerLaunchIntentForRequirement,U as partnerResourceAssetKey,p as permissionFamiliesFromPlan,j as resolveTokenIconUrl,M as resolveWolfGameResource,d as summarizeAuthorizationPlan,R as useEngineAccountActivity,T as useEngineAccountPortfolio,G as useEngineAccountTransactionStatus,W as useEngineBalancedLend,I as useEngineHistoryPositions,O as useEnginePositionAccounting,L as useEnginePositionHistory,x as useEnginePositionPnl,D as useEngineTransactionHistory,y as wolfGameResourceWidgetProps};
|
package/dist/core.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import { AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT as o, AEGIS_SWAP_TOKENS as r, fetchGlobalTokenMetadata as e, resolveTokenIconUrl as S } from "@aegis-engine/core";
|
|
3
|
-
import { a as E, m as I } from "./marketOrientation-B6SD7xSk.js";
|
|
4
|
-
import { A as T, a as P, b as m } from "./markets-Dea2-UUy.js";
|
|
5
|
-
export {
|
|
6
|
-
T as AEGIS_SWAP_CHAIN_ID,
|
|
7
|
-
o as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,
|
|
8
|
-
P as AEGIS_SWAP_DEFAULT_POOL_IDS,
|
|
9
|
-
m as AEGIS_SWAP_MARKETS,
|
|
10
|
-
r as AEGIS_SWAP_TOKENS,
|
|
11
|
-
E as assetFirstPair,
|
|
12
|
-
e as fetchGlobalTokenMetadata,
|
|
13
|
-
I as marketOrientation,
|
|
14
|
-
S as resolveTokenIconUrl
|
|
15
|
-
};
|
|
1
|
+
export*from"@aegis-engine/core";import{AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT as o,AEGIS_SWAP_TOKENS as r,fetchGlobalTokenMetadata as e,resolveTokenIconUrl as S}from"@aegis-engine/core";import{a as E,m as I}from"./marketOrientation-Blwrvl4i.js";import{A as T,a as P,b as m}from"./markets-DwaaaaTH.js";export{T as AEGIS_SWAP_CHAIN_ID,o as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,P as AEGIS_SWAP_DEFAULT_POOL_IDS,m as AEGIS_SWAP_MARKETS,r as AEGIS_SWAP_TOKENS,E as assetFirstPair,e as fetchGlobalTokenMetadata,I as marketOrientation,S as resolveTokenIconUrl};
|
package/dist/hooks.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export {
|
|
3
|
-
i as useEngineAccountActivity,
|
|
4
|
-
o as useEngineAccountPortfolio,
|
|
5
|
-
t as useEngineAccountTransactionStatus,
|
|
6
|
-
e as useEngineHistoryPositions,
|
|
7
|
-
a as useEnginePositionAccounting,
|
|
8
|
-
u as useEnginePositionHistory,
|
|
9
|
-
c as useEnginePositionPnl,
|
|
10
|
-
g as useEngineTransactionHistory
|
|
11
|
-
};
|
|
1
|
+
import{u as i,a as o,b as t,c as e,d as a,e as u,f as c,g}from"./useEngineActivity-CKXYZ7qm.js";export{i as useEngineAccountActivity,o as useEngineAccountPortfolio,t as useEngineAccountTransactionStatus,e as useEngineHistoryPositions,a as useEnginePositionAccounting,u as useEnginePositionHistory,c as useEnginePositionPnl,g as useEngineTransactionHistory};
|