(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[1859],{97754:(e,t)=>{var n;!function(){"use strict";var a={}.hasOwnProperty;function l(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)&&n.length){var r=l.apply(null,n);r&&e.push(r)}else if("object"===o)for(var i in n)a.call(n,i)&&n[i]&&e.push(i)}}return e.join(" ")}e.exports?(l.default=l,e.exports=l):void 0===(n=function(){return l}.apply(t,[]))||(e.exports=n)}()},88317:e=>{e.exports={pills:"pills-PVWoXu5j",primary:"primary-PVWoXu5j",gray:"gray-PVWoXu5j",selected:"selected-PVWoXu5j",grouped:"grouped-PVWoXu5j",active:"active-PVWoXu5j",disableActiveOnTouch:"disableActiveOnTouch-PVWoXu5j",disableActiveStateStyles:"disableActiveStateStyles-PVWoXu5j",withGrouped:"withGrouped-PVWoXu5j","quiet-primary":"quiet-primary-PVWoXu5j",green:"green-PVWoXu5j",red:"red-PVWoXu5j",blue:"blue-PVWoXu5j",secondary:"secondary-PVWoXu5j",ghost:"ghost-PVWoXu5j"}},1538:e=>{e.exports={lightButton:"lightButton-bYDQcOkp",link:"link-bYDQcOkp",ltr:"ltr-bYDQcOkp",rtl:"rtl-bYDQcOkp","typography-regular16px":"typography-regular16px-bYDQcOkp","typography-medium16px":"typography-medium16px-bYDQcOkp","typography-regular14px":"typography-regular14px-bYDQcOkp","typography-semibold14px":"typography-semibold14px-bYDQcOkp","typography-semibold16px":"typography-semibold16px-bYDQcOkp",content:"content-bYDQcOkp",visuallyHidden:"visuallyHidden-bYDQcOkp",nowrap:"nowrap-bYDQcOkp",ellipsisContainer:"ellipsisContainer-bYDQcOkp",textWrapContainer:"textWrapContainer-bYDQcOkp",textWrapWithEllipsis:"textWrapWithEllipsis-bYDQcOkp",slot:"slot-bYDQcOkp",caret:"caret-bYDQcOkp",activeCaret:"activeCaret-bYDQcOkp",xsmall:"xsmall-bYDQcOkp",withStartSlot:"withStartSlot-bYDQcOkp",withEndSlot:"withEndSlot-bYDQcOkp",noContent:"noContent-bYDQcOkp",wrap:"wrap-bYDQcOkp",small:"small-bYDQcOkp",medium:"medium-bYDQcOkp"}},33636:e=>{e.exports={"link-item":"link-item-eIA09f0e"}},32498:e=>{e.exports={"arrow-icon":"arrow-icon-NIrWNOPk",dropped:"dropped-NIrWNOPk","size-xsmall":"size-xsmall-NIrWNOPk","size-small":"size-small-NIrWNOPk","size-medium":"size-medium-NIrWNOPk","size-large":"size-large-NIrWNOPk","size-xlarge":"size-xlarge-NIrWNOPk"}},56406:e=>{e.exports={"underline-tab":"underline-tab-cfYYXvwA","disable-focus-outline":"disable-focus-outline-cfYYXvwA","enable-cursor-pointer":"enable-cursor-pointer-cfYYXvwA",selected:"selected-cfYYXvwA","disable-active-state-styles":"disable-active-state-styles-cfYYXvwA","size-xsmall":"size-xsmall-cfYYXvwA","size-small":"size-small-cfYYXvwA","size-medium":"size-medium-cfYYXvwA","size-large":"size-large-cfYYXvwA","size-xlarge":"size-xlarge-cfYYXvwA",fake:"fake-cfYYXvwA","margin-xsmall":"margin-xsmall-cfYYXvwA","margin-small":"margin-small-cfYYXvwA","margin-medium":"margin-medium-cfYYXvwA","margin-large":"margin-large-cfYYXvwA","margin-xlarge":"margin-xlarge-cfYYXvwA",collapse:"collapse-cfYYXvwA","ellipsis-children":"ellipsis-children-cfYYXvwA"}},98163:e=>{e.exports={
"scroll-wrap":"scroll-wrap-SmxgjhBJ","size-xlarge":"size-xlarge-SmxgjhBJ","enable-scroll":"enable-scroll-SmxgjhBJ","underline-tabs":"underline-tabs-SmxgjhBJ","size-large":"size-large-SmxgjhBJ","size-medium":"size-medium-SmxgjhBJ","size-small":"size-small-SmxgjhBJ","size-xsmall":"size-xsmall-SmxgjhBJ","make-grid-column":"make-grid-column-SmxgjhBJ","stretch-tabs":"stretch-tabs-SmxgjhBJ","equal-tab-size":"equal-tab-size-SmxgjhBJ"}},50368:e=>{e.exports={underline:"underline-Pun8HxCz",center:"center-Pun8HxCz",corner:"corner-Pun8HxCz",disabled:"disabled-Pun8HxCz"}},27011:(e,t,n)=>{"use strict";function a(e,t){return t||null==e||("string"==typeof e||Array.isArray(e))&&0===e.length}n.d(t,{isIconOnly:()=>a})},14543:(e,t,n)=>{"use strict";n.d(t,{LightButton:()=>a.LightButton});n(9038);var a=n(15893);n(50959),n(21593),n(66860),n(1538),n(88317);n(49406)},9038:(e,t,n)=>{"use strict";n.d(t,{useLightButtonClasses:()=>c});var a=n(50959),l=n(97754),o=n(17946),r=n(27011),i=n(86332);const s=a.createContext({isInButtonGroup:!1,isGroupPrimary:!1}),c=(e,t,n)=>{const c=(0,a.useContext)(o.CustomBehaviourContext),{className:u,isSelected:d,children:m,showCaret:p,forceDirection:f,iconOnly:v,color:g="gray",variant:b="primary",size:h="medium",enableActiveStateStyles:y=c.enableActiveStateStyles,typography:w,isLink:x=!1,textWrap:C,isPills:D,isActive:S,startSlot:k,endSlot:E}=t,O=e[`typography-${((e,t,n)=>{if(n){const e=n.replace(/^\D+/g,"");return t?`semibold${e}`:n}switch(e){case"xsmall":return t?"semibold14px":"regular14px";case"small":case"medium":return t?"semibold16px":"regular16px";default:return""}})(h,d||D,w||void 0)}`],A=(0,a.useContext)(i.ControlGroupContext),{isInButtonGroup:N,isGroupPrimary:T}=(0,a.useContext)(s);return l(u,e.lightButton,x&&e.link,S&&e.active,d&&e.selected,(0,r.isIconOnly)(m,v)&&e.noContent,!!k&&e.withStartSlot,(p||!!E)&&e.withEndSlot,n&&e.withGrouped,f&&e[f],e[T?"primary":b],e[T?"gray":g],e[h],O,!y&&e.disableActiveStateStyles,A.isGrouped&&e.grouped,C&&e.wrap,N&&e.disableActiveOnTouch,D&&e.pills)}},66860:(e,t,n)=>{"use strict";n.d(t,{LightButtonContent:()=>m});var a=n(50959),l=n(97754),o=n(34094),r=n(27011),i=n(9745),s=n(2948),c=n(1538),u=n.n(c);const d=e=>a.createElement(i.Icon,{className:l(u().caret,e&&u().activeCaret),icon:s});function m(e){const{showCaret:t,iconOnly:n,ellipsis:i=!0,textWrap:s,tooltipText:c,children:m,endSlot:p,startSlot:f,isActiveCaret:v}=e;[p,t].filter((e=>!!e));return a.createElement(a.Fragment,null,f&&a.createElement("span",{className:l(u().slot,u().startSlot)},f),!(0,r.isIconOnly)(m,n)&&a.createElement("span",{className:l(u().content,!s&&u().nowrap,"apply-overflow-tooltip","apply-overflow-tooltip--check-children-recursively","apply-overflow-tooltip--allow-text"),"data-overflow-tooltip-text":c??(0,o.getTextForTooltip)(m)},s||i?a.createElement(a.Fragment,null,a.createElement("span",{className:l(!s&&i&&u().ellipsisContainer,s&&u().textWrapContainer,s&&i&&u().textWrapWithEllipsis)},m),a.createElement("span",{className:u().visuallyHidden,"aria-hidden":!0
},m)):a.createElement(a.Fragment,null,m,a.createElement("span",{className:u().visuallyHidden,"aria-hidden":!0},m))),p&&a.createElement("span",{className:l(u().slot,u().endSlot)},p),t&&d(v))}},15893:(e,t,n)=>{"use strict";n.d(t,{LightButton:()=>d});var a=n(50959),l=n(86332),o=n(9038),r=n(66860),i=n(1538),s=n.n(i),c=n(88317),u=n.n(c);function d(e){const{isGrouped:t}=a.useContext(l.ControlGroupContext),{reference:n,className:i,isSelected:c,children:d,iconOnly:m,ellipsis:p,showCaret:f,forceDirection:v,endSlot:g,startSlot:b,color:h,variant:y,size:w,enableActiveStateStyles:x,typography:C,textWrap:D=!1,maxLines:S,style:k={},isPills:E,isActive:O,tooltipText:A,role:N,...T}=e,P=D?S??2:1,R=P>0?{...k,"--ui-lib-light-button-content-max-lines":P}:k;return a.createElement("button",{...T,className:(0,o.useLightButtonClasses)({...u(),...s()},{className:i,isSelected:c,children:d,iconOnly:m,showCaret:f,forceDirection:v,endSlot:g,startSlot:b,color:h,variant:y,size:w,enableActiveStateStyles:x,typography:C,textWrap:D,isPills:E,isActive:O},t),ref:n,style:R,role:N},a.createElement(r.LightButtonContent,{showCaret:f,isActiveCaret:f&&(E||O||c),iconOnly:m,ellipsis:p,textWrap:D,tooltipText:A,endSlot:g,startSlot:b},d))}},34094:(e,t,n)=>{"use strict";n.d(t,{getTextForTooltip:()=>r});var a=n(50959);const l=e=>(0,a.isValidElement)(e)&&Boolean(e.props.children),o=e=>null==e||"boolean"==typeof e||"{}"===JSON.stringify(e)?"":e.toString()+" ",r=e=>Array.isArray(e)||(0,a.isValidElement)(e)?a.Children.toArray(e).reduce(((e,t)=>{let n="";return n=(0,a.isValidElement)(t)&&l(t)?r(t.props.children):(0,a.isValidElement)(t)&&!l(t)?"":o(t),e.concat(n)}),"").trim():o(e)},86720:(e,t,n)=>{"use strict";n.d(t,{UnderlineButtonTabs:()=>$});var a,l=n(50959),o=n(97754),r=n.n(o),i=n(11542),s=n(95854),c=n(38528),u=n(47201),d=n(7953),m=n(36966),p=n(26597);!function(e){e.XSmall="xsmall",e.Small="small",e.Medium="medium",e.Large="large",e.XLarge="xlarge"}(a||(a={}));const f=(0,l.createContext)({size:"small",overflowBehaviour:void 0});var v=n(17946),g=n(56406);function b(e){const{size:t="xsmall",active:n,fake:a,enableActiveStateStyles:l,anchor:r=!1,hideFocusOutline:i=!1,equalTabSize:s,className:c,overflowBehaviour:u}=e;return o(g["underline-tab"],g[`size-${t}`],n&&g.selected,!l&&g["disable-active-state-styles"],i&&g["disable-focus-outline"],a&&g.fake,r&&g["enable-cursor-pointer"],s&&g[`margin-${t}`],"collapse"===u&&g.collapse,c)}const h=(0,l.forwardRef)(((e,t)=>{const{size:n,overflowBehaviour:a}=(0,l.useContext)(f),o=(0,l.useContext)(v.CustomBehaviourContext),{active:i,fake:s,className:c,enableActiveStateStyles:u=o.enableActiveStateStyles,hideFocusOutline:d=!1,equalTabSize:m,children:p,...h}=e;return l.createElement("button",{...h,ref:t,className:b({size:n,active:i,fake:s,enableActiveStateStyles:u,hideFocusOutline:d,equalTabSize:m,className:c,overflowBehaviour:a})},m&&"string"==typeof p?l.createElement("span",{className:r()(g["ellipsis-children"],"apply-overflow-tooltip")},p):p)}));h.displayName="UnderlineTabsBaseButton";const y=(0,l.forwardRef)(((e,t)=>{
const{item:n,highlighted:a,handleItemRef:o,onClick:r,"aria-disabled":i,...s}=e,c=(0,l.useCallback)((()=>{r&&r(n)}),[r,n]),u=(0,l.useCallback)((e=>{o&&o(n,e),t&&"object"==typeof t?t.current=e:"function"==typeof t&&t(e)}),[n,o,t]);return l.createElement(h,{...s,id:n.id,onClick:c,ref:u},n.label)}));y.displayName="UnderlineButtonTab";var w=n(50151),x=n(16396),C=n(4523),D=n(9745),S=n(47531),k=n(2948),E=n(63509),O=n(68874),A=n(32498);function N(e){switch(e){case"xsmall":return S;case"small":return k;case"medium":case"large":return E;case"xlarge":return O}}function T(e){const{size:t,isDropped:n=!1}=e;return l.createElement(D.Icon,{icon:N(t),className:o(A["arrow-icon"],A[`size-${t}`],n&&A.dropped)})}var P=n(33636);const R=4,z=4;function I(e){const{size:t,disabled:n,isOpened:a,enableActiveStateStyles:o,hideFocusOutline:r,fake:i,items:s,buttonContent:u,buttonRef:d,isAnchorTabs:m,isHighlighted:p,onButtonClick:f,onItemClick:v,onClose:g}=e,b=(0,l.useRef)(null),y=(0,c.useMergedRefs)([d,b]),D=function(e,t){const n=(0,l.useRef)(Y);return(0,l.useEffect)((()=>{const e=getComputedStyle((0,w.ensureNotNull)(t.current));n.current={xsmall:B(e,"xsmall"),small:B(e,"small"),medium:B(e,"medium"),large:B(e,"large"),xlarge:B(e,"xlarge")}}),[t]),(0,l.useCallback)((()=>{const a=(0,w.ensureNotNull)(t.current).getBoundingClientRect(),l=n.current[e];return{x:a.left,y:a.top+a.height+l+R,indentFromWindow:{top:z,bottom:z,left:z,right:z}}}),[t,e])}(t,b);return l.createElement(C.PopupMenuDisclosureView,{buttonRef:b,listboxTabIndex:-1,isOpened:a,onClose:g,listboxAria:{"aria-hidden":!0},popupPosition:D,button:l.createElement(h,{"aria-hidden":!0,disabled:n,active:a,onClick:f,ref:y,tabIndex:-1,enableActiveStateStyles:o,hideFocusOutline:r,fake:i},u,l.createElement(T,{size:t,isDropped:a})),popupChildren:s.map((e=>l.createElement(x.PopupMenuItem,{key:e.id,className:m?P["link-item"]:void 0,onClick:v,onClickArg:e,isActive:p(e),label:e.label,isDisabled:e.disabled,link:"href"in e?e.href:void 0,rel:"rel"in e?e.rel:void 0,target:"target"in e?e.target:void 0,renderComponent:"renderComponent"in e?e.renderComponent:void 0,dontClosePopup:!0})))})}function B(e,t){return parseInt(e.getPropertyValue(`--ui-lib-underline-tabs-tab-margin-bottom-${t}`),10)}const Y={xsmall:0,small:0,medium:0,large:0,xlarge:0};var W=n(75774),M=n(86781),V=n(86240),F=n(98163);function X(e){const{size:t,overflowBehaviour:n,className:a}=e;return o(F["scroll-wrap"],F[`size-${t}`],"scroll"===n&&F["enable-scroll"],a)}function L(){const[e,t]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{t(W.mobiletouch)}),[]),e}var j=n(90484),G=n(63273),Q=n(50368),H=n.n(Q);const _=100;function U(e){const{disabled:t,translateX:n,transitionDuration:a}=e,r=e.scale/100;return l.createElement("div",{className:o(H().underline,t&&H().disabled),style:{transform:`translateX(${n}px) scaleX(${r})`,transitionDuration:`${a}ms`}},l.createElement("div",{className:H().corner,style:{transform:`scaleX(${1/r})`}}),l.createElement("div",{className:H().center,style:{transform:`scaleX(${1-30/e.scale})`}}),l.createElement("div",{
className:H().corner,style:{transform:`scaleX(${1/r})`}}))}function $(e){const{id:t,items:a,activationType:o,orientation:v,disabled:g,moreButtonContent:b=i.t(null,void 0,n(37117)),size:h="small",onActivate:w,isActive:x,className:C,style:D,overflowBehaviour:S,enableActiveStateStyles:k,tablistLabelId:E,tablistLabel:O,"data-name":A="underline-tabs-buttons",stretchTabs:N,equalTabSize:T,defaultKeyboardFocus:P,stopPropagationIfKeyboardActionHandled:R,keyboardNavigationLoop:z,focusableItemAttributes:B}=e,Y=L(),W=function(e){const t=(0,M.useSafeMatchMedia)(V["media-mf-phone-landscape"],!0),n=L();return e??(n||!t?"scroll":"collapse")}(S),Q=(0,l.useRef)(!1),H=(0,l.useCallback)((e=>e.id),[]),$="none"===W&&N,J="none"===W&&T,q=k??!Y,{visibleItems:K,hiddenItems:Z,containerRefCallback:ee,innerContainerRefCallback:te,moreButtonRef:ne,setItemRef:ae}=(0,s.useCollapsible)(a,H,x),le="collapse"===W?K:a,oe="collapse"===W?Z:[],re=(0,l.useCallback)((e=>oe.includes(e)),[oe]),ie=(0,l.useRef)(new Map),{isOpened:se,open:ce,close:ue,onButtonClick:de}=(0,d.useDisclosure)({id:t,disabled:g}),me=function(e="xsmall"){switch(e){case"xsmall":case"small":return 12;case"medium":return 16;case"large":case"xlarge":return 20}}(h),{tabsBindings:pe,tablistBinding:fe,scrollWrapBinding:ve,onActivate:ge,onHighlight:be,isHighlighted:he}=(0,m.useTabs)({id:t,items:[...le,...oe],activationType:o,orientation:v,disabled:g,tablistLabelId:E,tablistLabel:O,onActivate:w,isActive:x,isCollapsed:re,isRtl:G.isRtl,itemsRefs:ie,isDisclosureOpened:se,defaultKeyboardFocus:P,stopPropagationIfKeyboardActionHandled:R,keyboardNavigationLoop:z,focusableItemAttributes:B,scrollIntoViewOptions:{additionalScroll:me}}),ye=a.find(x),we=oe.find(he),xe=(0,l.useCallback)((()=>{ye&&be(ye)}),[be,ye]),Ce=(0,l.useCallback)((e=>pe.find((t=>t.id===e.id))??{}),[pe]),De=(0,l.useCallback)((()=>{ue(),xe(),Q.current=!0}),[ue,xe]),Se=(0,l.useCallback)((()=>{we&&(ge(we),be(we,200))}),[ge,be,we]);ve.ref=(0,c.useMergedRefs)([ve.ref,ee]),fe.ref=(0,c.useMergedRefs)([fe.ref,te]),fe.onKeyDown=(0,u.createSafeMulticastEventHandler)((0,p.useKeyboardEventHandler)([(0,p.useKeyboardClose)(se,De),(0,p.useKeyboardActionHandler)([13,32],Se,(0,l.useCallback)((()=>Boolean(we)),[we]))]),fe.onKeyDown);const ke=(0,l.useCallback)((e=>{Q.current=!0,de(e)}),[Q,de]),Ee=(0,l.useCallback)((e=>{e&&ge(e)}),[ge]);(0,l.useEffect)((()=>{Q.current?Q.current=!1:(we&&!se&&ce(),!we&&se&&ue())}),[we,se,ce,ue]);const Oe=function(e,t,n=[]){const[a,o]=(0,l.useState)(),r=(0,l.useRef)(),i=(0,l.useRef)(),s=e=>{const t=e.parentElement??void 0;if(void 0===t)return;const n=void 0===i.current||i.current===e?0:_;i.current=e;const{left:a,right:l,width:r}=e.getBoundingClientRect(),{left:s,right:c}=t.getBoundingClientRect(),u=(0,G.isRtl)()?l-c:a-s;o({translateX:u,scale:r,transitionDuration:n})};return(0,l.useEffect)((()=>{const e=(0,j.default)((e=>{const t=e[0].target;void 0!==t&&s(t)}),50);r.current=new ResizeObserver(e)}),[]),(0,l.useEffect)((()=>{if(void 0===t)return;const n=e.get(t);return void 0!==n?(s(n),r.current?.observe(n),
()=>r.current?.disconnect()):void 0}),n),a}(ie.current,ye??we,[ye??we,le,h,$,W]);return l.createElement(f.Provider,{value:{size:h,overflowBehaviour:W}},l.createElement("div",{...ve,className:X({size:h,overflowBehaviour:W,className:C}),style:D,"data-name":A},l.createElement("div",{...fe,className:r()(F["underline-tabs"],{[F["make-grid-column"]]:$||J,[F["stretch-tabs"]]:$,[F["equal-tab-size"]]:J})},le.map((e=>l.createElement(y,{...Ce(e),key:e.id,item:e,onClick:ge,enableActiveStateStyles:q,hideFocusOutline:Y,ref:ae(H(e)),...e.dataId&&{"data-id":e.dataId},equalTabSize:J}))),oe.map((e=>l.createElement(y,{...Ce(e),ref:ae(H(e)),key:e.id,item:e,fake:!0}))),"collapse"===W&&l.createElement(I,{size:h,disabled:g,isOpened:se,items:oe,buttonContent:b,buttonRef:ne,isHighlighted:he,onButtonClick:ke,onItemClick:Ee,onClose:ue,enableActiveStateStyles:q,hideFocusOutline:Y,fake:0===oe.length}),Oe?l.createElement(U,{...Oe,disabled:g}):l.createElement("div",null))))}var J=n(38952);function q(e){return l.createElement("a",{...(0,J.renameRef)(e)})}(0,l.forwardRef)(((e,t)=>{const{size:n,overflowBehaviour:a}=(0,l.useContext)(f),o=(0,l.useContext)(v.CustomBehaviourContext),{item:r,highlighted:i,handleItemRef:s,onClick:c,active:u,fake:d,className:m,enableActiveStateStyles:p=o.enableActiveStateStyles,hideFocusOutline:g=!1,disabled:h,"aria-disabled":y,...w}=e,x=(0,l.useCallback)((e=>{y?e.preventDefault():c&&c(r)}),[c,y,r]),C=(0,l.useCallback)((e=>{s&&s(r,e),t&&"object"==typeof t?t.current=e:"function"==typeof t&&t(e)}),[r,s,t]),D=r.renderComponent??q;return l.createElement(D,{...w,id:r.id,"aria-disabled":y,onClick:x,reference:C,href:r.href,rel:r.rel,target:r.target,className:b({size:n,active:u,fake:d,enableActiveStateStyles:p,anchor:!0,hideFocusOutline:g,className:m,overflowBehaviour:a})},r.label)})).displayName="UnderlineAnchorTab"},4237:(e,t,n)=>{"use strict";var a=n(32227);t.createRoot=a.createRoot,a.hydrateRoot},93355:e=>{e.exports={calendar:"calendar-PM3TZruR"}},29741:e=>{e.exports={row:"row-Sj9z7O1v",mobileRow:"mobileRow-Sj9z7O1v"}},7037:e=>{e.exports={dialogWrapper:"dialogWrapper-P_IVoUsZ",dialogWrapperSmall:"dialogWrapperSmall-P_IVoUsZ",tabs:"tabs-P_IVoUsZ",content:"content-P_IVoUsZ",contentMobile:"contentMobile-P_IVoUsZ",bodyWrapper:"bodyWrapper-P_IVoUsZ"}},84828:(e,t,n)=>{"use strict";n.r(t),n.d(t,{showGoToDateDialog:()=>le});var a=n(50959),l=n(50151),o=n(82992),r=n(23935),i=n(51826),s=n(2740);const c=a.createContext(null);function u(e){const{initialGoToDate:t,children:n}=e,[l,o]=(0,a.useState)(t),i=l.valueOf()<=(0,r.resetToDayEnd)(new Date).valueOf(),s=(0,a.useMemo)((()=>({date:l,setDate:o,isValid:i})),[l,i]);return a.createElement(c.Provider,{value:s},n)}const d=a.createContext(null);function m(e){const{initialRanges:t,children:n}=e,[l,o]=(0,a.useState)(t.from),[r,i]=(0,a.useState)(t.to),s=l.valueOf()<=r.valueOf(),c=(0,a.useMemo)((()=>({dateFrom:l,dateTo:r,setDateFrom:o,setDateTo:i,isValid:s})),[l,r,s]);return a.createElement(d.Provider,{value:c},n)}
var p=n(11542),f=n(97754),v=n.n(f),g=n(76422),b=n(56840),h=n.n(b),y=n(52092),w=n(24437),x=n(50182),C=n(15499),D=n(29741);function S(e){const{children:t}=e;return a.createElement("div",{className:v()(D.row,j&&D.mobileRow)},t)}var k=n(85528),E=n(76056);const O=a.createContext({isActive:!1,isFocused:!1});function A(e){const{value:t,reference:n,isActive:l,onPick:o,onFocus:r,isDisabled:i,minValue:s,maxValue:c}=e,[u,d]=(0,a.useState)(!1);return a.createElement(O.Provider,{value:{isActive:l,isFocused:u}},a.createElement("div",{onFocus:function(){d(!0),r&&r()},onBlur:function(){d(!1)}},a.createElement(k.DatePicker,{initial:t,minDate:s,maxDate:c,inputReference:n,InputComponent:N,withCalendar:!1,onPick:function(e){if(!e)return;o(new Date(e))},revertInvalidData:!0,name:e.name,disabled:i})))}function N(e){const{isActive:t,isFocused:n}=(0,a.useContext)(O);return a.createElement(E.DateInput,{...e,highlight:t||n})}var T=n(36565);function P(e){const{value:t,isDisabled:n,onPick:l,className:o}=e;return a.createElement(T.TimeInput,{value:(i=t,(0,r.twoDigitsFormat)(i.getHours())+":"+(0,r.twoDigitsFormat)(i.getMinutes())),onChange:l,disabled:n,className:o});var i}var R=n(44313),z=n(93355);function I(e){const{className:t,...n}=e;return a.createElement(R.Calendar,{...n,className:v()(z.calendar,t),popupStyle:!1})}function B(e,t){const n=new Date(t);return n.setFullYear(e.getFullYear()),n.setMonth(e.getMonth(),1),n.setDate(e.getDate()),n}function Y(e,t){const n=new Date(t);return n.setHours(e.getHours()),n.setMinutes(e.getMinutes()),n}function W(e){const{dateOnly:t,onCalendarMonthSwitch:n,hideTimePick:o,minDate:r,datePickDelegate:i}=e,{date:s,setDate:u}=(0,l.ensureNotNull)((0,a.useContext)(c)),d=(0,a.useRef)(null),m=(0,a.useRef)(null);return(0,a.useEffect)((()=>{j||null===d.current||d.current.focus()}),[]),(0,a.useEffect)((()=>(i?.subscribe(null,p),()=>{i?.unsubscribe(null,p)})),[i]),a.createElement("div",null,a.createElement(S,null,a.createElement(A,{reference:function(e){d.current=e},value:new Date(s),onPick:function(e){p(B(e,s))},isActive:!j,minValue:r}),!o&&a.createElement(P,{value:new Date(s),isDisabled:t,onPick:function(e){const[t,n]=e.split(":"),a=new Date;a.setHours(Number(t)),a.setMinutes(Number(n));const l=Y(a,s);u(l),j||l.valueOf()===s.valueOf()||m.current?.focus()}})),!j&&a.createElement(I,{calendarRef:m,selectedDate:new Date(s),onSelect:function(e){const t=B(e,s);u(t)},onMonthSwitch:n,maxDate:new Date,minDate:r}));function p(e){u(e),m.current?.setViewDate(e),m.current?.setViewType(C.CalendarViewType.Month)}}function M(e){const{dateOnly:t,onCalendarMonthSwitch:n,onDateInputFocus:o}=e,{dateFrom:r,dateTo:i,setDateFrom:s,setDateTo:c}=(0,l.ensureNotNull)((0,a.useContext)(d)),[u,m]=(0,a.useState)("from"),p=(0,a.useRef)(null),f=(0,a.useRef)(null),v=(0,a.useRef)(null),g=(0,a.useMemo)((()=>"from"===u?new Date(r):new Date(i)),[u,i,r]);return(0,a.useEffect)((()=>{j||null===p.current||p.current.focus()}),[]),a.createElement("div",null,a.createElement(S,null,a.createElement(A,{value:r,reference:function(e){p.current=e},
isActive:!j&&"from"===u,onPick:function(e){const t=B(e,r);s(t),b(t)},onFocus:function(){m("from"),b(r),o()},name:"start-date-range"}),a.createElement(P,{value:r,isDisabled:t,onPick:function(e){h(e,r,(e=>{s(e),j||r.valueOf()===e.valueOf()||f.current?.focus({preventScroll:!0})}))}})),a.createElement(S,null,a.createElement(A,{value:i,reference:function(e){f.current=e},isActive:!j&&"to"===u,onPick:function(e){const t=B(e,i);c(t),b(t)},onFocus:function(){m("to"),b(i),o()},name:"end-date-range"}),a.createElement(P,{value:i,isDisabled:t,onPick:function(e){h(e,i,(e=>{c(e),j||i.valueOf()===e.valueOf()||v.current?.focus()}))}})),!j&&a.createElement(I,{calendarRef:v,selectedDate:new Date(g),onSelect:function(e){const t=B(e,"from"===u?r:i);({from:()=>{s(t),f.current?.focus({preventScroll:!0})},to:()=>{c(t)}})[u]()},onMonthSwitch:n,highlightedFrom:new Date(r),highlightedTo:new Date(i),maxDate:"from"===u?new Date(i):void 0,minDate:"to"===u?new Date(r):void 0}));function b(e){v.current?.setViewDate(e),v.current?.setViewType(C.CalendarViewType.Month)}function h(e,t,n){const[a,l]=e.split(":"),o=new Date;o.setHours(Number(a)),o.setMinutes(Number(l));n(Y(o,t))}}var V=n(86720),F=n(90692),X=n(32563),L=n(7037);const j=X.mobiletouch;var G;!function(e){e.Date="Date",e.CustomRange="CustomRange"}(G||(G={}));const Q=()=>!0,H=[{label:p.t(null,void 0,n(22677)),id:"Date",dataId:"tab-item-date"},{label:p.t(null,void 0,n(81861)),id:"CustomRange",dataId:"tab-item-customrange"}];function _(e){const{dateOnly:t,onClose:o,onGoToDate:r,onGoToRange:i}=e,s=(0,a.useRef)(null),[u,m]=(0,a.useState)(h().getValue("GoToDialog.activeTab","Date")),[f,b]=(0,a.useState)(0),{date:C,isValid:D}=(0,l.ensureNotNull)((0,a.useContext)(c)),{dateFrom:S,dateTo:k,isValid:E}=(0,l.ensureNotNull)((0,a.useContext)(d));return(0,a.useEffect)((()=>(g.subscribe(y.CLOSE_POPUPS_AND_DIALOGS_COMMAND,T,null),()=>{g.unsubscribe(y.CLOSE_POPUPS_AND_DIALOGS_COMMAND,T,null)})),[o]),(0,a.useEffect)((()=>{null!==s.current&&s.current()}),[f,u,C,S,k]),a.createElement(F.MatchMedia,{rule:w.DialogBreakpoints.TabletSmall},(e=>a.createElement(x.AdaptiveConfirmDialog,{className:v()(L.dialogWrapper,e&&L.dialogWrapperSmall),title:p.t(null,void 0,n(42432)),dataName:"go-to-date-dialog",render:O,defaultActionOnClose:"cancel",onClose:T,onClickOutside:T,onCancel:T,onSubmit:N,submitButtonDisabled:A(),submitButtonText:p.t(null,void 0,n(42432)),forceCloseOnEsc:Q,shouldForceFocus:!1,fullScreen:e,isOpened:!0})));function O({requestResize:e}){return s.current=e,a.createElement(a.Fragment,null,a.createElement("div",{className:L.tabs},a.createElement(V.UnderlineButtonTabs,{id:"go-to-date-tabs",isActive:e=>e.id===u,items:H,onActivate:P,overflowBehaviour:"scroll"})),a.createElement("div",{className:v()(L.content,j&&L.contentMobile)},a.createElement("div",{className:L.bodyWrapper},a.createElement(U,{onCalendarMonthSwitch:R,onDateInputFocus:R,activeTab:u,dateOnly:t}))))}function A(){return{CustomRange:!E,Date:!D}[u]}function N(){switch(u){case"Date":r(C);break;case"CustomRange":i(S,k)}}function T(){o()}function P(e){
m(e.id),h().setValue("GoToDialog.activeTab",e.id)}function R(){b(f+1)}}function U(e){const{activeTab:t,dateOnly:n,onCalendarMonthSwitch:l,onDateInputFocus:o}=e;switch(t){case"Date":return a.createElement(W,{dateOnly:n,onCalendarMonthSwitch:l});case"CustomRange":return a.createElement(M,{dateOnly:n,onCalendarMonthSwitch:l,onDateInputFocus:o})}}function $(e){const{dateOnly:t,onClose:n,onGoToDate:l,onGoToRange:o,initialGoToDate:r,initialRanges:i}=e;return a.createElement(u,{initialGoToDate:r},a.createElement(m,{initialRanges:i},a.createElement(_,{dateOnly:t,onClose:n,onGoToDate:l,onGoToRange:o})))}var J,q=n(10074),K=n(8025);!function(e){e.GoToDateTabLastPickedDate="goToDateTabLastPickedDate",e.DetailsKeyStatsExpanded="detailsKeyStatsExpanded",e.DetailsIncomeStatementPeriodId="detailsIncomeStatementPeriodId"}(J||(J={}));const Z=new class{constructor(){this._hasError=!1}getItemOrDefault(e,t){return!sessionStorage||this._hasError?t:sessionStorage.getItem(e)}setItem(e,t="true"){try{sessionStorage.setItem(e,t),this._hasError=!1}catch(e){this._hasError=!0}}};var ee=n(27365),te=n(87896);const ne="goTo",ae=new i.DialogsOpenerManager;function le(e){if(ae.isOpened(ne))return;if(!e.hasModel())return;const t=e.model(),n=document.createElement("div"),l=a.createElement($,{onClose:c,dateOnly:t.model().mainSeries().isDWM(),initialGoToDate:oe(e),initialRanges:re(e),onGoToDate:e=>{!function(e,t){Z.setItem("goToDateTabLastPickedDate",String(t.valueOf()));if(void 0===e.model().timeScale().tickMarks().minIndex)return;const n=(0,r.addLocalTime)(t).valueOf();e.model().gotoTime(n).then((t=>{const n=e.model().mainSeries();void 0===t?n.clearGotoDateResult():n.setGotoDateResult(t)}))}(t,e),c()},onGoToRange:(t,n)=>{!function(e,t,n){const a=(0,ee.getTimezoneName)(e.model());if(!a)return;const l=o.linking.interval.value(),i=l&&(0,q.normalizeIntervalString)(l),c=(0,s.get_timezone)(a),u=e=>(0,s.cal_to_utc)(c,new Date(e)),d=(0,r.addLocalTime)(t).valueOf(),m=(0,r.addLocalTime)(n).valueOf(),p={val:{type:"time-range",from:u(d)/1e3,to:u(m)/1e3},res:i};e.chartWidgetCollection().setTimeFrame(p)}(e,t,n),c()}}),i=(0,te.createReactRoot)(l,n);function c(){i.unmount(),ae.setAsClosed(ne)}ae.setAsOpened(ne)}function oe(e){const t=Z.getItemOrDefault("goToDateTabLastPickedDate",null);if(null===t)return(0,r.resetToDayStart)(new Date);const n=new Date(Number(t));return e.model().model().mainSeries().isDWM()?(0,r.resetToDayStart)(n):n}function re(e){const t=function(e){const t=e.model().timeScale(),n=t.visibleBarsStrictRange();if(null===n)return;const a=e.model().mainSeries(),o=a.nearestIndex(n.firstBar(),K.PlotRowSearchMode.NearestRight),r=a.nearestIndex(n.lastBar(),K.PlotRowSearchMode.NearestLeft);if(void 0===o||void 0===r)return;return{from:(0,l.ensureNotNull)(t.indexToUserTime(o)),to:(0,l.ensureNotNull)(t.indexToUserTime(r))}}(e);return t?{from:(0,r.subtractLocalTime)(t.from),to:(0,r.subtractLocalTime)(t.to)}:{from:(0,r.subtractLocalTime)(new Date),to:(0,r.subtractLocalTime)(new Date)}}},47531:e=>{
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="m4.67 7.38.66-.76L9 9.84l3.67-3.22.66.76L9 11.16 4.67 7.38Z"/></svg>'},63509:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M3.57 7.85 9 12.62l5.43-4.77-1.32-1.5L9 9.95l-4.11-3.6-1.32 1.5Z"/></svg>'},68874:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill="currentColor" d="m14 18.41-6.7-6.7 1.4-1.42 5.3 5.3 5.3-5.3 1.4 1.41-6.7 6.71Z"/></svg>'},55698:(e,t,n)=>{"use strict";n.d(t,{nanoid:()=>a});let a=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")}}]);