(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[847],{28209:e=>{e.exports={checkbox:"checkbox-2jiVkfto",reverse:"reverse-2jiVkfto",label:"label-2jiVkfto",baseline:"baseline-2jiVkfto"}},38817:e=>{e.exports={"textarea-container":"textarea-container-1F0MhDpb","change-highlight":"change-highlight-1F0MhDpb",focused:"focused-1F0MhDpb","resize-vertical":"resize-vertical-1F0MhDpb","resize-horizontal":"resize-horizontal-1F0MhDpb","resize-both":"resize-both-1F0MhDpb",textarea:"textarea-1F0MhDpb"}},81880:e=>{e.exports={wrap:"wrap-kAIcH6Vi",thicknessItem:"thicknessItem-kAIcH6Vi",checked:"checked-kAIcH6Vi",radio:"radio-kAIcH6Vi",bar:"bar-kAIcH6Vi"}},50105:e=>{e.exports={innerLabel:"innerLabel-21h1g6jU"}},76535:e=>{e.exports={controlWrapper:"controlWrapper-7ApHzdB4",hidden:"hidden-7ApHzdB4",control:"control-7ApHzdB4",controlIncrease:"controlIncrease-7ApHzdB4",controlDecrease:"controlDecrease-7ApHzdB4",controlIcon:"controlIcon-7ApHzdB4",title:"title-7ApHzdB4"}},44718:e=>{e.exports={content:"content-22S1W3v8",cell:"cell-22S1W3v8",inner:"inner-22S1W3v8",first:"first-22S1W3v8",inlineCell:"inlineCell-22S1W3v8",fill:"fill-22S1W3v8",top:"top-22S1W3v8",topCenter:"topCenter-22S1W3v8",offset:"offset-22S1W3v8",inlineRow:"inlineRow-22S1W3v8",grouped:"grouped-22S1W3v8",separator:"separator-22S1W3v8",groupSeparator:"groupSeparator-22S1W3v8",big:"big-22S1W3v8",adaptive:"adaptive-22S1W3v8",checkableTitle:"checkableTitle-22S1W3v8"}},44766:e=>{e.exports={wrap:"wrap-3GItoI3T",icon:"icon-3GItoI3T",text:"text-3GItoI3T",disabled:"disabled-3GItoI3T"}},96976:e=>{e.exports={colorPickerWrap:"colorPickerWrap-3gSLMlhu",focused:"focused-3gSLMlhu",readonly:"readonly-3gSLMlhu",disabled:"disabled-3gSLMlhu","size-small":"size-small-3gSLMlhu","size-medium":"size-medium-3gSLMlhu","size-large":"size-large-3gSLMlhu","font-size-small":"font-size-small-3gSLMlhu","font-size-medium":"font-size-medium-3gSLMlhu","font-size-large":"font-size-large-3gSLMlhu","border-none":"border-none-3gSLMlhu",shadow:"shadow-3gSLMlhu","border-thin":"border-thin-3gSLMlhu","border-thick":"border-thick-3gSLMlhu","intent-default":"intent-default-3gSLMlhu","intent-success":"intent-success-3gSLMlhu","intent-warning":"intent-warning-3gSLMlhu","intent-danger":"intent-danger-3gSLMlhu","intent-primary":"intent-primary-3gSLMlhu","corner-top-left":"corner-top-left-3gSLMlhu","corner-top-right":"corner-top-right-3gSLMlhu","corner-bottom-right":"corner-bottom-right-3gSLMlhu","corner-bottom-left":"corner-bottom-left-3gSLMlhu",colorPicker:"colorPicker-3gSLMlhu",swatch:"swatch-3gSLMlhu",placeholderContainer:"placeholderContainer-3gSLMlhu",placeholder:"placeholder-3gSLMlhu",white:"white-3gSLMlhu",opacitySwatch:"opacitySwatch-3gSLMlhu",colorLine:"colorLine-3gSLMlhu",thicknessContainer:"thicknessContainer-3gSLMlhu",thicknessTitle:"thicknessTitle-3gSLMlhu"}},69343:e=>{e.exports={thicknessContainer:"thicknessContainer-2K1QSVfY",thicknessTitle:"thicknessTitle-2K1QSVfY"}},2626:e=>{e.exports={hasTooltip:"hasTooltip-2kfQACVg",uppercase:"uppercase-2kfQACVg"}},75671:e=>{e.exports={
wrap:"wrap-2tojvhF7"}},38093:e=>{e.exports={checkbox:"checkbox-FNjK79Y1",title:"title-FNjK79Y1"}},22196:e=>{e.exports={titleWrap:"titleWrap-3OnZWCnE",title:"title-3OnZWCnE"}},37850:(e,t,n)=>{"use strict";n.d(t,{Checkbox:()=>c});var o=n(67294),r=n(94184),a=n(82604),s=n(53400),l=n(28209),i=n.n(l);class c extends o.PureComponent{render(){const{inputClassName:e,labelClassName:t,...n}=this.props,a=r(this.props.className,i().checkbox,{[i().reverse]:Boolean(this.props.labelPositionReverse),[i().baseline]:Boolean(this.props.labelAlignBaseline)}),l=r(i().label,t,{[i().disabled]:this.props.disabled});let c=null;return this.props.label&&(c=o.createElement("span",{className:l,title:this.props.title},this.props.label)),o.createElement("label",{className:a},o.createElement(s.CheckboxInput,{...n,className:e}),c)}}c.defaultProps={value:"on"};(0,a.makeSwitchGroupItem)(c)},40803:(e,t,n)=>{"use strict";n.d(t,{Textarea:()=>v});var o,r=n(67294),a=n(94184),s=n(66364),l=n(15965),i=n(65686),c=n(53563),u=n(66213),d=n(1130),p=n(11888),h=n(92136),m=n(38817),g=n.n(m);!function(e){e.None="none",e.Vertical="vertical",e.Horizontal="horizontal",e.Both="both"}(o||(o={}));const b=r.forwardRef((e,t)=>{const{id:n,title:o,tabIndex:s,containerTabIndex:l,role:i,inputClassName:c,autoComplete:u,autoFocus:d,cols:m,disabled:b,isFocused:f,form:C,maxLength:v,minLength:y,name:S,placeholder:E,readonly:N,required:k,rows:w,value:x,defaultValue:M,wrap:I,containerReference:T,onChange:L,onSelect:P,onFocus:V,onContainerFocus:_,onBlur:F,...z}=e,B={id:n,title:o,tabIndex:s,role:i,autoComplete:u,autoFocus:d,cols:m,disabled:b,form:C,maxLength:v,minLength:y,name:S,placeholder:E,readOnly:N,required:k,rows:w,value:x,defaultValue:M,wrap:I,onChange:L,onSelect:P,onFocus:V,onBlur:F};return r.createElement(p.ControlSkeleton,{...z,tabIndex:l,disabled:b,readonly:N,isFocused:f,ref:T,onFocus:_,middleSlot:r.createElement(h.MiddleSlot,null,r.createElement("textarea",{...B,className:a(g().textarea,c),ref:t}))})});b.displayName="TextareaView";const f=(e,t,n)=>t?void 0:e?-1:n,C=(e,t,n)=>t?void 0:e?n:-1,v=r.forwardRef((e,t)=>{e=(0,i.useControl)(e);const{className:n,disabled:p,autoSelectOnFocus:h,tabIndex:m=0,borderStyle:v,highlight:y,resize:S,containerReference:E=null,onFocus:N,onBlur:k,...w}=e,x=(0,r.useRef)(null),M=(0,r.useRef)(null),{isMouseDown:I,handleMouseDown:T,handleMouseUp:L}=(0,c.useIsMouseDown)(),[P,V]=(0,l.useFocus)(),_=(0,u.createSafeMulticastEventHandler)(V.onFocus,(function(e){h&&!I.current&&(0,d.selectAllContent)(e.currentTarget)}),N),F=(0,u.createSafeMulticastEventHandler)(V.onBlur,k),z=void 0!==S&&S!==o.None,B=null!=v?v:z?y?"thick":"thin":void 0,D=null!=y?y:!z&&void 0;return r.createElement(b,{...w,className:a(g()["textarea-container"],z&&g()["change-highlight"],S&&S!==o.None&&g()["resize-"+S],P&&g().focused,n),disabled:p,isFocused:P,containerTabIndex:f(P,p,m),tabIndex:C(P,p,m),borderStyle:B,highlight:D,onContainerFocus:function(e){M.current===e.target&&null!==x.current&&x.current.focus()},onFocus:_,onBlur:F,onMouseDown:T,onMouseUp:L,ref:function(e){x.current=e,
"function"==typeof t?t(e):t&&(t.current=e)},containerReference:(0,s.useMergedRefs)([E,M])})});v.displayName="Textarea"},82604:(e,t,n)=>{"use strict";n.d(t,{SwitchGroup:()=>a,makeSwitchGroupItem:()=>s});var o=n(67294),r=n(45697);class a extends o.PureComponent{constructor(){super(...arguments),this._subscriptions=new Set,this._getName=()=>this.props.name,this._getValues=()=>this.props.values,this._getOnChange=()=>this.props.onChange,this._subscribe=e=>{this._subscriptions.add(e)},this._unsubscribe=e=>{this._subscriptions.delete(e)}}getChildContext(){return{switchGroupContext:{getName:this._getName,getValues:this._getValues,getOnChange:this._getOnChange,subscribe:this._subscribe,unsubscribe:this._unsubscribe}}}render(){return this.props.children}componentDidUpdate(e){this._notify(this._getUpdates(this.props.values,e.values))}_notify(e){this._subscriptions.forEach(t=>t(e))}_getUpdates(e,t){return[...t,...e].filter(n=>t.includes(n)?!e.includes(n):e.includes(n))}}function s(e){var t;return(t=class extends o.PureComponent{constructor(){super(...arguments),this._onChange=e=>{this.context.switchGroupContext.getOnChange()(e)},this._onUpdate=e=>{e.includes(this.props.value)&&this.forceUpdate()}}componentDidMount(){this.context.switchGroupContext.subscribe(this._onUpdate)}render(){return o.createElement(e,{...this.props,name:this._getName(),onChange:this._onChange,checked:this._isChecked()})}componentWillUnmount(){this.context.switchGroupContext.unsubscribe(this._onUpdate)}_getName(){return this.context.switchGroupContext.getName()}_isChecked(){return this.context.switchGroupContext.getValues().includes(this.props.value)}}).contextTypes={switchGroupContext:r.any.isRequired},t}a.childContextTypes={switchGroupContext:r.any.isRequired}},66094:(e,t,n)=>{"use strict";n.d(t,{NumberInputView:()=>x});var o=n(67294),r=n(96404),a=n(94184),s=n(11888),l=n(92136),i=n(91943),c=n(16305),u=n(35347),d=n(50105);const p={large:s.InputClasses.FontSizeLarge,medium:s.InputClasses.FontSizeMedium},h={attachment:u.anchors.top.attachment,targetAttachment:u.anchors.top.targetAttachment,attachmentOffsetY:-4};function m(e){const{className:t,inputClassName:n,stretch:r=!0,errorMessage:s,fontSizeStyle:u="large",endSlot:m,button:g,error:b,warning:f,innerLabel:C,inputReference:v,children:y,...S}=e,E=b&&void 0!==s?[s]:void 0,N=f&&void 0!==s?[s]:void 0,k=a(d.inputContainer,p[u],t),w=C?o.createElement(l.StartSlot,{className:d.innerLabel,interactive:!1},C):void 0,x=m||g||y?o.createElement(l.EndSlot,null,m,g,y):void 0;return o.createElement(i.FormInput,{...S,className:k,inputClassName:n,errors:E,warnings:N,hasErrors:b,hasWarnings:f,messagesPosition:c.MessagesPosition.Attached,customErrorsAttachment:h,messagesRoot:"document",inheritMessagesWidthFromTarget:!0,disableMessagesRtlStyles:!0,iconHidden:!0,stretch:r,reference:v,startSlot:w,endSlot:x})}var g=n(79881),b=n(49775),f=n(85533),C=n(76535);function v(e){const t=a(C.control,C.controlIncrease),n=a(C.control,C.controlDecrease);return o.createElement(o.Fragment,null,void 0!==e.title&&o.createElement("div",{
className:C.title},e.title),o.createElement("div",{className:C.controlWrapper},(e.defaultButtonsVisible||e.title)&&o.createElement(o.Fragment,null,o.createElement("button",{type:"button",tabIndex:-1,"aria-label":(0,g.t)("Increase"),className:t,onClick:e.increaseValue},o.createElement(b.Icon,{icon:f,className:C.controlIcon})),o.createElement("button",{type:"button",tabIndex:-1,"aria-label":(0,g.t)("Decrease"),className:n,onClick:e.decreaseValue},o.createElement(b.Icon,{icon:f,className:C.controlIcon})))))}var y=n(11086),S=n(15965),E=n(66213),N=n(42998);const k=[38],w=[40];function x(e){const[t,n]=(0,y.useHover)(),[a,s]=(0,S.useFocus)(),l=(0,E.createSafeMulticastEventHandler)(s.onFocus,e.onFocus),i=(0,E.createSafeMulticastEventHandler)(s.onBlur,e.onBlur),c=(0,o.useCallback)(t=>{!e.disabled&&a&&(t.preventDefault(),t.deltaY<0?e.onValueByStepChange(1):e.onValueByStepChange(-1))},[a,e.disabled,e.onValueByStepChange]);return o.createElement(m,{...n,id:e.id,name:e.name,pattern:e.pattern,borderStyle:e.borderStyle,fontSizeStyle:e.fontSizeStyle,value:e.value,className:e.className,inputClassName:e.inputClassName,button:function(){const{button:n,forceShowControls:s,disabled:l,title:i}=e,c=!l&&!r.mobiletouch&&(s||a||t);return l?void 0:o.createElement(o.Fragment,null,null!=n?n:o.createElement(v,{increaseValue:u,decreaseValue:d,defaultButtonsVisible:c,title:i}))}(),disabled:e.disabled,placeholder:e.placeholder,innerLabel:e.innerLabel,endSlot:e.endSlot,containerReference:e.containerReference,inputReference:e.inputReference,inputMode:e.inputMode,type:e.type,error:e.error,errorMessage:e.errorMessage,onClick:e.onClick,onFocus:l,onBlur:i,onChange:e.onValueChange,onKeyDown:function(t){if(e.disabled||0!==(0,N.modifiersFromEvent)(t.nativeEvent))return;let n=k,o=w;e.controlDecKeyCodes&&(o=o.concat(e.controlDecKeyCodes));e.controlIncKeyCodes&&(n=n.concat(e.controlIncKeyCodes));(o.includes(t.keyCode)||n.includes(t.keyCode))&&(t.preventDefault(),e.onValueByStepChange(o.includes(t.keyCode)?-1:1));e.onKeyDown&&e.onKeyDown(t)},onWheelNoPassive:c,stretch:e.stretch,intent:e.intent,highlight:e.highlight,highlightRemoveRoundBorder:e.highlightRemoveRoundBorder,autoSelectOnFocus:e.autoSelectOnFocus,"data-property-id":e["data-name"]});function u(){e.disabled||e.onValueByStepChange(1)}function d(){e.disabled||e.onValueByStepChange(-1)}}},84254:(e,t,n)=>{"use strict";n.d(t,{bind:()=>s,setter:()=>l});var o=n(67294),r=n(41497),a=n(18820);function s(e){var t;return(t=class extends o.PureComponent{constructor(){super(...arguments),this._onChange=(e,t,n)=>{const{setValue:o}=this.context,{onChange:r}=this.props;l(o,r)(e,t,n)}}render(){const{input:t}=this.props,{values:n,model:r}=this.context;return o.createElement(e,{...this.props,value:n[t.id],tzName:(0,a.getTimezoneName)(r),onChange:this._onChange})}}).contextType=r.PropertyContext,t}function l(e,t){return(n,o,r)=>{e(o,n,r),t&&t(n,o,r)}}},41497:(e,t,n)=>{"use strict";n.d(t,{PropertyContext:()=>c,PropertyContainer:()=>u});var o=n(67294),r=n(16282),a=n(79881),s=n(90963);const l=(0,
n(65447).getLogger)("Platform.GUI.StudyInputPropertyContainer"),i=new s.TranslatedString("change {propertyName} property",(0,a.t)("change {propertyName} property")),c=o.createContext(null);class u extends o.PureComponent{constructor(e){super(e),this._setValue=(e,t,n)=>{const{property:o,model:c}=this.props,u=(0,r.ensureDefined)(o.child(e));l.logNormal(`Changing property "${e}" value from "${o.value()}" to "${t}"`);const d=new s.TranslatedString(n,function(e){return(0,a.t)(e,{context:"input"})}(n));c.setProperty(u,t,i.format({propertyName:d}))};const{property:t}=e,n={};t.childNames().forEach(e=>{const o=(0,r.ensureDefined)(t.child(e));n.hasOwnProperty(e)||(n[e]=o.value())}),this.state=n}componentDidMount(){const{property:e,onStudyInputChange:t}=this.props;e.childNames().forEach(n=>{(0,r.ensureDefined)(e.child(n)).subscribe(this,e=>{const o=e.value();l.logNormal(`Property "${n}" updated to value "${o}"`),this.setState({[n]:o}),null==t||t(o,n)})})}componentWillUnmount(){const{property:e}=this.props;e.childNames().forEach(t=>{(0,r.ensureDefined)(e.child(t)).unsubscribeAll(this)})}render(){const{study:e,model:t,children:n}=this.props,r={study:e,model:t,values:this.state,setValue:this._setValue};return o.createElement(c.Provider,{value:r},n)}}},49923:(e,t,n)=>{"use strict";n.d(t,{getSymbolName:()=>c,SymbolInput:()=>u});var o=n(67294),r=n(16282),a=n(41497),s=n(84254),l=n(48854),i=n(8786);function c(e,t){const n=(0,l.createAdapter)(t).resolvedSymbolInfoBySymbol(e);return n&&(n.ticker||n.full_name)?n.ticker||n.full_name:e}const u=(0,s.bind)((function(e){const t=(0,o.useContext)(a.PropertyContext),{study:n}=(0,r.ensureNotNull)(t),{input:{defval:s},value:l}=e;return o.createElement(i.SymbolInputsButton,{...e,value:c(l||s||"",n),study:n})}))},35665:(e,t,n)=>{"use strict";n.d(t,{PropertyTable:()=>i});var o=n(67294),r=n(94184),a=n(74818),s=n(44718);const l=o.createContext(!1);class i extends o.PureComponent{render(){return o.createElement("div",{ref:this.props.reference,className:s.content},this.props.children)}}i.InlineRowContext=l,i.Row=function(e){const{children:t}=e;return(0,o.useContext)(l)?o.createElement("span",{className:s.inlineRow},t):o.createElement(o.Fragment,null,t)},i.Cell=function(e){const t=(0,o.useContext)(l),n=r(s.cell,e.offset&&s.offset,e.grouped&&s.grouped,t&&s.inlineCell,"top"===e.verticalAlign&&s.top,"topCenter"===e.verticalAlign&&s.topCenter,"adaptive"===e.verticalAlign&&s.adaptive,e.checkableTitle&&s.checkableTitle,2===e.colSpan&&s.fill,"first"===e.placement&&2!==e.colSpan&&s.first,"last"===e.placement&&2!==e.colSpan&&s.last),i=(0,a.filterDataProps)(e);return o.createElement("div",{...i,className:n},o.createElement("div",{className:r(s.inner,e.className)},e.children))},i.Separator=function(e){return o.createElement(i.Row,null,o.createElement("div",{className:r(s.cell,s.separator,s.fill)}))},i.GroupSeparator=function(e){const t=e.size||0;return o.createElement(i.Row,null,o.createElement("div",{className:r(s.cell,s.groupSeparator,s.fill,1===t&&s.big)}))}},32895:(e,t,n)=>{"use strict";n.d(t,{ColorSelect:()=>w})
;var o=n(67294),r=n(94184),a=n.n(r),s=n(16282),l=n(42998),i=n(76420),c=n(15965),u=n(43001),d=n(97873);function p(e){const{button:t,children:n,className:r,onPopupClose:a,...p}=e,[h,m]=(0,o.useState)(!1),[g,b]=(0,o.useState)(!1),[f,C]=(0,c.useFocus)(),v=(0,o.useRef)(null);return o.createElement("div",{className:r},o.createElement("div",{tabIndex:e.disabled?void 0:-1,ref:v,onClick:y,onFocus:C.onFocus,onBlur:C.onBlur,onKeyDown:S},"function"==typeof t?t(g,f):t),o.createElement(i.PopupMenu,{isOpened:g,onClose:E,position:function(){const e=(0,s.ensureNotNull)(v.current).getBoundingClientRect();return{x:e.left,y:e.top+e.height}},doNotCloseOn:v.current,onKeyDown:S},o.createElement(d.MenuContext.Consumer,null,e=>o.createElement(u.ColorPicker,{...p,onToggleCustom:m,menu:e})),!h&&n));function y(){e.disabled||(b(e=>!e),m(!1))}function S(e){switch((0,l.hashFromEvent)(e)){case 27:g&&(e.preventDefault(),E())}}function E(){y(),(0,s.ensureNotNull)(v.current).focus(),a&&a()}}var h=n(6347),m=n(50968),g=n(35671),b=n(79881),f=n(82604),C=n(81880);const v=(0,f.makeSwitchGroupItem)(class extends o.PureComponent{constructor(){super(...arguments),this._onChange=()=>{this.props.onChange&&this.props.onChange(this.props.value)}}render(){const{name:e,checked:t,value:n}=this.props,a=r(C.thicknessItem,{[C.checked]:t}),s=r(C.bar,{[C.checked]:t}),l={borderTopWidth:parseInt(n)};return o.createElement("div",{className:a},o.createElement("input",{type:"radio",className:C.radio,name:e,value:n,onChange:this._onChange,checked:t}),o.createElement("div",{className:s,style:l}," "))}});function y(e){const{name:t,values:n,selectedValues:r,onChange:a}=e,s=n.map((e,t)=>o.createElement(v,{key:t,value:e.toString()})),l=r.map(e=>e.toString());return o.createElement("div",{className:C.wrap},o.createElement(f.SwitchGroup,{name:t,onChange:e=>{a(parseInt(e))},values:l},s))}var S=n(69343);const E=(0,b.t)("Thickness");function N(e){return o.createElement("div",{className:S.thicknessContainer},o.createElement("div",{className:S.thicknessTitle},E),o.createElement(y,{name:"color_picker_thickness_select",onChange:e.onChange,values:e.items,selectedValues:[e.value]}))}var k=n(96976);function w(e){const{className:t,selectOpacity:n=void 0!==e.opacity,thickness:r,color:s,disabled:l,opacity:i=1,onColorChange:c,onOpacityChange:u,onThicknessChange:d,thicknessItems:m,onPopupClose:g}=e,[b,f,C]=(0,h.useCustomColors)();return o.createElement(p,{className:t,disabled:l,color:s,selectOpacity:n,opacity:i,selectCustom:!0,customColors:b,onColorChange:c,onOpacityChange:s?u:void 0,onAddColor:f,onRemoveCustomColor:C,button:function(e,t){const n=e||t,c=n?"primary":"default";return o.createElement("div",{className:a()(k.colorPickerWrap,k["intent-"+c],k["border-thin"],k["size-medium"],n&&k.highlight,n&&k.focused,l&&k.disabled),"data-role":"button","data-name":r?"color-with-thickness-select":"color-select"},o.createElement("div",{className:a()(k.colorPicker,l&&k.disabled)},s?function(){const e=x(s,i),t=i>=.95&&M(s);return o.createElement("div",{className:k.opacitySwatch},o.createElement("div",{style:{
backgroundColor:e},className:a()(k.swatch,t&&k.white)}))}():o.createElement("div",{className:k.placeholderContainer},o.createElement("div",{className:k.placeholder})),r&&o.createElement("span",{className:a()(k.colorLine,M(s)&&k.white),style:{height:r,backgroundColor:x(s,i)}})),n&&o.createElement("span",{className:k.shadow}))},onPopupClose:g},r&&m&&o.createElement(N,{value:r,items:m,onChange:function(e){d&&d(e)}}))}function x(e,t){return e?(0,m.generateColor)(e,(0,m.alphaToTransparency)(t)):"#000000"}function M(e){return!!e&&e.toLowerCase()===g.white}},8786:(e,t,n)=>{"use strict";n.d(t,{SymbolInputsButton:()=>w});var o=n(67294),r=n(94184),a=n.n(r),s=n(79881),l=n(16282),i=n(78106),c=n(90714),u=n(27490),d=n(49923),p=n(20480),h=n(9772),m=n(49775),g=n(86284),b=n(44766);function f(e){const{value:t,onClick:n,className:a,startSlot:s,disabled:l=!1}=e;return o.createElement("div",{className:r(b.wrap,l&&b.disabled,a),onClick:n,"data-name":"edit-button"},o.createElement("div",{className:r(b.text,"apply-overflow-tooltip")},void 0!==s&&s,o.createElement("span",null,t)),o.createElement(m.Icon,{icon:g,className:b.icon}))}var C=n(15973),v=n(65244),y=n(65955),S=n(38208),E=n(61125);var N=n(2626);function k(e){const{symbol:t,onSymbolChanged:n,disabled:r,className:l}=e,[d,m]=(0,o.useState)(t),g=(0,o.useContext)(i.SlotContext),b=(0,o.useContext)(c.PopupContext);return o.createElement(f,{value:d,onClick:function(){const e=function(e){const t=(0,y.tokenize)(e);return(0,S.isSpread)(t)}(d)?d:function(e){try{return(0,E.shortName)(e)}catch(t){return e}}(d),t=(0,p.getSymbolSearchCompleteOverrideFunction)();(0,h.showSymbolSearchItemsDialog)({onSearchComplete:e=>{t(e[0].symbol).then(e=>{n(e),m(e)})},dialogTitle:(0,s.t)("Change symbol"),defaultValue:e,manager:g,onClose:()=>{b&&b.focus()},showSpreadActions:u.enabled("show_spread_operators")&&u.enabled("studies_symbol_search_spread_operators")})},disabled:r,className:a()(l,u.enabled("uppercase_instrument_names")&&N.uppercase)})}function w(e){if("definition"in e){const{propType:t,properties:n,id:r,title:a=""}=e.definition,s=n[t],i=s.value()||"",c=e=>{s.setValue(e)};return o.createElement(C.CommonSection,{id:r,title:a},o.createElement(v.CellWrap,null,o.createElement(k,{symbol:(0,l.ensureDefined)(i),onSymbolChanged:c})))}{const{study:t,value:n,input:{id:r,name:s},onChange:i,disabled:c,hasTooltip:u}=e,p=e=>{const n=(0,d.getSymbolName)(e,t);i(n,r,s)};return o.createElement(k,{symbol:(0,l.ensureDefined)(n),onSymbolChanged:p,disabled:c,className:a()(u&&N.hasTooltip)})}}},48854:(e,t,n)=>{"use strict";n.d(t,{createAdapter:()=>a});var o=n(67945),r=n(17e3);function a(e){if((0,o.isLineTool)(e))return{isPine:()=>!1,isStandardPine:()=>!1,canOverrideMinTick:()=>!1,resolvedSymbolInfoBySymbol:()=>{throw new TypeError("Only study is supported.")},symbolsResolved:()=>{throw new TypeError("Only study is supported.")},parentSource:()=>{throw new TypeError("Only study is supported.")},getAllChildren:()=>[],sourceId:()=>{throw new TypeError("Only study is supported.")}};if((0,r.isStudy)(e))return e
;if("isInputsStudy"in e)return e;throw new TypeError("Unsupported source type.")}},82653:(e,t,n)=>{"use strict";n.d(t,{useDefinitionProperty:()=>a});var o=n(67294),r=n(87131);const a=e=>{const t="property"in e?e.property:void 0,n="defaultValue"in e?e.defaultValue:e.property.value(),[a,s]=(0,o.useState)(t?t.value():n);(0,o.useEffect)(()=>{if(t){const n={};return s(t.value()),t.subscribe(n,t=>{const n=t.value();e.handler&&e.handler(n),s(n)}),()=>t.unsubscribeAll(n)}return()=>{}},[t]);return[a,e=>{if(void 0!==t){const n=t.value();r.logger.logNormal(`Changing property value from "${n}" to "${e}"`),t.setValue(e)}}]}},65244:(e,t,n)=>{"use strict";n.d(t,{CellWrap:()=>l});var o=n(67294),r=n(94184),a=n.n(r),s=n(75671);function l(e){return o.createElement("div",{className:a()(s.wrap,e.className)},e.children)}},96021:(e,t,n)=>{"use strict";n.d(t,{CheckableTitle:()=>c});var o=n(67294),r=n(37850),a=n(82653);function s(e){const{property:t,...n}=e,[s,l]=(0,a.useDefinitionProperty)({property:t}),i="mixed"===s;return o.createElement(r.Checkbox,{...n,name:"toggle-enabled",checked:i||s,indeterminate:i,onChange:function(){l("mixed"===s||!s)}})}var l=n(65244),i=n(38093);function c(e){const{property:t,disabled:n,title:r,className:a,name:c}=e,u=o.createElement("span",{className:i.title},r);return o.createElement(l.CellWrap,{className:a},t?o.createElement(s,{name:c,className:i.checkbox,property:t,disabled:n,label:u,labelAlignBaseline:!0}):u)}},15973:(e,t,n)=>{"use strict";n.d(t,{CommonSection:()=>s});var o=n(67294),r=n(35665),a=n(96021);function s(e){const{id:t,offset:n,disabled:s,checked:l,title:i,children:c}=e;return o.createElement(r.PropertyTable.Row,null,o.createElement(r.PropertyTable.Cell,{placement:"first",verticalAlign:"adaptive",offset:n,"data-section-name":t,colSpan:Boolean(c)?void 0:2,checkableTitle:!0},o.createElement(a.CheckableTitle,{name:"is-enabled-"+t,title:i,disabled:s,property:l})),Boolean(c)&&o.createElement(r.PropertyTable.Cell,{placement:"last","data-section-name":t},c))}},46358:(e,t,n)=>{"use strict";n.d(t,{GroupTitleSection:()=>l});var o=n(67294),r=n(35665),a=n(96021),s=n(22196);function l(e){return o.createElement(r.PropertyTable.Row,null,o.createElement(r.PropertyTable.Cell,{className:s.titleWrap,placement:"first",verticalAlign:"adaptive",colSpan:2,"data-section-name":e.name,checkableTitle:!0},o.createElement(a.CheckableTitle,{title:e.title,name:"is-enabled-"+e.name,className:s.title})))}},87131:(e,t,n)=>{"use strict";n.d(t,{logger:()=>o});const o=(0,n(65447).getLogger)("Platform.GUI.PropertyDefinitionTrace")},86284:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M13.5 7l1.65-1.65a.5.5 0 0 0 0-.7l-1.8-1.8a.5.5 0 0 0-.7 0L11 4.5M13.5 7L11 4.5M13.5 7l-8.35 8.35a.5.5 0 0 1-.36.15H2.5v-2.3a.5.5 0 0 1 .15-.35L11 4.5"/></svg>'}}]);