@deephaven/code-studio 0.59.1-beta.4 → 0.59.1-deferred-api.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/build/assets/{AppRoot-bc9433b4.js → AppRoot-15c43d14.js} +3 -3
  2. package/build/assets/AppRoot-15c43d14.js.map +1 -0
  3. package/build/assets/ControlType-ccb39f97.js +21 -0
  4. package/build/assets/ControlType-ccb39f97.js.map +1 -0
  5. package/build/assets/{FontBootstrap-5b595a14.js → FontBootstrap-f9c22091.js} +2 -2
  6. package/build/assets/{FontBootstrap-5b595a14.js.map → FontBootstrap-f9c22091.js.map} +1 -1
  7. package/build/assets/{IrisGrid-49222932.js → IrisGrid-194f7355.js} +2 -2
  8. package/build/assets/{IrisGrid-49222932.js.map → IrisGrid-194f7355.js.map} +1 -1
  9. package/build/assets/{IrisGridModelFactory-aa9601b0.js → IrisGridModelFactory-4d892db6.js} +2 -2
  10. package/build/assets/IrisGridModelFactory-4d892db6.js.map +1 -0
  11. package/build/assets/{StyleGuideRoot-42cc11d1.js → StyleGuideRoot-57022f58.js} +2 -2
  12. package/build/assets/{StyleGuideRoot-42cc11d1.js.map → StyleGuideRoot-57022f58.js.map} +1 -1
  13. package/build/assets/index-6bb07a89.js +8 -0
  14. package/build/assets/index-6bb07a89.js.map +1 -0
  15. package/build/assets/{index-c8c58d11.js → index-cb785e94.js} +2 -2
  16. package/build/assets/{index-c8c58d11.js.map → index-cb785e94.js.map} +1 -1
  17. package/build/assets/index-d2c4f360.js +2 -0
  18. package/build/assets/index-d2c4f360.js.map +1 -0
  19. package/build/assets/{usePlugins-660df156.js → usePlugins-50716f7f.js} +3 -3
  20. package/build/assets/usePlugins-50716f7f.js.map +1 -0
  21. package/build/assets/{useUser-84d4eed4.js → useUser-d7f27325.js} +2 -2
  22. package/build/assets/{useUser-84d4eed4.js.map → useUser-d7f27325.js.map} +1 -1
  23. package/build/index.html +1 -1
  24. package/package.json +31 -31
  25. package/build/assets/AppRoot-bc9433b4.js.map +0 -1
  26. package/build/assets/ControlType-b475cfe6.js +0 -21
  27. package/build/assets/ControlType-b475cfe6.js.map +0 -1
  28. package/build/assets/IrisGridModelFactory-aa9601b0.js.map +0 -1
  29. package/build/assets/index-e89a2b92.js +0 -2
  30. package/build/assets/index-e89a2b92.js.map +0 -1
  31. package/build/assets/index-fb867b42.js +0 -8
  32. package/build/assets/index-fb867b42.js.map +0 -1
  33. package/build/assets/usePlugins-660df156.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{r as u,L as De,K as ae,H as A,C as l,F as M,M as w,G as J,b6 as je,aJ as Ae,b7 as Re,aa as _e,a1 as Fe}from"./vendor-a758141f.js";import{v as Ce,d as ne,l as Le,C as ue,B as Q,w as Ve,a8 as $e,ax as We}from"./usePlugins-660df156.js";import{L as Ne,ay as Ue,j as Be,b5 as Ke,aQ as He,a8 as Ge,e as ze}from"./index-c8c58d11.js";import{M as Ee,D as qe,am as Xe,b as ce,n as Ye,o as Ze}from"./IrisGrid-49222932.js";function Je(r,e){u.useEffect(()=>{if(r!=null){var t=new window.ResizeObserver(e);return t.observe(r),()=>{r!=null&&t.unobserve(r)}}},[r,e])}function de(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Qe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?de(Object(t),!0).forEach(function(n){W(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):de(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function W(r,e,t){return e=et(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function et(r){var e=tt(r,"string");return typeof e=="symbol"?e:String(e)}function tt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var nt=100,ie;(function(r){r.UP="UP",r.DOWN="DOWN"})(ie||(ie={}));class V extends u.Component{constructor(e){super(e),W(this,"popper",void 0),W(this,"cbContainer",void 0),W(this,"menuContainer",void 0),W(this,"input",void 0),W(this,"getCachedFilteredOptions",De((n,a)=>n.filter(s=>s.title.toLowerCase().indexOf(a.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=Qe({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},t),this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=ae(this.updateInputValue,nt),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=A.createRef(),this.cbContainer=A.createRef(),this.menuContainer=A.createRef(),this.input=A.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,n=t.filter(a=>a.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:n,isValid:a}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,a)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:n}=this.props;n(e,t)}processFilterChange(e){var t,{options:n}=this.props,{menuIsOpen:a}=this.state,s=e?this.getCachedFilteredOptions(n,e):n,o=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),o&&a){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:n,keyboardOptionIndex:a}=this.state,s=n[a];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s!=null&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(V.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(V.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(V.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(V.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:n}=this.state,a=n;e===V.MENU_NAVIGATION_DIRECTION.UP?n>0?(a=(a-1)%t.length,this.setState({keyboardOptionIndex:a})):n===0&&(a=t.length-1,this.setState({keyboardOptionIndex:a})):e===V.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(a=(a+1)%t.length,this.setState({keyboardOptionIndex:a})),this.scrollOptionIntoView(a)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var n;(n=this.input.current)===null||n===void 0||n.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return l.jsx("div",{className:M("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?l.jsx("div",{className:"no-match",children:e}):n.map((a,s)=>this.renderOption(a,s))}renderOption(e,t){var{keyboardOptionIndex:n}=this.state,a="option-".concat(t,"-").concat(e.value);return l.jsx("button",{type:"button",className:M("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},a)}render(){var{options:e,inputPlaceholder:t,disabled:n,className:a,defaultTitle:s,spellCheck:o,"data-testid":i}=this.props,{title:p,menuIsOpen:c,popperOptions:d,invalid:f}=this.state;return l.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[l.jsx("input",{value:p||s,className:M("form-control",a,"aci-input",{"is-invalid":f&&!c}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":i}),l.jsx(Ce,{ref:this.popper,options:d,className:M("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}W(V,"propTypes",{options:w.arrayOf(w.shape({title:w.string.isRequired,value:w.string.isRequired})).isRequired,popperOptions:w.shape({}),onChange:w.func,inputPlaceholder:w.string,disabled:w.bool,className:w.string,defaultTitle:w.string,spellCheck:w.bool,onEnter:w.func,noMatchText:w.string,"data-testid":w.string});W(V,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});W(V,"MENU_NAVIGATION_DIRECTION",ie);const Xt=V;function we(r){var{className:e="",value:t,onChange:n,spellCheck:a=!1,placeholder:s="",disabled:o=!1,delimiter:i="",id:p="","data-testid":c}=r,[d,f]=u.useState(t),[m,g]=u.useState(!1),y=u.useRef(null);u.useEffect(function(){f(t)},[t]);function I(x){return x.trim().split(i).filter(S=>S).join(`
1
+ import{r as u,L as De,K as ae,H as A,C as l,F as M,M as w,G as J,b6 as je,aJ as Ae,b7 as Re,aa as _e,a1 as Fe}from"./vendor-a758141f.js";import{v as Ce,d as ne,l as Le,C as ue,B as Q,w as Ve,a8 as $e,ax as We}from"./usePlugins-50716f7f.js";import{L as Ne,ay as Ue,j as Be,b5 as Ke,aQ as He,a8 as Ge,e as ze}from"./index-cb785e94.js";import{M as Ee,D as qe,am as Xe,b as ce,n as Ye,o as Ze}from"./IrisGrid-194f7355.js";function Je(r,e){u.useEffect(()=>{if(r!=null){var t=new window.ResizeObserver(e);return t.observe(r),()=>{r!=null&&t.unobserve(r)}}},[r,e])}function de(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Qe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?de(Object(t),!0).forEach(function(n){W(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):de(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function W(r,e,t){return e=et(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function et(r){var e=tt(r,"string");return typeof e=="symbol"?e:String(e)}function tt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var nt=100,ie;(function(r){r.UP="UP",r.DOWN="DOWN"})(ie||(ie={}));class V extends u.Component{constructor(e){super(e),W(this,"popper",void 0),W(this,"cbContainer",void 0),W(this,"menuContainer",void 0),W(this,"input",void 0),W(this,"getCachedFilteredOptions",De((n,a)=>n.filter(s=>s.title.toLowerCase().indexOf(a.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=Qe({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},t),this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=ae(this.updateInputValue,nt),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=A.createRef(),this.cbContainer=A.createRef(),this.menuContainer=A.createRef(),this.input=A.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,n=t.filter(a=>a.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:n,isValid:a}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,a)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:n}=this.props;n(e,t)}processFilterChange(e){var t,{options:n}=this.props,{menuIsOpen:a}=this.state,s=e?this.getCachedFilteredOptions(n,e):n,o=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),o&&a){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:n,keyboardOptionIndex:a}=this.state,s=n[a];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s!=null&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(V.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(V.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(V.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(V.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:n}=this.state,a=n;e===V.MENU_NAVIGATION_DIRECTION.UP?n>0?(a=(a-1)%t.length,this.setState({keyboardOptionIndex:a})):n===0&&(a=t.length-1,this.setState({keyboardOptionIndex:a})):e===V.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(a=(a+1)%t.length,this.setState({keyboardOptionIndex:a})),this.scrollOptionIntoView(a)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var n;(n=this.input.current)===null||n===void 0||n.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return l.jsx("div",{className:M("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?l.jsx("div",{className:"no-match",children:e}):n.map((a,s)=>this.renderOption(a,s))}renderOption(e,t){var{keyboardOptionIndex:n}=this.state,a="option-".concat(t,"-").concat(e.value);return l.jsx("button",{type:"button",className:M("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},a)}render(){var{options:e,inputPlaceholder:t,disabled:n,className:a,defaultTitle:s,spellCheck:o,"data-testid":i}=this.props,{title:p,menuIsOpen:c,popperOptions:d,invalid:f}=this.state;return l.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[l.jsx("input",{value:p||s,className:M("form-control",a,"aci-input",{"is-invalid":f&&!c}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":i}),l.jsx(Ce,{ref:this.popper,options:d,className:M("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}W(V,"propTypes",{options:w.arrayOf(w.shape({title:w.string.isRequired,value:w.string.isRequired})).isRequired,popperOptions:w.shape({}),onChange:w.func,inputPlaceholder:w.string,disabled:w.bool,className:w.string,defaultTitle:w.string,spellCheck:w.bool,onEnter:w.func,noMatchText:w.string,"data-testid":w.string});W(V,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});W(V,"MENU_NAVIGATION_DIRECTION",ie);const Xt=V;function we(r){var{className:e="",value:t,onChange:n,spellCheck:a=!1,placeholder:s="",disabled:o=!1,delimiter:i="",id:p="","data-testid":c}=r,[d,f]=u.useState(t),[m,g]=u.useState(!1),y=u.useRef(null);u.useEffect(function(){f(t)},[t]);function I(x){return x.trim().split(i).filter(S=>S).join(`
2
2
  `.concat(i.trim()))}function N(x){return x.split(`
3
3
  `).map(S=>S.trim()).join(" ")}function C(){if(y.current){y.current.style.height="0";var x=y.current.scrollHeight+(y.current.offsetHeight-y.current.clientHeight);x>0&&(y.current.style.height="".concat(x,"px"))}}function D(x){var S=x.target.value;m&&(i&&(S=I(S)),g(!1)),f(S),n(S)}function $(){y.current&&(i&&(f(I(d)),C()),y.current.scrollLeft=0)}function L(){y.current&&document.activeElement!==y.current&&y.current.focus()}function b(){i&&(f(N(d)),n(N(d)))}function k(){g(!0)}return u.useEffect(function(){C()},[d]),l.jsx("textarea",{ref:y,id:p,className:M(e,"auto-resize-textarea form-control"),placeholder:s,value:d,rows:1,onChange:D,onFocus:$,onMouseDown:L,onBlur:b,onPaste:k,spellCheck:a,disabled:o,"data-testid":c})}we.propTypes={value:w.string.isRequired,onChange:w.func.isRequired,className:w.string,placeholder:w.string,spellCheck:w.bool,disabled:w.bool,delimiter:w.string,id:w.string,"data-testid":w.string};we.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};var rt=Ne.module("TimeInput"),at="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",it=["00:00:00","12:34:56","23:59:59"];function he(r){return r!=null?"".concat(r.substring(0,8).replace(/\u2007/g,"0")).concat("00:00:00".substring(r.length)):r}var ke=A.forwardRef((r,e)=>{var{allowValueWrapping:t=!0,className:n="",onChange:a=()=>!1,value:s=0,onFocus:o=()=>!1,onBlur:i=()=>!1,onSelect:p=()=>!1,"data-testid":c}=r,[d,f]=u.useState(ne.formatTime(s)),m=u.useRef(s),[g,y]=u.useState(),I=u.useRef(null);u.useImperativeHandle(e,()=>({focus:()=>{var b;(b=I.current)===null||b===void 0||b.focus()},setSelection:b=>{var k;(k=I.current)===null||k===void 0||k.focus(),y(b)}}),[]),u.useEffect(function(){m.current!==s&&(f(ne.formatTime(s)),m.current=s)},[m,s]);function N(b,k,x){var S=b.selectionStart===0?24:60,j=parseInt(x,10)-k;return Number.isNaN(j)?j=0:t?j=(j%S+S)%S:j=Math.min(Math.max(0,j),S-1),"".concat(j).padStart(2,"0")}function C(b,k,x,S,j){return S===0&&j===2&&k===1&&parseInt(x,10)>1?"0".concat(x).concat(b.substring(2)):qe(b,k,x)}var D=u.useCallback(b=>{rt.debug("handleChange",b),f(b),m.current=ne.parseTime(he(b)),a(m.current)},[a]),$=u.useCallback(()=>{var b=he(d);b!==d&&f(b),i()},[d,i]),L=u.useCallback(b=>{y(b),p(b)},[p]);return l.jsx(Ee,{ref:I,className:n,example:it,getNextSegmentValue:N,getPreferredReplacementString:C,onChange:D,onSelect:L,pattern:at,selection:g,value:d,onFocus:o,onBlur:$,"data-testid":c})});ke.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const se=ke;function pe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function st(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pe(Object(t),!0).forEach(function(n){K(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function K(r,e,t){return e=lt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lt(r){var e=ot(r,"string");return typeof e=="symbol"?e:String(e)}function ot(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var fe=-1,le;(function(r){r.UP="UP",r.DOWN="DOWN"})(le||(le={}));class R extends u.Component{constructor(e){super(e),K(this,"csContainer",void 0),K(this,"menuContainer",void 0),K(this,"button",void 0),K(this,"input",void 0);var{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=A.createRef(),this.menuContainer=A.createRef(),this.button=A.createRef(),this.input=A.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){var{options:e,value:t,placeholder:n}=this.props,{customTime:a}=this.state;if(t===null)return n;for(var s=0;s<e.length;s+=1){var o=e[s];if(o.value===t)return o.title}return ne.formatTime(a)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)===null||e===void 0||e.focus()}updateInputValue(e){var{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{keyboardOptionIndex:n,inputFocused:a}=this.state,{options:s}=this.props;switch(e.key){case"Enter":case" ":a?this.updateFromCustom():this.updateInputValue(s[n].value),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(R.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(R.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(R.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(R.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){var{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:a}=this.props,s=a.length,o=t;switch(e){case R.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(o=(o-1)%s,this.setState({keyboardOptionIndex:o})):t===0&&(o=s-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case R.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===s-1){this.focusInput();break}else n&&this.focusOption(t);t<s&&!(n&&t===0)&&(o=(o+1)%s,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){var t=Number(e.currentTarget.value),{options:n,timeToValue:a}=this.props,{customTime:s}=this.state;if(t===fe){var o=a(s);this.updateAndClose(o)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var e,{options:t,value:n}=this.props,{keyboardOptionIndex:a}=this.state;this.scrollOptionIntoView(a);var s=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),n!==null){var o=t.map(i=>i.value).indexOf(n);o<0&&this.focusInput()}}focusInput(){var e;(e=this.input.current)===null||e===void 0||e.focus()}focusOption(e){var t,n=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(n&&n.children!=null){var a=n.children.item(e);a instanceof HTMLElement&&a.focus()}}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){var{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){var{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),e){var t;(t=this.button.current)===null||t===void 0||t.focus()}}updateKeyboardIndex(){var{options:e,value:t}=this.props;if(t!==null){var n=e.map(a=>a.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}}scrollOptionIntoView(e){var t,n=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(n&&n.children!=null){var a=n.children.item(e);a instanceof HTMLElement&&a.offsetTop>R.DROP_DOWN_MENU_HEIGHT?n.scrollTop=a.offsetTop-R.DROP_DOWN_MENU_HEIGHT:(a instanceof HTMLElement&&a.offsetTop<0||e===0)&&(n.scrollTop=0)}}renderMenuElement(){var{inputWidth:e}=this.state;return l.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:l.jsx("div",{className:"cs-options-container",children:l.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){for(var{options:e,value:t,icon:n,customText:a}=this.props,{keyboardOptionIndex:s,customTime:o,inputFocused:i}=this.state,p=!1,c=[],d=0;d<e.length;d+=1){var f=e[d],m="option-".concat(d,"-").concat(f.value);p=p||f.value===t,c.push(l.jsxs("button",{type:"button",value:d,className:M("cs-option-btn",{"keyboard-active":s===d&&!i}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[f.value===t&&l.jsx(J,{icon:n,className:"mr-2"}),f.value!==t&&l.jsx("span",{className:"mr-4"}),f.title]},m))}return c.push(l.jsx("hr",{className:"cs-divider"},"option-divider")),c.push(l.jsxs("button",{type:"button",value:fe,className:M("cs-option-btn",{"keyboard-active":i}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!p&&t!==null?l.jsx(J,{icon:n,className:"mr-2"}):l.jsx("span",{className:"mr-4"}),a]},"option-custom-label")),c.push(l.jsxs("div",{className:"cs-custom-container",children:[l.jsx("span",{className:"mr-2"}),l.jsx(se,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),l.jsx("span",{className:"ml-2"})]},"cs-custom-container")),c.push(l.jsx("hr",{className:"mb-2"},"option-end")),c}render(){var{disabled:e,invalid:t,value:n,"data-testid":a}=this.props,{menuIsOpen:s}=this.state,{popperOptions:o}=this.props;return o=st({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},o),l.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":a,children:l.jsx("div",{className:M("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:l.jsxs("button",{type:"button",className:M("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[l.jsx("span",{className:M({"text-muted":n===null}),children:this.getSelectedText()}),l.jsx("span",{className:"cs-caret"}),l.jsx(Le,{isShown:s,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}K(R,"MENU_NAVIGATION_DIRECTION",le);K(R,"DROP_DOWN_MENU_HEIGHT",125);K(R,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:Ue,customText:"Custom",placeholder:"Select a time",valueToTime:r=>r===null?0:Math.round(r/1e3),timeToValue:r=>r*1e3,invalid:!1,"data-testid":void 0});const Yt=R;var ut=Ne.module("DateInput"),ct="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",dt=["2000-01-01","2022-12-31"],ht="YYYY-MM-DD",Se=A.forwardRef((r,e)=>{var{className:t="",onChange:n=()=>{},defaultValue:a="",onFocus:s=()=>{},onBlur:o=()=>{},"data-testid":i}=r,[p,c]=u.useState(a),[d,f]=u.useState(),m=u.useCallback(g=>{ut.debug("handleChange",g),c(g),n(g)},[n]);return l.jsx("div",{className:"d-flex flex-row align-items-center",children:l.jsx(Ee,{ref:e,className:M(t),example:dt,getNextSegmentValue:Xe,onChange:m,onSelect:f,pattern:ct,placeholder:ht,selection:d,value:p,onFocus:s,onBlur:o,"data-testid":i})})});Se.displayName="DateInput";const Zt=Se;function pt(r,e,t){return e=ft(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ft(r){var e=vt(r,"string");return typeof e=="symbol"?e:String(e)}function vt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class q extends u.Component{static isParentSelected(e,t){var n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;var a=Array.from(n.values()).includes(!0),s=Array.from(n.values()).includes(!1);return a&&s?null:a}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{var{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){var{valueMap:n,onUpdateValueMap:a}=this.props,s=new Map(n),o=s.get(e);if(o instanceof Map){var i=new Map(o);if(t!=null)i.set(t,o.get(t)===void 0);else{var p=q.isParentSelected(e,s),c=p==null||!p;o.forEach((m,g)=>i.set(g,c))}s.set(e,i)}else s.set(e,o==null||!o);var d=s.get(e);if(t===void 0&&d!==void 0&&typeof d!="boolean"){var f=q.isParentSelected(e,n);f!=null&&f?d.forEach((m,g)=>d.set(g,!1)):d.forEach((m,g)=>d.set(g,!0))}a(s)}setAllValues(e){var{valueMap:t,onUpdateValueMap:n}=this.props,a=new Map;t.forEach((s,o)=>{if(typeof s=="boolean")a.set(o,e);else{var i=new Map;s.forEach((p,c)=>i.set(c,e)),a.set(o,i)}}),n(a)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){var{valueMap:e,"data-testid":t}=this.props;return l.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(n=>{var[a,s]=n;return l.jsxs("div",{children:[l.jsx(ue,{className:"hcm-parent",checked:q.isParentSelected(a,e),onChange:()=>this.toggleValueFor(a),children:a}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(o=>{var[i,p]=o;return l.jsx(ue,{className:"hcm-child",checked:p,onChange:()=>this.toggleValueFor(a,i),children:i},i)})]},a)}),l.jsx(Q,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),l.jsx(Q,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?"".concat(t,"-btn-clear"):void 0,children:"Clear"})]})}render(){var{menuText:e,className:t,icon:n,id:a,"data-testid":s}=this.props,{menuIsOpen:o}=this.state;return l.jsxs("button",{type:"button",className:M("btn hcm-btn",t),onClick:this.toggleMenu,id:a,"data-testid":s,children:[l.jsxs("span",{children:[n&&l.jsx(J,{icon:n,className:"hcm-icon mr-1"}),e]}),l.jsx("span",{className:"cs-caret"}),l.jsx(Ce,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}pt(q,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const Jt=q;function ve(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function re(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ve(Object(t),!0).forEach(function(n){mt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ve(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function mt(r,e,t){return e=gt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gt(r){var e=bt(r,"string");return typeof e=="symbol"?e:String(e)}function bt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Pe=u.memo(r=>{var{tab:e,onClose:t,onSelect:n,isActive:a,activeRef:s,index:o,isDraggable:i,contextActions:p}=r,{key:c,isClosable:d=t!=null,title:f}=e;return l.jsx(je,{draggableId:c,index:o,isDragDisabled:!i,children:(m,g)=>l.jsxs("div",{className:"context-menu-wrapper",ref:a?s:null,children:[l.jsxs("div",re(re(re({ref:m.innerRef},m.draggableProps),m.dragHandleProps),{},{className:M("btn btn-link btn-nav-tab",{active:a},{dragging:g.isDragging}),"data-testid":"btn-nav-tab-".concat(f),role:"tab",tabIndex:0,onClick:y=>{y.target.focus(),n(c)},onKeyPress:y=>{y.key==="Enter"&&n(c)},children:[f,d&&l.jsx(Q,{kind:"ghost",className:"btn-nav-tab-close",onClick:y=>{t?.(c),y.stopPropagation(),y.preventDefault()},icon:Be,tooltip:"Close"})]})),l.jsx(Ve,{actions:p})]})},c)});Pe.displayName="NavTab";const Ot=Pe;function me(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function ge(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?me(Object(t),!0).forEach(function(n){yt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):me(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function yt(r,e,t){return e=Tt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Tt(r){var e=It(r,"string");return typeof e=="symbol"?e:String(e)}function It(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var xt=500,Ct=.01,Nt=5e-4;function be(r){return r.scrollLeft===0}function Oe(r){return r.scrollLeft+r.clientWidth===r.scrollWidth||r.scrollWidth===0}function Et(r,e,t){var{isClosable:n=!1,key:a}=r,s=[];if(n&&t!=null){s.push({title:"Close",order:10,group:20,action:()=>{t(a)}});for(var o=!0,i=e.length-1;i>0&&e[i].key!==r.key;i-=1)if(e[i].isClosable===!0){o=!1;break}s.push({title:"Close to the Right",order:20,group:20,action:()=>{for(var p=e.length-1;p>0&&e[p].key!==a;p-=1)e[p].isClosable===!0&&t(e[p].key)},disabled:o}),s.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(p=>{p.isClosable===!0&&t(p.key)})}})}return s}function Qt(r){var{activeKey:e,tabs:t,onSelect:n,onReorder:a,onClose:s,makeContextActions:o}=r,i=u.useRef(),[p,c]=u.useState(!0),[d,f]=u.useState(!0),[m,g]=u.useState(!0),y=u.useCallback(()=>{i.current!=null&&(i.current.clientWidth<i.current.scrollWidth&&t.length>0?c(!0):c(!1),f(be(i.current)),g(Oe(i.current)))},[t]);Je(i.current,y);var I=u.useCallback(h=>{ce.stopDragging(),h.destination&&a?.(h.source.index,h.destination.index)},[a]),N=u.useCallback(()=>{if(i.current!=null){var h=be(i.current);h!==d&&f(h);var v=Oe(i.current);v!==m&&g(v)}},[d,m]),C=u.useRef({cancelClick:!1}),D=u.useCallback(()=>{if(!(i.current==null||C.current.cancelClick))for(var{children:h}=i.current,v=h.length-1;v>=0;v-=1){var T=h[v];if(T.offsetLeft<i.current.scrollLeft-5){T.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),$=u.useCallback(()=>{if(!(i.current==null||C.current.cancelClick))for(var{children:h}=i.current,v=0;v<h.length;v+=1){var T=h[v];if(T.offsetLeft+5>i.current.scrollLeft+i.current.offsetWidth){T.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),L=u.useCallback(function(h,v){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,P=arguments.length>3?arguments[3]:void 0,F=i.current;F!=null&&(C.current.cancelClick=!0,h==="left"?F.scrollLeft=v-T:h==="right"&&(F.scrollLeft=v+T),C.current.rAF=requestAnimationFrame(H=>{var Y=P??H,G=H-Y,Z=Ct*G+.5*Nt*G**2;Z=Math.min(Z,F.scrollWidth),L(h,v,Z,Y)}))},[]),b=u.useCallback(()=>{var{holdTimer:h,rAF:v}=C.current;h!=null&&(clearTimeout(h),C.current.holdTimer=void 0),v!=null&&(cancelAnimationFrame(v),C.current.rAF=void 0),window.removeEventListener("mouseup",b)},[]);u.useEffect(()=>()=>window.removeEventListener("mouseup",b),[b]);var k=u.useCallback(h=>{i.current!=null&&(C.current.holdTimer=window.setTimeout(L,xt,h,i.current.scrollLeft)),C.current.cancelClick=!1,window.addEventListener("mouseup",b)},[b,L]),x=u.useCallback(()=>{k("left")},[k]),S=u.useCallback(()=>{k("right")},[k]);u.useEffect(function(){var v,T=P=>{P.stopPropagation(),P.preventDefault();var F=P.currentTarget,H=Math.abs(P.deltaY)>Math.abs(P.deltaX)?P.deltaY:P.deltaX;F.scrollLeft+=_e(H,-30,30)};return(v=i.current)===null||v===void 0||v.addEventListener("wheel",T),()=>{var P;(P=i.current)===null||P===void 0||P.removeEventListener("wheel",T)}},[]);var j=u.useMemo(()=>{var h=new Map;return t.forEach(v=>{var{key:T}=v,P=[()=>Et(v,t,s),()=>{var F;return(F=o?.(v))!==null&&F!==void 0?F:[]}];h.set(T,P)}),h},[o,t,s]),U=u.useRef(null),ee=t.find(h=>h.key===e),O=t.map((h,v)=>{var{key:T}=h,P=h===ee;return l.jsx(Ot,{tab:h,index:v,isActive:P,activeRef:U,onSelect:n,onClose:s,isDraggable:a!=null,contextActions:j.get(T)},T)});return u.useEffect(function(){U.current!=null&&U.current.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),l.jsxs("nav",{className:"nav-container",children:[p&&l.jsx(Q,{kind:"ghost",icon:l.jsx(J,{icon:Ke,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:D,onMouseDown:x,disabled:d}),l.jsx(Ae,{onDragStart:ce.startDragging,onDragEnd:I,children:l.jsx(Re,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(h,v)=>l.jsxs("div",ge(ge({ref:T=>{T!=null&&(i.current=T,h.innerRef(T))}},h.droppableProps),{},{className:M("nav nav-tabs",{dragging:v.draggingFromThisWith}),role:"tablist",onScroll:N,children:[O,h.placeholder]}))})}),p&&l.jsx(Q,{kind:"ghost",icon:l.jsx(J,{icon:He,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:$,onMouseDown:S,disabled:m})]})}var wt=.025,kt=.9,St=.1,Pt=.618,ye=80,z={SIZE:8,DOT_SIZE:2},B=18,Mt=250,Dt=60*1e3,jt={background:"var(--dh-color-random-area-plot-animation-bg)",foregroundFill:"var(--dh-color-random-area-plot-animation-fg-fill)",foregroundStroke:"var(--dh-color-random-area-plot-animation-fg-stroke)",gridColor:"var(--dh-color-random-area-plot-animation-grid)"};function At(){return Ge(jt)}var Rt=A.memo(()=>{var{activeThemes:r}=$e(),e=u.useMemo(At,[r]),t=u.useRef(null),n=u.useRef(null),[a,s]=u.useState(!1),o=window.devicePixelRatio,i,p,c,d,f,m=null,g=[];function y(){var O;n.current!=null&&(c=n.current.offsetWidth,d=n.current.offsetHeight),t.current!=null&&(t.current.style.width="".concat(c,"px"),t.current.style.height="".concat(d,"px"),t.current.width=c*o,t.current.height=d*o),(O=i)===null||O===void 0||O.scale(o,o)}function I(){var{foregroundFill:O,foregroundStroke:h}=e,v=document.createElement("canvas");v.width=z.SIZE,v.height=z.SIZE;var T=v.getContext("2d");return T!=null&&(T.fillStyle=h,T.fillRect(0,0,z.DOT_SIZE,z.DOT_SIZE),T.fillStyle=O,T.fillRect(0,0,z.SIZE,z.SIZE)),T?.createPattern(v,"repeat")}function N(O){var h=Math.random()-.5,v=wt*h;return O<St?v=Math.abs(v):O>kt&&(v=-Math.abs(v)),O+v}function C(){for(var O=[],h=Pt,v=0;v<c+B;v+=1)h=N(h),O.push(h);return O}function D(){for(;g.length>=c+B;)g.pop();for(;g.length<c+B;)g.push(N(g[g.length-1]))}function $(O,h){h.beginPath(),h.moveTo(-1,d+1),h.lineTo(-1,d*O[0]);for(var v=0;v<O.length;v+=1)h.lineTo(v,d*O[v]);h.lineTo(c+B,d*O[O.length-1]),h.lineTo(c+B,d+1),h.closePath()}function L(O){O.beginPath();for(var h=1;h<c;h+=ye)O.moveTo(h,0),O.lineTo(h,d);for(var v=1;v<d;v+=ye)O.moveTo(0,v),O.lineTo(c,v)}function b(O){var h,v,T;m=(h=m)!==null&&h!==void 0?h:O;var{background:P,foregroundStroke:F,gridColor:H}=e;ze(i),i.fillStyle=P,i.fillRect(0,0,c,d),L(i),i.lineWidth=1,i.strokeStyle=H,i.stroke();var Y=(((v=m)!==null&&v!==void 0?v:0)-(O??0))/(1e3/B);if(i.translate(Y,0),$(g,i),i.lineWidth=2,i.strokeStyle=F,i.stroke(),i.translate(-Y,0),p!=null&&(i.fillStyle=p),i.fill(),i.setTransform(o,0,0,o,0,0),(O??0)-((T=m)!==null&&T!==void 0?T:0)>1e3/B){for(var G,Z=Math.floor(((O??0)-((G=m)!==null&&G!==void 0?G:0))/(1e3/B)),oe=0;oe<Z;oe+=1)g.shift(),g.push(N(g[g.length-1]));m=O}f!=null&&cancelAnimationFrame(f),f=requestAnimationFrame(b)}var k=ae(()=>{f=requestAnimationFrame(O=>{y(),D(),s(!1),b(O)})},Mt,{leading:!0});function x(){s(!0),f!=null&&cancelAnimationFrame(f),f=null,m=null}var S=ae(()=>{x()},Dt);function j(){f==null&&(s(!1),y(),D(),f=requestAnimationFrame(b)),S()}function U(){document.hasFocus()&&j()}function ee(){f!=null&&cancelAnimationFrame(f),S(),k()}return u.useEffect(()=>{var O;return i=(O=t.current)===null||O===void 0?void 0:O.getContext("2d",{alpha:!1}),y(),g=C(),p=I(),b(),S(),window.addEventListener("resize",ee),window.addEventListener("focus",j),window.addEventListener("blur",x),window.addEventListener("mousemove",U),window.addEventListener("keydown",U),()=>{f!=null&&cancelAnimationFrame(f),window.removeEventListener("resize",ee),window.removeEventListener("focus",j),window.removeEventListener("blur",x),window.removeEventListener("mousemove",U),window.removeEventListener("keydown",U),S.cancel(),k.cancel()}},[e]),l.jsx("div",{className:"random-area-plot-animation-container",ref:n,children:l.jsx("canvas",{ref:t,className:a?"shade":""})})});const en=Rt,_t="_modified_10irp_24",Ft="_track_10irp_35",Lt="_handle_10irp_15",Vt="_ticks_10irp_103",Me={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_10irp_5","time-slider-popovers":"_time-slider-popovers_10irp_10","handle-popper":"_handle-popper_10irp_15",modified:_t,"flex-spacer":"_flex-spacer_10irp_31",track:Ft,"track-fills":"_track-fills_10irp_42","track-fill":"_track-fill_10irp_42","track-fill-start":"_track-fill-start_10irp_60","track-fill-middle":"_track-fill-middle_10irp_61","track-fill-end":"_track-fill-end_10irp_64","handle-track":"_handle-track_10irp_67",handle:Lt,ticks:Vt,"tick-labels":"_tick-labels_10irp_121","tick-label":"_tick-label_10irp_121","tick-label-wrapper":"_tick-label-wrapper_10irp_137"};var te=parseInt(Me["handle-size"],10),Te=parseInt(Me["popover-width"],10),_=24*60*60-1,Ie=5*60;function tn(r){var{startTime:e,endTime:t,onChange:n,isStartModified:a=!1,isEndModified:s=!1,"data-testid":o}=r,[i,p]=u.useState(e),[c,d]=u.useState(t),f=u.useRef(null);u.useEffect(function(){p(e),d(t)},[e,t]);var m=u.useCallback((I,N)=>{var C=I,D=N;C===D&&(D<_?D+=1:C-=1),p(C),d(D),n({startTime:C,endTime:D})},[p,d,n]),g=u.useCallback(I=>{m(I,c)},[m,c]),y=u.useCallback(I=>{m(i,I)},[m,i]);return l.jsxs("div",{className:"time-slider","data-testid":o,children:[l.jsx($t,{startTime:i,endTime:c,onStartTimeChange:g,onEndTimeChange:y,isStartModified:a,isEndModified:s}),l.jsxs("div",{className:"track",ref:f,children:[l.jsx(Wt,{startTime:i,endTime:c}),l.jsx("div",{className:"ticks",children:Array(24).fill(null).map((I,N)=>l.jsx("div",{className:"tick"},N))}),l.jsx(xe,{track:f,time:i,setTime:g}),l.jsx(xe,{track:f,time:c,setTime:y})]}),l.jsxs("div",{className:"tick-labels",children:[l.jsx("div",{className:"tick-label",children:"0:00"}),l.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((I,N)=>l.jsx("div",{className:"tick-label",children:"".concat(N+1,":00")},N))})]})]})}function $t(r){var{startTime:e,endTime:t,onStartTimeChange:n,onEndTimeChange:a,isStartModified:s,isEndModified:o,"data-testid":i}=r,p=e>t,[c,d]=u.useState(p?t:e),[f,m]=u.useState(p?e:t),g=u.useRef(null),y=u.useRef(null),I=u.useRef(null),N=u.useRef(null);u.useEffect(function(){d(e>t?t:e),m(e>t?e:t)},[e,t]),u.useEffect(function(){if(I.current!==null){var k;(k=y.current)===null||k===void 0||k.setSelection(I.current)}if(N.current!==null){var x;(x=g.current)===null||x===void 0||x.setSelection(N.current)}},[p]);function C(b){e<=t?n(b):a(b)}function D(b){e<=t?a(b):n(b)}var $=u.useCallback(b=>{I.current=b,N.current=null},[]),L=u.useCallback(b=>{I.current=null,N.current=b},[]);return l.jsxs("div",{className:"time-slider-popovers",children:[l.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(c/_*100,"% - ").concat(Te/2,"px)")}}),l.jsxs("div",{className:"handle-popper",children:[l.jsx("label",{className:M({modified:p?o:s}),children:p?"End Time":"Start Time"}),l.jsx(se,{ref:g,allowValueWrapping:!1,value:c,onChange:C,onSelect:$,"data-testid":i!==void 0?"".concat(i,"-input-1"):void 0})]}),l.jsx("div",{className:"flex-spacer"}),l.jsxs("div",{className:"handle-popper",children:[l.jsx("label",{className:M({modified:p?s:o}),children:p?"Start Time":"End Time"}),l.jsx(se,{ref:y,allowValueWrapping:!1,value:f,onChange:D,onSelect:L,"data-testid":i!==void 0?"".concat(i,"-input-2"):void 0})]}),l.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((_-f)/_*100,"% - ").concat(Te/2,"px)")}})]})}function Wt(r){var{startTime:e,endTime:t,"data-testid":n}=r;return l.jsxs("div",{className:"track-fills","data-testid":n,children:[e>t&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"track-fill track-fill-start",style:{transform:"scaleX(".concat(t/_,")")}}),l.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((_-e)/_,")")}})]}),e<t&&l.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/_*100,"%) scaleX(").concat((t-e)/_,")")}})]})}function xe(r){var{track:e,time:t,setTime:n,"data-testid":a}=r,s=u.useMemo(()=>{var m=3600,g=te/2;return t<m?g=t/m*(te/2):t>23*m&&(g=te/2+1/(_-23*m)*(t-23*m)*(te/2)),"translateX(calc(".concat(t/_*100,"% - ").concat(g,"px))")},[t]),o=u.useCallback(m=>{if(!e.current)return 0;var g=e.current.getBoundingClientRect(),y=Math.max(m-g.left,0),I=_*Math.min(1,y/g.width),N=Ie*Math.round(I/Ie),C=Math.min(_,N);return C},[e]),i=u.useCallback(m=>{var{clientX:g}=m;n(o(g))},[n,o]),p=u.useCallback(m=>{var{clientX:g}=m;n(o(g)),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",p),document.documentElement.classList.remove("drag-pointer-events-none")},[n,o,i]),c=u.useCallback(()=>{window.addEventListener("mousemove",i),window.addEventListener("mouseup",p),document.documentElement.classList.add("drag-pointer-events-none")},[i,p]),d=u.useCallback(()=>{window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",p),document.documentElement.classList.remove("drag-pointer-events-none")},[i,p]),f=u.useCallback(()=>{c()},[c]);return u.useEffect(function(){return()=>{d()}},[d]),l.jsx("div",{className:"handle-track",style:{transform:s},children:l.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:f,"data-testid":a})})}function nn(r){var{children:e,className:t,labelText:n,hintText:a,isModified:s,validationError:o,showValidationError:i=!0,"data-testid":p,id:c}=r,{current:d}=u.useRef(c??Fe());return l.jsxs(l.Fragment,{children:[l.jsx("label",{className:M("validate-label",t,{modified:s}),htmlFor:d,"data-testid":p,children:n}),A.Children.toArray(e).map(f=>A.isValidElement(f)?A.cloneElement(f,{className:M(f.props.className,{"is-invalid":o})}):l.jsx("div",{className:M(t),children:f})),a!==void 0&&l.jsx("small",{className:"form-text text-muted",children:a}),o!==void 0&&i&&l.jsx("p",{className:"validate-label-error text-danger",children:o})]})}function X(r,e,t){return e=Ut(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ut(r){var e=Bt(r,"string");return typeof e=="symbol"?e:String(e)}function Bt(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class E extends Ye{static get theme(){return E._theme==null&&(E._theme=We()),E._theme}static makeRandomSeries(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,a=[],s=[],o=[],i=[],p=new Date("2018-06-01"),c=0;c<n;c+=1){var d=new Date(p.getFullYear(),p.getMonth(),p.getDate()+c-n);a.push("".concat(d.getFullYear(),"-").concat(d.getMonth()+1,"-").concat(d.getDate()));var f=(Math.sin(c/n*e)*n/3+Math.cos(c*.2)*n/6+Math.sin(c*.5)*n/10+E.random()*n/5+c*E.smoothing)*t;f=Math.round(f*100)/100,s.push(f),i.push(40+c*E.smoothing),o.push(Math.sin(c/n*e)*n/3+E.random()*n/10+c*E.smoothing)}return{x:a,y:s,s:o,l:i}}static makeScatter(e){return{name:"SCTR",x:e.x,y:e.y,type:"scatter",mode:"markers",hoverinfo:"skip",marker:{size:5}}}static makeArea(e){return{name:"AREA",x:e.x,y:e.s,type:"scatter",mode:"line",fill:"tozeroy",hoverinfo:"all",line:{width:3}}}static makeTrendline(e){return{name:"Trendline <br>R<sup>2</sup> = 0.91",x:e.x,y:e.l,type:"scatter",mode:"line",hoverinfo:"skip",line:{width:3,dash:"dot"}}}static makeErrorBand(e){for(var t=[],n=[],a=0;a<e.y.length;a+=1){var s=e.y[a];t[a]=Math.round((s+18)*100)/100,n[a]=Math.round((s-18)*100)/100}var o=t.concat(n.reverse());return{name:"error",x:e.x.concat(e.x.slice().reverse()),y:o,type:"scatter",mode:"line",hoverinfo:"skip",fill:"toself",line:{width:0,color:E.theme.error_band_line_color,shape:"spline"}}}static makeLine(e){return{name:"LINE",x:e.x,y:e.y,type:"scatter",mode:"line",hoverinfo:"x+y+text+name",line:{width:3}}}static makeRandomData(){var e=E.makeRandomSeries(6),t=E.makeArea(e),n=E.makeTrendline(e),a=E.makeRandomSeries(2),s=E.makeLine(a),o=E.makeErrorBand(a);return[t,n,s,o]}static makeDefaultLayout(e){var t=new Ze(e).makeDefaultLayout(E.theme);return t.title="Chart",t.xaxis&&(t.xaxis.title="Datestamp"),t.yaxis&&(t.yaxis.title="Price"),t}constructor(e){var{data:t=E.makeRandomData(),layout:n=E.makeDefaultLayout(e),filterFields:a=[]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e),X(this,"data",void 0),X(this,"filterFields",void 0),X(this,"layout",void 0),this.data=t,this.layout=n,this.filterFields=a}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){for(var e=new Map,t=0;t<this.filterFields.length;t+=1){var n=this.filterFields[t],a="java.lang.String";e.set(n,{name:n,type:a})}return e}isFilterRequired(){return this.filterFields.length>0}setFilter(){this.fireUpdate(this.data)}}X(E,"random",Math.random.bind(Math));X(E,"smoothing",1.5);X(E,"_theme",void 0);const rn=E;var Kt=u.createContext(!1);function an(r){var{fontClassNames:e=["fira-sans-regular","fira-sans-semibold","fira-mono"],children:t}=r,[n,a]=u.useState(!1);return u.useEffect(function(){document.fonts.ready.then(()=>{a(!0)})},[]),l.jsxs(l.Fragment,{children:[l.jsx(Kt.Provider,{value:n,children:t}),l.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(s=>l.jsx("p",{className:s,children:"preload"},s))})]})}export{Xt as A,Yt as C,Zt as D,Kt as F,Jt as H,rn as M,Qt as N,se as T,nn as V,we as a,en as b,tn as c,an as d,Je as u};
4
- //# sourceMappingURL=FontBootstrap-5b595a14.js.map
4
+ //# sourceMappingURL=FontBootstrap-f9c22091.js.map