1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6835],{5929:(e,t,i)=>{function n(e){var t=e.width,i=e.height;if(t<0)throw Error("Negative width is not allowed for Size");if(i<0)throw Error("Negative height is not allowed for Size");return{width:t,height:i}}function r(e,t){return e.width===t.width&&e.height===t.height}i.d(t,{Dv:()=>o,zE:()=>r,Ej:()=>n,vb:()=>c});var s=function(){function e(e){var t=this;this._resolutionListener=function(){return t._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=e,this._installResolutionListener()}return e.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(e.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){var t=this,i={next:e};return this._observers.push(i),{unsubscribe:function(){t._observers=t._observers.filter(function(e){return e!==i})}}},e.prototype._installResolutionListener=function(){if(null!==this._resolutionMediaQueryList)throw Error("Resolution listener is already installed");var e=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(e,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){null!==this._resolutionMediaQueryList&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){var e=this;this._observers.forEach(function(t){return t.next(e._window.devicePixelRatio)}),this._reinstallResolutionListener()},e}(),a=function(){function e(e,t,i){var r;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=e,this._canvasElementClientSize=n({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=null!=t?t:function(e){return e},this._allowResizeObserver=null==(r=null==i?void 0:i.allowResizeObserver)||r,this._chooseAndInitObserver()}return e.prototype.dispose=function(){var e,t;if(null===this._canvasElement)throw Error("Object is disposed");null==(e=this._canvasElementResizeObserver)||e.disconnect(),this._canvasElementResizeObserver=null,null==(t=this._devicePixelRatioObservable)||t.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(e.prototype,"canvasElement",{get:function(){if(null===this._canvasElement)throw Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bitmapSize",{get:function(){return n({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),e.prototype.resizeCanvasElement=function(e){this._canvasElementClientSize=n(e),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},e.prototype.subscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners.push(e)},e.prototype.unsubscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(t){return t!==e})},Object.defineProperty(e.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),e.prototype.subscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners.push(e)},e.prototype.unsubscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(t){return t!==e})},e.prototype.applySuggestedBitmapSize=function(){if(null!==this._suggestedBitmapSize){var e=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(e),this._emitSuggestedBitmapSizeChanged(e,this._suggestedBitmapSize)}},e.prototype._resizeBitmap=function(e){var t=this.bitmapSize;r(t,e)||(this.canvasElement.width=e.width,this.canvasElement.height=e.height,this._emitBitmapSizeChanged(t,e))},e.prototype._emitBitmapSizeChanged=function(e,t){var i=this;
1this._bitmapSizeChangedListeners.forEach(function(n){return n.call(i,e,t)})},e.prototype._suggestNewBitmapSize=function(e){var t=this._suggestedBitmapSize,i=n(this._transformBitmapSize(e,this._canvasElementClientSize)),s=r(this.bitmapSize,i)?null:i;(null!==t||null!==s)&&(null!==t&&null!==s&&r(t,s)||(this._suggestedBitmapSize=s,this._emitSuggestedBitmapSizeChanged(t,s)))},e.prototype._emitSuggestedBitmapSizeChanged=function(e,t){var i=this;this._suggestedBitmapSizeChangedListeners.forEach(function(n){return n.call(i,e,t)})},e.prototype._chooseAndInitObserver=function(){var e=this;if(!this._allowResizeObserver)return void this._initDevicePixelRatioObservable();new Promise(function(e){var t=new ResizeObserver(function(i){e(i.every(function(e){return"devicePixelContentBoxSize"in e})),t.disconnect()});t.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1}).then(function(t){return t?e._initResizeObserver():e._initDevicePixelRatioObservable()})},e.prototype._initDevicePixelRatioObservable=function(){var e=this;if(null!==this._canvasElement){var t=l(this._canvasElement);if(null===t)throw Error("No window is associated with the canvas");this._devicePixelRatioObservable=new s(t),this._devicePixelRatioObservable.subscribe(function(){return e._invalidateBitmapSize()}),this._invalidateBitmapSize()}},e.prototype._invalidateBitmapSize=function(){if(null!==this._canvasElement){var e,t,i=l(this._canvasElement);if(null!==i){var r,s,a=null!=(t=null==(e=this._devicePixelRatioObservable)?void 0:e.value)?t:i.devicePixelRatio,o=this._canvasElement.getClientRects(),u=void 0!==o[0]?(r=o[0],s=a,n({width:Math.round(r.left*s+r.width*s)-Math.round(r.left*s),height:Math.round(r.top*s+r.height*s)-Math.round(r.top*s)})):n({width:this._canvasElementClientSize.width*a,height:this._canvasElementClientSize.height*a});this._suggestNewBitmapSize(u)}}},e.prototype._initResizeObserver=function(){var e=this;null!==this._canvasElement&&(this._canvasElementResizeObserver=new ResizeObserver(function(t){var i=t.find(function(t){return t.target===e._canvasElement});if(i&&i.devicePixelContentBoxSize&&i.devicePixelContentBoxSize[0]){var r=i.devicePixelContentBoxSize[0],s=n({width:r.inlineSize,height:r.blockSize});e._suggestNewBitmapSize(s)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},e}();function o(e,t){if("device-pixel-content-box"===t.type)return new a(e,t.transform,t.options);throw Error("Unsupported binding target")}function l(e){return e.ownerDocument.defaultView}var u=function(){function e(e,t,i){if(0===t.width||0===t.height)throw TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=t,0===i.width||0===i.height)throw TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=i,this._context=e}return e.prototype.useMediaCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),e({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},e.prototype.useBitmapCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),e({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(e.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),e}();function c(e,t){var i=e.canvasElementClientSize;if(0===i.width||0===i.height)return null;var n=e.bitmapSize;if(0===n.width||0===n.height)return null;var r=e.canvasElement.getContext("2d",t);return null===r?null:new u(r,i,n)}},36475:(e,t,i)=>{i.r(t),i.d(t,{default:()=>h});var n=i(37876),r=i(11290),s=i(14232),a=i(2813),o=i(35265);function l(e){let t=e.trim(),i=t.indexOf(".");return -1===i?0:t.length-i-1}function u(e,t,i){let n={type:"custom",minMove:10**-i,formatter:e=>(function(e,t){if(!Number.isFinite(e))return String(e);let i=e<0,n=Math.abs(e);if(0===t)return"".concat(i?"-":"").concat(Math.trunc(n));let r=10**t,s=Math.trunc(n*r+1e-12),a=Math.floor(s/r);return"".concat(i?"-":"").concat(a,".").concat(String(s%r).padStart(t,"0"))})(e,i)};t.applyOptions({priceFormat:n}),e.applyOptions({localization:{priceFormatter:n.formatter}})}function c(e,t){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}let h=e=>{let{symbol:t,resolution:i,tick:h}=e,d=(0,s.useRef)(null),f=(0,s.useRef)(null),m=(0,s.useRef)(null),p=(0,s.useRef)(0),v=(0,s.useRef)(0),g=(0,s.useRef)(h);g.current=h;let{data:b,loading:_,error:y}=function(e,t){let{origin:i}
1=(0,o.sn)(),[n,r]=(0,s.useState)([]),[l,u]=(0,s.useState)(!0),[c,h]=(0,s.useState)(null),d=(0,s.useCallback)(async n=>{if(!e||!a.RE){r([]),u(!1),h(null);return}try{u(!0),h(null);let s=await fetch(function(e,t){let i=Math.floor(Date.now()/1e3),n=function(e){switch(e){case"M5":return 300;case"H1":default:return 3600;case"D1":return 86400;case"W1":return 604800;case"MN":return 2592e3}}(t),r=new URLSearchParams({Symbol:e,From:String(i-200*n),To:String(i),Timeframe:String(function(e){switch(e){case"M5":return 5;case"H1":default:return 60;case"D1":return 1440;case"W1":return 10080;case"MN":return 43200}}(t))});return"".concat(a.RE,"/api/Chart/history?").concat(r)}(e,t),{signal:n,headers:{Accept:"application/json","X-Site-Origin":i,origin:i}}),o=await s.json().catch(()=>null);if(null==n?void 0:n.aborted)return;if(!s.ok){h("Failed to load chart history"),r([]);return}let l=function(e){var t,i,n;if(!e||"object"!=typeof e)return[];if("success"in e&&e.data&&"object"==typeof e.data&&!Array.isArray(e.data)&&Array.isArray(e.data.bars))return function(e){var t,i;if(!e||"object"!=typeof e)return[];let n=null!=(i=null==(t=e.data)?void 0:t.bars)?i:[];if(!Array.isArray(n)||0===n.length)return[];let r=new Map;for(let e of n)"number"==typeof e.time&&"number"==typeof e.close&&r.set(e.time,e.close);let s=[];for(let[e,t]of r)s.push({time:e,value:t});return s.sort((e,t)=>e.time-t.time)}(e);let r=null!=(n=null!=(i=null!=(t=e.series)?t:e.points)?i:Array.isArray(e.data)?e.data:void 0)?n:Array.isArray(e.candles)?e.candles.map(e=>({time:e.time,value:e.close})):void 0;if(!Array.isArray(r))return[];let s=[];for(let e of r){if(!e||"object"!=typeof e)continue;let t=function(e){let t="number"==typeof e.time?e.time:"number"==typeof e.t?e.t:null,i="number"==typeof e.value?e.value:"number"==typeof e.close?e.close:"number"==typeof e.v?e.v:null;return null===t||null===i?null:{time:t,value:i}}(e);t&&s.push(t)}return s.sort((e,t)=>e.time-t.time)}(o);r(l)}catch(e){if("AbortError"===e.name)return;h("Failed to load chart history"),r([])}finally{(null==n?void 0:n.aborted)||u(!1)}},[e,t,i]);return(0,s.useEffect)(()=>{let e=new AbortController;return d(e.signal),()=>e.abort()},[d]),{data:n,loading:l,error:c,refetch:(0,s.useCallback)(()=>d(),[d])}}(t,i),S=(0,s.useCallback)(e=>{let t=f.current,i=m.current;if(!t||!i)return;let n=function(e){if(!e)return 5;let t=Math.max(l(e.bid),l(e.ask),e.high?l(e.high):0,e.low?l(e.low):0);return t>0?t:5}(null!=e?e:g.current);n!==p.current&&(p.current=n,u(t,i,n))},[]),z=(0,s.useCallback)(e=>{let t=m.current;if(!t||!e)return;let i=function(e){let t=Number(e.bid),i=Number(e.timestamp);return Number.isFinite(t)&&Number.isFinite(i)?{time:i,value:t}:null}(e);i&&(i.time<v.current||(S(e),v.current=i.time,t.update({time:i.time,value:i.value})))},[S]);return(0,s.useLayoutEffect)(()=>{p.current=0,v.current=0;let e=d.current;if(!e)return;let t=c("--primary-clr","#2563eb"),i=c("--border-subtle","#e5e7eb"),n=c("--text-secondary","#5c5c5c"),s=t.startsWith("#")&&7===t.length?"".concat(t,"33"):"rgba(37, 99, 235, 0.2)",a=t.startsWith("#")&&7===t.length?"".concat(t,"00"):"rgba(37, 99, 235, 0)",o=(0,r.R9)(e,{layout:{background:{type:r.mE.Solid,color:"transparent"},textColor:n,fontFamily:"var(--font-primary), system-ui, sans-serif"},grid:{vertLines:{color:i},horzLines:{color:i}},rightPriceScale:{borderVisible:!1},timeScale:{borderVisible:!1},crosshair:{vertLine:{visible:!1},horzLine:{visible:!1}},width:e.clientWidth,height:e.clientHeight}),l=o.addSeries(r.ti,{lineColor:t,topColor:s,bottomColor:a,lineWidth:2});f.current=o,m.current=l,p.current=5,u(o,l,5);let h=new ResizeObserver(()=>{if(!d.current)return;let{width:e,height:t}=d.current.getBoundingClientRect();o.applyOptions({width:e,height:t})});return h.observe(e),()=>{h.disconnect(),o.remove(),f.current=null,m.current=null}},[t]),(0,s.useEffect)(()=>{S(h)},[h,S]),(0,s.useEffect)(()=>{var e,t;let i=m.current;if(!i)return;let n=b.map(e=>({time:e.time,value:e.value}));i.setData(n),v.current=n.length>0?Number(null==(e=n[n.length-1])?void 0:e.time):0,null==(t=f.current)||t.timeScale().fitContent(),S(g.current),z(g.current)},[b,z,S]),(0,s.useEffect)(()=>{z(h)},[h,z]),(0,n.jsxs)("div",{className:"relative h-80 min-h-[240px] w-full lg:h-96",children:[(0,n.jsx)("div",{ref:d,className:"h-full w-full","aria-label":"Live price chart for ".concat(t),role:"img"}),_&&(0,n.jsx)("div",{className:"bg-surface-muted/80 text-muted absolute inset-0 flex items-center justify-center text-sm",children:"Loading chartâ¦"}),y&&!_&&(0,n.jsx)("div",{className:"bg-surface-muted/80 text-danger absolute inset-0 flex items-center justify-center px-4 text-center text-sm",children:y})]})}}}]);
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.