Files
ai/charting_library/bundles/currency-label-menu.55e9cde04495046e7dcf.js

10 lines
29 KiB
JavaScript

(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[8297],{14487:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var s=r.apply(null,n);s&&e.push(s)}else if("object"===i)for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},9338:e=>{e.exports={logo:"logo-PsAlMQQF",hidden:"hidden-PsAlMQQF",xxceptionallysmalldonotusebrv1023:"xxceptionallysmalldonotusebrv1023-PsAlMQQF",xxxsmall:"xxxsmall-PsAlMQQF",xxsmall:"xxsmall-PsAlMQQF",xsmall:"xsmall-PsAlMQQF",small:"small-PsAlMQQF",medium:"medium-PsAlMQQF",large:"large-PsAlMQQF",xlarge:"xlarge-PsAlMQQF",xxlarge:"xxlarge-PsAlMQQF",xxxlarge:"xxxlarge-PsAlMQQF",skeleton:"skeleton-PsAlMQQF",letter:"letter-PsAlMQQF"}},44396:e=>{e.exports={wrapper:"wrapper-TJ9ObuLF",animated:"animated-TJ9ObuLF",pulsation:"pulsation-TJ9ObuLF"}},53160:e=>{e.exports={"tablet-normal-breakpoint":"(max-width: 768px)","small-height-breakpoint":"(max-height: 360px)","tablet-small-breakpoint":"(max-width: 440px)"}},66550:e=>{e.exports={container:"container-qm7Rg5MB",mobile:"mobile-qm7Rg5MB",inputContainer:"inputContainer-qm7Rg5MB",withCancel:"withCancel-qm7Rg5MB",input:"input-qm7Rg5MB",icon:"icon-qm7Rg5MB",cancel:"cancel-qm7Rg5MB"}},52605:e=>{e.exports={scrollWrap:"scrollWrap-a62DpCum",scrollWrapWithoutSearch:"scrollWrapWithoutSearch-a62DpCum"}},98711:e=>{e.exports={container:"container-c8Hkfy8e",separator:"separator-c8Hkfy8e",section:"section-c8Hkfy8e"}},93744:e=>{e.exports={action:"action-peI7w0K1",hovered:"hovered-peI7w0K1",active:"active-peI7w0K1",label:"label-peI7w0K1",description:"description-peI7w0K1",selected:"selected-peI7w0K1",small:"small-peI7w0K1",withDescription:"withDescription-peI7w0K1",action__favoriteIcon:"action__favoriteIcon-peI7w0K1",action__favoriteIcon_active:"action__favoriteIcon_active-peI7w0K1",labelAndDescription:"labelAndDescription-peI7w0K1",icon:"icon-peI7w0K1",fakeIcon:"fakeIcon-peI7w0K1",highlighted:"highlighted-peI7w0K1"}},45228:e=>{e.exports={menu:"menu-kJ5smAAE",withDescriptions:"withDescriptions-kJ5smAAE",header:"header-kJ5smAAE",title:"title-kJ5smAAE",searchContainer:"searchContainer-kJ5smAAE",icon:"icon-kJ5smAAE",clear:"clear-kJ5smAAE",input:"input-kJ5smAAE",highlighted:"highlighted-kJ5smAAE",active:"active-kJ5smAAE",section:"section-kJ5smAAE"}},73832:e=>{e.exports={favorite:"favorite-_FRQhM5Y",hovered:"hovered-_FRQhM5Y",disabled:"disabled-_FRQhM5Y",focused:"focused-_FRQhM5Y",active:"active-_FRQhM5Y",checked:"checked-_FRQhM5Y"}},1255:e=>{e.exports={highlighted:"highlighted-cwp8YRo6"}},52417:e=>{e.exports={separator:"separator-QjUlCDId",small:"small-QjUlCDId",normal:"normal-QjUlCDId",large:"large-QjUlCDId"}},72131:e=>{e.exports={icon:"icon-WB2y0EnP",dropped:"dropped-WB2y0EnP"}},13528:(e,t,n)=>{"use strict";n.d(t,{AppContext:()=>o});const o=(0,n(79474).createContext)({
isOnMobileAppPage:()=>!1,isRtl:!1,locale:"en",renderMode:"legacy"})},80129:(e,t,n)=>{"use strict";n.d(t,{CircleLogo:()=>a,hiddenCircleLogoClass:()=>s});var o=n(79474),r=n(11808),i=n(9338);const s=n.n(i)().hidden;function a(e){const t=(0,r.isCircleLogoWithUrlProps)(e),[n,i]=(0,o.useState)(0),s=(0,o.useRef)(null),a=(0,r.getStyleClasses)(e.size,n,e.className),c=e.alt??e.title??"",l=t?c[0]:e.placeholderLetter;return(0,o.useEffect)((()=>i(s.current?.complete??!t?2:1)),[t]),t&&3!==n?o.createElement("img",{ref:s,className:a,crossOrigin:"",src:e.logoUrl,alt:c,title:e.title,loading:e.loading,onLoad:()=>i(2),onError:()=>i(3),"aria-label":e["aria-label"],"aria-hidden":e["aria-hidden"]}):o.createElement("span",{className:a,title:e.title,"aria-label":e["aria-label"],"aria-hidden":e["aria-hidden"]},l)}},11808:(e,t,n)=>{"use strict";n.d(t,{getStyleClasses:()=>c,isCircleLogoWithUrlProps:()=>l});var o=n(14487),r=n.n(o),i=n(90849),s=n(9338),a=n.n(s);function c(e,t=2,n){return r()(a().logo,a()[e],n,0===t||1===t?r()(i.skeletonTheme.wrapper,a().skeleton):a().letter,1===t&&i.skeletonTheme.animated)}function l(e){return"logoUrl"in e&&null!==e.logoUrl&&void 0!==e.logoUrl&&0!==e.logoUrl.length}},73064:(e,t,n)=>{"use strict";n.d(t,{useFunctionalRefObject:()=>i});var o=n(79474),r=n(69947);function i(e){const t=(0,o.useMemo)((()=>function(e){const t=n=>{e(n),t.current=n};return t.current=null,t}((e=>{a.current(e)}))),[]),n=(0,o.useRef)(null),i=t=>{if(null===t)return s(n.current,t),void(n.current=null);n.current!==e&&(n.current=e,s(n.current,t))},a=(0,o.useRef)(i);return a.current=i,(0,r.useIsomorphicLayoutEffect)((()=>{if(null!==t.current)return a.current(t.current),()=>a.current(null)}),[e]),t}function s(e,t){null!==e&&("function"==typeof e?e(t):e.current=t)}},90849:(e,t,n)=>{"use strict";n.d(t,{skeletonTheme:()=>r});var o=n(44396);const r=n.n(o)()},64483:(e,t,n)=>{"use strict";n.d(t,{createReactRoot:()=>d});var o=n(79474),r=n(29365),i=n(36334),s=n(13528),a=n(90141),c=n(81458);const l={iOs:"old",android:"new",old:"old",new:"new",any:"any"};function u(e){const[t]=(0,o.useState)({isOnMobileAppPage:e=>(0,a.isOnMobileAppPage)(l[e]),isRtl:(0,c.isRtl)(),locale:window.locale,renderMode:e.renderMode??"legacy"});return o.createElement(s.AppContext.Provider,{value:t},e.children)}function d(e,t,n="legacy"){const s=o.createElement(u,{renderMode:n},e);if("modern"===n){const e=(0,i.createRoot)(t);return e.render(s),{render(t){e.render(o.createElement(u,{renderMode:n},t))},unmount(){e.unmount()}}}return r.render(s,t),{render(e){r.render(o.createElement(u,{renderMode:n},e),t)},unmount(){r.unmountComponentAtNode(t)}}}},73873:(e,t,n)=>{"use strict";n.d(t,{DialogBreakpoints:()=>r});var o=n(53160);const r={SmallHeight:o["small-height-breakpoint"],TabletSmall:o["tablet-small-breakpoint"],TabletNormal:o["tablet-normal-breakpoint"]}},44973:(e,t,n)=>{"use strict";n.d(t,{DialogSearch:()=>d});var o=n(79474),r=n(14487),i=n.n(r),s=n(91599),a=n(66334),c=n(92003),l=n(78275),u=n(66550);function d(e){
const{children:t,isMobile:r,renderInput:d,onCancel:m,containerClassName:p,inputContainerClassName:v,iconClassName:f,cancelTitle:g=s.t(null,void 0,n(43563)),...C}=e;return o.createElement("div",{className:i()(u.container,r&&u.mobile,p)},o.createElement("div",{className:i()(u.inputContainer,r&&u.mobile,v,m&&u.withCancel)},d||o.createElement(h,{isMobile:r,...C})),t,o.createElement(a.Icon,{className:i()(u.icon,r&&u.mobile,f),icon:r?l:c}),m&&(!r||""!==C.value)&&o.createElement("div",{className:i()(u.cancel,r&&u.mobile),onClick:m},g))}function h(e){const{className:t,reference:n,isMobile:r,value:s,onChange:a,onFocus:c,onBlur:l,onKeyDown:d,onSelect:h,placeholder:m,activeDescendant:p,...v}=e;return o.createElement("input",{...v,ref:n,type:"text",className:i()(t,u.input,r&&u.mobile),autoComplete:"off",role:"searchbox","data-role":"search",placeholder:m,value:s,onChange:a,onFocus:c,onBlur:l,onSelect:h,onKeyDown:d,"aria-activedescendant":p})}},45936:(e,t,n)=>{"use strict";n.d(t,{UnitConversionRenderer:()=>z});var o=n(79474),r=n(64916),i=n(64483),s=n(96375),a=n(46948),c=n(54466),l=n(77982),u=n(23351);var d=n(73873),h=n(86739),m=n(14487),p=n.n(m),v=n(91599),f=n(66334),g=n(29344),C=n(86738),x=n(73283),E=n(29796),y=n(26063),w=n(62466),A=n(22082),b=n(42482),M=n(93744);const S=o.memo((function(e){const{label:t,icon:n,rules:r,search:i,description:s,onClick:a,onClose:c,isActive:l,isSmallSize:u,isSelected:d,selectedRef:h,hasDescriptions:m,hasIcons:v,isFavorite:f,onFavoriteClick:g}=e,C=(0,o.useCallback)((()=>{a(),c&&c()}),[a,c]),x=u&&M.small;return o.createElement("div",{className:p()(M.action,l&&M.active,x,m&&M.withDescription,d&&M.selected),onClick:C,ref:h},v&&(void 0!==n?o.createElement(A.CircleLogo,{logoUrl:n,size:m?"xsmall":"xxxsmall",className:p()(M.icon,x)}):o.createElement("span",{className:p()(M.fakeIcon,x)})),o.createElement("div",{className:p()(M.labelAndDescription,x)},o.createElement("span",{className:p()(M.label,x)},E(t)),m&&o.createElement("br",null),m&&o.createElement("span",{className:p()(M.description,x)},s?E(s):"")),void 0!==f&&o.createElement("div",{className:p()(M.action__favoriteIcon,f&&M.action__favoriteIcon_active)},o.createElement(w.FavoriteButton,{isActive:l,isFilled:f,onClick:function(e){e.stopPropagation(),g?.()}})));function E(e){return o.createElement(b.HighlightedText,{text:e,rules:r,queryString:i,className:p()(l&&M.highlighted,l&&M.active)})}}),((e,t)=>Object.keys(t).filter((e=>!["onClick","onClose","onFavoriteClick"].includes(e))).every((n=>t[n]===e[n]))));var I=n(63097),k=n(34914),R=n(45228),N=n(52605);const D=(0,x.mergeThemes)(C.DEFAULT_MENU_THEME,{scrollWrap:N.scrollWrap}),L=(0,x.mergeThemes)(C.DEFAULT_MENU_THEME,{scrollWrap:N.scrollWrapWithoutSearch});function _(e){const{title:t,sections:r,onClose:i,selectedId:s,selectedRef:a,search:c,setSearch:l,hideSearch:u,items:d,rules:h,searchRef:m,hasDescriptions:C,hasIcons:x,...w}=e,[A,b]=(0,o.useState)((()=>r.reduce(((e,t,n)=>(t.name&&(e[t.id]=!0),e)),{})));function M(e){const{id:t,...n}=e;return o.createElement(S,{key:t,rules:h,search:c,onClose:i,
isSmallSize:!0,isSelected:t===s,selectedRef:t===s?a:void 0,hasDescriptions:C,hasIcons:x,...n})}return o.createElement(g.PopupMenu,{...w,onClose:i,className:p()(R.menu,C&&R.withDescriptions),theme:u?L:D,maxHeight:C?313:280,noMomentumBasedScroll:!0,isOpened:!0,onOpen:function(){m.current?.focus()}},o.createElement("div",{className:R.header},o.createElement("div",{className:R.title},t),!u&&o.createElement("div",{className:p()(R.searchContainer)},o.createElement(f.Icon,{icon:I,className:R.icon}),o.createElement("input",{size:1,type:"text",className:R.input,placeholder:v.t(null,void 0,n(52127)),autoComplete:"off","data-role":"search",onChange:function(e){l(e.target.value)},value:c,ref:m}),Boolean(c)&&o.createElement(f.Icon,{icon:k,className:R.clear,onClick:function(){l("")}}))),c?d.map(M):r.map(((e,t)=>o.createElement(o.Fragment,{key:e.id},Boolean(t)&&o.createElement(E.PopupMenuSeparator,null),e.name?o.createElement(y.CollapsibleSection,{summary:e.name,className:R.section,open:A[e.id],onStateChange:t=>b({...A,[e.id]:t})},e.actions.map(M)):e.actions.map(M)))))}var F=n(35088),T=n(44973),P=n(98711);function B(e){const{title:t,onClose:r,sections:i,selectedId:s,selectedRef:a,search:c,setSearch:l,hideSearch:u,items:d,rules:h,searchRef:m,hasIcons:p,hasDescriptions:f}=e;return o.createElement(F.AdaptivePopupDialog,{title:t,onClose:r,render:function(){return o.createElement(o.Fragment,null,!u&&o.createElement(T.DialogSearch,{placeholder:v.t(null,void 0,n(52127)),onChange:g,reference:m}),o.createElement("div",{className:P.container},c?d.map((e=>{const{id:t,isActive:n,...i}=e;return o.createElement(S,{key:t,isActive:n,onClose:r,rules:h,search:c,isSelected:t===s,selectedRef:t===s?a:void 0,hasIcons:p,hasDescriptions:f,...i})})):i.map(((e,t)=>o.createElement(o.Fragment,{key:e.id},e.name&&o.createElement("div",{className:P.section},e.name),e.actions.map(((n,l)=>{const{id:u,...d}=n,m=l===e.actions.length-1,v=t===i.length-1;return o.createElement(o.Fragment,{key:u},o.createElement(S,{rules:h,search:c,onClose:r,isSelected:u===s,selectedRef:u===s?a:void 0,hasIcons:p,hasDescriptions:f,...d}),!v&&m&&o.createElement("div",{className:P.separator}))})))))))},dataName:"unit-conversion-dialog",draggable:!1,fullScreen:!0,isOpened:!0});function g(e){l(e.target.value)}}const O={horizontalAttachEdge:h.HorizontalAttachEdge.Right,horizontalDropDirection:h.HorizontalDropDirection.FromRightToLeft};function U(e){const{element:t,...n}=e,[r,i]=(0,o.useState)(x()),[s,a]=(0,o.useState)(""),m=(0,o.useRef)(null),p=(0,o.useRef)(null),v=(0,o.useMemo)((()=>(0,l.createRegExpList)(s)),[s]),{activeIdx:f,setActiveIdx:g}=function(e,t,n,r="keydown"){const[i,s]=(0,o.useState)(-1);return(0,o.useEffect)((()=>{if(!e)return;const n=e=>{switch((0,u.hashFromEvent)(e)){case 40:if(i===t.length-1)break;e.preventDefault(),s(i+1);break;case 38:if(i<=0)break;e.preventDefault(),s(i-1)}};return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[e,i,t]),(0,o.useEffect)((()=>{if(!e||!n)return;const o=e=>{e.repeat||13===(0,u.hashFromEvent)(e)&&n(t[i]??null,e)}
;return e.addEventListener(r,o),()=>{e.removeEventListener(r,o)}}),[e,i,t,n,r]),{activeIdx:i,setActiveIdx:s}}(m.current,r,(function(e){e&&(e.onClick(),n.onClose())}));!function(e,t=[]){(0,o.useEffect)((()=>{e(-1)}),[...t])}(g,[r]),function(e,t){(0,o.useEffect)((()=>{t>=0&&e.current?.scrollIntoView({block:"nearest"})}),[t])}(p,f),(0,o.useEffect)((()=>{i(s?function(e,t,n){const o=e.reduce(((e,t)=>[...e,...t.actions]),[]);return(0,l.rankedSearch)({data:o,rules:n,queryString:t,primaryKey:"label",secondaryKey:"description"})}(n.sections,s,v):x())}),[s,n.sections,v]);const C=(0,o.useMemo)((()=>({selectedId:Boolean(f>=0&&r[f])?r[f].id:"",selectedRef:p,search:s,setSearch:a,searchRef:m,items:r,rules:v,hasIcons:r.some((e=>void 0!==e.icon)),hasDescriptions:r.some((e=>void 0!==e.description))})),[f,p,s,a,m,r,v]);return o.createElement(c.MatchMedia,{rule:d.DialogBreakpoints.TabletSmall},(e=>e?o.createElement(B,{...n,...C}):o.createElement(_,{...n,...C,position:(0,h.getPopupPositioner)(t,O),doNotCloseOn:t})));function x(){return n.sections.reduce(((e,t)=>(e.push(...t.actions),e)),[])}}class z{constructor(e,t,n,o,i){this._rootInstance=null,this._close=()=>this.destroy(),this._title=e,this._element=t,this._hideSearch=i??!1,this._sectionsGetter=n,this._menuClosedCallback=o,this._render(),a.favoriteCurrencyUnitConversionService.getOnChange().subscribe(this,this._render),s.subscribe(r.CLOSE_POPUPS_AND_DIALOGS_COMMAND,this._close,this)}destroy(){s.unsubscribe(r.CLOSE_POPUPS_AND_DIALOGS_COMMAND,this._close,this),a.favoriteCurrencyUnitConversionService.getOnChange().unsubscribeAll(this),null!==this._rootInstance&&(this._rootInstance.unmount(),this._rootInstance=null,this._menuClosedCallback())}_render(){const e=o.createElement(U,{title:this._title,sections:this._sectionsGetter(),element:this._element,hideSearch:this._hideSearch,onClose:this._close});null!==this._rootInstance?this._rootInstance.render(e):this._rootInstance=(0,i.createReactRoot)(e,document.createElement("div"),"modern")}}},28390:(e,t,n)=>{"use strict";n.d(t,{useActiveDescendant:()=>i});var o=n(79474),r=n(73064);function i(e,t=[]){const[n,i]=(0,o.useState)(!1),s=(0,r.useFunctionalRefObject)(e);return(0,o.useLayoutEffect)((()=>{const e=s.current;if(null===e)return;const t=e=>{switch(e.type){case"active-descendant-focus":i(!0);break;case"active-descendant-blur":i(!1)}};return e.addEventListener("active-descendant-focus",t),e.addEventListener("active-descendant-blur",t),()=>{e.removeEventListener("active-descendant-focus",t),e.removeEventListener("active-descendant-blur",t)}}),t),[s,n]}},22082:(e,t,n)=>{"use strict";n.d(t,{CircleLogo:()=>o.CircleLogo,hiddenCircleLogoClass:()=>o.hiddenCircleLogoClass});var o=n(80129)},92381:(e,t,n)=>{"use strict";n.d(t,{RemoveTitleType:()=>o,removeTitlesMap:()=>i});var o,r=n(91599);!function(e){e.Add="add",e.Remove="remove"}(o||(o={}));const i={[o.Add]:r.t(null,void 0,n(99529)),[o.Remove]:r.t(null,void 0,n(16590))}},62466:(e,t,n)=>{"use strict";n.d(t,{FavoriteButton:()=>h})
;var o=n(79474),r=n(14487),i=n.n(r),s=n(66334),a=n(92381),c=n(28390),l=n(72995),u=n(89658),d=n(73832);function h(e){const{className:t,isFilled:n,isActive:r,onClick:h,title:m,...p}=e,[v,f]=(0,c.useActiveDescendant)(null),g=m??(n?a.removeTitlesMap[a.RemoveTitleType.Remove]:a.removeTitlesMap[a.RemoveTitleType.Add]);return(0,o.useLayoutEffect)((()=>{const e=v.current;e instanceof HTMLElement&&g&&e.dispatchEvent(new CustomEvent("common-tooltip-update"))}),[g,v]),o.createElement(s.Icon,{...p,className:i()(d.favorite,"apply-common-tooltip",n&&d.checked,r&&d.active,f&&d.focused,t),onClick:h,icon:n?l:u,title:g,ariaLabel:g,ref:v})}},77982:(e,t,n)=>{"use strict";n.d(t,{createRegExpList:()=>a,getHighlightedChars:()=>c,rankedSearch:()=>s});var o=n(7321);function r(e){return e.replace(/[!-/[-^{-}?]/g,"\\$&")}var i;function s(e){const{data:t,rules:n,queryString:r,isPreventedFromFiltering:i,primaryKey:s,secondaryKey:a=s,optionalPrimaryKey:c,tertiaryKey:l}=e;return t.map((e=>{const t=c&&e[c]?e[c]:e[s],i=e[a],u=l&&e[l];let d,h=0;return n.forEach((e=>{const{re:n,fullMatch:s}=e;if(n.lastIndex=0,(0,o.isString)(t)&&t&&t.toLowerCase()===r.toLowerCase())return h=4,void(d=t.match(s)?.index);if((0,o.isString)(t)&&s.test(t))return h=3,void(d=t.match(s)?.index);if((0,o.isString)(i)&&s.test(i))return h=2,void(d=i.match(s)?.index);if((0,o.isString)(i)&&n.test(i))return h=2,void(d=i.match(n)?.index);if(Array.isArray(u))for(const e of u)if(s.test(e))return h=1,void(d=e.match(s)?.index)})),{matchPriority:h,matchIndex:d,item:e}})).filter((e=>i||e.matchPriority)).sort(((e,t)=>{if(e.matchPriority<t.matchPriority)return 1;if(e.matchPriority>t.matchPriority)return-1;if(e.matchPriority===t.matchPriority){if(void 0===e.matchIndex||void 0===t.matchIndex)return 0;if(e.matchIndex>t.matchIndex)return 1;if(e.matchIndex<t.matchIndex)return-1}return 0})).map((({item:e})=>e))}function a(e,t){const n=[],o=e.toLowerCase(),i=e.split("").map(((e,t)=>`(${0!==t?`[/\\s-]${r(e)}`:r(e)})`)).join("(.*?)")+"(.*)";return n.push({fullMatch:new RegExp(`(${r(e)})`,"i"),re:new RegExp(`^${i}`,"i"),reserveRe:new RegExp(i,"i"),fuzzyHighlight:!0}),t&&t.hasOwnProperty(o)&&n.push({fullMatch:t[o],re:t[o],fuzzyHighlight:!1}),n}function c(e,t,n){const o=[];return e&&n?(n.forEach((e=>{const{fullMatch:n,re:r,reserveRe:i}=e;n.lastIndex=0,r.lastIndex=0;const s=n.exec(t),a=s||r.exec(t)||i&&i.exec(t);if(e.fuzzyHighlight=!s,a)if(e.fuzzyHighlight){let e=a.index;for(let t=1;t<a.length;t++){const n=a[t],r=a[t].length;if(t%2){const t=n.startsWith(" ")||n.startsWith("/")||n.startsWith("-");o[t?e+1:e]=!0}e+=r}}else for(let e=0;e<a[0].length;e++)o[a.index+e]=!0})),o):o}!function(e){e[e.Low=0]="Low",e[e.MediumLow=1]="MediumLow",e[e.Medium=2]="Medium",e[e.High=3]="High",e[e.Highest=4]="Highest"}(i||(i={}))},42482:(e,t,n)=>{"use strict";n.d(t,{HighlightedText:()=>a});var o=n(79474),r=n(14487),i=n(77982),s=n(1255);function a(e){const{queryString:t,rules:n,text:a,className:c}=e,l=(0,o.useMemo)((()=>(0,i.getHighlightedChars)(t,a,n)),[t,n,a])
;return o.createElement(o.Fragment,null,l.length?a.split("").map(((e,t)=>o.createElement(o.Fragment,{key:t},l[t]?o.createElement("span",{className:r(s.highlighted,c)},e):o.createElement("span",null,e)))):a)}},29796:(e,t,n)=>{"use strict";n.d(t,{PopupMenuSeparator:()=>c});var o,r=n(79474),i=n(14487),s=n.n(i),a=n(52417);function c(e){const{size:t="normal",className:n,ariaHidden:o=!1}=e;return r.createElement("div",{className:s()(a.separator,"small"===t&&a.small,"normal"===t&&a.normal,"large"===t&&a.large,n),role:"separator","aria-hidden":o})}!function(e){e.Small="small",e.Large="large",e.Normal="normal"}(o||(o={}))},29344:(e,t,n)=>{"use strict";n.d(t,{PopupMenu:()=>h});var o=n(79474),r=n(29365),i=n(41863),s=n(64888),a=n(86738),c=n(11508);const l=o.createContext(void 0);var u=n(4138);const d=o.createContext({setMenuMaxWidth:!1});function h(e){const{controller:t,children:n,isOpened:h,closeOnClickOutside:m=!0,doNotCloseOn:p,onClickOutside:v,onClose:f,onKeyboardClose:g,"data-name":C="popup-menu-container",dataQaId:x="popup-menu-container",closeOnScrollOutsideOffset:E,...y}=e,w=(0,o.useContext)(c.CloseDelegateContext),A=o.useContext(d),b=(0,o.useContext)(l),M=(0,u.useOutsideEvent)({handler:function(e){v&&v(e);if(!m)return;const t=(0,i.default)(p)?p():null==p?[]:[p];if(t.length>0&&e.target instanceof Node)for(const n of t){const t=r.findDOMNode(n);if(t instanceof Node&&t.contains(e.target))return}f()},mouseDown:!0,touchStart:!0});return h?o.createElement(s.Portal,{top:"0",left:"0",right:"0",bottom:"0",pointerEvents:"none"},o.createElement("span",{ref:M,style:{pointerEvents:"auto"}},o.createElement(a.Menu,{...y,onClose:f,onKeyboardClose:g,onScroll:function(t){const{onScroll:n}=e;n&&n(t)},customCloseDelegate:w,customRemeasureDelegate:b,ref:t,"data-name":C,dataQaId:x,limitMaxWidth:A.setMenuMaxWidth,"data-tooltip-show-on-focus":"true",closeOnScrollOutsideOffset:E},n))):null}},42290:(e,t,n)=>{"use strict";n.d(t,{ToolWidgetCaret:()=>c});var o=n(79474),r=n(14487),i=n(66334),s=n(72131),a=n(56721);function c(e){const{dropped:t,className:n}=e;return o.createElement(i.Icon,{className:r(n,s.icon,{[s.dropped]:t}),icon:a})}},73283:(e,t,n)=>{"use strict";function o(e,t,n={}){return Object.assign({},e,function(e,t,n={}){const o=Object.assign({},t);for(const r of Object.keys(t)){const i=n[r]||r;i in e&&(o[r]=[e[i],t[r]].join(" "))}return o}(e,t,n))}n.d(t,{mergeThemes:()=>o})},36334:(e,t,n)=>{"use strict";var o=n(29365);t.createRoot=o.createRoot,o.hydrateRoot},49378:e=>{e.exports={summary:"summary-ynHBVe1n",hovered:"hovered-ynHBVe1n",caret:"caret-ynHBVe1n"}},26063:(e,t,n)=>{"use strict";n.d(t,{CollapsibleSection:()=>c});var o=n(79474),r=n(14487),i=n.n(r),s=n(42290),a=n(49378);const c=(0,o.forwardRef)((function(e,t){const{open:n,summary:r,children:c,onStateChange:l,tabIndex:u,className:d,...h}=e;return o.createElement(o.Fragment,null,o.createElement("div",{...h,className:i()(d,a.summary),onClick:function(){l&&l(!n)},"data-open":n,"aria-expanded":n,ref:t,tabIndex:u},r,o.createElement(s.ToolWidgetCaret,{className:a.caret,dropped:Boolean(n)
})),n&&c)}))},86739:(e,t,n)=>{"use strict";n.d(t,{HorizontalAttachEdge:()=>r,HorizontalDropDirection:()=>s,VerticalAttachEdge:()=>o,VerticalDropDirection:()=>i,getPopupPositioner:()=>l});var o,r,i,s,a=n(85842);!function(e){e[e.Top=0]="Top",e[e.Bottom=1]="Bottom",e[e.AutoStrict=2]="AutoStrict"}(o||(o={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right"}(r||(r={})),function(e){e[e.FromTopToBottom=0]="FromTopToBottom",e[e.FromBottomToTop=1]="FromBottomToTop"}(i||(i={})),function(e){e[e.FromLeftToRight=0]="FromLeftToRight",e[e.FromRightToLeft=1]="FromRightToLeft"}(s||(s={}));const c={verticalAttachEdge:o.Bottom,horizontalAttachEdge:r.Left,verticalDropDirection:i.FromTopToBottom,horizontalDropDirection:s.FromLeftToRight,verticalMargin:0,horizontalMargin:0,matchButtonAndListboxWidths:!1};function l(e,t){return n=>{const{contentWidth:l,contentHeight:u,availableHeight:d}=n,h=(0,a.ensureNotNull)(e).getBoundingClientRect(),{horizontalAttachEdge:m=c.horizontalAttachEdge,horizontalDropDirection:p=c.horizontalDropDirection,horizontalMargin:v=c.horizontalMargin,verticalMargin:f=c.verticalMargin,matchButtonAndListboxWidths:g=c.matchButtonAndListboxWidths}=t;let C=t.verticalAttachEdge??c.verticalAttachEdge,x=t.verticalDropDirection??c.verticalDropDirection;C===o.AutoStrict&&(d<h.y+h.height+f+u?(C=o.Top,x=i.FromBottomToTop):(C=o.Bottom,x=i.FromTopToBottom));const E=C===o.Top?-1*f:f,y=m===r.Right?h.right:h.left,w=C===o.Top?h.top:h.bottom,A={x:y-(p===s.FromRightToLeft?l:0)+v,y:w-(x===i.FromBottomToTop?u:0)+E};return g&&(A.overrideWidth=h.width),A}}},57271:(e,t,n)=>{"use strict";n.d(t,{currencyActions:()=>a});var o=n(85842),r=n(91599),i=n(98738),s=n(46948);function a(e,t,a){if(null===t||t.readOnly)return[];const c=[],l=t=>{e.setPriceScaleCurrency(a,t)},u=t.selectedCurrency,d=t.originalCurrencies,h=t.baseCurrencies,m=t.displayedValues,p=s.favoriteCurrencyUnitConversionService.get().currencies,v={id:"first_section",actions:[]};if(d.size>1){const e=(0,i.createAction)("Mixed",r.t(null,void 0,n(46936)),void 0,void 0,null===t.selectedCurrency,(()=>l(null)));v.actions.push(e)}const f=e.model().availableCurrencies();if(null!==u){const e=(0,o.ensureNotNull)(f.item(u)),t=(0,i.createAction)(u,(0,o.ensureDefined)(m.get(u)),e.logoUrl,e.description,!0,(()=>{}),p.has(u),(()=>s.favoriteCurrencyUnitConversionService.toggle("currencies",u)));v.actions.push(t)}const g=f.filterConvertible(h,(e=>e!==u&&d.has(e)));for(const e of g){const n=(0,o.ensureNotNull)(f.item(e.id));v.actions.push((0,i.createAction)(e.id,e.code,n.logoUrl,n.description,t.selectedCurrency===e.id,(()=>l(e.id)),p.has(e.id),(()=>s.favoriteCurrencyUnitConversionService.toggle("currencies",e.id))))}v.actions.length>0&&c.push(v);const C=f.filterConvertible(h,(e=>e!==u&&!d.has(e))),x=[],E=[];for(const e of C){const n=(0,o.ensureNotNull)(f.item(e.id)),r=p.has(e.id),a=(0,i.createAction)(e.id,e.code,n.logoUrl,n.description,t.selectedCurrency===e.id,(()=>l(e.id)),r,(()=>s.favoriteCurrencyUnitConversionService.toggle("currencies",e.id)));r?x.push(a):E.push(a)}
return(E.length>0||x.length>0)&&c.push({id:"second_section",actions:x.concat(E)}),c}},46948:(e,t,n)=>{"use strict";n.d(t,{favoriteCurrencyUnitConversionService:()=>a});var o=n(82287),r=n(69735),i=n(85388);class s extends i.AbstractJsonStoreService{constructor(e,t){super(e,t,"FAVORITE_CURRENCY_UNIT_CONVERSION_CHANGED","currencyUnitConversion.favorites",{currencies:new Set,units:new Set})}add(e,t){const n=this.get();n[e].add(t),this.set(n)}remove(e,t){const n=this.get();n[e].delete(t)&&this.set(n)}toggle(e,t){this.get()[e].has(t)?this.remove(e,t):this.add(e,t)}_serialize(e){return[[...e.currencies],[...e.units]]}_deserialize(e){return{currencies:new Set(e[0]),units:new Set(e[1])}}}const a=new s(r.TVXWindowEvents,o)},21508:(e,t,n)=>{"use strict";n.d(t,{metricActions:()=>i});var o=n(85842),r=n(98738);function i(e,t,n){if(null===t)return[];const i=[],s={id:"first_section",actions:[]},a=e.model().availableMetrics();for(const i of a.getItems()){const c=(0,o.ensureNotNull)(a.item(i));s.actions.push((0,r.createAction)(i,c.name,void 0,c.description,t.selectedMetricId===c.id,(()=>{return t=c.id,void e.setPriceScaleMetric(n,t);var t})))}return i.push(s),i}},32534:(e,t,n)=>{"use strict";n.d(t,{unitActions:()=>a});var o=n(85842),r=n(91599),i=n(98738),s=n(46948);function a(e,t,a){if(null===t||0===t.availableGroups.size)return[];const c=[],l=t=>{e.setPriceScaleUnit(a,t)},u=t.selectedUnit,d=t.originalUnits,h=t.names,m=t.descriptions,p=s.favoriteCurrencyUnitConversionService.get().units,v={actions:[],id:"first_section"};if(d.size>1){const e=(0,i.createAction)("Mixed",r.t(null,void 0,n(46936)),void 0,void 0,null===t.selectedUnit,(()=>l(null)));v.actions.push(e)}const f=e.model().availableUnits();if(null!==u){const e=(0,i.createAction)(u,(0,o.ensureDefined)(h.get(u)),void 0,(0,o.ensureDefined)(m.get(u)),!0,(()=>{}),p.has(u),(()=>s.favoriteCurrencyUnitConversionService.toggle("units",u)));v.actions.push(e)}const g=f.unitsByGroups(t.availableGroups),C=[],x=[];for(const e of g)for(const t of e.units){const e=p.has(t.id);if(t.id===u||!e&&!d.has(t.id))continue;const n=(0,i.createAction)(t.id,t.name,void 0,t.description,!1,(()=>l(t.id)),e,(()=>s.favoriteCurrencyUnitConversionService.toggle("units",t.id)));e?x.push(n):C.push(n)}(C.length>0||x.length>0)&&v.actions.push(...x.sort(((e,t)=>e.label.toLowerCase().localeCompare(t.label.toLowerCase()))),...C),v.actions.length>0&&c.push(v);const E=u&&f.unitGroupById(u);if(null!==E)for(const e of g){if(e.name!==E)continue;const t=[];for(const n of e.units)n.id===u||d.has(n.id)||p.has(n.id)||t.push((0,i.createAction)(n.id,n.name,void 0,n.description,!1,(()=>l(n.id)),!1,(()=>s.favoriteCurrencyUnitConversionService.toggle("units",n.id))));t.length>0&&c.push({id:e.name,name:e.name,actions:t})}for(const e of g){if(e.name===E)continue;const t=[];for(const n of e.units)n.id===u||d.has(n.id)||p.has(n.id)||t.push((0,i.createAction)(n.id,n.name,void 0,n.description,!1,(()=>l(n.id)),!1,(()=>s.favoriteCurrencyUnitConversionService.toggle("units",n.id))));t.length>0&&c.push({id:e.name,name:e.name,actions:t})}
return c}},98738:(e,t,n)=>{"use strict";function o(e,t,n,o,r,i,s,a){return{id:e,label:t,icon:n,description:o,isActive:r,onClick:i,isFavorite:s,onFavoriteClick:a}}n.d(t,{createAction:()=>o})},63097:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="currentColor"><path fill-rule="evenodd" d="M11.87 12.58a6 6 0 1 1 .71-.7L16 15.29l-.7.71zM13 8A5 5 0 1 1 3 8a5 5 0 0 1 10 0"/></svg>'},56721:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 8" width="16" height="8"><path fill="currentColor" d="M0 1.475l7.396 6.04.596.485.593-.49L16 1.39 14.807 0 7.393 6.122 8.58 6.12 1.186.08z"/></svg>'},34914:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.7 9l4.65-4.65-.7-.7L9 8.29 4.35 3.65l-.7.7L8.29 9l-4.64 4.65.7.7L9 9.71l4.65 4.64.7-.7L9.71 9z"/></svg>'},72995:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path fill="currentColor" d="M9 1l2.35 4.76 5.26.77-3.8 3.7.9 5.24L9 13l-4.7 2.47.9-5.23-3.8-3.71 5.25-.77L9 1z"/></svg>'},89658: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="M9 2.13l1.903 3.855.116.236.26.038 4.255.618-3.079 3.001-.188.184.044.259.727 4.237-3.805-2L9 12.434l-.233.122-3.805 2.001.727-4.237.044-.26-.188-.183-3.079-3.001 4.255-.618.26-.038.116-.236L9 2.13z"/></svg>'},78275:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill="currentColor" fill-rule="evenodd" d="M18.5 12.5a6 6 0 1 1-12 0 6 6 0 0 1 12 0Zm-1.25 5.8a7.5 7.5 0 1 1 1.06-1.06l4.22 4.23.53.53L22 23.06l-.53-.53-4.22-4.22Z"/></svg>'},92003:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path stroke="currentColor" d="M17.4 17.5a7 7 0 1 0-4.9 2c1.9 0 3.64-.76 4.9-2zm0 0l5.1 5"/></svg>'},56770:(e,t,n)=>{"use strict";n.d(t,{nanoid:()=>o});let o=(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?"-":"_"),"")}}]);