(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[9628],{66246:e=>{e.exports={wrap:"wrap-3JkbcgoB",input:"input-3JkbcgoB"}},44035:e=>{e.exports={icon:"icon-26rGYU-z"}},39628:(e,n,t)=>{"use strict";t.d(n,{TimeInput:()=>O});var u=t(43367),r=t(67294),o=t(94184),c=t.n(o),l=t(16282),a=t(66213),s=t(92136),i=t(81829),f=t(49775),p=t(44035),h=t(10130);function d(e){return r.createElement(f.Icon,{className:p.icon,icon:h})}var v=t(15965),g=t(66246);var m=t(47165),E=t(57968);const N={0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}};function b(e,n,t){const u=[],r=t;let o=0,c=0;const l=e.length,a=r.length;let s=-1,i=0;const f=[],p=l-1,h=[];let d;for(;o{const[t,u]=b(e,!1,n);s(t),g(u)},[n,e]),(0,r.useLayoutEffect)(()=>{const e=(0,l.ensureNotNull)(t.current);p&&(e.setSelectionRange(i,i),h(!1)),f(S(e))},[p]),[n,v,{onChange:function(){const n=(0,l.ensureNotNull)(t.current),u=n.value,[r,o]=b(e,!1,u);s(r),v.current=r;const c=g(o),p=function(e,n,t,u,r,o){if(e!==n){const c=n.length,l=e.length;let a=0,s=0,i=0,f=0,p=0;for(p=u;p=0&&r[p];p--)a++;for(p=u-1;p>=0;p--)r[p]&&i++;for(p=t-1;p>=0;p--)o[p]&&f++;if(u>l)u=10*c;else if(t>=u&&t!==l){if(o[u]){const e=u;u-=f-i,r[u-=a]&&(u=e)}}else u>t&&(u+=i-f,u+=s)}return u}(a,r,i,S(n),o,c);f(p),h(!0)},onSelect:function(){const e=(0,l.ensureNotNull)(t.current);f(S(e))},maxLength:u}];function g(e){const n=d.current;return d.current=e,n}}function S(e){return e.selectionStart||0}function w(e){const{value:n,mask:t,onChange:u,...o}=e,c=(0,r.useRef)(null),[l,a,s]=C(t,n,c);return(0,r.useLayoutEffect)(()=>{void 0!==e.reference&&(e.reference.current=c.current)},[e.reference]),r.createElement(i.InputControl,{...o,maxLength:s.maxLength,value:l,autoComplete:"off",reference:function(e){c.current=e},onChange:function(){s.onChange(),u(a.current)},onSelect:s.onSelect})}var k=t(42998),x=t(76420),y=t(95860),R=t(49382);const B=(()=>{const e=[];for(let n=0;n<24;++n)for(let t=0;t<60;t+=15){const[u,r]=[D(n.toString()),D(t.toString())],o=`${u}:${r}`,c=F(o)?o:L(o);e.push(c)}return e})();function I(e){let n=!1;const t=(0,r.useRef)(null),u=(0,r.useRef)(null),o=(0,r.useRef)(null),a=(0,r.useRef)(null),[i,f]=(0, v.useFocus)(),[p,h]=(0,r.useState)(e.value),g=A(p),N=F(g)?g:L(g),[b,C]=(0,r.useState)(N),S=i||T().some(e=>null!==e&&e.contains(document.activeElement));(0,r.useLayoutEffect)(()=>h(e.value),[e.value]),(0,r.useLayoutEffect)(()=>C(N),[p,S]),(0,r.useEffect)(()=>V(b===N?"auto":"smooth"),[b]);const I=(0,R.lowerbound)(B,N,(e,n)=>eu&&r>n){const t=(0,E.clamp)(r,0,u),c=(0,E.clamp)(r,0,n);r=Math.max(t,c),o=t>c?e.top-t:e.bottom}else r>n&&(o=e.top-r);return{x:e.left,y:o,overrideWidth:e.width,overrideHeight:r}},closeOnClickOutside:!1,isOpened:S,tabIndex:-1,reference:o},D.map(e=>r.createElement(y.PopupMenuItem,{key:e,label:e,isActive:e===N,isHovered:e===b,reference:e===b?$:void 0,onClick:z,onClickArg:e}))));function O(t){const u=A(t),r=F(u)?u:L(u);h(r),n||(n=!0,e.onChange(r))}function $(e){a.current=e}function z(e){O((0,l.ensureDefined)(e)),(0,l.ensureNotNull)(o.current).blur()}function H(e){return i&&(null!==P(document.activeElement)||null!==P(e.relatedTarget))}function P(e){return e instanceof Node&&T().find(n=>null!==n&&n.contains(e))||null}function T(){return[o.current,u.current]}function V(e="auto"){if(null!==a.current){const n=(0,l.ensureNotNull)(o.current).getBoundingClientRect(),t=a.current.getBoundingClientRect();(n.top>t.top||n.bottom{p.current&&u&&(p.current.defaultValue=u)},[]),(0,r.useLayoutEffect)(()=>{p.current&&u&&(p.current.value=u)},[u]),r.createElement("div",{className:c()(g.wrap,o)},r.createElement(i.InputControl,{...f,type:"text",endSlot:r.createElement(s.EndSlot,{icon:!0},r.createElement(d,null)),value:u,highlight:h,intent:h?"primary":void 0,onFocus:function(e){(0,l.ensureNotNull)(p.current).focus(),t&&t(e)},onChange:function(){}}),r.createElement("input",{...m,disabled:e.disabled,className:g.input,type:"time",onBlur:E,onChange:function(e){const{value:t}=e.currentTarget;n&&t&&n(t)},ref:p}))}:I},10130:e=>{e.exports=''}}]);