@deephaven/code-studio 0.82.1-beta.6 → 0.82.1-beta.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.
- package/build/assets/{AppRoot-e0623c71.js → AppRoot-98ad8cf7.js} +3 -3
- package/build/assets/{AppRoot-e0623c71.js.map → AppRoot-98ad8cf7.js.map} +1 -1
- package/build/assets/{Chart-e5224823.js → Chart-a9c6e441.js} +2 -2
- package/build/assets/{Chart-e5224823.js.map → Chart-a9c6e441.js.map} +1 -1
- package/build/assets/{ControlType-ee9c672e.js → ControlType-c918f1cd.js} +3 -3
- package/build/assets/{ControlType-ee9c672e.js.map → ControlType-c918f1cd.js.map} +1 -1
- package/build/assets/FontBootstrap-93399df4.js +4 -0
- package/build/assets/FontBootstrap-93399df4.js.map +1 -0
- package/build/assets/{FormatterUtils-aa7386ef.js → FormatterUtils-8bc07bb9.js} +2 -2
- package/build/assets/{FormatterUtils-aa7386ef.js.map → FormatterUtils-8bc07bb9.js.map} +1 -1
- package/build/assets/{Grid-4206eb66.js → Grid-68f28f7c.js} +2 -2
- package/build/assets/{Grid-4206eb66.js.map → Grid-68f28f7c.js.map} +1 -1
- package/build/assets/GridRenderer-beadd456.js +2 -0
- package/build/assets/GridRenderer-beadd456.js.map +1 -0
- package/build/assets/{IrisGrid-c5f818f4.js → IrisGrid-8471fc12.js} +2 -2
- package/build/assets/{IrisGrid-c5f818f4.js.map → IrisGrid-8471fc12.js.map} +1 -1
- package/build/assets/{IrisGridModel-f63f94cc.js → IrisGridModel-db71cdf7.js} +2 -2
- package/build/assets/{IrisGridModel-f63f94cc.js.map → IrisGridModel-db71cdf7.js.map} +1 -1
- package/build/assets/{IrisGridShortcuts-c8a512d6.js → IrisGridShortcuts-6b660c54.js} +2 -2
- package/build/assets/{IrisGridShortcuts-c8a512d6.js.map → IrisGridShortcuts-6b660c54.js.map} +1 -1
- package/build/assets/{IrisGridThemeProvider-ed895144.js → IrisGridThemeProvider-98bbe2be.js} +2 -2
- package/build/assets/{IrisGridThemeProvider-ed895144.js.map → IrisGridThemeProvider-98bbe2be.js.map} +1 -1
- package/build/assets/{LocalWorkspaceStorage-8e43291a.js → LocalWorkspaceStorage-20cf2372.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-8e43291a.js.map → LocalWorkspaceStorage-20cf2372.js.map} +1 -1
- package/build/assets/{MarkdownEditor-d90e4bef.js → MarkdownEditor-92833d91.js} +2 -2
- package/build/assets/{MarkdownEditor-d90e4bef.js.map → MarkdownEditor-92833d91.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-7c4e9125.js → MarkdownNotebook-58af34d7.js} +2 -2
- package/build/assets/{MarkdownNotebook-7c4e9125.js.map → MarkdownNotebook-58af34d7.js.map} +1 -1
- package/build/assets/{MissingPartitionError-1e490bac.js → MissingPartitionError-6ffc79b5.js} +2 -2
- package/build/assets/{MissingPartitionError-1e490bac.js.map → MissingPartitionError-6ffc79b5.js.map} +1 -1
- package/build/assets/{StyleGuideRoot-42855334.js → StyleGuideRoot-d45b2596.js} +12 -12
- package/build/assets/{StyleGuideRoot-42855334.js.map → StyleGuideRoot-d45b2596.js.map} +1 -1
- package/build/assets/index-0b8d9e03.js +2 -0
- package/build/assets/{index-0e1c1551.js.map → index-0b8d9e03.js.map} +1 -1
- package/build/assets/{index-2f2129be.js → index-7440403e.js} +2 -2
- package/build/assets/{index-2f2129be.js.map → index-7440403e.js.map} +1 -1
- package/build/assets/{index-1f683a88.js → index-ea785fe0.js} +3 -3
- package/build/assets/{index-1f683a88.js.map → index-ea785fe0.js.map} +1 -1
- package/build/index.html +1 -1
- package/package.json +30 -30
- package/build/assets/FontBootstrap-4f906e56.js +0 -4
- package/build/assets/FontBootstrap-4f906e56.js.map +0 -1
- package/build/assets/GridRenderer-bf66c0c9.js +0 -2
- package/build/assets/GridRenderer-bf66c0c9.js.map +0 -1
- package/build/assets/index-0e1c1551.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as y,_ as $r,I as s,K as Y,Z as bi,M as ke,L as Z,J as Ei,T as rt,bf as De,U as J,bb as aa,bc as oa,ba as sa,bd as hr,ag as di,V as At}from"./vendor-6ba620f4.js";import{L as ce,f as Ai,P as kt,e as L,g as Ri,br as mr,T as yi,ah as la,ai as ua,bs as _i,bt as Pt,bu as da,bv as Ue,bw as ca,bx as ha,aE as wi,aU as Fi,by as ma,bz as pa,bA as ga,am as va,bB as pr,a$ as gr,bC as ci,bD as fa,an as Ca,bE as Sa,ag as Ta,bF as ba,bG as Ea,aq as ya,aK as wa,M as Fa,b as Na,bH as Oa,bI as Aa,c as Ra,j as Qr,A as _a,bJ as xa,bK as Da,bg as Ia,al as Pa,bL as La,r as Ua,bM as ja,bN as ka,bO as Ga,bP as Ma,aw as Va,bQ as Ba,b3 as $a}from"./index-2f2129be.js";import{c as T,S as nt,B as W,x as xi,P as Oe,O as ht,cJ as Qa,t as Ae,b1 as Di,aD as Hr,a6 as Ii,c4 as Ha,s as Xe,b4 as Dt,b as Ct,a as we,I as Ke,G as Wa,ah as U,ch as hi,ae as de,cf as Ve,A as Wr,Q as Ka,af as Kr,C as Ya,cj as Yr,J as qa,cC as za,T as Te,F as mi,cK as Xa,bj as Za}from"./ControlType-ee9c672e.js";import{k as Ja,l as eo,m as to,o as io,I as ie,j as qr,d as Ni,a as Lt,b as Rt,g as ro,h as no}from"./MissingPartitionError-1e490bac.js";import{G as Fe,c as ve,i as $e,d as Be,g as vr,b as xe}from"./IrisGridModel-f63f94cc.js";import{P as ao,n as oo,F as so,O as K,y as lo,q as uo,T as Ye,p as co,A as ho,l as mo,R as po,m as go,V as vo,C as fo,x as Co,r as So}from"./IrisGridThemeProvider-ed895144.js";import{w as To,ad as Re,ac as bo,r as zr,l as Xr,m as Eo,x as yo,P as fr}from"./GridRenderer-bf66c0c9.js";import{I as Ne,a as Cr,S as wo,D as Fo}from"./IrisGridShortcuts-c8a512d6.js";import{K as Gt,a as Sr,i as No,G as Oo}from"./Grid-4206eb66.js";import{F as Tr}from"./FormatterUtils-aa7386ef.js";import"./helpers-de833af9.js";import"./monaco-b5248072.js";function br(r,e,t){return e=Ao(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ao(r){var e=Ro(r,"string");return typeof e=="symbol"?e:String(e)}function Ro(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _t=ce.module("AdvancedFilterCreatorFilterItem");class Pi extends y.PureComponent{static getLabelForFilter(e,t){try{if(T.isNumberType(e)||T.isCharType(e))return Ja(t);if(T.isTextType(e))return eo(t);if(T.isDateType(e))return to(t);if(T.isBooleanType(e))return io(t);throw new Error("Unrecognized column type: ".concat(e))}catch(i){return _t.warn(i),""}}constructor(e){super(e),br(this,"typeDropdown",void 0),br(this,"getCachedIsValid",$r((a,o,u,l,d)=>{try{return!u||d.makeAdvancedValueFilter(a,o,u,l)!=null}catch{return!1}})),this.handleDelete=this.handleDelete.bind(this),this.handleTypeChange=this.handleTypeChange.bind(this),this.handleValueChange=this.handleValueChange.bind(this),this.typeDropdown=null;var{value:t="",filterTypes:i,selectedType:n=i[0]}=e;this.state={selectedType:n,value:t}}componentDidMount(){var e;(e=this.typeDropdown)===null||e===void 0||e.focus()}componentDidUpdate(e){var{value:t,selectedType:i}=this.props;i!==void 0&&e.selectedType!==i&&this.setState({selectedType:i}),t!==void 0&&e.value!==t&&this.setState({value:t})}handleTypeChange(e){var t=e;_t.debug2("typeChange",t),this.setState({selectedType:t});var{onChange:i}=this.props,{value:n}=this.state;n!=null&&n.length>0&&i(t,n)}handleValueChange(e){_t.debug2("valueChange");var{value:t}=e.target;this.setState({value:t});var{onChange:i}=this.props,{selectedType:n}=this.state;n!=null&&i(n,t)}handleDelete(){_t.debug("delete");var{onDelete:e}=this.props;e()}render(){for(var{column:e,filterTypes:t,formatter:i,tableUtils:n}=this.props,{selectedType:a,value:o}=this.state,u=!T.isBooleanType(e.type),l=[],d=this.getCachedIsValid(e,a,o,i.timeZone,n),c=0;c<t.length;c+=1){var m=t[c],p=Pi.getLabelForFilter(e.type,m),h=s.jsx("option",{value:m,children:p},m);l.push(h)}return s.jsx("div",{className:"advanced-filter-creator-filter-item",children:s.jsxs("div",{className:"form-row",children:[s.jsx("div",{className:"form-group col",children:s.jsx(nt,{className:"form-control",value:a,onChange:this.handleTypeChange,ref:f=>{this.typeDropdown=f},children:l})}),u&&s.jsx("div",{className:"form-group col",children:s.jsx("div",{className:"input-group",children:s.jsx("input",{type:"text",className:Y("form-control",{error:!d}),placeholder:"Enter value",value:o,onChange:this.handleValueChange})})}),s.jsx("div",{className:"form-group col-1 px-0",children:s.jsx(W,{kind:"ghost",className:"w-100 h-100 p-0 m-0",onClick:this.handleDelete,icon:Ai,tooltip:"Remove Filter"})})]})})}}const _o=Pi;function Oi(r,e,t){return e=xo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xo(r){var e=Do(r,"string");return typeof e=="symbol"?e:String(e)}function Do(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Er=ce.module("AdvancedFilterCreatorSelectValueList");class bt extends y.PureComponent{static indexOf(e,t){for(var i=0;i<t.length;i+=1){var n=t[i];if(n===e||n!=null&&n.valueOf!=null&&e!=null&&e.valueOf!=null&&n.valueOf()===e.valueOf())return i}return-1}constructor(e){super(e),Oi(this,"dh",void 0),Oi(this,"list",void 0),this.handleSelect=this.handleSelect.bind(this),this.handleViewportChange=this.handleViewportChange.bind(this),this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.handleTableUpdate=this.handleTableUpdate.bind(this);var{selectedValues:t,dh:i}=this.props;this.dh=i,this.list=null,this.state={itemCount:0,items:[],offset:0,selectedValues:t,isLoading:!0}}componentDidMount(){var{table:e}=this.props;e&&this.startListening(e)}componentDidUpdate(e){var{filters:t,invertSelection:i,selectedValues:n,table:a}=this.props;e.table!==a&&(e.table&&this.stopListening(e.table),a&&this.startListening(a),this.resetViewport()),e.invertSelection!==i&&this.setState({selectedValues:[]},this.handleSelectionUpdate),e.selectedValues!==n&&this.setState({selectedValues:n},this.handleSelectionUpdate),e.filters!==t&&(a?.applyFilter(t),this.resetViewport())}componentWillUnmount(){var{table:e}=this.props;e&&this.stopListening(e)}handleSelect(e,t){var{invertSelection:i}=this.props,{selectedValues:n}=this.state;n=[...n];var a=bt.indexOf(t,n);a>=0?n.splice(a,1):n.push(t);var o=a<0;i&&(o=!o);var{offset:u}=this.state,{items:l}=this.state;l=[...l];var d=e-u;d>=0&&d<l.length&&(l[d].isSelected=o),this.setState({items:l,selectedValues:n});var{onChange:c}=this.props;c(n,i)}handleViewportChange(e,t){this.updateViewport(e,t)}handleSelectionUpdate(){this.updateItemSelection()}handleTableUpdate(e){var{table:t,formatter:i}=this.props;if(t){for(var n=e.detail,{offset:a}=n,o=[],u=t.columns[0],l=0;l<n.rows.length;l+=1){var d=n.rows[l],c=d.get(u),m=void 0;c==null?m=s.jsx("i",{className:"text-muted",children:"null"}):c===""?m=s.jsx("i",{className:"text-muted",children:"empty"}):m=i.getFormattedString(c,u.type,u.name);var p=this.isValueSelected(c);o.push({displayValue:m,value:c,isSelected:p})}Er.debug2("Received table update:",a,o.length);var h=t.size;this.setState({itemCount:h,items:o,offset:a,isLoading:!1})}}isValueSelected(e){var{invertSelection:t}=this.props,{selectedValues:i}=this.state,n=bt.indexOf(e,i);return t?n<0:n>=0}startListening(e){e.addEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}stopListening(e){e.removeEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}resetViewport(){this.list&&this.list.topRow!=null&&this.list.bottomRow!=null&&this.updateViewport(this.list.topRow,this.list.bottomRow,!0)}updateItemSelection(){var{items:e}=this.state;e=[...e];for(var t=0;t<e.length;t+=1){var i=e[t],{value:n}=i;i.isSelected=this.isValueSelected(n)}this.setState({items:e})}updateViewport(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{table:n}=this.props;if(n!=null){i&&this.setState({isLoading:!0});var a=t-e+1,o=Math.max(0,e-a*3),u=Math.max(o,t+a*3);Er.debug2("Setting viewport",o,",",u),n.setViewport(o,u)}}render(){var{offset:e,isLoading:t,items:i,itemCount:n}=this.state;return s.jsxs("div",{className:"select-value-list-wrapper",children:[s.jsx(To,{itemCount:n,items:i,offset:e,onSelect:this.handleSelect,onViewportChange:this.handleViewportChange,ref:a=>{this.list=a}}),s.jsx(xi,{in:t,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"loading-list",children:s.jsx(kt,{className:"loading-spinner-large"})})})]})}}Oi(bt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{}});const Io=bt;function St(r,e,t){return e=Po(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Po(r){var e=Lo(r,"string");return typeof e=="symbol"?e:String(e)}function Lo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yt extends y.PureComponent{constructor(e){super(e),St(this,"searchTablePromise",void 0),St(this,"tableUtils",void 0),St(this,"updateFilterTimer",void 0),this.handleSelectAllClick=this.handleSelectAllClick.bind(this),this.handleClearAllClick=this.handleClearAllClick.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUpdateFilterTimeout=this.handleUpdateFilterTimeout.bind(this);var{dh:t,invertSelection:i,selectedValues:n}=e;this.tableUtils=new T(t),this.state={filters:[],invertSelection:i,selectedValues:n,searchText:""}}componentDidMount(){this.initSearchTable()}componentDidUpdate(e,t){var{invertSelection:i,selectedValues:n,table:a}=this.props;e.table!==a&&this.initSearchTable(),e.invertSelection!==i&&this.setState({invertSelection:i}),e.selectedValues!==n&&this.setState({selectedValues:n});var{table:o,searchText:u}=this.state;o!==t.table&&(t.table!=null&&t.table.close(),o!=null&&this.startUpdateFilterTimer()),u!==t.searchText&&this.startUpdateFilterTimer()}componentWillUnmount(){var{table:e}=this.state;e?.close(),this.searchTablePromise=void 0,this.stopUpdateFilterTimer()}getColumnName(){var{table:e}=this.props;return e!=null?e.columns[0].name:""}getDisplayedValuesCount(){var{invertSelection:e,selectedValues:t,table:i}=this.state;return i==null?null:e?i.totalSize-t.length:t.length}getDisplayedValueText(){var e=this.getDisplayedValuesCount(),{table:t}=this.state,{formatter:i}=this.props;if(e!=null&&t!=null){var n=i.getFormattedString(e,"long"),a=i.getFormattedString(t.totalSize,"long"),o="";return e<1e6&&(o="Displaying "),"".concat(o).concat(n," of ").concat(a)}return null}initSearchTable(){var{table:e}=this.props;if(e!=null){var t=e.copy();this.searchTablePromise=t,this.searchTablePromise.then(i=>{this.searchTablePromise===t?(this.setState({table:i}),this.searchTablePromise=void 0):i.close()})}}handleListChange(e,t){this.setState({selectedValues:e,invertSelection:t});var{onChange:i}=this.props;i(e,t)}handleSearchChange(e){var t=e.target.value;this.setState({searchText:t})}handleSelectAllClick(){this.resetSelection(!0)}handleClearAllClick(){this.resetSelection(!1)}handleUpdateFilterTimeout(){this.updateFilterTimer=void 0,this.updateTableFilter()}resetSelection(e){var t=[];this.setState({invertSelection:e,selectedValues:t});var{onChange:i}=this.props;i(t,e)}startUpdateFilterTimer(){this.stopUpdateFilterTimer(),this.updateFilterTimer=setTimeout(this.handleUpdateFilterTimeout,yt.searchDebounceTime)}stopUpdateFilterTimer(){this.updateFilterTimer!=null&&(clearTimeout(this.updateFilterTimer),this.updateFilterTimer=void 0)}updateTableFilter(){var{table:e,searchText:t}=this.state,{timeZone:i}=this.props,{tableUtils:n}=this,a=e?.columns[0],o=[];if(a!=null){var u;if(t.length>0){var l=null;T.isCharType(a.type)?l=n.makeQuickFilter(a,t):T.isTextType(a.type)?l=n.makeQuickFilter(a,"~".concat(t),i):l=n.makeQuickFilter(a,">=".concat(t),i),l!=null?o.push(l):u="Invalid search text"}this.setState({filters:o,error:u})}}render(){var{error:e,filters:t,invertSelection:i,selectedValues:n,searchText:a,table:o}=this.state,{dh:u,formatter:l,showSearch:d}=this.props,c=this.getColumnName(),m=this.getDisplayedValueText(),p=c?"Find ".concat(c,"..."):"";return s.jsxs("div",{className:"advanced-filter-creator-select-value",children:[s.jsxs("div",{className:d?"form-group":"",children:[s.jsx("label",{htmlFor:"advanced-filter-creator-select-value-input",children:"Select Values"}),d&&s.jsx("input",{type:"text",className:Y("form-control",{"is-invalid":e!=null}),id:"advanced-filter-creator-select-value-input",placeholder:p,value:a,onChange:this.handleSearchChange})]}),s.jsx(Io,{dh:u,table:o,filters:t,invertSelection:i,selectedValues:n,formatter:l,onChange:this.handleListChange}),s.jsxs("div",{className:"advanced-filter-creator-select-meta-row",children:[s.jsxs("div",{children:[s.jsx(W,{kind:"ghost",onClick:this.handleSelectAllClick,children:"Select All"}),s.jsx(W,{kind:"ghost",onClick:this.handleClearAllClick,children:"Clear"})]}),s.jsx(xi,{in:m!=null,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"row-count-info",children:m})})]})]})}}St(yt,"searchDebounceTime",250);St(yt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{},showSearch:!0});const Uo=yt;function it(r,e,t){return e=jo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jo(r){var e=ko(r,"string");return typeof e=="symbol"?e:String(e)}function ko(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var mt=ce.module("AdvancedFilterCreator");class Ie extends y.PureComponent{static makeFilterItem(){return{key:bi()}}constructor(e){var t,i;super(e),it(this,"focusTrapContainer",void 0),it(this,"debounceTimeout",void 0),it(this,"valuesTablePromise",void 0),it(this,"getFilterTypes",$r(h=>T.getFilterTypes(h))),this.handleAddAnd=this.handleAddAnd.bind(this),this.handleAddOr=this.handleAddOr.bind(this),this.handleChangeFilterOperator=this.handleChangeFilterOperator.bind(this),this.handleDone=this.handleDone.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleFilterDelete=this.handleFilterDelete.bind(this),this.handleSelectValueChange=this.handleSelectValueChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSortDown=this.handleSortDown.bind(this),this.handleSortUp=this.handleSortUp.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleFocusTrapStart=this.handleFocusTrapStart.bind(this),this.handleFocusTrapEnd=this.handleFocusTrapEnd.bind(this),this.handleUpdateTimeout=this.handleUpdateTimeout.bind(this),this.focusTrapContainer=ke.createRef();var{model:n,column:a,options:o}=e,{filterOperators:u,invertSelection:l,selectedValues:d}=o,c=(t=(i=o.filterItems)===null||i===void 0?void 0:i.map(h=>{var{selectedType:f,value:C}=h;return{selectedType:f,value:C,key:bi()}}))!==null&&t!==void 0?t:[];c.length===0&&c.push(Ie.makeFilterItem()),u==null&&(u=[]),l==null&&(l=!0),d==null&&(d=[]);var m=n.getColumnIndexByName(a.name);L(m);var p=n.isColumnSortable(m);this.state={filterItems:c,filterOperators:u,invertSelection:l,selectedValues:d,valuesTableError:null,valuesTable:void 0,isSortable:p}}componentDidMount(){this.initValuesTable()}componentWillUnmount(){this.debounceTimeout!=null&&(clearTimeout(this.debounceTimeout),this.sendUpdate()),this.valuesTablePromise!=null&&this.valuesTablePromise.cancel()}getFilterChangeHandler(e){return this.handleFilterChange.bind(this,e)}getFilterDeleteHandler(e){return this.handleFilterDelete.bind(this,e)}initValuesTable(){var{model:e,column:t}=this.props;if(!e.isValuesTableAvailable){mt.debug("No values table for this model, just ignore");return}this.valuesTablePromise=T.makeCancelableTablePromise(e.valuesTable(t)),this.valuesTablePromise.then(i=>{var n;if(!((n=i.columns[0].isSortable)!==null&&n!==void 0)||n){var a=i.columns[0].sort().asc();i.applySort([a])}this.setState({valuesTable:i})}).catch(i=>{Oe.isCanceled(i)||(mt.error("Unable to open values table",i),this.setState({valuesTableError:i}))})}handleFocusTrapEnd(){var e,t;((e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelector("button,select,input,textarea")).focus()}handleFocusTrapStart(){var e,t,i=(e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelectorAll("button,select,input,textarea");if(i&&i.length>0){var n=i[i.length-1];n.focus()}}handleAddAnd(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(Ie.makeFilterItem()),t=t.concat(ht.and),this.setState({filterItems:e,filterOperators:t})}handleAddOr(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(Ie.makeFilterItem()),t=t.concat(ht.or),this.setState({filterItems:e,filterOperators:t})}handleChangeFilterOperator(e,t){var{filterOperators:i}=this.state;i=[...i],Qa(t),i[e]=t,this.setState({filterOperators:i}),this.startUpdateTimer()}handleFilterChange(e,t,i){var{filterItems:n}=this.state;n=[...n];var{key:a}=n[e];n[e]={key:a,selectedType:t,value:i},this.setState({filterItems:n}),this.startUpdateTimer()}handleFilterDelete(e){var{filterItems:t,filterOperators:i}=this.state;t=[...t],i=[...i],e<t.length&&t.splice(e,1),e<i.length?i.splice(e,1):e===i.length&&i.splice(i.length-1,1),t.length===0&&t.push(Ie.makeFilterItem()),this.setState({filterItems:t,filterOperators:i}),this.startUpdateTimer()}handleSelectValueChange(e,t){this.setState({selectedValues:e,invertSelection:t}),this.startUpdateTimer()}handleReset(){mt.debug("Resetting Advanced Filter"),this.setState({filterItems:[Ie.makeFilterItem()],filterOperators:[],selectedValues:[],invertSelection:!0}),this.startUpdateTimer()}handleSortDown(e){var t=Ae.isModifierKeyDown(e);this.sortTable(T.sortDirection.descending,t)}handleSortUp(e){var t=Ae.isModifierKeyDown(e);this.sortTable(T.sortDirection.ascending,t)}handleSubmit(e){mt.debug("Submitting Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate(),e.preventDefault()}handleDone(e){mt.debug("Submitting and Closing Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate();var{onDone:t}=this.props;t(),e.preventDefault()}handleUpdateTimeout(){this.debounceTimeout=void 0,this.sendUpdate()}shouldShowAddFilter(){var{filterItems:e}=this.state;if(e.length===0)return!1;var t=e[e.length-1],{selectedType:i,value:n}=t;return i!=null&&i.length>0&&n!=null&&n.length>0}sortTable(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{column:i,onSortChange:n}=this.props,{isSortable:a}=this.state;a&&n(i,e,t)}startUpdateTimer(){this.stopUpdateTimer(),this.debounceTimeout=setTimeout(this.handleUpdateTimeout,Ie.debounceFilterUpdate)}stopUpdateTimer(){this.debounceTimeout!==void 0&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=void 0)}sendUpdate(){var{filterItems:e,filterOperators:t,invertSelection:i,selectedValues:n}=this.state,{column:a,onFilterChange:o,model:u,tableUtils:l}=this.props,{formatter:d}=u,c=e.filter(f=>{var{selectedType:C,value:g}=f;return C!=null&&g!=null&&g!==""}),m=t.filter((f,C)=>f!=null&&e[C].selectedType!=null&&e[C].value!=null&&e[C].value!=="").slice(0,c.length-1),p={filterItems:c,filterOperators:m,invertSelection:i,selectedValues:n},h=l.makeAdvancedFilter(a,p,d.timeZone);o(a,h,p)}render(){var e=this,{column:t,model:i,sortDirection:n,formatter:a,tableUtils:o}=this.props,{filterItems:u,filterOperators:l,invertSelection:d,selectedValues:c,valuesTable:m,valuesTableError:p,isSortable:h}=this.state,{dh:f,isValuesTableAvailable:C}=i,g=T.isBooleanType(t.type),F=T.isDateType(t.type),w=this.getFilterTypes(t.type),v=t.type.substring(t.type.lastIndexOf(".")+1),N=[];if(!g&&w.length)for(var A=function(G){var z=u[G],{key:M,selectedType:oe,value:X}=z,le=s.jsx(_o,{column:t,filterTypes:w,onChange:e.getFilterChangeHandler(G),onDelete:e.getFilterDeleteHandler(G),selectedType:oe,value:X,formatter:a,tableUtils:o},M);if(N.push(le),G<l.length){var _e=l[G],Le=_e===ht.and,Ge=s.jsxs("div",{className:"form-row justify-content-end advanced-filter-creator-filter-operator",children:[s.jsx(W,{kind:"ghost",className:Y("filter-operator",{active:Le}),onClick:()=>e.handleChangeFilterOperator(G,ht.and),children:"AND"}),s.jsx(W,{kind:"ghost",className:Y("filter-operator",{active:!Le}),onClick:()=>e.handleChangeFilterOperator(G,ht.or),children:"OR"})]},"filterOperator".concat(M));N.push(Ge)}},E=0;E<u.length;E+=1)A(E);var O=this.shouldShowAddFilter(),D=s.jsxs("div",{className:Y("form-row justify-content-end add-filter-item",{hidden:!O}),children:[s.jsx("span",{className:"text-muted",children:s.jsx(Z,{icon:Ri})}),s.jsx(W,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddAnd,disabled:!O,tooltip:"Add filter with AND",children:"AND"}),s.jsx(W,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddOr,disabled:!O,tooltip:"Add filter with OR",children:"OR"})]},"addFilterItem");return N.push(D),s.jsxs("div",{className:"advanced-filter-creator",role:"presentation",children:[s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapStart}),s.jsxs("form",{onSubmit:this.handleSubmit,ref:this.focusTrapContainer,children:[s.jsxs("div",{className:"title-bar",children:[s.jsx("h6",{className:"advanced-filter-title",children:"Advanced Filters"}),s.jsxs("div",{className:"advanced-filter-menu-buttons",children:[s.jsx(W,{kind:"ghost",className:Y("sort-operator",{active:n===T.sortDirection.descending}),onClick:this.handleSortDown,icon:mr,tooltip:h?"Sort ".concat(t.name," Descending"):"Not sortable",disabled:!h}),s.jsx(W,{kind:"ghost",className:Y("sort-operator",{active:n===T.sortDirection.ascending}),onClick:this.handleSortUp,icon:s.jsx(Z,{icon:mr,rotation:180}),tooltip:h?"Sort ".concat(t.name," Ascending"):"Not sortable",disabled:!h})]})]}),s.jsx("hr",{}),s.jsxs("div",{className:"advanced-filter-column-name",children:[t.name," ",s.jsxs("span",{className:"column-type",children:["(",v,")"]})]}),N,C&&p==null&&s.jsxs(s.Fragment,{children:[!g&&s.jsx("hr",{}),s.jsx("div",{className:"form-group",children:s.jsx(Uo,{dh:f,table:m,onChange:this.handleSelectValueChange,invertSelection:d,selectedValues:c,formatter:a,showSearch:!F,timeZone:a.timeZone})})]}),s.jsxs("div",{className:"form-row justify-content-end",children:[s.jsx(W,{kind:"secondary",className:"mr-2",onClick:this.handleReset,children:"Reset"}),s.jsx(W,{kind:"primary",onClick:this.handleDone,children:"Done"})]})]}),s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapEnd})]})}}it(Ie,"debounceFilterUpdate",250);it(Ie,"defaultProps",{options:{filterItems:null,filterOperators:null,invertSelection:!0,selectedValues:[]},sortDirection:null});const Go=Ie;function Mo(r,e){var t=$o(r);if(t!==void 0){var i=qo(r);return"".concat(i," ? ").concat(t," : ").concat(e)}}function Vo(r,e){return r.Column.formatRowColor(e)}function Bo(r,e){return r.formatColor(e)}var Tt=ce.module("ConditionalFormattingUtils"),Ce;(function(r){r.CONDITIONAL="conditional",r.ROWS="rows"})(Ce||(Ce={}));var P;(function(r){r.IS_EQUAL="is-equal",r.IS_NOT_EQUAL="is-not-equal",r.IS_BETWEEN="is-between",r.GREATER_THAN="greater-than",r.GREATER_THAN_OR_EQUAL="greater-than-or-equal",r.LESS_THAN="less-than",r.LESS_THAN_OR_EQUAL="less-than-or-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(P||(P={}));var B;(function(r){r.IS_EXACTLY="is-exactly",r.IS_NOT_EXACTLY="is-not-exactly",r.CONTAINS="contains",r.DOES_NOT_CONTAIN="does-not-contain",r.STARTS_WITH="starts-with",r.ENDS_WITH="ends-with",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(B||(B={}));var k;(function(r){r.IS_EXACTLY="is-exactly",r.IS_NOT_EXACTLY="is-not-exactly",r.IS_BEFORE="is-before",r.IS_BEFORE_OR_EQUAL="is-before-or-equal",r.IS_AFTER="is-after",r.IS_AFTER_OR_EQUAL="is-after-or-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(k||(k={}));var ne;(function(r){r.IS_TRUE="is-true",r.IS_FALSE="is-false",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(ne||(ne={}));var ee;(function(r){r.IS_EQUAL="is-equal",r.IS_NOT_EQUAL="is-not-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(ee||(ee={}));var $;(function(r){r.NO_FORMATTING="no-formatting",r.POSITIVE="positive",r.NEGATIVE="negative",r.WARN="warn",r.NEUTRAL="neutral",r.ACCENT_1="accent-1",r.ACCENT_2="accent-2",r.CUSTOM="custom"})($||($={}));function yr(r){switch(r){case $.NO_FORMATTING:return"No formatting";case $.POSITIVE:return"Positive";case $.NEGATIVE:return"Negative";case $.WARN:return"Warn";case $.NEUTRAL:return"Neutral";case $.ACCENT_1:return"Accent 1";case $.ACCENT_2:return"Accent 2";case $.CUSTOM:return"Custom..."}}function Ut(r){var{type:e,customConfig:t}=r;switch(e){case $.NO_FORMATTING:return;case $.POSITIVE:return"#9fde6f";case $.NEGATIVE:return"#ff6087";case $.WARN:return"#f67f40";case $.NEUTRAL:return"#ffd95c";case $.ACCENT_1:return"#78dce8";case $.ACCENT_2:return"#ab9bf5";case $.CUSTOM:return t?.background;default:return}}function jt(r){var{type:e,customConfig:t}=r;switch(e){case $.NO_FORMATTING:return;case $.POSITIVE:return"#526a3f";case $.NEGATIVE:return"#802f44";case $.WARN:return"#663318";case $.NEUTRAL:return"#63562b";case $.ACCENT_1:return"#3f6469";case $.ACCENT_2:return"#554d72";case $.CUSTOM:return t?.color;default:return}}function $o(r){var e=jt(r.style),t=Ut(r.style);if(!(e===void 0||t===void 0))return"bgfg(`".concat(t,"`, `").concat(e,"`)")}function Qo(r){var{column:e,value:t,start:i,end:n}=r;return os(e.name,r.condition,t,i,n)}function Ho(r){var{column:e,value:t}=r;return ss(e.name,r.condition,t)}function Wo(r){var{column:e,value:t}=r;return ls(e.name,r.condition,t)}function Ko(r){var{column:e}=r;return us(e.name,r.condition)}function Yo(r){var{column:e,value:t}=r;return ds(e.name,r.condition,t)}function qo(r){var{column:e}=r;if(T.isNumberType(e.type))return Qo(r);if(T.isCharType(e.type))return Yo(r);if(T.isStringType(e.type))return Ho(r);if(T.isDateType(e.type))return Wo(r);if(T.isBooleanType(e.type))return Ko(r);throw new Error("Invalid column type")}function zo(r){switch(r){case P.IS_EQUAL:return"is equal to";case P.IS_NOT_EQUAL:return"is not equal to";case P.IS_BETWEEN:return"is between";case P.GREATER_THAN:return"greater than";case P.GREATER_THAN_OR_EQUAL:return"greater than or equal to";case P.LESS_THAN:return"less than";case P.LESS_THAN_OR_EQUAL:return"less than or equal to";case P.IS_NULL:return"is null";case P.IS_NOT_NULL:return"is not null"}}function Xo(r){switch(r){case B.IS_EXACTLY:return"is exactly";case B.IS_NOT_EXACTLY:return"is not exactly";case B.CONTAINS:return"contains";case B.DOES_NOT_CONTAIN:return"does not contain";case B.STARTS_WITH:return"starts with";case B.ENDS_WITH:return"ends with";case B.IS_NULL:return"is null";case B.IS_NOT_NULL:return"is not null"}}function Zo(r){switch(r){case k.IS_EXACTLY:return"is";case k.IS_NOT_EXACTLY:return"is not";case k.IS_BEFORE:return"is before";case k.IS_BEFORE_OR_EQUAL:return"is before or equal";case k.IS_AFTER:return"is after";case k.IS_AFTER_OR_EQUAL:return"is after or equal";case k.IS_NULL:return"is null";case k.IS_NOT_NULL:return"is not null"}}function Jo(r){switch(r){case ne.IS_TRUE:return"is true";case ne.IS_FALSE:return"is false";case ne.IS_NULL:return"is null";case ne.IS_NOT_NULL:return"is not null"}}function es(r){switch(r){case ee.IS_EQUAL:return"is";case ee.IS_NOT_EQUAL:return"is not";case ee.IS_NULL:return"is null";case ee.IS_NOT_NULL:return"is not null"}}function Zr(r){if(T.isNumberType(r))return P.IS_EQUAL;if(T.isCharType(r))return ee.IS_EQUAL;if(T.isStringType(r))return B.IS_EXACTLY;if(T.isDateType(r))return k.IS_EXACTLY;if(T.isBooleanType(r))return ne.IS_TRUE;throw new Error("Invalid column type")}function Jr(r){if(T.isCharType(r)||T.isStringType(r))return""}function en(r){var{condition:e,value:t,start:i,end:n}=r;return{condition:e,value:t,start:i,end:n}}function Mt(r){return{condition:Zr(r),value:Jr(r),start:void 0,end:void 0}}function tn(){return{type:$.NO_FORMATTING}}function ts(r){switch(r){case B.IS_EXACTLY:return"==";case B.IS_NOT_EXACTLY:return"!=";case B.CONTAINS:return"contains";case B.DOES_NOT_CONTAIN:return"does not contain";case B.STARTS_WITH:return"starts with";case B.ENDS_WITH:return"ends with";case B.IS_NULL:return"is null";case B.IS_NOT_NULL:return"is not null"}}function is(r){switch(r){case k.IS_EXACTLY:return"==";case k.IS_NOT_EXACTLY:return"!=";case k.IS_BEFORE:return"<";case k.IS_BEFORE_OR_EQUAL:return"<=";case k.IS_AFTER:return">";case k.IS_AFTER_OR_EQUAL:return">=";case k.IS_NULL:return"is null";case k.IS_NOT_NULL:return"is not null"}}function rs(r){switch(r){case ne.IS_TRUE:return"is true";case ne.IS_FALSE:return"is false";case ne.IS_NULL:return"is null";case ne.IS_NOT_NULL:return"is not null"}}function ns(r){switch(r){case ee.IS_EQUAL:return"==";case ee.IS_NOT_EQUAL:return"!=";case ee.IS_NULL:return"is null";case ee.IS_NOT_NULL:return"is not null"}}function as(r){switch(r){case P.IS_EQUAL:return"==";case P.IS_NOT_EQUAL:return"!=";case P.IS_BETWEEN:return"==";case P.GREATER_THAN:return">";case P.GREATER_THAN_OR_EQUAL:return">=";case P.LESS_THAN:return"<";case P.LESS_THAN_OR_EQUAL:return"<=";case P.IS_NULL:return"is null";case P.IS_NOT_NULL:return"is not null"}}function os(r,e,t,i,n){switch(e){case P.IS_EQUAL:return"".concat(r," == ").concat(t);case P.IS_NOT_EQUAL:return"".concat(r," != ").concat(t);case P.IS_BETWEEN:return"".concat(r," > ").concat(i," && ").concat(r," < ").concat(n);case P.GREATER_THAN:return"".concat(r," > ").concat(t);case P.GREATER_THAN_OR_EQUAL:return"".concat(r," >= ").concat(t);case P.LESS_THAN:return"".concat(r," < ").concat(t);case P.LESS_THAN_OR_EQUAL:return"".concat(r," <= ").concat(t);case P.IS_NULL:return"".concat(r," == null");case P.IS_NOT_NULL:return"".concat(r," != null")}}function ss(r,e,t){switch(e){case B.IS_EXACTLY:return"".concat(r,' == "').concat(t,'"');case B.IS_NOT_EXACTLY:return"".concat(r,' != "').concat(t,'"');case B.CONTAINS:return"".concat(r," != null && ").concat(r,'.contains("').concat(t,'")');case B.DOES_NOT_CONTAIN:return"".concat(r," != null && !").concat(r,'.contains("').concat(t,'")');case B.STARTS_WITH:return"".concat(r," != null && ").concat(r,'.startsWith("').concat(t,'")');case B.ENDS_WITH:return"".concat(r," != null && ").concat(r,'.endsWith("').concat(t,'")');case B.IS_NULL:return"".concat(r," == null");case B.IS_NOT_NULL:return"".concat(r," != null")}}function ls(r,e,t){switch(e){case k.IS_EXACTLY:return"".concat(r,' == convertDateTime("').concat(t,'")');case k.IS_NOT_EXACTLY:return"".concat(r," != convertDateTime(`").concat(t,"`)");case k.IS_BEFORE:return"".concat(r," < convertDateTime(`").concat(t,"`)");case k.IS_BEFORE_OR_EQUAL:return"".concat(r,' <= convertDateTime("').concat(t,'")');case k.IS_AFTER:return"".concat(r," > convertDateTime(`").concat(t,"`)");case k.IS_AFTER_OR_EQUAL:return"".concat(r," >= convertDateTime(`").concat(t,"`)");case k.IS_NULL:return"".concat(r," == null");case k.IS_NOT_NULL:return"".concat(r," != null")}}function us(r,e){switch(e){case ne.IS_TRUE:return"".concat(r," == true");case ne.IS_FALSE:return"".concat(r," == false");case ne.IS_NULL:return"".concat(r," == null");case ne.IS_NOT_NULL:return"".concat(r," != null")}}function ds(r,e,t){switch(e){case ee.IS_EQUAL:return"".concat(r," == '").concat(t,"'");case ee.IS_NOT_EQUAL:return"".concat(r," != '").concat(t,"'");case ee.IS_NULL:return"isNull(".concat(r,")");case ee.IS_NOT_NULL:return"!isNull(".concat(r,")")}}function cs(r,e){if(T.isNumberType(r))return as(e);if(T.isCharType(r))return ns(e);if(T.isStringType(r))return ts(e);if(T.isDateType(r))return is(e);if(T.isBooleanType(r))return rs(e);throw new Error("Invalid column type")}function hs(r,e,t){if(t===void 0)return Tt.debug("no rules passed."),[];var i=[],n,a=new Map;return t.forEach(o=>{var u,{config:l,type:d}=o,{column:c}=l,m=e.find(F=>{var{name:w,type:v}=F;return w===c.name&&v===c.type});if(m===void 0){Tt.debug("Column ".concat(c.name,":").concat(c.type," not found. Ignoring format rule."),l);return}var[p,h]=(u=d===Ce.CONDITIONAL?a.get(m.name):n)!==null&&u!==void 0?u:["null",void 0],f=Mo(l,p);if(f===void 0){Tt.debug("Ignoring format rule.",l);return}var C=h===void 0?-1:i.indexOf(h);C>-1&&i.splice(C,1);var g=d===Ce.CONDITIONAL?Bo(m,f):Vo(r,f);i.push(g),d===Ce.CONDITIONAL?a.set(m.name,[f,g]):n=[f,g]}),i}function ms(r,e,t){switch(e){case k.IS_NULL:case k.IS_NOT_NULL:return!0;default:{var[i,...n]=(t??"").split(" "),a=n.join(" ");try{Di.parseDateTimeString(i)}catch{return Tt.debug("Invalid datetime string",i),!1}try{r.i18n.TimeZone.getTimeZone(a)}catch{return Tt.debug("Invalid timezone string",a),!1}return!0}}}function ps(r){var{type:e}=r;return T.isNumberType(e)||T.isCharType(e)||T.isStringType(e)||T.isDateType(e)||T.isBooleanType(e)}function Vt(r){var{animation:e="iris-grid-bottom-bar-slide-up",children:t,className:i,isShown:n,onClick:a,onEntering:o,onEntered:u,onExiting:l,onExited:d}=r;return s.jsx(Ei,{in:n,timeout:yi.transitionMs,classNames:e,onEntering:o,onEntered:u,onExiting:l,onExited:d,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:Y("iris-grid-bottom-bar",i),role:"presentation",onClick:a,onKeyPress:a,children:t})})}var gs=3e3,vs=5;function fs(r){var{isSaving:e=!1,onSave:t,onDiscard:i,discardTooltip:n,saveTooltip:a,error:o,pendingDataErrors:u,pendingDataMap:l,onEntering:d,onEntered:c,onExiting:m,onExited:p}=r,[h,f]=y.useState(!1),[C,g]=y.useState(!1),F=y.useRef(),w=Hr(e),v=y.useMemo(()=>u.size===0?o:u.size<=vs?"Key can't be empty (on pending row".concat(u.size>1?"s":""," ").concat(Array.from(u.keys()).join(", ").trim(),")"):"Key can't be empty (on ".concat(u.size," rows)"),[o,u]);y.useEffect(function(){w!=null&&w&&!e&&v==null&&(f(!0),g(!0),F.current=setTimeout(()=>{f(!1)},gs))},[v,e,w]),y.useEffect(function(){F.current&&l.size>0&&(clearTimeout(F.current),f(!1),g(!1))},[l]),y.useEffect(function(){return()=>F.current?clearTimeout(F.current):void 0},[]);var N=l.size,A;return e?A=s.jsx(kt,{className:"loading-spinner-vertical-align"}):C&&(A=ua),s.jsxs(Vt,{className:"pending-data-bottom-bar",isShown:N>0||h||v!=null,onEntering:d,onEntered:c,onExiting:m,onExited:()=>{g(!1),p&&p()},children:[v!=null&&v!==""&&s.jsxs("div",{className:"error-message",children:[s.jsx(Z,{icon:la}),s.jsx("span",{children:"".concat(v)})]}),(v==null||v==="")&&s.jsx("div",{className:"status-message",children:N>0&&s.jsx("span",{children:"".concat(N," row").concat(N>1?"s":""," pending")})}),s.jsxs("div",{className:"buttons-container",children:[!e&&!C&&s.jsx(W,{kind:"secondary",onClick:i,tooltip:n,children:"Discard"}),s.jsxs(W,{kind:C?"success":"primary",onClick:t,icon:A,disabled:e||C||v!=null,tooltip:a,children:[e&&"Committing...",!e&&C&&"Success",!e&&!C&&"Commit"]})]})]})}function wr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function pi(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){wr(a,i,n,o,u,"next",l)}function u(l){wr(a,i,n,o,u,"throw",l)}o(void 0)})}}function Qe(r,e,t){return e=Cs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cs(r){var e=Ss(r,"string");return typeof e=="symbol"?e:String(e)}function Ss(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var me=ce.module("IrisGridCopyHandler");function Ts(r){return r.ranges!=null}function bs(r){return r.columnIndex!=null}class V extends y.Component{static getStatusMessageText(e,t){switch(e){case V.COPY_STATES.CONFIRMATION_REQUIRED:return"Are you sure you want to copy ".concat(t.toLocaleString()," rows to your clipboard?");case V.COPY_STATES.CLICK_REQUIRED:return"Fetched ".concat(t.toLocaleString()," rows!");case V.COPY_STATES.FETCH_ERROR:return"Unable to copy data.";case V.COPY_STATES.FETCH_RANGES_IN_PROGRESS:return"Fetching ".concat(t.toLocaleString()," rows for clipboard...");case V.COPY_STATES.FETCH_HEADER_IN_PROGRESS:return"Fetching header for clipboard...";case V.COPY_STATES.DONE:return"Copied to Clipboard!";default:return""}}static getCopyButtonText(e){switch(e){case V.BUTTON_STATES.FETCH_IN_PROGRESS:return"Fetching";case V.BUTTON_STATES.CLICK_TO_COPY:return"Click to Copy";case V.BUTTON_STATES.RETRY:return"Retry";default:return"Copy"}}constructor(e){super(e),Qe(this,"textData",void 0),Qe(this,"hideTimer",void 0),Qe(this,"fetchPromise",void 0),this.handleBackgroundClick=this.handleBackgroundClick.bind(this),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleCopyClick=this.handleCopyClick.bind(this),this.handleHideTimeout=this.handleHideTimeout.bind(this),this.state={error:void 0,copyState:V.COPY_STATES.IDLE,buttonState:V.BUTTON_STATES.COPY,isShown:!1,rowCount:0}}componentDidMount(){var{copyOperation:e}=this.props;e!=null&&this.startCopy()}componentDidUpdate(e){var{copyOperation:t}=this.props;e.copyOperation!==t&&this.startCopy()}componentWillUnmount(){this.stopCopy()}startCopy(){me.debug2("startCopy"),this.stopCopy();var{copyOperation:e}=this.props;if(e==null){me.debug2("No copy operation set, cancelling out"),this.setState({isShown:!1});return}var{error:t}=e;if(t!=null){me.debug("Showing copy error",t),this.setState({isShown:!0,copyState:V.COPY_STATES.DONE,error:t}),this.startHideTimer();return}if(this.setState({isShown:!0,error:void 0}),Ts(e)){var{ranges:i}=e,n=Fe.rowCount(i);if(this.setState({rowCount:n}),n>V.NO_PROMPT_THRESHOLD){this.setState({buttonState:V.BUTTON_STATES.COPY,copyState:V.COPY_STATES.CONFIRMATION_REQUIRED});return}}this.startFetch()}stopCopy(){this.textData=void 0,this.stopFetch(),this.stopHideTimer()}handleBackgroundClick(){me.debug2("handleBackgroundClick");var{copyState:e}=this.state;e===V.COPY_STATES.DONE&&this.setState({isShown:!1})}handleCancelClick(){me.debug2("handleCancelClick"),this.stopFetch(),this.setState({isShown:!1})}handleCopyClick(){var e=this;return pi(function*(){if(me.debug2("handleCopyClick"),e.textData!=null)try{yield e.copyText(e.textData),e.showCopyDone()}catch(t){me.error("Error copying text",t),e.setState({error:"Unable to copy. Verify your browser permissions."})}else e.startFetch()})()}handleHideTimeout(){me.debug2("handleHideTimeout"),this.stopHideTimer(),this.setState({isShown:!1})}copyText(e){var t=this;return pi(function*(){me.debug2("copyText",e),t.textData=e,yield Ii(e)})()}showCopyDone(){this.setState({copyState:V.COPY_STATES.DONE}),this.startHideTimer()}startFetch(){var e=this;return pi(function*(){e.stopFetch();var{model:t,copyOperation:i}=e.props;if(bs(i)){var{columnIndex:n,columnDepth:a,movedColumns:o}=i;me.debug("startFetch copyHeader",n,a),e.setState({buttonState:V.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:V.COPY_STATES.FETCH_HEADER_IN_PROGRESS});var u=ve.getModelIndex(n,o),l=t.textForColumnHeader(u,a);if(l===void 0){e.fetchPromise=void 0,e.setState({error:"Invalid column header selected.",copyState:V.COPY_STATES.DONE});return}e.fetchPromise=Oe.makeCancelable(l)}else{var{ranges:d,includeHeaders:c,userColumnWidths:m,movedColumns:p,formatValues:h}=i;me.debug("startFetch copyRanges",d),e.setState({buttonState:V.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:V.COPY_STATES.FETCH_RANGES_IN_PROGRESS});var f=ie.getHiddenColumns(m),C=ve.getModelRanges(d,p);if(f.length>0){var g=f.map(Fe.makeColumn);C=Fe.subtractRangesFromRanges(C,g)}var F=h!=null&&h?(v,N)=>t.displayString(v,N.type,N.name):v=>"".concat(v);e.fetchPromise=Oe.makeCancelable(t.textSnapshot(C,c,F))}try{var w=yield e.fetchPromise;e.fetchPromise=void 0;try{yield e.copyText(w),e.showCopyDone()}catch(v){me.error("Error copying text",v),e.setState({buttonState:V.BUTTON_STATES.CLICK_TO_COPY,copyState:V.COPY_STATES.CLICK_REQUIRED})}}catch(v){v instanceof Ha?me.debug("User cancelled copy."):(me.error("Error fetching contents",v),e.fetchPromise=void 0,e.setState({buttonState:V.BUTTON_STATES.RETRY,copyState:V.COPY_STATES.FETCH_ERROR}))}})()}stopFetch(){this.fetchPromise&&(me.debug2("stopFetch"),this.fetchPromise.cancel(),this.fetchPromise=void 0)}startHideTimer(){this.stopHideTimer(),this.hideTimer=setTimeout(this.handleHideTimeout,V.HIDE_TIMEOUT)}stopHideTimer(){this.hideTimer!=null&&(clearTimeout(this.hideTimer),this.hideTimer=void 0)}render(){var{onEntering:e,onEntered:t,onExiting:i,onExited:n}=this.props,{buttonState:a,copyState:o,isShown:u,rowCount:l,error:d}=this.state,c=o===V.COPY_STATES.DONE?"fade":"copy-slide-up",m=V.getCopyButtonText(a),p=d??V.getStatusMessageText(o,l),h=o!==V.COPY_STATES.DONE,f=a===V.BUTTON_STATES.FETCH_IN_PROGRESS,C=o===V.COPY_STATES.DONE;return s.jsxs(Vt,{animation:c,isShown:u,className:Y("iris-grid-copy-handler",{"copy-done":C}),onClick:this.handleBackgroundClick,onEntering:e,onEntered:t,onExiting:i,onExited:n,children:[s.jsx("div",{className:"status-message",children:s.jsx("span",{children:p})}),s.jsx(xi,{in:h,mountOnEnter:!0,unmountOnExit:!0,children:s.jsxs("div",{className:"buttons-container",children:[s.jsx("button",{type:"button",className:"btn btn-outline-secondary btn-cancel",onClick:this.handleCancelClick,children:"Cancel"}),s.jsxs(W,{kind:f?"tertiary":"primary",className:Y("btn-copy",{"btn-spinner":f}),onClick:this.handleCopyClick,disabled:f,children:[f&&s.jsx(kt,{className:"loading-spinner-vertical-align"}),m]})]})})]})}}Qe(V,"NO_PROMPT_THRESHOLD",1e4);Qe(V,"HIDE_TIMEOUT",3e3);Qe(V,"COPY_STATES",{IDLE:"IDLE",CONFIRMATION_REQUIRED:"CONFIRMATION_REQUIRED",FETCH_RANGES_IN_PROGRESS:"FETCH_RANGES_IN_PROGRESS",FETCH_HEADER_IN_PROGRESS:"FETCH_HEADER_IN_PROGRESS",FETCH_ERROR:"FETCH_ERROR",CLICK_REQUIRED:"CLICK_REQUIRED",DONE:"DONE"});Qe(V,"BUTTON_STATES",{COPY:"COPY",FETCH_IN_PROGRESS:"FETCH_IN_PROGRESS",CLICK_TO_COPY:"CLICK_TO_COPY",RETRY:"RETRY"});Qe(V,"defaultProps",{copyOperation:null,onEntering:()=>{},onEntered:()=>{},onExiting:()=>{},onExited:()=>{}});const Es=V;function It(r,e,t){return e=ys(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ys(r){var e=ws(r,"string");return typeof e=="symbol"?e:String(e)}function ws(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class rn extends y.PureComponent{constructor(e){super(e),It(this,"inputField",void 0),It(this,"initialValue",void 0),It(this,"debouncedSendUpdate",void 0);var{debounceMs:t}=e;this.debouncedSendUpdate=rt(this.sendUpdate.bind(this),t),this.handleCancel=this.handleCancel.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCommit=this.handleCommit.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.inputField=null;var{value:i}=e;this.initialValue=i,this.state={isChanged:!1,value:i}}componentDidMount(){var e;(e=this.inputField)===null||e===void 0||e.focus()}componentDidUpdate(e){var{debounceMs:t}=this.props;e.debounceMs!==t&&(this.debouncedSendUpdate.flush(),this.debouncedSendUpdate=rt(this.sendUpdate.bind(this),t))}componentWillUnmount(){this.debouncedSendUpdate.cancel()}setValue(e){this.initialValue=e,this.setState({value:e})}focus(){var e;(e=this.inputField)===null||e===void 0||e.focus()}handleChange(e){var{value:t}=e.target;this.setState({value:t,isChanged:!0}),this.debouncedSendUpdate(t)}handleCancel(){this.debouncedSendUpdate.cancel();var{initialValue:e}=this,{isChanged:t}=this.state;t&&this.sendUpdate(e);var{onDone:i}=this.props;i()}handleCommit(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.debouncedSendUpdate.flush();var{onDone:i}=this.props;i(e,t)}handleFocus(){var e;(e=this.inputField)===null||e===void 0||e.select()}handleBlur(e){var{relatedTarget:t}=e;t!=null&&t.classList.contains("context-menu-container")?this.handleCommit(!1,!0):t!=null&&t.classList.contains("advanced-filter-button")?this.handleCommit(!1,!1):this.handleCommit(!0,!0)}handleTab(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.debouncedSendUpdate.flush();var{onTab:t}=this.props;t(e)}handleKeyDown(e){switch(e.key){case"Escape":e.stopPropagation(),e.preventDefault(),this.handleCancel();break;case"Enter":e.stopPropagation(),e.preventDefault(),this.handleCommit();break;case"Tab":e.stopPropagation(),e.preventDefault(),this.handleTab(e.shiftKey);break}}handleContextMenu(e){var{onContextMenu:t}=this.props;t(e)}sendUpdate(e){var{onChange:t}=this.props;t(e)}render(){var{className:e,style:t,isAdvancedFilterSet:i,onAdvancedFiltersTriggered:n}=this.props,{value:a}=this.state;return s.jsxs("div",{style:t,className:"iris-grid-input-autosized-wrapper","data-value":a,children:[s.jsx("input",{ref:o=>{this.inputField=o},className:Y("iris-grid-input-field",e),type:"text",value:a,onBlur:this.handleBlur,onFocus:this.handleFocus,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onContextMenu:this.handleContextMenu,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"}),s.jsx("div",{className:"advanced-filter-button-container",children:s.jsx(W,{kind:"ghost",className:Y("btn-link-icon advanced-filter-button",{"filter-set":i}),onClick:n,onContextMenu:this.handleContextMenu,children:s.jsxs("div",{className:"fa-layers ",children:[s.jsx(Z,{icon:_i,className:"filter-solid"}),s.jsx(Z,{icon:Pt,className:"filter-light"})]})})})]})}}It(rn,"defaultProps",{style:{},className:"",value:"",isAdvancedFilterSet:!1,onAdvancedFiltersTriggered:()=>{},onChange:()=>{},onDone:()=>{},onTab:()=>{},onContextMenu:()=>{},debounceMs:150});const Fs=rn;function Ns(r,e,t){return e=Os(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Os(r){var e=As(r,"string");return typeof e=="symbol"?e:String(e)}function As(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Rs extends Gt{constructor(e){super(),Ns(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onDown(e,t){if(e.altKey&&!Ae.isModifierKeyDown(e)&&!e.shiftKey){var{mouseX:i,mouseY:n}=t.state;if(i==null||n==null)return!1;var a=t.getGridPointFromXY(i,n);if(a.column!=null&&a.row!=null)return this.cursor=this.irisGrid.props.copyCursor,!0}return!1}onUp(e,t){return this.cursor===this.irisGrid.props.copyCursor?(this.cursor=null,!0):!1}}const _s=Rs;function xs(r,e,t){return e=Ds(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ds(r){var e=Is(r,"string");return typeof e=="symbol"?e:String(e)}function Is(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ps extends Gt{constructor(e){super(),xs(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{selectedRanges:t}=this.irisGrid.state;return e.key==="c"&&Ae.isModifierKeyDown(e)?(ie.isValidSnapshotRanges(t)?this.irisGrid.copyRanges(t):this.irisGrid.copyRanges(t,!1,!1,"Invalid copy ranges"),!0):!1}}const Ls=Ps;function Us(r,e,t){return e=js(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function js(r){var e=ks(r,"string");return typeof e=="symbol"?e:String(e)}function ks(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Gs extends Gt{constructor(e){super(),Us(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){if(Ne.TABLE.REVERSE.matchesEvent(e)){if(!this.irisGrid.isReversible())return!1;var{reverseType:t}=this.irisGrid.state;return t===T.REVERSE_TYPE.NONE?this.irisGrid.reverse(T.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(T.REVERSE_TYPE.NONE),!0}return!1}}const Ms=Gs;function Vs(r,e,t){return e=Bs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Bs(r){var e=$s(r,"string");return typeof e=="symbol"?e:String(e)}function $s(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qs extends Gt{constructor(e){super(),Vs(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){return Ne.TABLE.CLEAR_FILTERS.matchesEvent(e)?(this.irisGrid.clearAllFilters(),!0):!1}}const Hs=Qs;function Ws(r,e,t){return e=Ks(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ks(r){var e=Ys(r,"string");return typeof e=="symbol"?e:String(e)}function Ys(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class qs extends Re{constructor(e){super(850),Ws(this,"irisGrid",void 0),this.irisGrid=e}destroyColumnTooltip(){this.irisGrid.setState({overflowButtonTooltipProps:null})}setCursor(e){return this.isHoveringOverflowButton(e)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:t,y:i,column:n,row:a}=e;if(n==null||a==null)return null;var{renderer:o,grid:u,state:l,props:d}=this.irisGrid;if(!u)return null;var{metrics:c}=l,{model:m}=d,{canvasContext:p}=u,h=u.getTheme(),f={context:p,mouseX:t,mouseY:i,metrics:c,model:m,theme:h},{left:C,top:g,width:F,height:w}=o.getCellOverflowButtonPosition(f);return C==null||F==null||g==null||w==null?null:{left:C,top:g,width:F,height:w}}isHoveringOverflowButton(e){var t,{x:i,y:n}=e,{left:a,top:o,width:u,height:l}=(t=this.getButtonPosition(e))!==null&&t!==void 0?t:{};if(a==null||u==null||o==null||l==null)return!1;var{renderer:d,grid:c,state:m,props:p}=this.irisGrid;if(!c)return!1;var{metrics:h}=m,{model:f}=p,{canvasContext:C}=c,g=c.getTheme(),F={context:C,mouseX:i,mouseY:n,metrics:h,model:f,theme:g};return d.shouldRenderOverflowButton(F)&&i>=a&&i<=a+u&&n>=o&&n<=o+l}onMove(e){if(this.isHoveringOverflowButton(e)){var{overflowButtonTooltipProps:t}=this.irisGrid.state,i=this.getButtonPosition(e);De(t,i)||this.irisGrid.setState({overflowButtonTooltipProps:i})}else this.destroyColumnTooltip();return this.setCursor(e)}onWheel(e){return this.destroyColumnTooltip(),this.onMove(e)}onDown(e){this.destroyColumnTooltip();var{column:t,row:i}=e;return this.isHoveringOverflowButton(e)&&this.irisGrid.setState({showOverflowModal:!0,overflowText:this.irisGrid.getValueForCell(t,i)}),!1}onContextMenu(){return this.destroyColumnTooltip(),!1}onLeave(){return this.destroyColumnTooltip(),!1}}const zs=qs;function Xs(r,e,t){return e=Zs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Zs(r){var e=Js(r,"string");return typeof e=="symbol"?e:String(e)}function Js(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class el extends Re{constructor(e){super(),Xs(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}isActive(){var{isSelectingColumn:e}=this.irisGrid.props;return e}isValidColumn(e){if(e==null||e.isProxy===!0)return!1;var{columnSelectionValidator:t}=this.irisGrid.props;return t!=null?t(e):!0}updateColumnSelectionStatus(){var{columnSelectionValidator:e}=this.irisGrid.props;e?.(null)}getTableColumn(e){if(e==null)return null;var{model:t}=this.irisGrid.props,i=this.irisGrid.getModelColumn(e);return i==null?null:t.columns[i]}onMove(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:i}=this.irisGrid.props,{column:n}=e,a=this.getTableColumn(n);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:n})):(this.cursor=i,this.irisGrid.setState({hoverSelectColumn:null})),!0}onWheel(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:i}=this.irisGrid.props,{column:n}=e,a=this.getTableColumn(n);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:n})):(this.cursor=i,this.irisGrid.setState({hoverSelectColumn:null})),{preventDefault:!1,stopPropagation:!1}}onLeave(){return this.isActive()&&this.irisGrid.setState({hoverSelectColumn:null}),this.updateColumnSelectionStatus(),!1}onDown(){return this.isActive()}onClick(e){if(!this.isActive())return!1;var{column:t}=e,i=this.getTableColumn(t);return i!=null&&this.isValidColumn(i)&&this.irisGrid.selectColumn(i),!0}}const tl=el;function il(r,e,t){return e=rl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rl(r){var e=nl(r,"string");return typeof e=="symbol"?e:String(e)}function nl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class al extends Re{constructor(e){super(),il(this,"irisGrid",void 0),this.irisGrid=e}hideColumnTooltip(){var{tooltip:e}=this.irisGrid;e&&(e.stopTimer(),e.hide())}onDown(){return this.hideColumnTooltip(),!1}onContextMenu(){return this.hideColumnTooltip(),!1}onWheel(){return this.hideColumnTooltip(),!1}onLeave(e,t,i){var{relatedTarget:n}=i instanceof MouseEvent?i:i.nativeEvent,{tooltip:a}=this.irisGrid;if(!a)return!1;var o=a.popper.current;return o&&n instanceof Element&&o.element.contains(n)||this.hideColumnTooltip(),!1}onMove(e){var{column:t,row:i,columnHeaderDepth:n}=e,{shownColumnTooltip:a}=this.irisGrid.state,o=null;return t!==null&&i===null&&n===0&&(o=t),o!==a&&this.irisGrid.setState({shownColumnTooltip:o}),!1}}const ol=al;function nn(r,e,t){return e=sl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sl(r){var e=ll(r,"string");return typeof e=="symbol"?e:String(e)}function ll(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Bt extends y.Component{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bt.defaultProps;super(e),nn(this,"inputRef",void 0),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.inputRef=ke.createRef()}handleInputChange(){var{onChange:e}=this.props;this.inputRef.current&&e(this.inputRef.current.value)}closeContextMenu(){var{forwardedProps:e}=this.props,{closeMenu:t}=e;t(!0)}revertToDefault(){var{onChange:e}=this.props;e(null)}returnFocusToContextMenu(){var e=da.getClosestByClassName(this.inputRef.current,"context-menu-container");e instanceof HTMLElement&&e.focus()}handleKeyDown(e){switch(e.key){case"Enter":e.stopPropagation(),this.closeContextMenu();break;case"Escape":e.stopPropagation(),this.revertToDefault(),this.closeContextMenu();break;case"ArrowRight":case"ArrowLeft":e.stopPropagation();break;case"ArrowUp":case"ArrowDown":this.returnFocusToContextMenu();break;default:e.stopPropagation()}}render(){var{formatString:e,forwardedProps:t,placeholder:i,title:n}=this.props,{menuItem:{description:a},iconElement:o}=t;return s.jsxs("div",{className:"form-group flex-grow mb-0",children:[s.jsxs("div",{className:"custom-format-title",children:[s.jsx("span",{className:"icon",children:o}),s.jsxs("label",{className:"title mb-0",htmlFor:"custom-format-input",children:[n,a!=null&&s.jsx(Xe,{children:a})]})]}),s.jsx("div",{className:"pl-2 pr-2 pb-2",children:s.jsx("input",{id:"custom-format-input",className:"form-control text-right mb-0",type:"text",defaultValue:e,ref:this.inputRef,placeholder:i,onKeyDown:this.handleKeyDown,onChange:this.handleInputChange,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"})})]})}}nn(Bt,"defaultProps",{formatString:"",forwardedProps:{menuItem:{},closeMenu(r){},iconElement:null},placeholder:"",title:"",onChange(r){}});const ul=Bt;class dl{static isDefaultSelected(e){return!e||![Dt.TYPE_CONTEXT_CUSTOM,Dt.TYPE_CONTEXT_PRESET].includes(e.type)}static isCustomSelected(e){return e!=null&&e.type===Dt.TYPE_CONTEXT_CUSTOM}static makeOption(e,t,i,n){return{title:e,description:e,group:i,format:t,isSelected:n}}static makeCustomFormatOption(e,t,i,n,a){var o;return{title:e.label,description:e.label,format:e,group:t,isSelected:n,menuElement:s.jsx(ul,{formatString:(o=e.formatString)!==null&&o!==void 0?o:void 0,title:e.label,placeholder:i,onChange:a})}}}const be=dl;function Li(r,e,t){return e=cl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function cl(r){var e=hl(r,"string");return typeof e=="symbol"?e:String(e)}function hl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class fe{static getOptions(e,t){var i=new Date,n=[{group:fe.dateGroup,formatString:"yyyy-MM-dd"},{group:fe.dateGroup,formatString:"MM-dd-yyyy"},{group:fe.timeGroup,formatString:"HH:mm:ss"},{group:fe.timeGroup,formatString:"HH:mm:ss.SSS"},{group:fe.timeGroup,formatString:"HH:mm:ss.SSSSSSSSS"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSS"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSSSSSSSS"}],a=n.map(u=>{var l=Ct.makeFormat("",u.formatString,Ct.TYPE_CONTEXT_PRESET),d=e.getFormattedString(i,T.dataType.DATETIME,"",l);return be.makeOption(d,l,u.group,Ct.isSameFormat(l,t))}),o=be.makeOption("Default",null,fe.dateGroup,be.isDefaultSelected(t));return[o,...a]}}Li(fe,"dateGroup",10);Li(fe,"timeGroup",20);Li(fe,"dateTimeGroup",30);const ml=fe;function $t(r,e,t){return e=pl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pl(r){var e=gl(r,"string");return typeof e=="symbol"?e:String(e)}function gl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class pe{static getOptions(e,t,i){var n=[{format:we.FORMAT_PERCENT,group:pe.presetGroup},{format:we.FORMAT_BASIS_POINTS,group:pe.presetGroup},{format:we.FORMAT_MILLIONS,group:pe.presetGroup},{format:we.FORMAT_SCIENTIFIC_NOTATION,group:pe.presetGroup},{format:we.FORMAT_ROUND,group:pe.presetRoundGroup},{format:we.FORMAT_ROUND_TWO_DECIMALS,group:pe.presetRoundGroup},{format:we.FORMAT_ROUND_FOUR_DECIMALS,group:pe.presetRoundGroup}],a=be.makeOption("Default",null,pe.defaultGroup,be.isDefaultSelected(t)),o=n.map(c=>be.makeOption(c.format.label,c.format,c.group,we.isSameFormat(c.format,t))),u=be.isCustomSelected(t),l=u?t:we.makeCustomFormat(),d=be.makeCustomFormatOption(l,pe.customGroup,we.DEFAULT_FORMAT_STRING,u,c=>{if(c!=null){var m=we.makeCustomFormat(c);we.isValid(e,m)&&i(m)}else i(null)});return[a,...o,d]}}$t(pe,"defaultGroup",10);$t(pe,"presetGroup",20);$t(pe,"presetRoundGroup",30);$t(pe,"customGroup",40);const vl=pe;function Ui(r,e,t){return e=fl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fl(r){var e=Cl(r,"string");return typeof e=="symbol"?e:String(e)}function Cl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class je{static getOptions(e,t,i){var n=[{format:Ke.FORMAT_MILLIONS,group:je.presetGroup},{format:Ke.FORMAT_SCIENTIFIC_NOTATION,group:je.presetGroup}],a=be.makeOption("Default",null,je.defaultGroup,be.isDefaultSelected(t)),o=n.map(c=>be.makeOption(c.format.label,c.format,c.group,Ke.isSameFormat(c.format,t))),u=be.isCustomSelected(t),l=u?t:Ke.makeCustomFormat(),d=be.makeCustomFormatOption(l,je.customGroup,Ke.DEFAULT_FORMAT_STRING,u,c=>{if(c!=null){var m=Ke.makeCustomFormat(c);Ke.isValid(e,m)&&i(m)}else i(null)});return[a,...o,d]}}Ui(je,"defaultGroup",10);Ui(je,"presetGroup",20);Ui(je,"customGroup",30);const Sl=je;function Fr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function Nr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fr(Object(t),!0).forEach(function(i){Se(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Or(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function Tl(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Or(a,i,n,o,u,"next",l)}function u(l){Or(a,i,n,o,u,"throw",l)}o(void 0)})}}function Se(r,e,t){return e=bl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bl(r){var e=El(r,"string");return typeof e=="symbol"?e:String(e)}function El(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ar=ce.module("IrisGridContextMenuHandler"),yl=150,Rr="yyyy-MM-dd HH:mm:ss.SSSSSSSSS",gi=1e3;class b extends Re{static getQuickFilterCondition(e,t,i){return e&&i==="&&"?e.and(t):e&&i==="||"?e.or(t):t}static getQuickFilterText(e,t,i){return i&&e!=null?"".concat(e," ").concat(i," ").concat(t):t}static getOperatorAsText(e){return e==="&&"?"And":"Or"}static getRowOptionFormatted(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30;return"".concat(e,' "').concat(bo.truncate(t,i-e.length-3),'"')}constructor(e,t){super(),Se(this,"irisGrid",void 0),Se(this,"debouncedUpdateCustomFormat",void 0),Se(this,"dh",void 0),this.getNumberValueEqualsFilter=this.getNumberValueEqualsFilter.bind(this),this.getFilterValueForNumberOrChar=this.getFilterValueForNumberOrChar.bind(this),this.debouncedUpdateCustomFormat=rt(e.handleFormatSelection,yl),this.dh=t,this.irisGrid=e}componentWillUnmount(){this.debouncedUpdateCustomFormat.flush()}getHeaderActions(e,t){var{irisGrid:i}=this,{column:n}=t;L(n);var{model:a}=i.props,{columns:o}=a,u=o[e],l=[],{metrics:d,reverseType:c,quickFilters:m,advancedFilters:p,searchFilter:h}=i.state,f=i.getTheme();L(d);var{filterIconColor:C,filterBarActiveColor:g,contextMenuSortIconColor:F,contextMenuReverseIconColor:w}=f,v=a.sort,N=T.getSortForColumn(v,u.name),A=c!==T.REVERSE_TYPE.NONE,{userColumnWidths:E}=d,O=[...E.values()].some(M=>M===0),D=a.getColumnHeaderParentGroup(e,0)===void 0&&!($e(a)&&a.hasExpandableRows),x=a.isColumnFrozen(e),G=a.isColumnSortable(e);if(l.push({title:"Hide Column",group:b.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.hideColumnByVisibleIndex(n)}}),l.push({title:x?"Unfreeze Column":"Freeze Column",group:b.GROUP_HIDE_COLUMNS,disabled:!D,action:()=>{x?this.irisGrid.unFreezeColumnByColumnName(u.name):this.irisGrid.freezeColumnByColumnName(u.name)},order:10}),l.push({title:"Show All Columns",group:b.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.showAllColumns()},disabled:!O}),l.push({title:"Quick Filters",icon:Ue,iconColor:g,shortcut:Ne.TABLE.TOGGLE_QUICK_FILTER,group:b.GROUP_FILTER,order:10,action:()=>{this.irisGrid.toggleFilterBar(n)}}),l.push({title:"Advanced Filters",icon:p.get(e)?_i:Pt,iconColor:C,group:b.GROUP_FILTER,order:20,action:()=>{this.irisGrid.handleAdvancedMenuOpened(n)}}),l.push({title:"Clear Table Filters",group:b.GROUP_FILTER,order:40,shortcut:Ne.TABLE.CLEAR_FILTERS,action:()=>{this.irisGrid.clearAllFilters()},disabled:!(m.size>0||p.size>0||h!=null)}),l.push({title:"Sort by",icon:Ue,iconColor:F,group:b.GROUP_SORT,order:10,actions:this.sortByActions(u,e,N),disabled:!G}),l.push({title:"Add Additional Sort",disabled:N&&v.length===1||A&&v.length===1||N&&A&&v.length===2||v.length===0||!G,group:b.GROUP_SORT,order:20,actions:this.additionalSortActions(u,e)}),l.push({title:"Clear Table Sorting",disabled:v.length===0||A&&v.length===1,group:b.GROUP_SORT,action:()=>{this.irisGrid.sortColumn(n,b.COLUMN_SORT_DIRECTION.none)},order:30}),l.push({title:c===T.REVERSE_TYPE.NONE?"Reverse Table":"Clear Reverse Table",icon:Ue,iconColor:w,group:b.GROUP_SORT,order:40,disabled:!a.isReversible,shortcut:Ne.TABLE.REVERSE,action:()=>{c===T.REVERSE_TYPE.NONE?this.irisGrid.reverse(T.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(T.REVERSE_TYPE.NONE)}}),l.push({title:"Copy Column Name",group:b.GROUP_COPY,shortcutText:Ae.isMacPlatform()?"⌥Click":"Alt+Click",action:()=>{var M;Ii((M=a.textForColumnHeader(e))!==null&&M!==void 0?M:"").catch(oe=>Ar.error("Unable to copy header",oe))}}),T.isDateType(u.type))l.push({title:"Date/Time Format",group:b.GROUP_FORMAT,actions:this.dateFormatActions(u)});else if(T.isNumberType(u.type)){var z;l.push({title:"Number Format",group:b.GROUP_FORMAT,actions:(z=this.numberFormatActions(u))!==null&&z!==void 0?z:void 0})}return l}getCellActions(e,t,i){var{irisGrid:n}=this,{column:a,row:o}=i,{model:u,canCopy:l}=n.props,{columns:d}=u,c=n.getModelRow(o);L(c);var m=u.sourceForCell(e,c),{column:p,row:h}=m,f=u.valueForCell(p,h),C=d[p],g=[],F=n.getTheme(),{filterIconColor:w}=F;if(C==null||o==null)return g;if($e(u)&&u.isRowExpandable(h)){var v=0,N=u.valueForCell(v,h),A=N==null?"null":u.textForCell(v,h);g.push({title:b.getRowOptionFormatted(u.isRowExpanded(h)?"Collapse":"Expand",A),group:b.GROUP_EXPAND_COLLAPSE,order:10,action:()=>{u.setRowExpanded(h,!u.isRowExpanded(h))}}),u.isExpandAllAvailable===!0&&g.push({title:b.getRowOptionFormatted("Expand All in",A),group:b.GROUP_EXPAND_COLLAPSE,order:20,action:()=>{u.setRowExpanded(h,!0,!0)}})}$e(u)&&u.hasExpandableRows&&u.isExpandAllAvailable===!0&&(g.push({title:"Expand Entire Table",group:b.GROUP_EXPAND_COLLAPSE,order:30,action:()=>{u.expandAll()}}),g.push({title:"Collapse Entire Table",group:b.GROUP_EXPAND_COLLAPSE,order:40,action:()=>{u.collapseAll()}}));var E={title:"Go to",iconColor:w,shortcut:Ne.TABLE.GOTO_ROW,group:b.GROUP_GOTO,order:10,action:()=>this.irisGrid.toggleGotoRow("".concat(o+1),"".concat(f),C.name)};return g.push(E),l&&(g.push({title:"Copy Cell",group:b.GROUP_COPY,shortcutText:Ae.isMacPlatform()?"⌥Click":"Alt+Click",order:10,action:()=>{n.copyCell(a,o)}}),g.push({title:"Copy Cell Unformatted",group:b.GROUP_COPY,order:20,action:()=>{n.copyCell(a,o,!0)}})),g.push({title:"View Cell Contents",group:b.GROUP_VIEW_CONTENTS,order:10,action:()=>{n.setState({showOverflowModal:!0,overflowText:n.getValueForCell(a,o)})}}),g}getCellFilterActions(e,t,i){var n=this;return Tl(function*(){var{dh:a,irisGrid:o}=n,{row:u}=i,{model:l}=o.props,{columns:d}=l,c=o.getModelRow(u),{getSelectedRanges:m}=t;L(c);var p=l.sourceForCell(e,c),{column:h,row:f}=p,C=d[h];if(C==null||u==null)return[];if(!l.isFilterable(h))return[];var{quickFilters:g}=o.state,F=o.getTheme(),{filterIconColor:w}=F,{settings:v}=o.props,N=[...m()];if(N.length===0&&N.push(new Fe(h,f,h,f)),Fe.containsCell(N,h,f))for(var A=Fe.rowCount(N);A>gi;){var E=N.pop();L(E,"Selected ranges should not be empty");var O=Fe.rowCount([E]);if(ca(O,"Selected ranges should not be unbounded"),A-O<gi){var D;N.push(new Fe(E.startColumn,E.startRow,E.endColumn,((D=E.endRow)!==null&&D!==void 0?D:0)-(A-gi)));break}A-=O}else N=[new Fe(h,f,h,f)];ha(N);for(var x=yield l.snapshot(N),G=new Set,z=0;z<x.length;z+=1)x[z].length===1?x[z][0]!=null&&G.add(x[z][0]):x[z][h]!=null&&G.add(x[z][h]);var M={title:"Filter by Value".concat(G.size>1?"s":""),icon:Ue,iconColor:w,group:b.GROUP_FILTER,order:10,actions:[]};if(G.size===0)g.get(h)&&M.actions.push({title:"And",actions:n.nullFilterActions(C,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.nullFilterActions(C));else if(G.size===1&&G.has(""))g.get(h)&&M.actions.push({title:"And",actions:n.emptyStringFilterActions(C,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.emptyStringFilterActions(C));else if(T.isBooleanType(C.type))g.get(h)&&M.actions.push({title:"Or",actions:n.booleanFilterActions(C,l.textForCell(h,f),g.get(h),"||"),order:2,group:U.groups.high}),M.actions.push(...n.booleanFilterActions(C,l.textForCell(h,f)));else if(T.isNumberType(C.type)||T.isCharType(C.type))L(h),g.get(h)&&M.actions.push({title:"And",actions:n.numberFilterActions(C,G,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.numberFilterActions(C,G,g.get(h)));else if(T.isDateType(C.type)){var oe=new Ct(a,{timeZone:v?.timeZone,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:Rr}),X=new Ct(a,{timeZone:v?.timeZone,showTimeZone:v?.showTimeZone,showTSeparator:v?.showTSeparator,defaultDateTimeFormatString:Rr});g.get(h)&&M.actions.push({title:"And",actions:n.dateFilterActions(C,G,oe,X,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.dateFilterActions(C,G,oe,X,g.get(h)))}else g.get(h)&&M.actions.push({title:"And",actions:n.stringFilterActions(C,G,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.stringFilterActions(C,G));return[M]})()}getNumberValueEqualsFilter(e,t){var{dh:i}=this,n=e.filter();if(t===Number.POSITIVE_INFINITY)return i.FilterCondition.invoke("isInf",n).and(n.greaterThan(i.FilterValue.ofNumber(0)));if(t===Number.NEGATIVE_INFINITY)return i.FilterCondition.invoke("isInf",n).and(n.lessThan(i.FilterValue.ofNumber(0)));if(Number.isNaN(t))return i.FilterCondition.invoke("isNaN",n);var a=this.getFilterValueForNumberOrChar(e.type,t);return n.eq(a)}getFilterValueForNumberOrChar(e,t){var{dh:i}=this;return T.isCharType(e)?i.FilterValue.ofString(String.fromCharCode(t)):i.FilterValue.ofNumber(t)}onContextMenu(e,t,i){var{irisGrid:n}=this,{y:a,column:o,row:u,columnHeaderDepth:l}=e,d=n.getModelColumn(o),c=n.getModelRow(u),{model:m,canCopy:p}=n.props,{columns:h}=m,{metrics:f,isFilterBarShown:C,quickFilters:g,advancedFilters:F,selectedRanges:w}=n.state;L(f);var{columnHeaderHeight:v,gridY:N,columnHeaderMaxDepth:A}=f,E=[];if(d!=null&&c!=null){var O=m.sourceForCell(d,c??0),{column:D,row:x}=O,G=m.valueForCell(D,x),z=m.textForCell(D,x),M=h[D],{onContextMenu:oe}=n.props;M!=null&&E.push(...oe({model:m,value:G,valueText:z,column:M,rowIndex:u,columnIndex:o,modelRow:c,modelColumn:d}))}if(d!=null){var X=m.getClearFilterRange(d);X!=null&&X.length>0&&E.push({title:X[1]-X[0]>0?"Clear Group Filter":"Clear Column Filter",group:b.GROUP_FILTER,order:30,action:()=>{this.irisGrid.removeColumnFilter(X)},disabled:!Array.from(g.keys()).some(le=>le>=X[0]&&le<=X[1])&&!Array.from(F.keys()).some(le=>le>=X[0]&&le<=X[1])})}return(C?a<=N:a<=v*A&&l===0)?d!=null&&E.push(...this.getHeaderActions(d,e)):(d!=null&&c!=null&&(E.push(...this.getCellActions(d,t,e)),E.push(this.getCellFilterActions(d,t,e))),p&&w.length>0&&(E.push({title:"Copy Selection",shortcut:Wa.COPY,group:b.GROUP_COPY,order:30,action:()=>{n.copyRanges(w)}}),E.push({title:"Copy Selection w/ Headers",group:b.GROUP_COPY,order:40,action:()=>{n.copyRanges(w,!0)}})),Be(m)&&m.isEditable&&w.length>0&&qr(m)&&m.isDeletable&&E.push({title:"Delete Selected Rows",group:b.GROUP_EDIT,disabled:!m.isDeletableRanges(w),order:50,action:()=>{this.irisGrid.deleteRanges(w)}})),E.length===0?!1:(L(n.gridWrapper),U.triggerMenu(n.gridWrapper,i.clientX,i.clientY,E),!0)}dateFormatActions(e){for(var t=this,{model:i}=this.irisGrid.props,{formatter:n}=i,a=n.getColumnFormat(e.type,e.name),o=ml.getOptions(n,a),u=[],l=function(){var{description:m,format:p,group:h,isSelected:f,title:C}=o[d];u.push({title:C,description:m,icon:f?wi:void 0,group:h,order:d,action:()=>{var g=i.getColumnIndexByName(e.name);L(g),t.irisGrid.handleFormatSelection(g,p)}})},d=0;d<o.length;d+=1)l();return u}numberFormatActions(e){var t=this,{model:i}=this.irisGrid.props,{formatter:n}=i,{dh:a}=this,o=n.getColumnFormat(e.type,e.name),u,l=i.getColumnIndexByName(e.name);if(T.isDecimalType(e.type))u=vl.getOptions(a,o,p=>{L(l),this.debouncedUpdateCustomFormat(l,p)});else if(T.isIntegerType(e.type))u=Sl.getOptions(a,o,p=>{L(l),this.debouncedUpdateCustomFormat(l,p)});else return Ar.error("Invalid column type in numberFormatActions"),null;for(var d=[],c=function(){var{format:h,isSelected:f}=u[m];d.push(Nr(Nr({},u[m]),{},{icon:f?wi:void 0,order:m,action:()=>{l===void 0&&h&&h.type===Dt.TYPE_CONTEXT_CUSTOM||(L(l),t.irisGrid.handleFormatSelection(l,h))}}))},m=0;m<u.length;m+=1)c();return d}stringFilterActions(e,t,i,n){var{dh:a}=this,o=Array.from(t.keys()),u=o.map(g=>a.FilterValue.ofString(g)),l=u.length===1?u[0]:"the selected values",d=i;d||(d={filter:null,text:null});var{filter:c,text:m}=d,p=[],{model:h}=this.irisGrid.props,f=h.getColumnIndexByName(e.name),C=g=>{var F;return(F=T.escapeQuickTextFilter(g))!==null&&F!==void 0?F:""};return L(f),p.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",hi.join(o.slice(0,20).map(g=>'"'.concat(C(g),'"'))),o.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",o.length," values selected)"]})]}),order:1,group:U.groups.high}),p.push({title:"text is exactly",description:"Show only rows where ".concat(e.name," is ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,u.map(g=>e.filter().eq(g)).reduce((g,F)=>g.or(F)),n),b.getQuickFilterText(m,o.map(C).join(" || "),n))},order:10,group:U.groups.low}),p.push({title:"text is not exactly",description:"Show only rows where ".concat(e.name," is not ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,u.map(g=>e.filter().notEq(g)).reduce((g,F)=>g.and(F)),n),b.getQuickFilterText(m,o.map(g=>"!=".concat(C(g))).join(" && "),n))},order:20,group:U.groups.low}),p.push({title:"text contains",description:"Show only rows where ".concat(e.name," contains ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(g=>e.filter().contains(g)).reduce((g,F)=>g.or(F))),n),b.getQuickFilterText(m,o.map(g=>"~".concat(C(g))).join(" || "),n))},order:30,group:U.groups.low}),p.push({title:"text does not contain",description:"Show only rows where ".concat(e.name," does not contain ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().or(u.map(g=>e.filter().contains(g).not()).reduce((g,F)=>g.and(F))),n),b.getQuickFilterText(m,o.map(g=>"!~".concat(C(g))).join(" && "),n))},order:40,group:U.groups.low}),p.push({title:"text starts with",description:"Show only rows where ".concat(e.name," starts with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(g=>e.filter().invoke("startsWith",g)).reduce((g,F)=>g.or(F))),n),b.getQuickFilterText(m,o.map(g=>"".concat(C(g),"*")).join(" || "),n))},order:50,group:U.groups.low}),p.push({title:"text ends with",description:"Show only rows where ".concat(e.name," ends with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(g=>e.filter().invoke("endsWith",g)).reduce((g,F)=>g.or(F))),n),b.getQuickFilterText(m,o.map(g=>"*".concat(C(g))).join(" || "),n))},order:60,group:U.groups.low}),p}numberFilterActions(e,t,i,n){var a=Array.from(t.keys()),o=a.length===1?"".concat(a):"the selected values",u=v=>T.isCharType(e.type)?String.fromCharCode(v):"".concat(v),l=null,d=null;i&&(l=i.filter,d=i.text);var c=[],{model:m}=this.irisGrid.props,p=m.getColumnIndexByName(e.name);if(L(p),c.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",hi.join(a.slice(0,20).map(v=>'"'.concat(u(v),'"'))),a.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",a.length," values selected)"]})]}),order:1,group:U.groups.high}),c.push({title:"is equal to",description:"Show only rows where ".concat(e.name," is ").concat(o),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,a.map(v=>this.getNumberValueEqualsFilter(e,v)).reduce((v,N)=>v.or(N)),n),b.getQuickFilterText(d,a.map(v=>"=".concat(u(v))).join(" || "),n))},order:10,group:U.groups.low}),c.push({title:"is not equal to",description:"Show only rows where ".concat(e.name," is not ").concat(o),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,a.map(v=>this.getNumberValueEqualsFilter(e,v).not()).reduce((v,N)=>v.and(N)),n),b.getQuickFilterText(d,a.map(v=>"!=".concat(u(v))).join(" && "),n))},order:20,group:U.groups.low}),!t.has(Number.NaN)&&!t.has(Number.POSITIVE_INFINITY)&&!t.has(Number.NEGATIVE_INFINITY)&&!T.isCharType(e.type)){var h=a.reduce((v,N)=>v>N?v:N),f=a.reduce((v,N)=>v<N?v:N),C=this.getFilterValueForNumberOrChar(e.type,h),g=this.getFilterValueForNumberOrChar(e.type,f),F="".concat(C),w="".concat(g);c.push({title:"greater than",description:"Show only rows where ".concat(e.name," is greater than ").concat(F),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().greaterThan(C),n),b.getQuickFilterText(d,">".concat(u(h)),n))},order:30,group:U.groups.low}),c.push({title:"greater than or equal to",description:"Show only rows where ".concat(e.name," is greater than or equal to ").concat(F),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().greaterThanOrEqualTo(C),n),b.getQuickFilterText(d,">=".concat(u(h)),n))},order:40,group:U.groups.low}),c.push({title:"less than",description:"Show only rows where ".concat(e.name," is less than ").concat(w),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().lessThan(g),n),b.getQuickFilterText(d,"<".concat(u(f)),n))},order:50,group:U.groups.low}),c.push({title:"less than or equal to",description:"Show only rows where ".concat(e.name," is less than or equal to ").concat(w),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().lessThanOrEqualTo(g),n),b.getQuickFilterText(d,"<=".concat(u(f)),n))},order:60,group:U.groups.low})}return c}booleanFilterActions(e,t,i,n){var a=[],{model:o}=this.irisGrid.props,{filter:u,text:l}=i||{},d=o.getColumnIndexByName(e.name);return L(d),a.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",'"',t??"null",'"']}),order:1,group:U.groups.high}),a.push({title:"true",description:"Show only rows where ".concat(e.name," is true"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isTrue(),n),b.getQuickFilterText(l,"true",n))},order:10,group:U.groups.low}),a.push({title:"false",description:"Show only rows where ".concat(e.name," is false"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isFalse(),n),b.getQuickFilterText(l,"false",n))},order:20,group:U.groups.low}),a.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isNull(),n),b.getQuickFilterText(l,"null",n))},order:30,group:U.groups.low}),a.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isNull().not(),n),b.getQuickFilterText(l,"!null",n))},order:40,group:U.groups.low}),a}dateFilterActions(e,t,i,n,a,o){var{dh:u}=this,l=Array.from(t.keys()),d=l.map(D=>u.FilterValue.ofNumber(D)),c=d.length===1?n.format(l[0]):"the selected values",m=l.reduce((D,x)=>D>x?D:x),p=l.reduce((D,x)=>D<x?D:x),h=u.FilterValue.ofNumber(m),f=u.FilterValue.ofNumber(p),C=i.format(m),g=i.format(p),F=n.format(m),w=n.format(p),v=null,N=null;a&&(v=a.filter,N=a.text);var{model:A}=this.irisGrid.props,E=A.getColumnIndexByName(e.name);L(E);var O=[];return O.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[o?b.getOperatorAsText(o):""," ",hi.join(l.slice(0,20).map(D=>'"'.concat(n.format(D),'"'))),l.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",l.length," values selected)"]})]}),order:1,group:U.groups.high}),O.push({title:"date is",description:"Show only rows where ".concat(e.name," is ").concat(c),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,d.map(D=>e.filter().eq(D)).reduce((D,x)=>D.or(x)),o),b.getQuickFilterText(N,l.map(D=>"=".concat(i.format(D))).join(" || "),o))},order:10,group:U.groups.low}),O.push({title:"date is not",description:"Show only rows where ".concat(e.name," is not ").concat(c),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,d.map(D=>e.filter().notEq(D)).reduce((D,x)=>D.and(x)),o),b.getQuickFilterText(N,l.map(D=>"!=".concat(i.format(D))).join(" && "),o))},order:20,group:U.groups.low}),O.push({title:"date is before",description:"Show only rows where ".concat(e.name," is before ").concat(w),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,e.filter().lessThan(f),o),b.getQuickFilterText(N,"<".concat(g),o))},order:30,group:U.groups.low}),O.push({title:"date is before or equal",description:"Show only rows where ".concat(e.name," is before or equal to ").concat(w),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,e.filter().lessThanOrEqualTo(f),o),b.getQuickFilterText(N,"<=".concat(g),o))},order:40,group:U.groups.low}),O.push({title:"date is after",description:"Show only rows where ".concat(e.name," is greater than ").concat(F),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,e.filter().greaterThan(h),o),b.getQuickFilterText(N,">".concat(C),o))},order:50,group:U.groups.low}),O.push({title:"date is after or equal",description:"Show only rows where ".concat(e.name," is after or equal to ").concat(F),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,e.filter().greaterThanOrEqualTo(h),o),b.getQuickFilterText(N,">=".concat(C),o))},order:60,group:U.groups.low}),O}emptyStringFilterActions(e,t,i){var{dh:n}=this,a=n.FilterValue.ofString(""),o=t;o||(o={filter:null,text:null});var{filter:u,text:l}=o,d=[],{model:c}=this.irisGrid.props,m=c.getColumnIndexByName(e.name);return L(m),d.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?b.getOperatorAsText(i):""," ",s.jsx("i",{className:"text-muted",children:"empty"})]}),order:1,group:U.groups.high}),d.push({title:"is empty string",description:"Show only rows where ".concat(e.name," is empty"),action:()=>{this.irisGrid.setQuickFilter(m,b.getQuickFilterCondition(u,e.filter().eq(a),i),b.getQuickFilterText(l,"=",i))},order:10,group:U.groups.low}),d.push({title:"is not empty string",description:"Show only rows where ".concat(e.name," is not empty"),action:()=>{this.irisGrid.setQuickFilter(m,b.getQuickFilterCondition(u,e.filter().notEq(a),i),b.getQuickFilterText(l,"!=",i))},order:20,group:U.groups.low}),d}nullFilterActions(e,t,i){var n=null,a=null;t&&(n=t.filter,a=t.text);var o=[],{model:u}=this.irisGrid.props,l=u.getColumnIndexByName(e.name);return L(l),o.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?b.getOperatorAsText(i):""," ",s.jsx("i",{className:"text-muted",children:"null"})]}),order:1,group:U.groups.high}),o.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(l,b.getQuickFilterCondition(n,e.filter().isNull(),i),b.getQuickFilterText(a,"null",i))},order:10,group:U.groups.low}),o.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(l,b.getQuickFilterCondition(n,e.filter().isNull().not(),i),b.getQuickFilterText(a,"!null",i))},order:20,group:U.groups.low}),o}sortByActions(e,t,i){var n=this.irisGrid.getTheme(),{contextMenuSortIconColor:a}=n,o=[{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.ascending)?Ue:void 0,iconColor:a},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.descending)?Ue:void 0,iconColor:a},{title:"Remove Sort",order:50,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.none,!1,!0)},disabled:!i}];return T.isNumberType(e.type)&&(o.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!0)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.ascending,!0)?Ue:void 0,iconColor:a}),o.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!0)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.descending,!0)?Ue:void 0,iconColor:a})),o}additionalSortActions(e,t){var i=this.irisGrid.getTheme(),{contextMenuSortIconColor:n}=i,a=[{title:"Add Sort By",menuElement:s.jsxs("div",{className:"btn-context-menu menu-title",children:[s.jsx("span",{className:"icon",children:s.jsx(Z,{icon:Ue,style:{color:n??void 0}})}),s.jsx("span",{className:"title",children:"Add Additional Sort"}),s.jsx("span",{className:"shortcut",children:Ae.isMacPlatform()?"⌘Click":"Ctrl+Click"})]}),order:1},{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!1,!0)}},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!1,!0)}}];return T.isNumberType(e.type)&&(a.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!0,!0)}}),a.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!0,!0)}})),a}checkColumnSort(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e?e.direction===t&&e.isAbs===i:!1}}Se(b,"GROUP_EDIT",U.groups.high+10);Se(b,"GROUP_HIDE_COLUMNS",U.groups.high+25);Se(b,"GROUP_FILTER",U.groups.high+50);Se(b,"GROUP_EXPAND_COLLAPSE",U.groups.high+55);Se(b,"GROUP_GOTO",U.groups.high+60);Se(b,"GROUP_SORT",U.groups.high+75);Se(b,"GROUP_COPY",U.groups.high+100);Se(b,"GROUP_FORMAT",U.groups.high+150);Se(b,"GROUP_VIEW_CONTENTS",U.groups.high+175);Se(b,"COLUMN_SORT_DIRECTION",{ascending:"ASC",descending:"DESC",none:null});const wl=b;function Fl(r,e,t){return e=Nl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nl(r){var e=Ol(r,"string");return typeof e=="symbol"?e:String(e)}function Ol(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Al extends Re{constructor(e){super(250),Fl(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onClick(e,t,i){return i.altKey&&!Ae.isModifierKeyDown(i)&&!i.shiftKey?(this.cursor=null,e.columnHeaderDepth!==void 0?this.irisGrid.copyColumnHeader(e.column,e.columnHeaderDepth):this.irisGrid.copyRanges([Fe.makeCell(e.column,e.row)]),!0):!1}onMove(e,t,i){return i.altKey&&!Ae.isModifierKeyDown(i)&&!i.shiftKey&&e.column!=null&&(e.row!=null||e.columnHeaderDepth!=null)?(this.cursor=this.irisGrid.props.copyCursor,!0):!1}}const Rl=Al;function _l(r,e,t){return e=xl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xl(r){var e=Dl(r,"string");return typeof e=="symbol"?e:String(e)}function Dl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Il extends Re{constructor(e){super(880),_l(this,"irisGrid",void 0),this.irisGrid=e}onDoubleClick(e,t){var{column:i,row:n}=e;return n==null||i==null||this.irisGrid.selectData(i,n),!1}}const Pl=Il;function Ll(r,e,t){return e=Ul(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ul(r){var e=jl(r,"string");return typeof e=="symbol"?e:String(e)}function jl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class kl extends Re{constructor(e){super(),Ll(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{y:t,column:i,row:n}=e;if(i!==null&&n===null){var{isFilterBarShown:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:u}=o,l=this.irisGrid.getTheme();if(a&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&t>l.columnHeaderHeight*u&&t<=l.columnHeaderHeight*u+l.filterBarHeight)return this.irisGrid.focusFilterBar(i),!0}return!1}onMove(e){var{y:t,column:i}=e,{isFilterBarShown:n,hoverAdvancedFilter:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:u}=o,l=this.irisGrid.getTheme(),d=null;return n&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&i!==null&&t>=l.columnHeaderHeight*u&&t<=l.columnHeaderHeight*u+l.filterBarHeight&&(d=i),d!==a&&this.irisGrid.setState({hoverAdvancedFilter:d}),!1}onLeave(e){var{column:t}=e,{hoverAdvancedFilter:i}=this.irisGrid.state;return i!==null&&t!==i&&this.irisGrid.setState({hoverAdvancedFilter:null}),!1}}const Gl=kl;function Ml(r,e,t){return e=Vl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Vl(r){var e=Bl(r,"string");return typeof e=="symbol"?e:String(e)}function Bl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class $l extends Re{constructor(e){super(750),Ml(this,"irisGrid",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({expandCellTooltipProps:null})}setCursor(e,t){return Sr.isInTreeBox(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:t,y:i,column:n,row:a}=e;if(n==null||a==null)return null;var{renderer:o,grid:u,state:l,props:d}=this.irisGrid;if(!u)return null;var{metrics:c}=l,{model:m}=d,{canvasContext:p}=u,h=u.getTheme(),f={context:p,mouseX:t,mouseY:i,metrics:c,model:m,theme:h},C=$e(m)?m.depthForRow(a):null,{left:g,top:F,width:w,height:v}=o.getExpandButtonPosition(f,C);return g==null||w==null||F==null||v==null?null:{left:g,top:F,width:w,height:v}}onMove(e,t){if(Sr.isInTreeBox(e,t)){var{expandCellTooltipProps:i}=this.irisGrid.state,{model:n}=this.irisGrid.props,a=this.getButtonPosition(e),{row:o}=e;L(o);var u=$e(n)&&n.isRowExpanded(o);De(i,a)||this.irisGrid.setState({expandCellTooltipProps:a,expandTooltipDisplayValue:u?"collapse":"expand"})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const Ql=$l;function _r(r,e,t){return e=Hl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hl(r){var e=Wl(r,"string");return typeof e=="symbol"?e:String(e)}function Wl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Kl extends Re{constructor(e){super(),_r(this,"irisGrid",void 0),_r(this,"column",void 0),this.column=null,this.irisGrid=e}getColumnFromGridPoint(e){var{column:t,row:i,columnHeaderDepth:n}=e;return t!==null&&i===null&&n===0?t:null}onDown(e){return this.column=this.getColumnFromGridPoint(e),!1}onClick(e,t,i){var n=this.getColumnFromGridPoint(e);if(n!=null&&n===this.column){var a=Ae.isModifierKeyDown(i);return this.irisGrid.toggleSort(n,a),!0}return!1}}const Yl=Kl;class ql extends Re{constructor(e){super(),this.irisGrid=e}onWheel(e,t,i){var{irisGrid:n}=this,{model:a}=n.props,{metrics:o,pendingRowCount:u}=n.state;L(o);var{bottom:l,rowCount:d,rowHeight:c}=o,{deltaY:m}=ve.getScrollDelta(i);return Be(a)&&a.isEditable&&l>=d-1&&m>0&&n.setState({pendingRowCount:u+Math.ceil(m/c)}),!1}}const zl=ql;function xr(r,e,t){return e=Xl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xl(r){var e=Zl(r,"string");return typeof e=="symbol"?e:String(e)}function Zl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Jl extends Re{constructor(e){super(),xr(this,"irisGrid",void 0),xr(this,"currentLinkBox",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({linkHoverTooltipProps:null})}isHoveringLink(e,t){var{column:i,row:n,x:a,y:o}=e,{renderer:u,metrics:l,props:d}=t,{model:c}=d;if(i==null||n==null||l==null)return this.currentLinkBox=void 0,!1;var{modelRows:m,modelColumns:p}=l,h=Fi(m,n),f=Fi(p,i),C=c.renderTypeForCell(f,h),g=u.getCellRenderer(C);if(!No(g))return!1;if(this.currentLinkBox!=null){var{x1:F,y1:w,x2:v,y2:N}=this.currentLinkBox;if(a>=F&&a<=v&&o>=w&&o<=N)return!0}for(var A=t.updateRenderState(),E=g.getTokenBoxesForVisibleCell(i,n,A),O=0;O<E.length;O+=1)if(vr(E[O].token)){var D=ve.translateTokenBox(E[O],l),{x1:x,x2:G,y1:z,y2:M}=D;if(a>=x&&a<=G&&o>=z&&o<=M)return this.currentLinkBox=D,!0}return this.currentLinkBox=void 0,!1}setCursor(e,t){return this.isHoveringLink(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}onMove(e,t){var i=this.isHoveringLink(e,t);if(i&&this.currentLinkBox!=null&&vr(this.currentLinkBox.token)){var{linkHoverTooltipProps:n}=this.irisGrid.state;if(this.currentLinkBox==null)return!1;var{x1:a,y1:o,x2:u,y2:l}=this.currentLinkBox,{href:d}=this.currentLinkBox.token,c=u-a,m=l-o,p={left:a,top:o+1,width:c,height:m};De(n,p)||this.irisGrid.setState({linkHoverTooltipProps:p,linkHoverDisplayValue:d})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const eu=Jl;var tu=3e3;function iu(r){var{children:e=null,onEntering:t,onEntered:i,onExiting:n,onExited:a}=r,[o,u]=y.useState(!1),l=y.useRef(),d=Hr(e),c=y.useCallback(()=>{u(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{u(!1)},tu)},[u,l]);return y.useEffect(()=>{d!==e&&e!=null&&c()},[e,d,u,c]),y.useEffect(()=>()=>l.current?clearTimeout(l.current):void 0,[]),s.jsx(Vt,{className:"toast-bottom-bar",isShown:o,onEntering:t,onEntered:i,onExiting:n,onExited:a,children:e})}var ru=1,an=ke.memo(r=>{var{model:e,modelColumns:t,top:i,bottom:n,left:a,right:o,filter:u,formatter:l,reverseType:d=T.REVERSE_TYPE.NONE,sorts:c,customColumns:m,movedColumns:p,hiddenColumns:h,alwaysFetchColumns:f,rollupConfig:C=null,totalsConfig:g=null,selectDistinctColumns:F=de,pendingRowCount:w=0,pendingDataMap:v=Ve,frozenColumns:N,formatColumns:A,columnHeaderGroups:E,partitionConfig:O}=r,D=y.useMemo(()=>ie.getModelViewportColumns(t,a,o,p,h,f,ru),[t,a,o,p,h,f]);return y.useEffect(function(){e.filter=u},[e,u]),y.useEffect(function(){var G=[...c];d!==T.REVERSE_TYPE.NONE&&G.push(e.dh.Table.reverse()),e.sort=G},[e,c,d]),y.useEffect(function(){e.formatter=l},[e,l]),y.useEffect(function(){e.isCustomColumnsAvailable&&(e.customColumns=m)},[e,m]),y.useEffect(function(){e.isFormatColumnsAvailable&&(e.formatColumns=A)},[e,A]),y.useEffect(function(){e.setViewport(i,n,D)},[e,i,n,D]),y.useEffect(function(){e.isRollupAvailable&&(e.rollupConfig=C)},[e,e.isRollupAvailable,C]),y.useEffect(function(){e.isSelectDistinctAvailable&&(e.selectDistinctColumns=F)},[e,F]),y.useEffect(function(){e.isTotalsAvailable&&(e.totalsConfig=g)},[e,e.isTotalsAvailable,g]),y.useEffect(function(){e.pendingRowCount=w},[e,w]),y.useEffect(function(){e.pendingDataMap=v},[e,v]),y.useEffect(function(){N&&e.updateFrozenColumns(N)},[e,N]),y.useEffect(function(){e.columnHeaderGroups=E},[e,E]),y.useEffect(function(){O&&Ni(e)&&(e.partitionConfig=O)},[e,O]),null});an.displayName="IrisGridModelUpdater";const nu=an;function on(r,e,t){return e=au(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function au(r){var e=ou(r,"string");return typeof e=="symbol"?e:String(e)}function ou(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var vi=ce.module("ColumnStatistics"),su={SIZE:"Number of Rows"};class Et extends y.Component{static getStatsLabel(e){var t;return(t=su[e])!==null&&t!==void 0?t:e.split(" ").map(i=>i[0].toUpperCase()+i.substr(1).toLowerCase()).join(" ")}constructor(e){super(e),on(this,"cancelablePromise",void 0),this.handleError=this.handleError.bind(this),this.handleGenerateStatistics=this.handleGenerateStatistics.bind(this),this.handleStatistics=this.handleStatistics.bind(this),this.cancelablePromise=null,this.state={error:null,loading:!1,statistics:null,numRows:0}}componentDidMount(){this.maybeGenerateStatistics()}componentWillUnmount(){this.cancelablePromise&&this.cancelablePromise.cancel()}maybeGenerateStatistics(){var{column:e,model:t}=this.props,i=t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount;this.setState({numRows:i}),!t.isColumnStatisticsAvailable||e.isProxy===!0?this.setState({loading:!1}):i<Et.AUTO_GENERATE_LIMIT&&this.handleGenerateStatistics()}handleGenerateStatistics(){this.setState({loading:!0});var{column:e,model:t}=this.props;this.cancelablePromise=Oe.makeCancelable(t.columnStatistics(e)),this.cancelablePromise.then(this.handleStatistics).catch(this.handleError)}handleStatistics(e){vi.debug("Received statistics",e);var{model:t,onStatistics:i}=this.props,n=[];e.statisticsMap.forEach((a,o)=>{n.push({operation:Et.getStatsLabel(o),value:a,type:e.getType(o)})}),e.uniqueValues.forEach((a,o)=>{n.push({operation:o,className:"column-statistics-unique-value",value:a,type:"long"})}),this.setState({loading:!1,statistics:n,numRows:t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount}),i()}handleError(e){if(e!=null&&Oe.isCanceled(e)){vi.debug("Called handleError on a cancelled promise result");return}vi.error("Error generating statistics",e),this.setState({error:e,loading:!1,statistics:null})}render(){var e,{column:t,model:i}=this.props,{error:n,loading:a,statistics:o,numRows:u}=this.state,l=!a&&n==null&&o==null&&i.isColumnStatisticsAvailable,d=[],c=t.type.substring(t.type.lastIndexOf(".")+1),m=t.description===null?null:t.description;if(o!=null)for(var p=0;p<o.length;p+=1){var{operation:h,className:f,value:C,type:g}=o[p],F=g?i.displayString(C,g):i.displayString(C,t.type,t.name),w=s.jsxs(ke.Fragment,{children:[s.jsx("div",{className:Y("column-statistic-operation",f),children:h}),s.jsx("div",{className:"column-statistic-value",children:F})]},h);d.push(w)}var v=$e(i)&&i.hasExpandableRows?"Expanded Rows":"Number of Rows",N=i.displayString(u,"long"),A=i.getColumnIndexByName(t.name);return s.jsxs("div",{className:"column-statistics",children:[s.jsxs("div",{className:"column-statistics-title",children:[(e=t.displayName)!==null&&e!==void 0?e:t.name,s.jsxs("span",{className:"column-statistics-type",children:[" (",c,")"]}),s.jsx(Wr,{className:"column-statistics-copy",tooltip:"Copy column name",copy:t.name})]}),m!=null&&s.jsx("div",{className:"column-statistics-description",children:m}),A!=null&&!i.isColumnSortable(A)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(Z,{icon:ma,className:"mr-1"}),"Not sortable"]}),A!=null&&!i.isColumnMovable(A)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(Z,{icon:i.isColumnFrozen(A)?pa:ga,className:"mr-1"}),i.isColumnFrozen(A)?"Frozen":"Not movable"]}),s.jsxs("div",{className:"column-statistics-grid",children:[o==null&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"column-statistic-operation",children:v}),s.jsx("div",{className:"column-statistic-value",children:N})]}),d]}),l&&s.jsx(W,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,children:"Generate Stats"}),n!=null&&s.jsx("div",{className:"error-message",children:"".concat(n)}),o&&!a&&s.jsx(W,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,icon:va,children:"Refresh"}),a&&s.jsxs("div",{className:"column-statistics-loading",children:[s.jsx(kt,{className:"loading-spinner-vertical-align"}),"Calculating Stats..."]})]})}}on(Et,"AUTO_GENERATE_LIMIT",1e5);const lu=Et;function uu(r,e,t){return e=du(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function du(r){var e=cu(r,"string");return typeof e=="symbol"?e:String(e)}function cu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class hu extends y.PureComponent{static createSearchFilter(e,t,i,n,a){var o=a?n.filter(d=>!i.includes(d.name)).map(d=>d.name):i;if(t&&o.length>0){var u=e.FilterValue.ofString(t),l=o.length===n.length?e.FilterCondition.search(u):e.FilterCondition.search(u,n.filter(d=>o.includes(d.name)).map(d=>d.filter()));return l}}constructor(e){super(e),uu(this,"searchField",void 0),this.handleSearchValueChange=this.handleSearchValueChange.bind(this),this.toggleColumn=this.toggleColumn.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.selectNumbers=this.selectNumbers.bind(this),this.searchField=ke.createRef(),this.state={isConfigureColumnsShown:!1}}focus(){var e;(e=this.searchField.current)===null||e===void 0||e.focus()}handleSearchValueChange(e){var{onChange:t,selectedColumns:i,invertSelection:n}=this.props;t(e.target.value,i,n)}sendColumnChange(e,t){var{onChange:i,value:n}=this.props;i(n,e,t)}setInvertSelection(e){var{onChange:t,value:i}=this.props;t(i,[],e)}toggleColumn(e){var{selectedColumns:t,invertSelection:i}=this.props;if(t.includes(e))this.sendColumnChange(t.filter(a=>a!==e),i);else{var n=t.slice();n.push(e),this.sendColumnChange(n,i)}}selectAll(){this.setInvertSelection(!0)}clear(){this.setInvertSelection(!1)}selectNumbers(){var{columns:e}=this.props;this.sendColumnChange(e.filter(t=>T.isNumberType(t.type)).map(t=>t.name),!1)}render(){var{value:e,selectedColumns:t,invertSelection:i,columns:n}=this.props,{isConfigureColumnsShown:a}=this.state,o=t.length===0&&i===!0||t.length===n.length&&i===!1,u=t.length===0&&i===!1||t.length===n.length&&i===!0,l;return o?l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:gr,mask:ci,transform:"shrink-2 down-5 right-7"}),s.jsx(Z,{icon:fa,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}):u?l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:Ca,mask:ci,transform:"shrink-1 down-5 right-7"}),s.jsx(Z,{icon:pr,className:"text-danger",transform:"shrink-4 down-5 right-7"})]}):l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:gr,mask:ci,transform:"shrink-2 down-5 right-7"}),s.jsx(Z,{icon:Sa,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}),s.jsxs("div",{className:"cross-column-container",children:[s.jsx(Ka,{className:"cross-column-search",placeholder:"Search Data...","data-testid":"cross-column-search",value:e,onChange:this.handleSearchValueChange,ref:this.searchField}),s.jsxs("button",{type:"button",className:"btn btn-link btn-link-icon px-2",onClick:()=>{a?this.setState({isConfigureColumnsShown:!1}):this.setState({isConfigureColumnsShown:!0})},children:[s.jsx("div",{className:"fa-layers",children:l}),s.jsx(Xe,{children:"Configure Columns"}),s.jsx(Kr,{isShown:a,className:"cross-column-popper",onExited:()=>{this.setState({isConfigureColumnsShown:!1})},closeOnBlur:!0,interactive:!0,children:s.jsxs("div",{className:"cross-column-popup",children:["Searched Columns",s.jsx("div",{className:"cross-column-scroll",children:n.map(d=>d.isProxy===!0?null:s.jsxs(ke.Fragment,{children:[s.jsx(Ya,{className:"cross-column-checkbox",checked:i?!t.includes(d.name):t.includes(d.name),onChange:()=>this.toggleColumn(d.name),children:d.name}),d.type.substring(d.type.lastIndexOf(".")+1)]},d.name))}),s.jsxs("div",{className:"cross-column-button-bar",children:[s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,children:"Select All"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.clear,children:"Clear"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectNumbers,children:"Numbers Only"})]}),u&&s.jsxs("p",{className:"text-danger",children:[s.jsx(Z,{icon:pr})," Select at least one column to search."]})]})})]})]})}}const xt=hu;function Dr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function Ir(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dr(Object(t),!0).forEach(function(i){ft(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Pr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function fi(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Pr(a,i,n,o,u,"next",l)}function u(l){Pr(a,i,n,o,u,"throw",l)}o(void 0)})}}function ft(r,e,t){return e=mu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mu(r){var e=pu(r,"string");return typeof e=="symbol"?e:String(e)}function pu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var qe=ce.module("IrisGridPartitionSelector");class gu extends y.Component{constructor(e){super(e),ft(this,"pending",void 0),ft(this,"tableUtils",void 0),ft(this,"getCachedChangeCallback",J(i=>n=>this.handlePartitionSelect(i,n))),ft(this,"getCachedFormatValueCallback",J(i=>n=>this.getDisplayValue(i,n))),this.handleKeyTableClick=this.handleKeyTableClick.bind(this),this.handleMergeClick=this.handleMergeClick.bind(this),this.handlePartitionSelect=this.handlePartitionSelect.bind(this);var{model:t}=e;this.tableUtils=new T(t.dh),this.pending=new Yr,this.state={isLoading:!0,keysTable:null,partitionFilters:null,partitionTables:null}}componentDidMount(){var e=this;return fi(function*(){var{model:t}=e.props;try{var i=yield e.pending.add(t.partitionKeysTable().then(o=>{var u=t.partitionColumns.map(l=>l.sort().desc());return o.applySort(u),o}),o=>o.close()),n=yield Promise.all(t.partitionColumns.map(function(){var o=fi(function*(u,l){return e.pending.add(i.selectDistinct(t.partitionColumns.slice(0,l+1)),d=>d.close())});return function(u,l){return o.apply(this,arguments)}}())),a=e.getPartitionFilters(n);e.setState({isLoading:!1,keysTable:i,partitionFilters:a,partitionTables:n})}catch(o){if(!Oe.isCanceled(o))throw o}})()}componentDidUpdate(e){var{partitionConfig:t}=e,{partitionConfig:i}=this.props;t!==i&&this.updatePartitionFilters()}componentWillUnmount(){this.pending.cancel();var{keysTable:e,partitionTables:t}=this.state;e?.close(),t?.forEach(i=>i.close())}handleKeyTableClick(){qe.debug2("handleKeyTableClick");var{partitionConfig:e}=this.props,t=Ir({},e);t.mode=e.mode==="keys"?"partition":"keys",this.sendUpdate(t)}handleMergeClick(){qe.debug2("handleMergeClick");var{partitionConfig:e}=this.props,t=Ir({},e);t.mode=e.mode==="merged"?"partition":"merged",this.sendUpdate(t)}handlePartitionSelect(e,t){var i=this;return fi(function*(){var{model:n,partitionConfig:a}=i.props;qe.debug("handlePartitionSelect",e,t,a);var o=[...a.partitions];if(o[e]=t,e===n.partitionColumns.length-1){i.sendUpdate({partitions:o,mode:"partition"});return}var{keysTable:u}=i.state;L(u);try{i.setState({isLoading:!0});var l=yield i.pending.add(u.copy(),p=>p.close()),d=o.slice(0,e+1).map((p,h)=>{var f=l.columns[h];return i.tableUtils.makeNullableEqFilter(f,p)});l.applyFilter(d),l.setViewport(0,0,l.columns);var c=yield i.pending.add(l.getViewportData()),m={partitions:l.columns.map(p=>{var h;return(h=c.rows[0].get(p))!==null&&h!==void 0?h:null}),mode:"partition"};l.close(),i.sendUpdate(m)}catch(p){Oe.isCanceled(p)||qe.error("Unable to get partition tables",p)}finally{i.setState({isLoading:!1})}})()}sendUpdate(e){qe.debug2("sendUpdate",e);var{onChange:t}=this.props;t(e)}getDisplayValue(e,t){var{model:i}=this.props;if(t===null)return"(null)";if(t===void 0||t==="")return"";var n=i.partitionColumns[e];return T.isCharType(n.type)&&t.toString().length>0?String.fromCharCode(parseInt(t.toString(),10)):i.displayString(t,n.type,n.name)}updatePartitionFilters(){var{partitionTables:e}=this.state;L(e);var{partitionConfig:t}=this.props,{mode:i}=t;if(qe.debug("updatePartitionFilters",t),i==="partition"){var n=this.getPartitionFilters(e);this.setState({partitionFilters:n})}}getPartitionFilters(e){var{model:t,partitionConfig:i}=this.props,{partitions:n}=i;if(qe.debug("getPartitionFilters",i),n.length!==e.length)throw new Error("Invalid partition config set. Expected ".concat(e.length," partitions, but got ").concat(n.length));for(var a=[],o=0;o<n.length;o+=1)if(o===0)a.push([]);else{var u=a[o-1],l=n[o-1],d=t.partitionColumns[o-1],c=[...u,this.tableUtils.makeNullableEqFilter(d,l)];a.push(c)}return a}render(){var{model:e,partitionConfig:t}=this.props,{isLoading:i,partitionFilters:n,partitionTables:a}=this.state,{partitions:o}=t;n!==null&&a!==null&&n.forEach((l,d)=>{a[d].applyFilter(l)});var u=e.partitionColumns.map((l,d)=>s.jsxs("div",{className:"column-selector",children:[a?.[d]&&s.jsx(ao,{label:l.name,labelPosition:"side",table:a[d],direction:"bottom",shouldFlip:!1,keyColumn:a[d].columns[d].name,placeholder:"Loading...",labelColumn:a[d].columns[d].name,onChange:this.getCachedChangeCallback(d),defaultSelectedKey:o[d],isDisabled:d>0&&t.mode!=="partition"||i}),e.partitionColumns.length-1===d||s.jsx(Z,{icon:Ta})]},"selector-".concat(l.name)));return s.jsxs("div",{className:"iris-grid-partition-selector",children:[s.jsx("div",{className:"table-name",children:"Partitioned Table"}),s.jsxs("div",{className:"partition-button-group",children:[s.jsx(W,{onClick:this.handleKeyTableClick,kind:"inline",tooltip:"View keys as table",icon:ba,active:t.mode==="keys",disabled:i,children:"Keys"}),s.jsx(W,{onClick:this.handleMergeClick,kind:"inline",tooltip:"View all partitions as one merged table",icon:s.jsx(Z,{icon:Ea,rotation:90}),active:t.mode==="merged",disabled:i,children:"Merge"})]}),u]})}}const vu=gu;function fu(r,e,t){return e=Cu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cu(r){var e=Su(r,"string");return typeof e=="symbol"?e:String(e)}function Su(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Tu=ce.module("SelectDistinctBuilder");class sn extends y.Component{constructor(e){super(e),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleDropdownChanged=this.handleDropdownChanged.bind(this);var{model:t,selectDistinctColumns:i}=this.props;this.state={inputs:i.length>0?[...i]:[""],columns:t.originalColumns}}componentDidUpdate(e,t){var{inputs:i}=this.state,{onChange:n}=this.props;if(t.inputs!==i){var a=i.filter(o=>o!=="");De(t.inputs.filter(o=>o!==""),a)||n(a)}}handleAddColumnClick(){this.setState(e=>{var{inputs:t}=e;return{inputs:[...t,""]}})}handleDeleteColumn(e){this.setState(t=>{var{inputs:i}=t;return{inputs:i.length===1&&e===0?[""]:i.filter((n,a)=>e!==a)}})}handleDropdownChanged(e,t){Tu.debug("handleDropdownChanged",e,t),this.setState(i=>{var{inputs:n}=i,a=[...n];return a[e]=t,{inputs:a}})}renderInputs(){var{columns:e,inputs:t}=this.state;return t.map((i,n)=>{var a=e.filter(o=>{var{name:u}=o;return u===i||!t.includes(u)}).map(o=>{var{name:u}=o;return s.jsx("option",{value:u,children:u},u)});return s.jsxs("div",{className:"form-inline px-3 pb-3",children:[s.jsxs(nt,{className:"form-control custom-select col",value:i,onChange:o=>this.handleDropdownChanged(n,o),children:[s.jsx("option",{value:"",children:"Select a column"}),a]}),(t.length>1||i!=="")&&s.jsx(W,{kind:"ghost",className:"ml-1 px-2",onClick:()=>{this.handleDeleteColumn(n)},icon:s.jsx(Z,{icon:Ai,transform:"grow-3"}),tooltip:"Delete column"})]},n)})}render(){var{columns:e,inputs:t}=this.state,i=t.length>=e.length;return s.jsxs("div",{role:"presentation",className:"select-distinct-builder-container h-100",children:[s.jsx("div",{className:"select-distinct-title",children:"Display Unique Values From"}),this.renderInputs(),s.jsx("hr",{}),s.jsx("div",{className:"pt-1 px-3",children:s.jsx(W,{kind:"ghost",className:"btn-add-column",onClick:this.handleAddColumnClick,disabled:i,icon:Ri,children:"Add Additional Column"})}),s.jsx("div",{className:"select-distinct-builder-footer",children:s.jsx("div",{className:"select-distinct-builder-hint",children:"Display only unique values from the selected table columns. Note that this will reset any filters and display only the selected columns."})})]})}}fu(sn,"defaultProps",{selectDistinctColumns:[],onChange:()=>{}});const bu=sn;function ji(r){var{items:e,onChange:t=()=>{}}=r;return s.jsx(zr,{items:Array.from(e.entries()).map(i=>{var[n,a]=i;return{title:ji.getAdvancedSettingsTitleForKey(n),isOn:a,onChange:o=>t(n,o)}})})}ji.getAdvancedSettingsTitleForKey=r=>{switch(r){case Lt.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from a control";case Lt.LINK_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from an incoming link filter"}};function Lr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function tt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(i){Eu(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Eu(r,e,t){return e=yu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yu(r){var e=wu(r,"string");return typeof e=="symbol"?e:String(e)}function wu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ur=ce.module("ConditionalFormattingMenu"),Ci=()=>{};function Fu(r){var{column:{type:e}}=r;if(T.isNumberType(e))return r.condition===P.IS_NULL||r.condition===P.IS_NOT_NULL?"":"".concat(r.value);if(T.isCharType(e))return r.condition===k.IS_NULL||r.condition===k.IS_NOT_NULL?"":"".concat(r.value);if(T.isStringType(e))return r.condition===B.IS_NULL||r.condition===B.IS_NOT_NULL?"":'"'.concat(r.value,'"');if(T.isDateType(e))return r.condition===k.IS_NULL||r.condition===k.IS_NOT_NULL?"":"".concat(r.value);if(T.isBooleanType(e))return"";throw new Error("Invalid column type ".concat(e," in getRuleValue"))}function Nu(r){return T.isNumberType(r.column.type)&&r.condition===P.IS_BETWEEN?"".concat(r.start," < ").concat(r.column.name," < ").concat(r.end):"".concat(r.column.name," ").concat(cs(r.column.type,r.condition),`
|
|
1
|
+
import{r as y,_ as $r,I as s,K as Y,Z as bi,M as ke,L as Z,J as Ei,T as rt,bf as De,U as J,bb as aa,bc as oa,ba as sa,bd as hr,ag as di,V as At}from"./vendor-6ba620f4.js";import{L as ce,f as Ai,P as kt,e as L,g as Ri,br as mr,T as yi,ah as la,ai as ua,bs as _i,bt as Pt,bu as da,bv as Ue,bw as ca,bx as ha,aE as wi,aU as Fi,by as ma,bz as pa,bA as ga,am as va,bB as pr,a$ as gr,bC as ci,bD as fa,an as Ca,bE as Sa,ag as Ta,bF as ba,bG as Ea,aq as ya,aK as wa,M as Fa,b as Na,bH as Oa,bI as Aa,c as Ra,j as Qr,A as _a,bJ as xa,bK as Da,bg as Ia,al as Pa,bL as La,r as Ua,bM as ja,bN as ka,bO as Ga,bP as Ma,aw as Va,bQ as Ba,b3 as $a}from"./index-7440403e.js";import{c as T,S as nt,B as W,x as xi,P as Oe,O as ht,cJ as Qa,t as Ae,b1 as Di,aD as Hr,a6 as Ii,c4 as Ha,s as Xe,b4 as Dt,b as Ct,a as we,I as Ke,G as Wa,ah as U,ch as hi,ae as de,cf as Ve,A as Wr,Q as Ka,af as Kr,C as Ya,cj as Yr,J as qa,cC as za,T as Te,F as mi,cK as Xa,bj as Za}from"./ControlType-c918f1cd.js";import{k as Ja,l as eo,m as to,o as io,I as ie,j as qr,d as Ni,a as Lt,b as Rt,g as ro,h as no}from"./MissingPartitionError-6ffc79b5.js";import{G as Fe,c as ve,i as $e,d as Be,g as vr,b as xe}from"./IrisGridModel-db71cdf7.js";import{P as ao,n as oo,F as so,O as K,y as lo,q as uo,T as Ye,p as co,A as ho,l as mo,R as po,m as go,V as vo,C as fo,x as Co,r as So}from"./IrisGridThemeProvider-98bbe2be.js";import{w as To,ae as Re,ad as bo,r as zr,l as Xr,m as Eo,x as yo,P as fr}from"./GridRenderer-beadd456.js";import{I as Ne,a as Cr,S as wo,D as Fo}from"./IrisGridShortcuts-6b660c54.js";import{K as Gt,a as Sr,i as No,G as Oo}from"./Grid-68f28f7c.js";import{F as Tr}from"./FormatterUtils-8bc07bb9.js";import"./helpers-de833af9.js";import"./monaco-b5248072.js";function br(r,e,t){return e=Ao(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ao(r){var e=Ro(r,"string");return typeof e=="symbol"?e:String(e)}function Ro(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _t=ce.module("AdvancedFilterCreatorFilterItem");class Pi extends y.PureComponent{static getLabelForFilter(e,t){try{if(T.isNumberType(e)||T.isCharType(e))return Ja(t);if(T.isTextType(e))return eo(t);if(T.isDateType(e))return to(t);if(T.isBooleanType(e))return io(t);throw new Error("Unrecognized column type: ".concat(e))}catch(i){return _t.warn(i),""}}constructor(e){super(e),br(this,"typeDropdown",void 0),br(this,"getCachedIsValid",$r((a,o,u,l,d)=>{try{return!u||d.makeAdvancedValueFilter(a,o,u,l)!=null}catch{return!1}})),this.handleDelete=this.handleDelete.bind(this),this.handleTypeChange=this.handleTypeChange.bind(this),this.handleValueChange=this.handleValueChange.bind(this),this.typeDropdown=null;var{value:t="",filterTypes:i,selectedType:n=i[0]}=e;this.state={selectedType:n,value:t}}componentDidMount(){var e;(e=this.typeDropdown)===null||e===void 0||e.focus()}componentDidUpdate(e){var{value:t,selectedType:i}=this.props;i!==void 0&&e.selectedType!==i&&this.setState({selectedType:i}),t!==void 0&&e.value!==t&&this.setState({value:t})}handleTypeChange(e){var t=e;_t.debug2("typeChange",t),this.setState({selectedType:t});var{onChange:i}=this.props,{value:n}=this.state;n!=null&&n.length>0&&i(t,n)}handleValueChange(e){_t.debug2("valueChange");var{value:t}=e.target;this.setState({value:t});var{onChange:i}=this.props,{selectedType:n}=this.state;n!=null&&i(n,t)}handleDelete(){_t.debug("delete");var{onDelete:e}=this.props;e()}render(){for(var{column:e,filterTypes:t,formatter:i,tableUtils:n}=this.props,{selectedType:a,value:o}=this.state,u=!T.isBooleanType(e.type),l=[],d=this.getCachedIsValid(e,a,o,i.timeZone,n),c=0;c<t.length;c+=1){var m=t[c],p=Pi.getLabelForFilter(e.type,m),h=s.jsx("option",{value:m,children:p},m);l.push(h)}return s.jsx("div",{className:"advanced-filter-creator-filter-item",children:s.jsxs("div",{className:"form-row",children:[s.jsx("div",{className:"form-group col",children:s.jsx(nt,{className:"form-control",value:a,onChange:this.handleTypeChange,ref:f=>{this.typeDropdown=f},children:l})}),u&&s.jsx("div",{className:"form-group col",children:s.jsx("div",{className:"input-group",children:s.jsx("input",{type:"text",className:Y("form-control",{error:!d}),placeholder:"Enter value",value:o,onChange:this.handleValueChange})})}),s.jsx("div",{className:"form-group col-1 px-0",children:s.jsx(W,{kind:"ghost",className:"w-100 h-100 p-0 m-0",onClick:this.handleDelete,icon:Ai,tooltip:"Remove Filter"})})]})})}}const _o=Pi;function Oi(r,e,t){return e=xo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xo(r){var e=Do(r,"string");return typeof e=="symbol"?e:String(e)}function Do(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Er=ce.module("AdvancedFilterCreatorSelectValueList");class bt extends y.PureComponent{static indexOf(e,t){for(var i=0;i<t.length;i+=1){var n=t[i];if(n===e||n!=null&&n.valueOf!=null&&e!=null&&e.valueOf!=null&&n.valueOf()===e.valueOf())return i}return-1}constructor(e){super(e),Oi(this,"dh",void 0),Oi(this,"list",void 0),this.handleSelect=this.handleSelect.bind(this),this.handleViewportChange=this.handleViewportChange.bind(this),this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.handleTableUpdate=this.handleTableUpdate.bind(this);var{selectedValues:t,dh:i}=this.props;this.dh=i,this.list=null,this.state={itemCount:0,items:[],offset:0,selectedValues:t,isLoading:!0}}componentDidMount(){var{table:e}=this.props;e&&this.startListening(e)}componentDidUpdate(e){var{filters:t,invertSelection:i,selectedValues:n,table:a}=this.props;e.table!==a&&(e.table&&this.stopListening(e.table),a&&this.startListening(a),this.resetViewport()),e.invertSelection!==i&&this.setState({selectedValues:[]},this.handleSelectionUpdate),e.selectedValues!==n&&this.setState({selectedValues:n},this.handleSelectionUpdate),e.filters!==t&&(a?.applyFilter(t),this.resetViewport())}componentWillUnmount(){var{table:e}=this.props;e&&this.stopListening(e)}handleSelect(e,t){var{invertSelection:i}=this.props,{selectedValues:n}=this.state;n=[...n];var a=bt.indexOf(t,n);a>=0?n.splice(a,1):n.push(t);var o=a<0;i&&(o=!o);var{offset:u}=this.state,{items:l}=this.state;l=[...l];var d=e-u;d>=0&&d<l.length&&(l[d].isSelected=o),this.setState({items:l,selectedValues:n});var{onChange:c}=this.props;c(n,i)}handleViewportChange(e,t){this.updateViewport(e,t)}handleSelectionUpdate(){this.updateItemSelection()}handleTableUpdate(e){var{table:t,formatter:i}=this.props;if(t){for(var n=e.detail,{offset:a}=n,o=[],u=t.columns[0],l=0;l<n.rows.length;l+=1){var d=n.rows[l],c=d.get(u),m=void 0;c==null?m=s.jsx("i",{className:"text-muted",children:"null"}):c===""?m=s.jsx("i",{className:"text-muted",children:"empty"}):m=i.getFormattedString(c,u.type,u.name);var p=this.isValueSelected(c);o.push({displayValue:m,value:c,isSelected:p})}Er.debug2("Received table update:",a,o.length);var h=t.size;this.setState({itemCount:h,items:o,offset:a,isLoading:!1})}}isValueSelected(e){var{invertSelection:t}=this.props,{selectedValues:i}=this.state,n=bt.indexOf(e,i);return t?n<0:n>=0}startListening(e){e.addEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}stopListening(e){e.removeEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}resetViewport(){this.list&&this.list.topRow!=null&&this.list.bottomRow!=null&&this.updateViewport(this.list.topRow,this.list.bottomRow,!0)}updateItemSelection(){var{items:e}=this.state;e=[...e];for(var t=0;t<e.length;t+=1){var i=e[t],{value:n}=i;i.isSelected=this.isValueSelected(n)}this.setState({items:e})}updateViewport(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{table:n}=this.props;if(n!=null){i&&this.setState({isLoading:!0});var a=t-e+1,o=Math.max(0,e-a*3),u=Math.max(o,t+a*3);Er.debug2("Setting viewport",o,",",u),n.setViewport(o,u)}}render(){var{offset:e,isLoading:t,items:i,itemCount:n}=this.state;return s.jsxs("div",{className:"select-value-list-wrapper",children:[s.jsx(To,{itemCount:n,items:i,offset:e,onSelect:this.handleSelect,onViewportChange:this.handleViewportChange,ref:a=>{this.list=a}}),s.jsx(xi,{in:t,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"loading-list",children:s.jsx(kt,{className:"loading-spinner-large"})})})]})}}Oi(bt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{}});const Io=bt;function St(r,e,t){return e=Po(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Po(r){var e=Lo(r,"string");return typeof e=="symbol"?e:String(e)}function Lo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yt extends y.PureComponent{constructor(e){super(e),St(this,"searchTablePromise",void 0),St(this,"tableUtils",void 0),St(this,"updateFilterTimer",void 0),this.handleSelectAllClick=this.handleSelectAllClick.bind(this),this.handleClearAllClick=this.handleClearAllClick.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUpdateFilterTimeout=this.handleUpdateFilterTimeout.bind(this);var{dh:t,invertSelection:i,selectedValues:n}=e;this.tableUtils=new T(t),this.state={filters:[],invertSelection:i,selectedValues:n,searchText:""}}componentDidMount(){this.initSearchTable()}componentDidUpdate(e,t){var{invertSelection:i,selectedValues:n,table:a}=this.props;e.table!==a&&this.initSearchTable(),e.invertSelection!==i&&this.setState({invertSelection:i}),e.selectedValues!==n&&this.setState({selectedValues:n});var{table:o,searchText:u}=this.state;o!==t.table&&(t.table!=null&&t.table.close(),o!=null&&this.startUpdateFilterTimer()),u!==t.searchText&&this.startUpdateFilterTimer()}componentWillUnmount(){var{table:e}=this.state;e?.close(),this.searchTablePromise=void 0,this.stopUpdateFilterTimer()}getColumnName(){var{table:e}=this.props;return e!=null?e.columns[0].name:""}getDisplayedValuesCount(){var{invertSelection:e,selectedValues:t,table:i}=this.state;return i==null?null:e?i.totalSize-t.length:t.length}getDisplayedValueText(){var e=this.getDisplayedValuesCount(),{table:t}=this.state,{formatter:i}=this.props;if(e!=null&&t!=null){var n=i.getFormattedString(e,"long"),a=i.getFormattedString(t.totalSize,"long"),o="";return e<1e6&&(o="Displaying "),"".concat(o).concat(n," of ").concat(a)}return null}initSearchTable(){var{table:e}=this.props;if(e!=null){var t=e.copy();this.searchTablePromise=t,this.searchTablePromise.then(i=>{this.searchTablePromise===t?(this.setState({table:i}),this.searchTablePromise=void 0):i.close()})}}handleListChange(e,t){this.setState({selectedValues:e,invertSelection:t});var{onChange:i}=this.props;i(e,t)}handleSearchChange(e){var t=e.target.value;this.setState({searchText:t})}handleSelectAllClick(){this.resetSelection(!0)}handleClearAllClick(){this.resetSelection(!1)}handleUpdateFilterTimeout(){this.updateFilterTimer=void 0,this.updateTableFilter()}resetSelection(e){var t=[];this.setState({invertSelection:e,selectedValues:t});var{onChange:i}=this.props;i(t,e)}startUpdateFilterTimer(){this.stopUpdateFilterTimer(),this.updateFilterTimer=setTimeout(this.handleUpdateFilterTimeout,yt.searchDebounceTime)}stopUpdateFilterTimer(){this.updateFilterTimer!=null&&(clearTimeout(this.updateFilterTimer),this.updateFilterTimer=void 0)}updateTableFilter(){var{table:e,searchText:t}=this.state,{timeZone:i}=this.props,{tableUtils:n}=this,a=e?.columns[0],o=[];if(a!=null){var u;if(t.length>0){var l=null;T.isCharType(a.type)?l=n.makeQuickFilter(a,t):T.isTextType(a.type)?l=n.makeQuickFilter(a,"~".concat(t),i):l=n.makeQuickFilter(a,">=".concat(t),i),l!=null?o.push(l):u="Invalid search text"}this.setState({filters:o,error:u})}}render(){var{error:e,filters:t,invertSelection:i,selectedValues:n,searchText:a,table:o}=this.state,{dh:u,formatter:l,showSearch:d}=this.props,c=this.getColumnName(),m=this.getDisplayedValueText(),p=c?"Find ".concat(c,"..."):"";return s.jsxs("div",{className:"advanced-filter-creator-select-value",children:[s.jsxs("div",{className:d?"form-group":"",children:[s.jsx("label",{htmlFor:"advanced-filter-creator-select-value-input",children:"Select Values"}),d&&s.jsx("input",{type:"text",className:Y("form-control",{"is-invalid":e!=null}),id:"advanced-filter-creator-select-value-input",placeholder:p,value:a,onChange:this.handleSearchChange})]}),s.jsx(Io,{dh:u,table:o,filters:t,invertSelection:i,selectedValues:n,formatter:l,onChange:this.handleListChange}),s.jsxs("div",{className:"advanced-filter-creator-select-meta-row",children:[s.jsxs("div",{children:[s.jsx(W,{kind:"ghost",onClick:this.handleSelectAllClick,children:"Select All"}),s.jsx(W,{kind:"ghost",onClick:this.handleClearAllClick,children:"Clear"})]}),s.jsx(xi,{in:m!=null,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"row-count-info",children:m})})]})]})}}St(yt,"searchDebounceTime",250);St(yt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{},showSearch:!0});const Uo=yt;function it(r,e,t){return e=jo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jo(r){var e=ko(r,"string");return typeof e=="symbol"?e:String(e)}function ko(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var mt=ce.module("AdvancedFilterCreator");class Ie extends y.PureComponent{static makeFilterItem(){return{key:bi()}}constructor(e){var t,i;super(e),it(this,"focusTrapContainer",void 0),it(this,"debounceTimeout",void 0),it(this,"valuesTablePromise",void 0),it(this,"getFilterTypes",$r(h=>T.getFilterTypes(h))),this.handleAddAnd=this.handleAddAnd.bind(this),this.handleAddOr=this.handleAddOr.bind(this),this.handleChangeFilterOperator=this.handleChangeFilterOperator.bind(this),this.handleDone=this.handleDone.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleFilterDelete=this.handleFilterDelete.bind(this),this.handleSelectValueChange=this.handleSelectValueChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSortDown=this.handleSortDown.bind(this),this.handleSortUp=this.handleSortUp.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleFocusTrapStart=this.handleFocusTrapStart.bind(this),this.handleFocusTrapEnd=this.handleFocusTrapEnd.bind(this),this.handleUpdateTimeout=this.handleUpdateTimeout.bind(this),this.focusTrapContainer=ke.createRef();var{model:n,column:a,options:o}=e,{filterOperators:u,invertSelection:l,selectedValues:d}=o,c=(t=(i=o.filterItems)===null||i===void 0?void 0:i.map(h=>{var{selectedType:f,value:C}=h;return{selectedType:f,value:C,key:bi()}}))!==null&&t!==void 0?t:[];c.length===0&&c.push(Ie.makeFilterItem()),u==null&&(u=[]),l==null&&(l=!0),d==null&&(d=[]);var m=n.getColumnIndexByName(a.name);L(m);var p=n.isColumnSortable(m);this.state={filterItems:c,filterOperators:u,invertSelection:l,selectedValues:d,valuesTableError:null,valuesTable:void 0,isSortable:p}}componentDidMount(){this.initValuesTable()}componentWillUnmount(){this.debounceTimeout!=null&&(clearTimeout(this.debounceTimeout),this.sendUpdate()),this.valuesTablePromise!=null&&this.valuesTablePromise.cancel()}getFilterChangeHandler(e){return this.handleFilterChange.bind(this,e)}getFilterDeleteHandler(e){return this.handleFilterDelete.bind(this,e)}initValuesTable(){var{model:e,column:t}=this.props;if(!e.isValuesTableAvailable){mt.debug("No values table for this model, just ignore");return}this.valuesTablePromise=T.makeCancelableTablePromise(e.valuesTable(t)),this.valuesTablePromise.then(i=>{var n;if(!((n=i.columns[0].isSortable)!==null&&n!==void 0)||n){var a=i.columns[0].sort().asc();i.applySort([a])}this.setState({valuesTable:i})}).catch(i=>{Oe.isCanceled(i)||(mt.error("Unable to open values table",i),this.setState({valuesTableError:i}))})}handleFocusTrapEnd(){var e,t;((e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelector("button,select,input,textarea")).focus()}handleFocusTrapStart(){var e,t,i=(e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelectorAll("button,select,input,textarea");if(i&&i.length>0){var n=i[i.length-1];n.focus()}}handleAddAnd(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(Ie.makeFilterItem()),t=t.concat(ht.and),this.setState({filterItems:e,filterOperators:t})}handleAddOr(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(Ie.makeFilterItem()),t=t.concat(ht.or),this.setState({filterItems:e,filterOperators:t})}handleChangeFilterOperator(e,t){var{filterOperators:i}=this.state;i=[...i],Qa(t),i[e]=t,this.setState({filterOperators:i}),this.startUpdateTimer()}handleFilterChange(e,t,i){var{filterItems:n}=this.state;n=[...n];var{key:a}=n[e];n[e]={key:a,selectedType:t,value:i},this.setState({filterItems:n}),this.startUpdateTimer()}handleFilterDelete(e){var{filterItems:t,filterOperators:i}=this.state;t=[...t],i=[...i],e<t.length&&t.splice(e,1),e<i.length?i.splice(e,1):e===i.length&&i.splice(i.length-1,1),t.length===0&&t.push(Ie.makeFilterItem()),this.setState({filterItems:t,filterOperators:i}),this.startUpdateTimer()}handleSelectValueChange(e,t){this.setState({selectedValues:e,invertSelection:t}),this.startUpdateTimer()}handleReset(){mt.debug("Resetting Advanced Filter"),this.setState({filterItems:[Ie.makeFilterItem()],filterOperators:[],selectedValues:[],invertSelection:!0}),this.startUpdateTimer()}handleSortDown(e){var t=Ae.isModifierKeyDown(e);this.sortTable(T.sortDirection.descending,t)}handleSortUp(e){var t=Ae.isModifierKeyDown(e);this.sortTable(T.sortDirection.ascending,t)}handleSubmit(e){mt.debug("Submitting Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate(),e.preventDefault()}handleDone(e){mt.debug("Submitting and Closing Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate();var{onDone:t}=this.props;t(),e.preventDefault()}handleUpdateTimeout(){this.debounceTimeout=void 0,this.sendUpdate()}shouldShowAddFilter(){var{filterItems:e}=this.state;if(e.length===0)return!1;var t=e[e.length-1],{selectedType:i,value:n}=t;return i!=null&&i.length>0&&n!=null&&n.length>0}sortTable(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{column:i,onSortChange:n}=this.props,{isSortable:a}=this.state;a&&n(i,e,t)}startUpdateTimer(){this.stopUpdateTimer(),this.debounceTimeout=setTimeout(this.handleUpdateTimeout,Ie.debounceFilterUpdate)}stopUpdateTimer(){this.debounceTimeout!==void 0&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=void 0)}sendUpdate(){var{filterItems:e,filterOperators:t,invertSelection:i,selectedValues:n}=this.state,{column:a,onFilterChange:o,model:u,tableUtils:l}=this.props,{formatter:d}=u,c=e.filter(f=>{var{selectedType:C,value:g}=f;return C!=null&&g!=null&&g!==""}),m=t.filter((f,C)=>f!=null&&e[C].selectedType!=null&&e[C].value!=null&&e[C].value!=="").slice(0,c.length-1),p={filterItems:c,filterOperators:m,invertSelection:i,selectedValues:n},h=l.makeAdvancedFilter(a,p,d.timeZone);o(a,h,p)}render(){var e=this,{column:t,model:i,sortDirection:n,formatter:a,tableUtils:o}=this.props,{filterItems:u,filterOperators:l,invertSelection:d,selectedValues:c,valuesTable:m,valuesTableError:p,isSortable:h}=this.state,{dh:f,isValuesTableAvailable:C}=i,g=T.isBooleanType(t.type),F=T.isDateType(t.type),w=this.getFilterTypes(t.type),v=t.type.substring(t.type.lastIndexOf(".")+1),N=[];if(!g&&w.length)for(var A=function(G){var z=u[G],{key:M,selectedType:oe,value:X}=z,le=s.jsx(_o,{column:t,filterTypes:w,onChange:e.getFilterChangeHandler(G),onDelete:e.getFilterDeleteHandler(G),selectedType:oe,value:X,formatter:a,tableUtils:o},M);if(N.push(le),G<l.length){var _e=l[G],Le=_e===ht.and,Ge=s.jsxs("div",{className:"form-row justify-content-end advanced-filter-creator-filter-operator",children:[s.jsx(W,{kind:"ghost",className:Y("filter-operator",{active:Le}),onClick:()=>e.handleChangeFilterOperator(G,ht.and),children:"AND"}),s.jsx(W,{kind:"ghost",className:Y("filter-operator",{active:!Le}),onClick:()=>e.handleChangeFilterOperator(G,ht.or),children:"OR"})]},"filterOperator".concat(M));N.push(Ge)}},E=0;E<u.length;E+=1)A(E);var O=this.shouldShowAddFilter(),D=s.jsxs("div",{className:Y("form-row justify-content-end add-filter-item",{hidden:!O}),children:[s.jsx("span",{className:"text-muted",children:s.jsx(Z,{icon:Ri})}),s.jsx(W,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddAnd,disabled:!O,tooltip:"Add filter with AND",children:"AND"}),s.jsx(W,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddOr,disabled:!O,tooltip:"Add filter with OR",children:"OR"})]},"addFilterItem");return N.push(D),s.jsxs("div",{className:"advanced-filter-creator",role:"presentation",children:[s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapStart}),s.jsxs("form",{onSubmit:this.handleSubmit,ref:this.focusTrapContainer,children:[s.jsxs("div",{className:"title-bar",children:[s.jsx("h6",{className:"advanced-filter-title",children:"Advanced Filters"}),s.jsxs("div",{className:"advanced-filter-menu-buttons",children:[s.jsx(W,{kind:"ghost",className:Y("sort-operator",{active:n===T.sortDirection.descending}),onClick:this.handleSortDown,icon:mr,tooltip:h?"Sort ".concat(t.name," Descending"):"Not sortable",disabled:!h}),s.jsx(W,{kind:"ghost",className:Y("sort-operator",{active:n===T.sortDirection.ascending}),onClick:this.handleSortUp,icon:s.jsx(Z,{icon:mr,rotation:180}),tooltip:h?"Sort ".concat(t.name," Ascending"):"Not sortable",disabled:!h})]})]}),s.jsx("hr",{}),s.jsxs("div",{className:"advanced-filter-column-name",children:[t.name," ",s.jsxs("span",{className:"column-type",children:["(",v,")"]})]}),N,C&&p==null&&s.jsxs(s.Fragment,{children:[!g&&s.jsx("hr",{}),s.jsx("div",{className:"form-group",children:s.jsx(Uo,{dh:f,table:m,onChange:this.handleSelectValueChange,invertSelection:d,selectedValues:c,formatter:a,showSearch:!F,timeZone:a.timeZone})})]}),s.jsxs("div",{className:"form-row justify-content-end",children:[s.jsx(W,{kind:"secondary",className:"mr-2",onClick:this.handleReset,children:"Reset"}),s.jsx(W,{kind:"primary",onClick:this.handleDone,children:"Done"})]})]}),s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapEnd})]})}}it(Ie,"debounceFilterUpdate",250);it(Ie,"defaultProps",{options:{filterItems:null,filterOperators:null,invertSelection:!0,selectedValues:[]},sortDirection:null});const Go=Ie;function Mo(r,e){var t=$o(r);if(t!==void 0){var i=qo(r);return"".concat(i," ? ").concat(t," : ").concat(e)}}function Vo(r,e){return r.Column.formatRowColor(e)}function Bo(r,e){return r.formatColor(e)}var Tt=ce.module("ConditionalFormattingUtils"),Ce;(function(r){r.CONDITIONAL="conditional",r.ROWS="rows"})(Ce||(Ce={}));var P;(function(r){r.IS_EQUAL="is-equal",r.IS_NOT_EQUAL="is-not-equal",r.IS_BETWEEN="is-between",r.GREATER_THAN="greater-than",r.GREATER_THAN_OR_EQUAL="greater-than-or-equal",r.LESS_THAN="less-than",r.LESS_THAN_OR_EQUAL="less-than-or-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(P||(P={}));var B;(function(r){r.IS_EXACTLY="is-exactly",r.IS_NOT_EXACTLY="is-not-exactly",r.CONTAINS="contains",r.DOES_NOT_CONTAIN="does-not-contain",r.STARTS_WITH="starts-with",r.ENDS_WITH="ends-with",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(B||(B={}));var k;(function(r){r.IS_EXACTLY="is-exactly",r.IS_NOT_EXACTLY="is-not-exactly",r.IS_BEFORE="is-before",r.IS_BEFORE_OR_EQUAL="is-before-or-equal",r.IS_AFTER="is-after",r.IS_AFTER_OR_EQUAL="is-after-or-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(k||(k={}));var ne;(function(r){r.IS_TRUE="is-true",r.IS_FALSE="is-false",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(ne||(ne={}));var ee;(function(r){r.IS_EQUAL="is-equal",r.IS_NOT_EQUAL="is-not-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(ee||(ee={}));var $;(function(r){r.NO_FORMATTING="no-formatting",r.POSITIVE="positive",r.NEGATIVE="negative",r.WARN="warn",r.NEUTRAL="neutral",r.ACCENT_1="accent-1",r.ACCENT_2="accent-2",r.CUSTOM="custom"})($||($={}));function yr(r){switch(r){case $.NO_FORMATTING:return"No formatting";case $.POSITIVE:return"Positive";case $.NEGATIVE:return"Negative";case $.WARN:return"Warn";case $.NEUTRAL:return"Neutral";case $.ACCENT_1:return"Accent 1";case $.ACCENT_2:return"Accent 2";case $.CUSTOM:return"Custom..."}}function Ut(r){var{type:e,customConfig:t}=r;switch(e){case $.NO_FORMATTING:return;case $.POSITIVE:return"#9fde6f";case $.NEGATIVE:return"#ff6087";case $.WARN:return"#f67f40";case $.NEUTRAL:return"#ffd95c";case $.ACCENT_1:return"#78dce8";case $.ACCENT_2:return"#ab9bf5";case $.CUSTOM:return t?.background;default:return}}function jt(r){var{type:e,customConfig:t}=r;switch(e){case $.NO_FORMATTING:return;case $.POSITIVE:return"#526a3f";case $.NEGATIVE:return"#802f44";case $.WARN:return"#663318";case $.NEUTRAL:return"#63562b";case $.ACCENT_1:return"#3f6469";case $.ACCENT_2:return"#554d72";case $.CUSTOM:return t?.color;default:return}}function $o(r){var e=jt(r.style),t=Ut(r.style);if(!(e===void 0||t===void 0))return"bgfg(`".concat(t,"`, `").concat(e,"`)")}function Qo(r){var{column:e,value:t,start:i,end:n}=r;return os(e.name,r.condition,t,i,n)}function Ho(r){var{column:e,value:t}=r;return ss(e.name,r.condition,t)}function Wo(r){var{column:e,value:t}=r;return ls(e.name,r.condition,t)}function Ko(r){var{column:e}=r;return us(e.name,r.condition)}function Yo(r){var{column:e,value:t}=r;return ds(e.name,r.condition,t)}function qo(r){var{column:e}=r;if(T.isNumberType(e.type))return Qo(r);if(T.isCharType(e.type))return Yo(r);if(T.isStringType(e.type))return Ho(r);if(T.isDateType(e.type))return Wo(r);if(T.isBooleanType(e.type))return Ko(r);throw new Error("Invalid column type")}function zo(r){switch(r){case P.IS_EQUAL:return"is equal to";case P.IS_NOT_EQUAL:return"is not equal to";case P.IS_BETWEEN:return"is between";case P.GREATER_THAN:return"greater than";case P.GREATER_THAN_OR_EQUAL:return"greater than or equal to";case P.LESS_THAN:return"less than";case P.LESS_THAN_OR_EQUAL:return"less than or equal to";case P.IS_NULL:return"is null";case P.IS_NOT_NULL:return"is not null"}}function Xo(r){switch(r){case B.IS_EXACTLY:return"is exactly";case B.IS_NOT_EXACTLY:return"is not exactly";case B.CONTAINS:return"contains";case B.DOES_NOT_CONTAIN:return"does not contain";case B.STARTS_WITH:return"starts with";case B.ENDS_WITH:return"ends with";case B.IS_NULL:return"is null";case B.IS_NOT_NULL:return"is not null"}}function Zo(r){switch(r){case k.IS_EXACTLY:return"is";case k.IS_NOT_EXACTLY:return"is not";case k.IS_BEFORE:return"is before";case k.IS_BEFORE_OR_EQUAL:return"is before or equal";case k.IS_AFTER:return"is after";case k.IS_AFTER_OR_EQUAL:return"is after or equal";case k.IS_NULL:return"is null";case k.IS_NOT_NULL:return"is not null"}}function Jo(r){switch(r){case ne.IS_TRUE:return"is true";case ne.IS_FALSE:return"is false";case ne.IS_NULL:return"is null";case ne.IS_NOT_NULL:return"is not null"}}function es(r){switch(r){case ee.IS_EQUAL:return"is";case ee.IS_NOT_EQUAL:return"is not";case ee.IS_NULL:return"is null";case ee.IS_NOT_NULL:return"is not null"}}function Zr(r){if(T.isNumberType(r))return P.IS_EQUAL;if(T.isCharType(r))return ee.IS_EQUAL;if(T.isStringType(r))return B.IS_EXACTLY;if(T.isDateType(r))return k.IS_EXACTLY;if(T.isBooleanType(r))return ne.IS_TRUE;throw new Error("Invalid column type")}function Jr(r){if(T.isCharType(r)||T.isStringType(r))return""}function en(r){var{condition:e,value:t,start:i,end:n}=r;return{condition:e,value:t,start:i,end:n}}function Mt(r){return{condition:Zr(r),value:Jr(r),start:void 0,end:void 0}}function tn(){return{type:$.NO_FORMATTING}}function ts(r){switch(r){case B.IS_EXACTLY:return"==";case B.IS_NOT_EXACTLY:return"!=";case B.CONTAINS:return"contains";case B.DOES_NOT_CONTAIN:return"does not contain";case B.STARTS_WITH:return"starts with";case B.ENDS_WITH:return"ends with";case B.IS_NULL:return"is null";case B.IS_NOT_NULL:return"is not null"}}function is(r){switch(r){case k.IS_EXACTLY:return"==";case k.IS_NOT_EXACTLY:return"!=";case k.IS_BEFORE:return"<";case k.IS_BEFORE_OR_EQUAL:return"<=";case k.IS_AFTER:return">";case k.IS_AFTER_OR_EQUAL:return">=";case k.IS_NULL:return"is null";case k.IS_NOT_NULL:return"is not null"}}function rs(r){switch(r){case ne.IS_TRUE:return"is true";case ne.IS_FALSE:return"is false";case ne.IS_NULL:return"is null";case ne.IS_NOT_NULL:return"is not null"}}function ns(r){switch(r){case ee.IS_EQUAL:return"==";case ee.IS_NOT_EQUAL:return"!=";case ee.IS_NULL:return"is null";case ee.IS_NOT_NULL:return"is not null"}}function as(r){switch(r){case P.IS_EQUAL:return"==";case P.IS_NOT_EQUAL:return"!=";case P.IS_BETWEEN:return"==";case P.GREATER_THAN:return">";case P.GREATER_THAN_OR_EQUAL:return">=";case P.LESS_THAN:return"<";case P.LESS_THAN_OR_EQUAL:return"<=";case P.IS_NULL:return"is null";case P.IS_NOT_NULL:return"is not null"}}function os(r,e,t,i,n){switch(e){case P.IS_EQUAL:return"".concat(r," == ").concat(t);case P.IS_NOT_EQUAL:return"".concat(r," != ").concat(t);case P.IS_BETWEEN:return"".concat(r," > ").concat(i," && ").concat(r," < ").concat(n);case P.GREATER_THAN:return"".concat(r," > ").concat(t);case P.GREATER_THAN_OR_EQUAL:return"".concat(r," >= ").concat(t);case P.LESS_THAN:return"".concat(r," < ").concat(t);case P.LESS_THAN_OR_EQUAL:return"".concat(r," <= ").concat(t);case P.IS_NULL:return"".concat(r," == null");case P.IS_NOT_NULL:return"".concat(r," != null")}}function ss(r,e,t){switch(e){case B.IS_EXACTLY:return"".concat(r,' == "').concat(t,'"');case B.IS_NOT_EXACTLY:return"".concat(r,' != "').concat(t,'"');case B.CONTAINS:return"".concat(r," != null && ").concat(r,'.contains("').concat(t,'")');case B.DOES_NOT_CONTAIN:return"".concat(r," != null && !").concat(r,'.contains("').concat(t,'")');case B.STARTS_WITH:return"".concat(r," != null && ").concat(r,'.startsWith("').concat(t,'")');case B.ENDS_WITH:return"".concat(r," != null && ").concat(r,'.endsWith("').concat(t,'")');case B.IS_NULL:return"".concat(r," == null");case B.IS_NOT_NULL:return"".concat(r," != null")}}function ls(r,e,t){switch(e){case k.IS_EXACTLY:return"".concat(r,' == convertDateTime("').concat(t,'")');case k.IS_NOT_EXACTLY:return"".concat(r," != convertDateTime(`").concat(t,"`)");case k.IS_BEFORE:return"".concat(r," < convertDateTime(`").concat(t,"`)");case k.IS_BEFORE_OR_EQUAL:return"".concat(r,' <= convertDateTime("').concat(t,'")');case k.IS_AFTER:return"".concat(r," > convertDateTime(`").concat(t,"`)");case k.IS_AFTER_OR_EQUAL:return"".concat(r," >= convertDateTime(`").concat(t,"`)");case k.IS_NULL:return"".concat(r," == null");case k.IS_NOT_NULL:return"".concat(r," != null")}}function us(r,e){switch(e){case ne.IS_TRUE:return"".concat(r," == true");case ne.IS_FALSE:return"".concat(r," == false");case ne.IS_NULL:return"".concat(r," == null");case ne.IS_NOT_NULL:return"".concat(r," != null")}}function ds(r,e,t){switch(e){case ee.IS_EQUAL:return"".concat(r," == '").concat(t,"'");case ee.IS_NOT_EQUAL:return"".concat(r," != '").concat(t,"'");case ee.IS_NULL:return"isNull(".concat(r,")");case ee.IS_NOT_NULL:return"!isNull(".concat(r,")")}}function cs(r,e){if(T.isNumberType(r))return as(e);if(T.isCharType(r))return ns(e);if(T.isStringType(r))return ts(e);if(T.isDateType(r))return is(e);if(T.isBooleanType(r))return rs(e);throw new Error("Invalid column type")}function hs(r,e,t){if(t===void 0)return Tt.debug("no rules passed."),[];var i=[],n,a=new Map;return t.forEach(o=>{var u,{config:l,type:d}=o,{column:c}=l,m=e.find(F=>{var{name:w,type:v}=F;return w===c.name&&v===c.type});if(m===void 0){Tt.debug("Column ".concat(c.name,":").concat(c.type," not found. Ignoring format rule."),l);return}var[p,h]=(u=d===Ce.CONDITIONAL?a.get(m.name):n)!==null&&u!==void 0?u:["null",void 0],f=Mo(l,p);if(f===void 0){Tt.debug("Ignoring format rule.",l);return}var C=h===void 0?-1:i.indexOf(h);C>-1&&i.splice(C,1);var g=d===Ce.CONDITIONAL?Bo(m,f):Vo(r,f);i.push(g),d===Ce.CONDITIONAL?a.set(m.name,[f,g]):n=[f,g]}),i}function ms(r,e,t){switch(e){case k.IS_NULL:case k.IS_NOT_NULL:return!0;default:{var[i,...n]=(t??"").split(" "),a=n.join(" ");try{Di.parseDateTimeString(i)}catch{return Tt.debug("Invalid datetime string",i),!1}try{r.i18n.TimeZone.getTimeZone(a)}catch{return Tt.debug("Invalid timezone string",a),!1}return!0}}}function ps(r){var{type:e}=r;return T.isNumberType(e)||T.isCharType(e)||T.isStringType(e)||T.isDateType(e)||T.isBooleanType(e)}function Vt(r){var{animation:e="iris-grid-bottom-bar-slide-up",children:t,className:i,isShown:n,onClick:a,onEntering:o,onEntered:u,onExiting:l,onExited:d}=r;return s.jsx(Ei,{in:n,timeout:yi.transitionMs,classNames:e,onEntering:o,onEntered:u,onExiting:l,onExited:d,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:Y("iris-grid-bottom-bar",i),role:"presentation",onClick:a,onKeyPress:a,children:t})})}var gs=3e3,vs=5;function fs(r){var{isSaving:e=!1,onSave:t,onDiscard:i,discardTooltip:n,saveTooltip:a,error:o,pendingDataErrors:u,pendingDataMap:l,onEntering:d,onEntered:c,onExiting:m,onExited:p}=r,[h,f]=y.useState(!1),[C,g]=y.useState(!1),F=y.useRef(),w=Hr(e),v=y.useMemo(()=>u.size===0?o:u.size<=vs?"Key can't be empty (on pending row".concat(u.size>1?"s":""," ").concat(Array.from(u.keys()).join(", ").trim(),")"):"Key can't be empty (on ".concat(u.size," rows)"),[o,u]);y.useEffect(function(){w!=null&&w&&!e&&v==null&&(f(!0),g(!0),F.current=setTimeout(()=>{f(!1)},gs))},[v,e,w]),y.useEffect(function(){F.current&&l.size>0&&(clearTimeout(F.current),f(!1),g(!1))},[l]),y.useEffect(function(){return()=>F.current?clearTimeout(F.current):void 0},[]);var N=l.size,A;return e?A=s.jsx(kt,{className:"loading-spinner-vertical-align"}):C&&(A=ua),s.jsxs(Vt,{className:"pending-data-bottom-bar",isShown:N>0||h||v!=null,onEntering:d,onEntered:c,onExiting:m,onExited:()=>{g(!1),p&&p()},children:[v!=null&&v!==""&&s.jsxs("div",{className:"error-message",children:[s.jsx(Z,{icon:la}),s.jsx("span",{children:"".concat(v)})]}),(v==null||v==="")&&s.jsx("div",{className:"status-message",children:N>0&&s.jsx("span",{children:"".concat(N," row").concat(N>1?"s":""," pending")})}),s.jsxs("div",{className:"buttons-container",children:[!e&&!C&&s.jsx(W,{kind:"secondary",onClick:i,tooltip:n,children:"Discard"}),s.jsxs(W,{kind:C?"success":"primary",onClick:t,icon:A,disabled:e||C||v!=null,tooltip:a,children:[e&&"Committing...",!e&&C&&"Success",!e&&!C&&"Commit"]})]})]})}function wr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function pi(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){wr(a,i,n,o,u,"next",l)}function u(l){wr(a,i,n,o,u,"throw",l)}o(void 0)})}}function Qe(r,e,t){return e=Cs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cs(r){var e=Ss(r,"string");return typeof e=="symbol"?e:String(e)}function Ss(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var me=ce.module("IrisGridCopyHandler");function Ts(r){return r.ranges!=null}function bs(r){return r.columnIndex!=null}class V extends y.Component{static getStatusMessageText(e,t){switch(e){case V.COPY_STATES.CONFIRMATION_REQUIRED:return"Are you sure you want to copy ".concat(t.toLocaleString()," rows to your clipboard?");case V.COPY_STATES.CLICK_REQUIRED:return"Fetched ".concat(t.toLocaleString()," rows!");case V.COPY_STATES.FETCH_ERROR:return"Unable to copy data.";case V.COPY_STATES.FETCH_RANGES_IN_PROGRESS:return"Fetching ".concat(t.toLocaleString()," rows for clipboard...");case V.COPY_STATES.FETCH_HEADER_IN_PROGRESS:return"Fetching header for clipboard...";case V.COPY_STATES.DONE:return"Copied to Clipboard!";default:return""}}static getCopyButtonText(e){switch(e){case V.BUTTON_STATES.FETCH_IN_PROGRESS:return"Fetching";case V.BUTTON_STATES.CLICK_TO_COPY:return"Click to Copy";case V.BUTTON_STATES.RETRY:return"Retry";default:return"Copy"}}constructor(e){super(e),Qe(this,"textData",void 0),Qe(this,"hideTimer",void 0),Qe(this,"fetchPromise",void 0),this.handleBackgroundClick=this.handleBackgroundClick.bind(this),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleCopyClick=this.handleCopyClick.bind(this),this.handleHideTimeout=this.handleHideTimeout.bind(this),this.state={error:void 0,copyState:V.COPY_STATES.IDLE,buttonState:V.BUTTON_STATES.COPY,isShown:!1,rowCount:0}}componentDidMount(){var{copyOperation:e}=this.props;e!=null&&this.startCopy()}componentDidUpdate(e){var{copyOperation:t}=this.props;e.copyOperation!==t&&this.startCopy()}componentWillUnmount(){this.stopCopy()}startCopy(){me.debug2("startCopy"),this.stopCopy();var{copyOperation:e}=this.props;if(e==null){me.debug2("No copy operation set, cancelling out"),this.setState({isShown:!1});return}var{error:t}=e;if(t!=null){me.debug("Showing copy error",t),this.setState({isShown:!0,copyState:V.COPY_STATES.DONE,error:t}),this.startHideTimer();return}if(this.setState({isShown:!0,error:void 0}),Ts(e)){var{ranges:i}=e,n=Fe.rowCount(i);if(this.setState({rowCount:n}),n>V.NO_PROMPT_THRESHOLD){this.setState({buttonState:V.BUTTON_STATES.COPY,copyState:V.COPY_STATES.CONFIRMATION_REQUIRED});return}}this.startFetch()}stopCopy(){this.textData=void 0,this.stopFetch(),this.stopHideTimer()}handleBackgroundClick(){me.debug2("handleBackgroundClick");var{copyState:e}=this.state;e===V.COPY_STATES.DONE&&this.setState({isShown:!1})}handleCancelClick(){me.debug2("handleCancelClick"),this.stopFetch(),this.setState({isShown:!1})}handleCopyClick(){var e=this;return pi(function*(){if(me.debug2("handleCopyClick"),e.textData!=null)try{yield e.copyText(e.textData),e.showCopyDone()}catch(t){me.error("Error copying text",t),e.setState({error:"Unable to copy. Verify your browser permissions."})}else e.startFetch()})()}handleHideTimeout(){me.debug2("handleHideTimeout"),this.stopHideTimer(),this.setState({isShown:!1})}copyText(e){var t=this;return pi(function*(){me.debug2("copyText",e),t.textData=e,yield Ii(e)})()}showCopyDone(){this.setState({copyState:V.COPY_STATES.DONE}),this.startHideTimer()}startFetch(){var e=this;return pi(function*(){e.stopFetch();var{model:t,copyOperation:i}=e.props;if(bs(i)){var{columnIndex:n,columnDepth:a,movedColumns:o}=i;me.debug("startFetch copyHeader",n,a),e.setState({buttonState:V.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:V.COPY_STATES.FETCH_HEADER_IN_PROGRESS});var u=ve.getModelIndex(n,o),l=t.textForColumnHeader(u,a);if(l===void 0){e.fetchPromise=void 0,e.setState({error:"Invalid column header selected.",copyState:V.COPY_STATES.DONE});return}e.fetchPromise=Oe.makeCancelable(l)}else{var{ranges:d,includeHeaders:c,userColumnWidths:m,movedColumns:p,formatValues:h}=i;me.debug("startFetch copyRanges",d),e.setState({buttonState:V.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:V.COPY_STATES.FETCH_RANGES_IN_PROGRESS});var f=ie.getHiddenColumns(m),C=ve.getModelRanges(d,p);if(f.length>0){var g=f.map(Fe.makeColumn);C=Fe.subtractRangesFromRanges(C,g)}var F=h!=null&&h?(v,N)=>t.displayString(v,N.type,N.name):v=>"".concat(v);e.fetchPromise=Oe.makeCancelable(t.textSnapshot(C,c,F))}try{var w=yield e.fetchPromise;e.fetchPromise=void 0;try{yield e.copyText(w),e.showCopyDone()}catch(v){me.error("Error copying text",v),e.setState({buttonState:V.BUTTON_STATES.CLICK_TO_COPY,copyState:V.COPY_STATES.CLICK_REQUIRED})}}catch(v){v instanceof Ha?me.debug("User cancelled copy."):(me.error("Error fetching contents",v),e.fetchPromise=void 0,e.setState({buttonState:V.BUTTON_STATES.RETRY,copyState:V.COPY_STATES.FETCH_ERROR}))}})()}stopFetch(){this.fetchPromise&&(me.debug2("stopFetch"),this.fetchPromise.cancel(),this.fetchPromise=void 0)}startHideTimer(){this.stopHideTimer(),this.hideTimer=setTimeout(this.handleHideTimeout,V.HIDE_TIMEOUT)}stopHideTimer(){this.hideTimer!=null&&(clearTimeout(this.hideTimer),this.hideTimer=void 0)}render(){var{onEntering:e,onEntered:t,onExiting:i,onExited:n}=this.props,{buttonState:a,copyState:o,isShown:u,rowCount:l,error:d}=this.state,c=o===V.COPY_STATES.DONE?"fade":"copy-slide-up",m=V.getCopyButtonText(a),p=d??V.getStatusMessageText(o,l),h=o!==V.COPY_STATES.DONE,f=a===V.BUTTON_STATES.FETCH_IN_PROGRESS,C=o===V.COPY_STATES.DONE;return s.jsxs(Vt,{animation:c,isShown:u,className:Y("iris-grid-copy-handler",{"copy-done":C}),onClick:this.handleBackgroundClick,onEntering:e,onEntered:t,onExiting:i,onExited:n,children:[s.jsx("div",{className:"status-message",children:s.jsx("span",{children:p})}),s.jsx(xi,{in:h,mountOnEnter:!0,unmountOnExit:!0,children:s.jsxs("div",{className:"buttons-container",children:[s.jsx("button",{type:"button",className:"btn btn-outline-secondary btn-cancel",onClick:this.handleCancelClick,children:"Cancel"}),s.jsxs(W,{kind:f?"tertiary":"primary",className:Y("btn-copy",{"btn-spinner":f}),onClick:this.handleCopyClick,disabled:f,children:[f&&s.jsx(kt,{className:"loading-spinner-vertical-align"}),m]})]})})]})}}Qe(V,"NO_PROMPT_THRESHOLD",1e4);Qe(V,"HIDE_TIMEOUT",3e3);Qe(V,"COPY_STATES",{IDLE:"IDLE",CONFIRMATION_REQUIRED:"CONFIRMATION_REQUIRED",FETCH_RANGES_IN_PROGRESS:"FETCH_RANGES_IN_PROGRESS",FETCH_HEADER_IN_PROGRESS:"FETCH_HEADER_IN_PROGRESS",FETCH_ERROR:"FETCH_ERROR",CLICK_REQUIRED:"CLICK_REQUIRED",DONE:"DONE"});Qe(V,"BUTTON_STATES",{COPY:"COPY",FETCH_IN_PROGRESS:"FETCH_IN_PROGRESS",CLICK_TO_COPY:"CLICK_TO_COPY",RETRY:"RETRY"});Qe(V,"defaultProps",{copyOperation:null,onEntering:()=>{},onEntered:()=>{},onExiting:()=>{},onExited:()=>{}});const Es=V;function It(r,e,t){return e=ys(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ys(r){var e=ws(r,"string");return typeof e=="symbol"?e:String(e)}function ws(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class rn extends y.PureComponent{constructor(e){super(e),It(this,"inputField",void 0),It(this,"initialValue",void 0),It(this,"debouncedSendUpdate",void 0);var{debounceMs:t}=e;this.debouncedSendUpdate=rt(this.sendUpdate.bind(this),t),this.handleCancel=this.handleCancel.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCommit=this.handleCommit.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.inputField=null;var{value:i}=e;this.initialValue=i,this.state={isChanged:!1,value:i}}componentDidMount(){var e;(e=this.inputField)===null||e===void 0||e.focus()}componentDidUpdate(e){var{debounceMs:t}=this.props;e.debounceMs!==t&&(this.debouncedSendUpdate.flush(),this.debouncedSendUpdate=rt(this.sendUpdate.bind(this),t))}componentWillUnmount(){this.debouncedSendUpdate.cancel()}setValue(e){this.initialValue=e,this.setState({value:e})}focus(){var e;(e=this.inputField)===null||e===void 0||e.focus()}handleChange(e){var{value:t}=e.target;this.setState({value:t,isChanged:!0}),this.debouncedSendUpdate(t)}handleCancel(){this.debouncedSendUpdate.cancel();var{initialValue:e}=this,{isChanged:t}=this.state;t&&this.sendUpdate(e);var{onDone:i}=this.props;i()}handleCommit(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.debouncedSendUpdate.flush();var{onDone:i}=this.props;i(e,t)}handleFocus(){var e;(e=this.inputField)===null||e===void 0||e.select()}handleBlur(e){var{relatedTarget:t}=e;t!=null&&t.classList.contains("context-menu-container")?this.handleCommit(!1,!0):t!=null&&t.classList.contains("advanced-filter-button")?this.handleCommit(!1,!1):this.handleCommit(!0,!0)}handleTab(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.debouncedSendUpdate.flush();var{onTab:t}=this.props;t(e)}handleKeyDown(e){switch(e.key){case"Escape":e.stopPropagation(),e.preventDefault(),this.handleCancel();break;case"Enter":e.stopPropagation(),e.preventDefault(),this.handleCommit();break;case"Tab":e.stopPropagation(),e.preventDefault(),this.handleTab(e.shiftKey);break}}handleContextMenu(e){var{onContextMenu:t}=this.props;t(e)}sendUpdate(e){var{onChange:t}=this.props;t(e)}render(){var{className:e,style:t,isAdvancedFilterSet:i,onAdvancedFiltersTriggered:n}=this.props,{value:a}=this.state;return s.jsxs("div",{style:t,className:"iris-grid-input-autosized-wrapper","data-value":a,children:[s.jsx("input",{ref:o=>{this.inputField=o},className:Y("iris-grid-input-field",e),type:"text",value:a,onBlur:this.handleBlur,onFocus:this.handleFocus,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onContextMenu:this.handleContextMenu,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"}),s.jsx("div",{className:"advanced-filter-button-container",children:s.jsx(W,{kind:"ghost",className:Y("btn-link-icon advanced-filter-button",{"filter-set":i}),onClick:n,onContextMenu:this.handleContextMenu,children:s.jsxs("div",{className:"fa-layers ",children:[s.jsx(Z,{icon:_i,className:"filter-solid"}),s.jsx(Z,{icon:Pt,className:"filter-light"})]})})})]})}}It(rn,"defaultProps",{style:{},className:"",value:"",isAdvancedFilterSet:!1,onAdvancedFiltersTriggered:()=>{},onChange:()=>{},onDone:()=>{},onTab:()=>{},onContextMenu:()=>{},debounceMs:150});const Fs=rn;function Ns(r,e,t){return e=Os(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Os(r){var e=As(r,"string");return typeof e=="symbol"?e:String(e)}function As(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Rs extends Gt{constructor(e){super(),Ns(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onDown(e,t){if(e.altKey&&!Ae.isModifierKeyDown(e)&&!e.shiftKey){var{mouseX:i,mouseY:n}=t.state;if(i==null||n==null)return!1;var a=t.getGridPointFromXY(i,n);if(a.column!=null&&a.row!=null)return this.cursor=this.irisGrid.props.copyCursor,!0}return!1}onUp(e,t){return this.cursor===this.irisGrid.props.copyCursor?(this.cursor=null,!0):!1}}const _s=Rs;function xs(r,e,t){return e=Ds(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ds(r){var e=Is(r,"string");return typeof e=="symbol"?e:String(e)}function Is(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ps extends Gt{constructor(e){super(),xs(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{selectedRanges:t}=this.irisGrid.state;return e.key==="c"&&Ae.isModifierKeyDown(e)?(ie.isValidSnapshotRanges(t)?this.irisGrid.copyRanges(t):this.irisGrid.copyRanges(t,!1,!1,"Invalid copy ranges"),!0):!1}}const Ls=Ps;function Us(r,e,t){return e=js(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function js(r){var e=ks(r,"string");return typeof e=="symbol"?e:String(e)}function ks(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Gs extends Gt{constructor(e){super(),Us(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){if(Ne.TABLE.REVERSE.matchesEvent(e)){if(!this.irisGrid.isReversible())return!1;var{reverseType:t}=this.irisGrid.state;return t===T.REVERSE_TYPE.NONE?this.irisGrid.reverse(T.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(T.REVERSE_TYPE.NONE),!0}return!1}}const Ms=Gs;function Vs(r,e,t){return e=Bs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Bs(r){var e=$s(r,"string");return typeof e=="symbol"?e:String(e)}function $s(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qs extends Gt{constructor(e){super(),Vs(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){return Ne.TABLE.CLEAR_FILTERS.matchesEvent(e)?(this.irisGrid.clearAllFilters(),!0):!1}}const Hs=Qs;function Ws(r,e,t){return e=Ks(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ks(r){var e=Ys(r,"string");return typeof e=="symbol"?e:String(e)}function Ys(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class qs extends Re{constructor(e){super(850),Ws(this,"irisGrid",void 0),this.irisGrid=e}destroyColumnTooltip(){this.irisGrid.setState({overflowButtonTooltipProps:null})}setCursor(e){return this.isHoveringOverflowButton(e)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:t,y:i,column:n,row:a}=e;if(n==null||a==null)return null;var{renderer:o,grid:u,state:l,props:d}=this.irisGrid;if(!u)return null;var{metrics:c}=l,{model:m}=d,{canvasContext:p}=u,h=u.getTheme(),f={context:p,mouseX:t,mouseY:i,metrics:c,model:m,theme:h},{left:C,top:g,width:F,height:w}=o.getCellOverflowButtonPosition(f);return C==null||F==null||g==null||w==null?null:{left:C,top:g,width:F,height:w}}isHoveringOverflowButton(e){var t,{x:i,y:n}=e,{left:a,top:o,width:u,height:l}=(t=this.getButtonPosition(e))!==null&&t!==void 0?t:{};if(a==null||u==null||o==null||l==null)return!1;var{renderer:d,grid:c,state:m,props:p}=this.irisGrid;if(!c)return!1;var{metrics:h}=m,{model:f}=p,{canvasContext:C}=c,g=c.getTheme(),F={context:C,mouseX:i,mouseY:n,metrics:h,model:f,theme:g};return d.shouldRenderOverflowButton(F)&&i>=a&&i<=a+u&&n>=o&&n<=o+l}onMove(e){if(this.isHoveringOverflowButton(e)){var{overflowButtonTooltipProps:t}=this.irisGrid.state,i=this.getButtonPosition(e);De(t,i)||this.irisGrid.setState({overflowButtonTooltipProps:i})}else this.destroyColumnTooltip();return this.setCursor(e)}onWheel(e){return this.destroyColumnTooltip(),this.onMove(e)}onDown(e){this.destroyColumnTooltip();var{column:t,row:i}=e;return this.isHoveringOverflowButton(e)&&this.irisGrid.setState({showOverflowModal:!0,overflowText:this.irisGrid.getValueForCell(t,i)}),!1}onContextMenu(){return this.destroyColumnTooltip(),!1}onLeave(){return this.destroyColumnTooltip(),!1}}const zs=qs;function Xs(r,e,t){return e=Zs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Zs(r){var e=Js(r,"string");return typeof e=="symbol"?e:String(e)}function Js(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class el extends Re{constructor(e){super(),Xs(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}isActive(){var{isSelectingColumn:e}=this.irisGrid.props;return e}isValidColumn(e){if(e==null||e.isProxy===!0)return!1;var{columnSelectionValidator:t}=this.irisGrid.props;return t!=null?t(e):!0}updateColumnSelectionStatus(){var{columnSelectionValidator:e}=this.irisGrid.props;e?.(null)}getTableColumn(e){if(e==null)return null;var{model:t}=this.irisGrid.props,i=this.irisGrid.getModelColumn(e);return i==null?null:t.columns[i]}onMove(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:i}=this.irisGrid.props,{column:n}=e,a=this.getTableColumn(n);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:n})):(this.cursor=i,this.irisGrid.setState({hoverSelectColumn:null})),!0}onWheel(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:i}=this.irisGrid.props,{column:n}=e,a=this.getTableColumn(n);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:n})):(this.cursor=i,this.irisGrid.setState({hoverSelectColumn:null})),{preventDefault:!1,stopPropagation:!1}}onLeave(){return this.isActive()&&this.irisGrid.setState({hoverSelectColumn:null}),this.updateColumnSelectionStatus(),!1}onDown(){return this.isActive()}onClick(e){if(!this.isActive())return!1;var{column:t}=e,i=this.getTableColumn(t);return i!=null&&this.isValidColumn(i)&&this.irisGrid.selectColumn(i),!0}}const tl=el;function il(r,e,t){return e=rl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rl(r){var e=nl(r,"string");return typeof e=="symbol"?e:String(e)}function nl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class al extends Re{constructor(e){super(),il(this,"irisGrid",void 0),this.irisGrid=e}hideColumnTooltip(){var{tooltip:e}=this.irisGrid;e&&(e.stopTimer(),e.hide())}onDown(){return this.hideColumnTooltip(),!1}onContextMenu(){return this.hideColumnTooltip(),!1}onWheel(){return this.hideColumnTooltip(),!1}onLeave(e,t,i){var{relatedTarget:n}=i instanceof MouseEvent?i:i.nativeEvent,{tooltip:a}=this.irisGrid;if(!a)return!1;var o=a.popper.current;return o&&n instanceof Element&&o.element.contains(n)||this.hideColumnTooltip(),!1}onMove(e){var{column:t,row:i,columnHeaderDepth:n}=e,{shownColumnTooltip:a}=this.irisGrid.state,o=null;return t!==null&&i===null&&n===0&&(o=t),o!==a&&this.irisGrid.setState({shownColumnTooltip:o}),!1}}const ol=al;function nn(r,e,t){return e=sl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sl(r){var e=ll(r,"string");return typeof e=="symbol"?e:String(e)}function ll(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Bt extends y.Component{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bt.defaultProps;super(e),nn(this,"inputRef",void 0),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.inputRef=ke.createRef()}handleInputChange(){var{onChange:e}=this.props;this.inputRef.current&&e(this.inputRef.current.value)}closeContextMenu(){var{forwardedProps:e}=this.props,{closeMenu:t}=e;t(!0)}revertToDefault(){var{onChange:e}=this.props;e(null)}returnFocusToContextMenu(){var e=da.getClosestByClassName(this.inputRef.current,"context-menu-container");e instanceof HTMLElement&&e.focus()}handleKeyDown(e){switch(e.key){case"Enter":e.stopPropagation(),this.closeContextMenu();break;case"Escape":e.stopPropagation(),this.revertToDefault(),this.closeContextMenu();break;case"ArrowRight":case"ArrowLeft":e.stopPropagation();break;case"ArrowUp":case"ArrowDown":this.returnFocusToContextMenu();break;default:e.stopPropagation()}}render(){var{formatString:e,forwardedProps:t,placeholder:i,title:n}=this.props,{menuItem:{description:a},iconElement:o}=t;return s.jsxs("div",{className:"form-group flex-grow mb-0",children:[s.jsxs("div",{className:"custom-format-title",children:[s.jsx("span",{className:"icon",children:o}),s.jsxs("label",{className:"title mb-0",htmlFor:"custom-format-input",children:[n,a!=null&&s.jsx(Xe,{children:a})]})]}),s.jsx("div",{className:"pl-2 pr-2 pb-2",children:s.jsx("input",{id:"custom-format-input",className:"form-control text-right mb-0",type:"text",defaultValue:e,ref:this.inputRef,placeholder:i,onKeyDown:this.handleKeyDown,onChange:this.handleInputChange,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"})})]})}}nn(Bt,"defaultProps",{formatString:"",forwardedProps:{menuItem:{},closeMenu(r){},iconElement:null},placeholder:"",title:"",onChange(r){}});const ul=Bt;class dl{static isDefaultSelected(e){return!e||![Dt.TYPE_CONTEXT_CUSTOM,Dt.TYPE_CONTEXT_PRESET].includes(e.type)}static isCustomSelected(e){return e!=null&&e.type===Dt.TYPE_CONTEXT_CUSTOM}static makeOption(e,t,i,n){return{title:e,description:e,group:i,format:t,isSelected:n}}static makeCustomFormatOption(e,t,i,n,a){var o;return{title:e.label,description:e.label,format:e,group:t,isSelected:n,menuElement:s.jsx(ul,{formatString:(o=e.formatString)!==null&&o!==void 0?o:void 0,title:e.label,placeholder:i,onChange:a})}}}const be=dl;function Li(r,e,t){return e=cl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function cl(r){var e=hl(r,"string");return typeof e=="symbol"?e:String(e)}function hl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class fe{static getOptions(e,t){var i=new Date,n=[{group:fe.dateGroup,formatString:"yyyy-MM-dd"},{group:fe.dateGroup,formatString:"MM-dd-yyyy"},{group:fe.timeGroup,formatString:"HH:mm:ss"},{group:fe.timeGroup,formatString:"HH:mm:ss.SSS"},{group:fe.timeGroup,formatString:"HH:mm:ss.SSSSSSSSS"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSS"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSSSSSSSS"}],a=n.map(u=>{var l=Ct.makeFormat("",u.formatString,Ct.TYPE_CONTEXT_PRESET),d=e.getFormattedString(i,T.dataType.DATETIME,"",l);return be.makeOption(d,l,u.group,Ct.isSameFormat(l,t))}),o=be.makeOption("Default",null,fe.dateGroup,be.isDefaultSelected(t));return[o,...a]}}Li(fe,"dateGroup",10);Li(fe,"timeGroup",20);Li(fe,"dateTimeGroup",30);const ml=fe;function $t(r,e,t){return e=pl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pl(r){var e=gl(r,"string");return typeof e=="symbol"?e:String(e)}function gl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class pe{static getOptions(e,t,i){var n=[{format:we.FORMAT_PERCENT,group:pe.presetGroup},{format:we.FORMAT_BASIS_POINTS,group:pe.presetGroup},{format:we.FORMAT_MILLIONS,group:pe.presetGroup},{format:we.FORMAT_SCIENTIFIC_NOTATION,group:pe.presetGroup},{format:we.FORMAT_ROUND,group:pe.presetRoundGroup},{format:we.FORMAT_ROUND_TWO_DECIMALS,group:pe.presetRoundGroup},{format:we.FORMAT_ROUND_FOUR_DECIMALS,group:pe.presetRoundGroup}],a=be.makeOption("Default",null,pe.defaultGroup,be.isDefaultSelected(t)),o=n.map(c=>be.makeOption(c.format.label,c.format,c.group,we.isSameFormat(c.format,t))),u=be.isCustomSelected(t),l=u?t:we.makeCustomFormat(),d=be.makeCustomFormatOption(l,pe.customGroup,we.DEFAULT_FORMAT_STRING,u,c=>{if(c!=null){var m=we.makeCustomFormat(c);we.isValid(e,m)&&i(m)}else i(null)});return[a,...o,d]}}$t(pe,"defaultGroup",10);$t(pe,"presetGroup",20);$t(pe,"presetRoundGroup",30);$t(pe,"customGroup",40);const vl=pe;function Ui(r,e,t){return e=fl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fl(r){var e=Cl(r,"string");return typeof e=="symbol"?e:String(e)}function Cl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class je{static getOptions(e,t,i){var n=[{format:Ke.FORMAT_MILLIONS,group:je.presetGroup},{format:Ke.FORMAT_SCIENTIFIC_NOTATION,group:je.presetGroup}],a=be.makeOption("Default",null,je.defaultGroup,be.isDefaultSelected(t)),o=n.map(c=>be.makeOption(c.format.label,c.format,c.group,Ke.isSameFormat(c.format,t))),u=be.isCustomSelected(t),l=u?t:Ke.makeCustomFormat(),d=be.makeCustomFormatOption(l,je.customGroup,Ke.DEFAULT_FORMAT_STRING,u,c=>{if(c!=null){var m=Ke.makeCustomFormat(c);Ke.isValid(e,m)&&i(m)}else i(null)});return[a,...o,d]}}Ui(je,"defaultGroup",10);Ui(je,"presetGroup",20);Ui(je,"customGroup",30);const Sl=je;function Fr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function Nr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fr(Object(t),!0).forEach(function(i){Se(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Or(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function Tl(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Or(a,i,n,o,u,"next",l)}function u(l){Or(a,i,n,o,u,"throw",l)}o(void 0)})}}function Se(r,e,t){return e=bl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bl(r){var e=El(r,"string");return typeof e=="symbol"?e:String(e)}function El(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ar=ce.module("IrisGridContextMenuHandler"),yl=150,Rr="yyyy-MM-dd HH:mm:ss.SSSSSSSSS",gi=1e3;class b extends Re{static getQuickFilterCondition(e,t,i){return e&&i==="&&"?e.and(t):e&&i==="||"?e.or(t):t}static getQuickFilterText(e,t,i){return i&&e!=null?"".concat(e," ").concat(i," ").concat(t):t}static getOperatorAsText(e){return e==="&&"?"And":"Or"}static getRowOptionFormatted(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30;return"".concat(e,' "').concat(bo.truncate(t,i-e.length-3),'"')}constructor(e,t){super(),Se(this,"irisGrid",void 0),Se(this,"debouncedUpdateCustomFormat",void 0),Se(this,"dh",void 0),this.getNumberValueEqualsFilter=this.getNumberValueEqualsFilter.bind(this),this.getFilterValueForNumberOrChar=this.getFilterValueForNumberOrChar.bind(this),this.debouncedUpdateCustomFormat=rt(e.handleFormatSelection,yl),this.dh=t,this.irisGrid=e}componentWillUnmount(){this.debouncedUpdateCustomFormat.flush()}getHeaderActions(e,t){var{irisGrid:i}=this,{column:n}=t;L(n);var{model:a}=i.props,{columns:o}=a,u=o[e],l=[],{metrics:d,reverseType:c,quickFilters:m,advancedFilters:p,searchFilter:h}=i.state,f=i.getTheme();L(d);var{filterIconColor:C,filterBarActiveColor:g,contextMenuSortIconColor:F,contextMenuReverseIconColor:w}=f,v=a.sort,N=T.getSortForColumn(v,u.name),A=c!==T.REVERSE_TYPE.NONE,{userColumnWidths:E}=d,O=[...E.values()].some(M=>M===0),D=a.getColumnHeaderParentGroup(e,0)===void 0&&!($e(a)&&a.hasExpandableRows),x=a.isColumnFrozen(e),G=a.isColumnSortable(e);if(l.push({title:"Hide Column",group:b.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.hideColumnByVisibleIndex(n)}}),l.push({title:x?"Unfreeze Column":"Freeze Column",group:b.GROUP_HIDE_COLUMNS,disabled:!D,action:()=>{x?this.irisGrid.unFreezeColumnByColumnName(u.name):this.irisGrid.freezeColumnByColumnName(u.name)},order:10}),l.push({title:"Show All Columns",group:b.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.showAllColumns()},disabled:!O}),l.push({title:"Quick Filters",icon:Ue,iconColor:g,shortcut:Ne.TABLE.TOGGLE_QUICK_FILTER,group:b.GROUP_FILTER,order:10,action:()=>{this.irisGrid.toggleFilterBar(n)}}),l.push({title:"Advanced Filters",icon:p.get(e)?_i:Pt,iconColor:C,group:b.GROUP_FILTER,order:20,action:()=>{this.irisGrid.handleAdvancedMenuOpened(n)}}),l.push({title:"Clear Table Filters",group:b.GROUP_FILTER,order:40,shortcut:Ne.TABLE.CLEAR_FILTERS,action:()=>{this.irisGrid.clearAllFilters()},disabled:!(m.size>0||p.size>0||h!=null)}),l.push({title:"Sort by",icon:Ue,iconColor:F,group:b.GROUP_SORT,order:10,actions:this.sortByActions(u,e,N),disabled:!G}),l.push({title:"Add Additional Sort",disabled:N&&v.length===1||A&&v.length===1||N&&A&&v.length===2||v.length===0||!G,group:b.GROUP_SORT,order:20,actions:this.additionalSortActions(u,e)}),l.push({title:"Clear Table Sorting",disabled:v.length===0||A&&v.length===1,group:b.GROUP_SORT,action:()=>{this.irisGrid.sortColumn(n,b.COLUMN_SORT_DIRECTION.none)},order:30}),l.push({title:c===T.REVERSE_TYPE.NONE?"Reverse Table":"Clear Reverse Table",icon:Ue,iconColor:w,group:b.GROUP_SORT,order:40,disabled:!a.isReversible,shortcut:Ne.TABLE.REVERSE,action:()=>{c===T.REVERSE_TYPE.NONE?this.irisGrid.reverse(T.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(T.REVERSE_TYPE.NONE)}}),l.push({title:"Copy Column Name",group:b.GROUP_COPY,shortcutText:Ae.isMacPlatform()?"⌥Click":"Alt+Click",action:()=>{var M;Ii((M=a.textForColumnHeader(e))!==null&&M!==void 0?M:"").catch(oe=>Ar.error("Unable to copy header",oe))}}),T.isDateType(u.type))l.push({title:"Date/Time Format",group:b.GROUP_FORMAT,actions:this.dateFormatActions(u)});else if(T.isNumberType(u.type)){var z;l.push({title:"Number Format",group:b.GROUP_FORMAT,actions:(z=this.numberFormatActions(u))!==null&&z!==void 0?z:void 0})}return l}getCellActions(e,t,i){var{irisGrid:n}=this,{column:a,row:o}=i,{model:u,canCopy:l}=n.props,{columns:d}=u,c=n.getModelRow(o);L(c);var m=u.sourceForCell(e,c),{column:p,row:h}=m,f=u.valueForCell(p,h),C=d[p],g=[],F=n.getTheme(),{filterIconColor:w}=F;if(C==null||o==null)return g;if($e(u)&&u.isRowExpandable(h)){var v=0,N=u.valueForCell(v,h),A=N==null?"null":u.textForCell(v,h);g.push({title:b.getRowOptionFormatted(u.isRowExpanded(h)?"Collapse":"Expand",A),group:b.GROUP_EXPAND_COLLAPSE,order:10,action:()=>{u.setRowExpanded(h,!u.isRowExpanded(h))}}),u.isExpandAllAvailable===!0&&g.push({title:b.getRowOptionFormatted("Expand All in",A),group:b.GROUP_EXPAND_COLLAPSE,order:20,action:()=>{u.setRowExpanded(h,!0,!0)}})}$e(u)&&u.hasExpandableRows&&u.isExpandAllAvailable===!0&&(g.push({title:"Expand Entire Table",group:b.GROUP_EXPAND_COLLAPSE,order:30,action:()=>{u.expandAll()}}),g.push({title:"Collapse Entire Table",group:b.GROUP_EXPAND_COLLAPSE,order:40,action:()=>{u.collapseAll()}}));var E={title:"Go to",iconColor:w,shortcut:Ne.TABLE.GOTO_ROW,group:b.GROUP_GOTO,order:10,action:()=>this.irisGrid.toggleGotoRow("".concat(o+1),"".concat(f),C.name)};return g.push(E),l&&(g.push({title:"Copy Cell",group:b.GROUP_COPY,shortcutText:Ae.isMacPlatform()?"⌥Click":"Alt+Click",order:10,action:()=>{n.copyCell(a,o)}}),g.push({title:"Copy Cell Unformatted",group:b.GROUP_COPY,order:20,action:()=>{n.copyCell(a,o,!0)}})),g.push({title:"View Cell Contents",group:b.GROUP_VIEW_CONTENTS,order:10,action:()=>{n.setState({showOverflowModal:!0,overflowText:n.getValueForCell(a,o)})}}),g}getCellFilterActions(e,t,i){var n=this;return Tl(function*(){var{dh:a,irisGrid:o}=n,{row:u}=i,{model:l}=o.props,{columns:d}=l,c=o.getModelRow(u),{getSelectedRanges:m}=t;L(c);var p=l.sourceForCell(e,c),{column:h,row:f}=p,C=d[h];if(C==null||u==null)return[];if(!l.isFilterable(h))return[];var{quickFilters:g}=o.state,F=o.getTheme(),{filterIconColor:w}=F,{settings:v}=o.props,N=[...m()];if(N.length===0&&N.push(new Fe(h,f,h,f)),Fe.containsCell(N,h,f))for(var A=Fe.rowCount(N);A>gi;){var E=N.pop();L(E,"Selected ranges should not be empty");var O=Fe.rowCount([E]);if(ca(O,"Selected ranges should not be unbounded"),A-O<gi){var D;N.push(new Fe(E.startColumn,E.startRow,E.endColumn,((D=E.endRow)!==null&&D!==void 0?D:0)-(A-gi)));break}A-=O}else N=[new Fe(h,f,h,f)];ha(N);for(var x=yield l.snapshot(N),G=new Set,z=0;z<x.length;z+=1)x[z].length===1?x[z][0]!=null&&G.add(x[z][0]):x[z][h]!=null&&G.add(x[z][h]);var M={title:"Filter by Value".concat(G.size>1?"s":""),icon:Ue,iconColor:w,group:b.GROUP_FILTER,order:10,actions:[]};if(G.size===0)g.get(h)&&M.actions.push({title:"And",actions:n.nullFilterActions(C,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.nullFilterActions(C));else if(G.size===1&&G.has(""))g.get(h)&&M.actions.push({title:"And",actions:n.emptyStringFilterActions(C,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.emptyStringFilterActions(C));else if(T.isBooleanType(C.type))g.get(h)&&M.actions.push({title:"Or",actions:n.booleanFilterActions(C,l.textForCell(h,f),g.get(h),"||"),order:2,group:U.groups.high}),M.actions.push(...n.booleanFilterActions(C,l.textForCell(h,f)));else if(T.isNumberType(C.type)||T.isCharType(C.type))L(h),g.get(h)&&M.actions.push({title:"And",actions:n.numberFilterActions(C,G,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.numberFilterActions(C,G,g.get(h)));else if(T.isDateType(C.type)){var oe=new Ct(a,{timeZone:v?.timeZone,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:Rr}),X=new Ct(a,{timeZone:v?.timeZone,showTimeZone:v?.showTimeZone,showTSeparator:v?.showTSeparator,defaultDateTimeFormatString:Rr});g.get(h)&&M.actions.push({title:"And",actions:n.dateFilterActions(C,G,oe,X,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.dateFilterActions(C,G,oe,X,g.get(h)))}else g.get(h)&&M.actions.push({title:"And",actions:n.stringFilterActions(C,G,g.get(h),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.stringFilterActions(C,G));return[M]})()}getNumberValueEqualsFilter(e,t){var{dh:i}=this,n=e.filter();if(t===Number.POSITIVE_INFINITY)return i.FilterCondition.invoke("isInf",n).and(n.greaterThan(i.FilterValue.ofNumber(0)));if(t===Number.NEGATIVE_INFINITY)return i.FilterCondition.invoke("isInf",n).and(n.lessThan(i.FilterValue.ofNumber(0)));if(Number.isNaN(t))return i.FilterCondition.invoke("isNaN",n);var a=this.getFilterValueForNumberOrChar(e.type,t);return n.eq(a)}getFilterValueForNumberOrChar(e,t){var{dh:i}=this;return T.isCharType(e)?i.FilterValue.ofString(String.fromCharCode(t)):i.FilterValue.ofNumber(t)}onContextMenu(e,t,i){var{irisGrid:n}=this,{y:a,column:o,row:u,columnHeaderDepth:l}=e,d=n.getModelColumn(o),c=n.getModelRow(u),{model:m,canCopy:p}=n.props,{columns:h}=m,{metrics:f,isFilterBarShown:C,quickFilters:g,advancedFilters:F,selectedRanges:w}=n.state;L(f);var{columnHeaderHeight:v,gridY:N,columnHeaderMaxDepth:A}=f,E=[];if(d!=null&&c!=null){var O=m.sourceForCell(d,c??0),{column:D,row:x}=O,G=m.valueForCell(D,x),z=m.textForCell(D,x),M=h[D],{onContextMenu:oe}=n.props;M!=null&&E.push(...oe({model:m,value:G,valueText:z,column:M,rowIndex:u,columnIndex:o,modelRow:c,modelColumn:d}))}if(d!=null){var X=m.getClearFilterRange(d);X!=null&&X.length>0&&E.push({title:X[1]-X[0]>0?"Clear Group Filter":"Clear Column Filter",group:b.GROUP_FILTER,order:30,action:()=>{this.irisGrid.removeColumnFilter(X)},disabled:!Array.from(g.keys()).some(le=>le>=X[0]&&le<=X[1])&&!Array.from(F.keys()).some(le=>le>=X[0]&&le<=X[1])})}return(C?a<=N:a<=v*A&&l===0)?d!=null&&E.push(...this.getHeaderActions(d,e)):(d!=null&&c!=null&&(E.push(...this.getCellActions(d,t,e)),E.push(this.getCellFilterActions(d,t,e))),p&&w.length>0&&(E.push({title:"Copy Selection",shortcut:Wa.COPY,group:b.GROUP_COPY,order:30,action:()=>{n.copyRanges(w)}}),E.push({title:"Copy Selection w/ Headers",group:b.GROUP_COPY,order:40,action:()=>{n.copyRanges(w,!0)}})),Be(m)&&m.isEditable&&w.length>0&&qr(m)&&m.isDeletable&&E.push({title:"Delete Selected Rows",group:b.GROUP_EDIT,disabled:!m.isDeletableRanges(w),order:50,action:()=>{this.irisGrid.deleteRanges(w)}})),E.length===0?!1:(L(n.gridWrapper),U.triggerMenu(n.gridWrapper,i.clientX,i.clientY,E),!0)}dateFormatActions(e){for(var t=this,{model:i}=this.irisGrid.props,{formatter:n}=i,a=n.getColumnFormat(e.type,e.name),o=ml.getOptions(n,a),u=[],l=function(){var{description:m,format:p,group:h,isSelected:f,title:C}=o[d];u.push({title:C,description:m,icon:f?wi:void 0,group:h,order:d,action:()=>{var g=i.getColumnIndexByName(e.name);L(g),t.irisGrid.handleFormatSelection(g,p)}})},d=0;d<o.length;d+=1)l();return u}numberFormatActions(e){var t=this,{model:i}=this.irisGrid.props,{formatter:n}=i,{dh:a}=this,o=n.getColumnFormat(e.type,e.name),u,l=i.getColumnIndexByName(e.name);if(T.isDecimalType(e.type))u=vl.getOptions(a,o,p=>{L(l),this.debouncedUpdateCustomFormat(l,p)});else if(T.isIntegerType(e.type))u=Sl.getOptions(a,o,p=>{L(l),this.debouncedUpdateCustomFormat(l,p)});else return Ar.error("Invalid column type in numberFormatActions"),null;for(var d=[],c=function(){var{format:h,isSelected:f}=u[m];d.push(Nr(Nr({},u[m]),{},{icon:f?wi:void 0,order:m,action:()=>{l===void 0&&h&&h.type===Dt.TYPE_CONTEXT_CUSTOM||(L(l),t.irisGrid.handleFormatSelection(l,h))}}))},m=0;m<u.length;m+=1)c();return d}stringFilterActions(e,t,i,n){var{dh:a}=this,o=Array.from(t.keys()),u=o.map(g=>a.FilterValue.ofString(g)),l=u.length===1?u[0]:"the selected values",d=i;d||(d={filter:null,text:null});var{filter:c,text:m}=d,p=[],{model:h}=this.irisGrid.props,f=h.getColumnIndexByName(e.name),C=g=>{var F;return(F=T.escapeQuickTextFilter(g))!==null&&F!==void 0?F:""};return L(f),p.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",hi.join(o.slice(0,20).map(g=>'"'.concat(C(g),'"'))),o.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",o.length," values selected)"]})]}),order:1,group:U.groups.high}),p.push({title:"text is exactly",description:"Show only rows where ".concat(e.name," is ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,u.map(g=>e.filter().eq(g)).reduce((g,F)=>g.or(F)),n),b.getQuickFilterText(m,o.map(C).join(" || "),n))},order:10,group:U.groups.low}),p.push({title:"text is not exactly",description:"Show only rows where ".concat(e.name," is not ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,u.map(g=>e.filter().notEq(g)).reduce((g,F)=>g.and(F)),n),b.getQuickFilterText(m,o.map(g=>"!=".concat(C(g))).join(" && "),n))},order:20,group:U.groups.low}),p.push({title:"text contains",description:"Show only rows where ".concat(e.name," contains ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(g=>e.filter().contains(g)).reduce((g,F)=>g.or(F))),n),b.getQuickFilterText(m,o.map(g=>"~".concat(C(g))).join(" || "),n))},order:30,group:U.groups.low}),p.push({title:"text does not contain",description:"Show only rows where ".concat(e.name," does not contain ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().or(u.map(g=>e.filter().contains(g).not()).reduce((g,F)=>g.and(F))),n),b.getQuickFilterText(m,o.map(g=>"!~".concat(C(g))).join(" && "),n))},order:40,group:U.groups.low}),p.push({title:"text starts with",description:"Show only rows where ".concat(e.name," starts with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(g=>e.filter().invoke("startsWith",g)).reduce((g,F)=>g.or(F))),n),b.getQuickFilterText(m,o.map(g=>"".concat(C(g),"*")).join(" || "),n))},order:50,group:U.groups.low}),p.push({title:"text ends with",description:"Show only rows where ".concat(e.name," ends with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(g=>e.filter().invoke("endsWith",g)).reduce((g,F)=>g.or(F))),n),b.getQuickFilterText(m,o.map(g=>"*".concat(C(g))).join(" || "),n))},order:60,group:U.groups.low}),p}numberFilterActions(e,t,i,n){var a=Array.from(t.keys()),o=a.length===1?"".concat(a):"the selected values",u=v=>T.isCharType(e.type)?String.fromCharCode(v):"".concat(v),l=null,d=null;i&&(l=i.filter,d=i.text);var c=[],{model:m}=this.irisGrid.props,p=m.getColumnIndexByName(e.name);if(L(p),c.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",hi.join(a.slice(0,20).map(v=>'"'.concat(u(v),'"'))),a.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",a.length," values selected)"]})]}),order:1,group:U.groups.high}),c.push({title:"is equal to",description:"Show only rows where ".concat(e.name," is ").concat(o),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,a.map(v=>this.getNumberValueEqualsFilter(e,v)).reduce((v,N)=>v.or(N)),n),b.getQuickFilterText(d,a.map(v=>"=".concat(u(v))).join(" || "),n))},order:10,group:U.groups.low}),c.push({title:"is not equal to",description:"Show only rows where ".concat(e.name," is not ").concat(o),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,a.map(v=>this.getNumberValueEqualsFilter(e,v).not()).reduce((v,N)=>v.and(N)),n),b.getQuickFilterText(d,a.map(v=>"!=".concat(u(v))).join(" && "),n))},order:20,group:U.groups.low}),!t.has(Number.NaN)&&!t.has(Number.POSITIVE_INFINITY)&&!t.has(Number.NEGATIVE_INFINITY)&&!T.isCharType(e.type)){var h=a.reduce((v,N)=>v>N?v:N),f=a.reduce((v,N)=>v<N?v:N),C=this.getFilterValueForNumberOrChar(e.type,h),g=this.getFilterValueForNumberOrChar(e.type,f),F="".concat(C),w="".concat(g);c.push({title:"greater than",description:"Show only rows where ".concat(e.name," is greater than ").concat(F),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().greaterThan(C),n),b.getQuickFilterText(d,">".concat(u(h)),n))},order:30,group:U.groups.low}),c.push({title:"greater than or equal to",description:"Show only rows where ".concat(e.name," is greater than or equal to ").concat(F),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().greaterThanOrEqualTo(C),n),b.getQuickFilterText(d,">=".concat(u(h)),n))},order:40,group:U.groups.low}),c.push({title:"less than",description:"Show only rows where ".concat(e.name," is less than ").concat(w),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().lessThan(g),n),b.getQuickFilterText(d,"<".concat(u(f)),n))},order:50,group:U.groups.low}),c.push({title:"less than or equal to",description:"Show only rows where ".concat(e.name," is less than or equal to ").concat(w),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().lessThanOrEqualTo(g),n),b.getQuickFilterText(d,"<=".concat(u(f)),n))},order:60,group:U.groups.low})}return c}booleanFilterActions(e,t,i,n){var a=[],{model:o}=this.irisGrid.props,{filter:u,text:l}=i||{},d=o.getColumnIndexByName(e.name);return L(d),a.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",'"',t??"null",'"']}),order:1,group:U.groups.high}),a.push({title:"true",description:"Show only rows where ".concat(e.name," is true"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isTrue(),n),b.getQuickFilterText(l,"true",n))},order:10,group:U.groups.low}),a.push({title:"false",description:"Show only rows where ".concat(e.name," is false"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isFalse(),n),b.getQuickFilterText(l,"false",n))},order:20,group:U.groups.low}),a.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isNull(),n),b.getQuickFilterText(l,"null",n))},order:30,group:U.groups.low}),a.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isNull().not(),n),b.getQuickFilterText(l,"!null",n))},order:40,group:U.groups.low}),a}dateFilterActions(e,t,i,n,a,o){var{dh:u}=this,l=Array.from(t.keys()),d=l.map(D=>u.FilterValue.ofNumber(D)),c=d.length===1?n.format(l[0]):"the selected values",m=l.reduce((D,x)=>D>x?D:x),p=l.reduce((D,x)=>D<x?D:x),h=u.FilterValue.ofNumber(m),f=u.FilterValue.ofNumber(p),C=i.format(m),g=i.format(p),F=n.format(m),w=n.format(p),v=null,N=null;a&&(v=a.filter,N=a.text);var{model:A}=this.irisGrid.props,E=A.getColumnIndexByName(e.name);L(E);var O=[];return O.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[o?b.getOperatorAsText(o):""," ",hi.join(l.slice(0,20).map(D=>'"'.concat(n.format(D),'"'))),l.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",l.length," values selected)"]})]}),order:1,group:U.groups.high}),O.push({title:"date is",description:"Show only rows where ".concat(e.name," is ").concat(c),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,d.map(D=>e.filter().eq(D)).reduce((D,x)=>D.or(x)),o),b.getQuickFilterText(N,l.map(D=>"=".concat(i.format(D))).join(" || "),o))},order:10,group:U.groups.low}),O.push({title:"date is not",description:"Show only rows where ".concat(e.name," is not ").concat(c),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,d.map(D=>e.filter().notEq(D)).reduce((D,x)=>D.and(x)),o),b.getQuickFilterText(N,l.map(D=>"!=".concat(i.format(D))).join(" && "),o))},order:20,group:U.groups.low}),O.push({title:"date is before",description:"Show only rows where ".concat(e.name," is before ").concat(w),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,e.filter().lessThan(f),o),b.getQuickFilterText(N,"<".concat(g),o))},order:30,group:U.groups.low}),O.push({title:"date is before or equal",description:"Show only rows where ".concat(e.name," is before or equal to ").concat(w),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,e.filter().lessThanOrEqualTo(f),o),b.getQuickFilterText(N,"<=".concat(g),o))},order:40,group:U.groups.low}),O.push({title:"date is after",description:"Show only rows where ".concat(e.name," is greater than ").concat(F),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,e.filter().greaterThan(h),o),b.getQuickFilterText(N,">".concat(C),o))},order:50,group:U.groups.low}),O.push({title:"date is after or equal",description:"Show only rows where ".concat(e.name," is after or equal to ").concat(F),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(v,e.filter().greaterThanOrEqualTo(h),o),b.getQuickFilterText(N,">=".concat(C),o))},order:60,group:U.groups.low}),O}emptyStringFilterActions(e,t,i){var{dh:n}=this,a=n.FilterValue.ofString(""),o=t;o||(o={filter:null,text:null});var{filter:u,text:l}=o,d=[],{model:c}=this.irisGrid.props,m=c.getColumnIndexByName(e.name);return L(m),d.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?b.getOperatorAsText(i):""," ",s.jsx("i",{className:"text-muted",children:"empty"})]}),order:1,group:U.groups.high}),d.push({title:"is empty string",description:"Show only rows where ".concat(e.name," is empty"),action:()=>{this.irisGrid.setQuickFilter(m,b.getQuickFilterCondition(u,e.filter().eq(a),i),b.getQuickFilterText(l,"=",i))},order:10,group:U.groups.low}),d.push({title:"is not empty string",description:"Show only rows where ".concat(e.name," is not empty"),action:()=>{this.irisGrid.setQuickFilter(m,b.getQuickFilterCondition(u,e.filter().notEq(a),i),b.getQuickFilterText(l,"!=",i))},order:20,group:U.groups.low}),d}nullFilterActions(e,t,i){var n=null,a=null;t&&(n=t.filter,a=t.text);var o=[],{model:u}=this.irisGrid.props,l=u.getColumnIndexByName(e.name);return L(l),o.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?b.getOperatorAsText(i):""," ",s.jsx("i",{className:"text-muted",children:"null"})]}),order:1,group:U.groups.high}),o.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(l,b.getQuickFilterCondition(n,e.filter().isNull(),i),b.getQuickFilterText(a,"null",i))},order:10,group:U.groups.low}),o.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(l,b.getQuickFilterCondition(n,e.filter().isNull().not(),i),b.getQuickFilterText(a,"!null",i))},order:20,group:U.groups.low}),o}sortByActions(e,t,i){var n=this.irisGrid.getTheme(),{contextMenuSortIconColor:a}=n,o=[{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.ascending)?Ue:void 0,iconColor:a},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.descending)?Ue:void 0,iconColor:a},{title:"Remove Sort",order:50,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.none,!1,!0)},disabled:!i}];return T.isNumberType(e.type)&&(o.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!0)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.ascending,!0)?Ue:void 0,iconColor:a}),o.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!0)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.descending,!0)?Ue:void 0,iconColor:a})),o}additionalSortActions(e,t){var i=this.irisGrid.getTheme(),{contextMenuSortIconColor:n}=i,a=[{title:"Add Sort By",menuElement:s.jsxs("div",{className:"btn-context-menu menu-title",children:[s.jsx("span",{className:"icon",children:s.jsx(Z,{icon:Ue,style:{color:n??void 0}})}),s.jsx("span",{className:"title",children:"Add Additional Sort"}),s.jsx("span",{className:"shortcut",children:Ae.isMacPlatform()?"⌘Click":"Ctrl+Click"})]}),order:1},{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!1,!0)}},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!1,!0)}}];return T.isNumberType(e.type)&&(a.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!0,!0)}}),a.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!0,!0)}})),a}checkColumnSort(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e?e.direction===t&&e.isAbs===i:!1}}Se(b,"GROUP_EDIT",U.groups.high+10);Se(b,"GROUP_HIDE_COLUMNS",U.groups.high+25);Se(b,"GROUP_FILTER",U.groups.high+50);Se(b,"GROUP_EXPAND_COLLAPSE",U.groups.high+55);Se(b,"GROUP_GOTO",U.groups.high+60);Se(b,"GROUP_SORT",U.groups.high+75);Se(b,"GROUP_COPY",U.groups.high+100);Se(b,"GROUP_FORMAT",U.groups.high+150);Se(b,"GROUP_VIEW_CONTENTS",U.groups.high+175);Se(b,"COLUMN_SORT_DIRECTION",{ascending:"ASC",descending:"DESC",none:null});const wl=b;function Fl(r,e,t){return e=Nl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nl(r){var e=Ol(r,"string");return typeof e=="symbol"?e:String(e)}function Ol(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Al extends Re{constructor(e){super(250),Fl(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onClick(e,t,i){return i.altKey&&!Ae.isModifierKeyDown(i)&&!i.shiftKey?(this.cursor=null,e.columnHeaderDepth!==void 0?this.irisGrid.copyColumnHeader(e.column,e.columnHeaderDepth):this.irisGrid.copyRanges([Fe.makeCell(e.column,e.row)]),!0):!1}onMove(e,t,i){return i.altKey&&!Ae.isModifierKeyDown(i)&&!i.shiftKey&&e.column!=null&&(e.row!=null||e.columnHeaderDepth!=null)?(this.cursor=this.irisGrid.props.copyCursor,!0):!1}}const Rl=Al;function _l(r,e,t){return e=xl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xl(r){var e=Dl(r,"string");return typeof e=="symbol"?e:String(e)}function Dl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Il extends Re{constructor(e){super(880),_l(this,"irisGrid",void 0),this.irisGrid=e}onDoubleClick(e,t){var{column:i,row:n}=e;return n==null||i==null||this.irisGrid.selectData(i,n),!1}}const Pl=Il;function Ll(r,e,t){return e=Ul(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ul(r){var e=jl(r,"string");return typeof e=="symbol"?e:String(e)}function jl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class kl extends Re{constructor(e){super(),Ll(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{y:t,column:i,row:n}=e;if(i!==null&&n===null){var{isFilterBarShown:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:u}=o,l=this.irisGrid.getTheme();if(a&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&t>l.columnHeaderHeight*u&&t<=l.columnHeaderHeight*u+l.filterBarHeight)return this.irisGrid.focusFilterBar(i),!0}return!1}onMove(e){var{y:t,column:i}=e,{isFilterBarShown:n,hoverAdvancedFilter:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:u}=o,l=this.irisGrid.getTheme(),d=null;return n&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&i!==null&&t>=l.columnHeaderHeight*u&&t<=l.columnHeaderHeight*u+l.filterBarHeight&&(d=i),d!==a&&this.irisGrid.setState({hoverAdvancedFilter:d}),!1}onLeave(e){var{column:t}=e,{hoverAdvancedFilter:i}=this.irisGrid.state;return i!==null&&t!==i&&this.irisGrid.setState({hoverAdvancedFilter:null}),!1}}const Gl=kl;function Ml(r,e,t){return e=Vl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Vl(r){var e=Bl(r,"string");return typeof e=="symbol"?e:String(e)}function Bl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class $l extends Re{constructor(e){super(750),Ml(this,"irisGrid",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({expandCellTooltipProps:null})}setCursor(e,t){return Sr.isInTreeBox(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:t,y:i,column:n,row:a}=e;if(n==null||a==null)return null;var{renderer:o,grid:u,state:l,props:d}=this.irisGrid;if(!u)return null;var{metrics:c}=l,{model:m}=d,{canvasContext:p}=u,h=u.getTheme(),f={context:p,mouseX:t,mouseY:i,metrics:c,model:m,theme:h},C=$e(m)?m.depthForRow(a):null,{left:g,top:F,width:w,height:v}=o.getExpandButtonPosition(f,C);return g==null||w==null||F==null||v==null?null:{left:g,top:F,width:w,height:v}}onMove(e,t){if(Sr.isInTreeBox(e,t)){var{expandCellTooltipProps:i}=this.irisGrid.state,{model:n}=this.irisGrid.props,a=this.getButtonPosition(e),{row:o}=e;L(o);var u=$e(n)&&n.isRowExpanded(o);De(i,a)||this.irisGrid.setState({expandCellTooltipProps:a,expandTooltipDisplayValue:u?"collapse":"expand"})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const Ql=$l;function _r(r,e,t){return e=Hl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hl(r){var e=Wl(r,"string");return typeof e=="symbol"?e:String(e)}function Wl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Kl extends Re{constructor(e){super(),_r(this,"irisGrid",void 0),_r(this,"column",void 0),this.column=null,this.irisGrid=e}getColumnFromGridPoint(e){var{column:t,row:i,columnHeaderDepth:n}=e;return t!==null&&i===null&&n===0?t:null}onDown(e){return this.column=this.getColumnFromGridPoint(e),!1}onClick(e,t,i){var n=this.getColumnFromGridPoint(e);if(n!=null&&n===this.column){var a=Ae.isModifierKeyDown(i);return this.irisGrid.toggleSort(n,a),!0}return!1}}const Yl=Kl;class ql extends Re{constructor(e){super(),this.irisGrid=e}onWheel(e,t,i){var{irisGrid:n}=this,{model:a}=n.props,{metrics:o,pendingRowCount:u}=n.state;L(o);var{bottom:l,rowCount:d,rowHeight:c}=o,{deltaY:m}=ve.getScrollDelta(i);return Be(a)&&a.isEditable&&l>=d-1&&m>0&&n.setState({pendingRowCount:u+Math.ceil(m/c)}),!1}}const zl=ql;function xr(r,e,t){return e=Xl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xl(r){var e=Zl(r,"string");return typeof e=="symbol"?e:String(e)}function Zl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Jl extends Re{constructor(e){super(),xr(this,"irisGrid",void 0),xr(this,"currentLinkBox",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({linkHoverTooltipProps:null})}isHoveringLink(e,t){var{column:i,row:n,x:a,y:o}=e,{renderer:u,metrics:l,props:d}=t,{model:c}=d;if(i==null||n==null||l==null)return this.currentLinkBox=void 0,!1;var{modelRows:m,modelColumns:p}=l,h=Fi(m,n),f=Fi(p,i),C=c.renderTypeForCell(f,h),g=u.getCellRenderer(C);if(!No(g))return!1;if(this.currentLinkBox!=null){var{x1:F,y1:w,x2:v,y2:N}=this.currentLinkBox;if(a>=F&&a<=v&&o>=w&&o<=N)return!0}for(var A=t.updateRenderState(),E=g.getTokenBoxesForVisibleCell(i,n,A),O=0;O<E.length;O+=1)if(vr(E[O].token)){var D=ve.translateTokenBox(E[O],l),{x1:x,x2:G,y1:z,y2:M}=D;if(a>=x&&a<=G&&o>=z&&o<=M)return this.currentLinkBox=D,!0}return this.currentLinkBox=void 0,!1}setCursor(e,t){return this.isHoveringLink(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}onMove(e,t){var i=this.isHoveringLink(e,t);if(i&&this.currentLinkBox!=null&&vr(this.currentLinkBox.token)){var{linkHoverTooltipProps:n}=this.irisGrid.state;if(this.currentLinkBox==null)return!1;var{x1:a,y1:o,x2:u,y2:l}=this.currentLinkBox,{href:d}=this.currentLinkBox.token,c=u-a,m=l-o,p={left:a,top:o+1,width:c,height:m};De(n,p)||this.irisGrid.setState({linkHoverTooltipProps:p,linkHoverDisplayValue:d})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const eu=Jl;var tu=3e3;function iu(r){var{children:e=null,onEntering:t,onEntered:i,onExiting:n,onExited:a}=r,[o,u]=y.useState(!1),l=y.useRef(),d=Hr(e),c=y.useCallback(()=>{u(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{u(!1)},tu)},[u,l]);return y.useEffect(()=>{d!==e&&e!=null&&c()},[e,d,u,c]),y.useEffect(()=>()=>l.current?clearTimeout(l.current):void 0,[]),s.jsx(Vt,{className:"toast-bottom-bar",isShown:o,onEntering:t,onEntered:i,onExiting:n,onExited:a,children:e})}var ru=1,an=ke.memo(r=>{var{model:e,modelColumns:t,top:i,bottom:n,left:a,right:o,filter:u,formatter:l,reverseType:d=T.REVERSE_TYPE.NONE,sorts:c,customColumns:m,movedColumns:p,hiddenColumns:h,alwaysFetchColumns:f,rollupConfig:C=null,totalsConfig:g=null,selectDistinctColumns:F=de,pendingRowCount:w=0,pendingDataMap:v=Ve,frozenColumns:N,formatColumns:A,columnHeaderGroups:E,partitionConfig:O}=r,D=y.useMemo(()=>ie.getModelViewportColumns(t,a,o,p,h,f,ru),[t,a,o,p,h,f]);return y.useEffect(function(){e.filter=u},[e,u]),y.useEffect(function(){var G=[...c];d!==T.REVERSE_TYPE.NONE&&G.push(e.dh.Table.reverse()),e.sort=G},[e,c,d]),y.useEffect(function(){e.formatter=l},[e,l]),y.useEffect(function(){e.isCustomColumnsAvailable&&(e.customColumns=m)},[e,m]),y.useEffect(function(){e.isFormatColumnsAvailable&&(e.formatColumns=A)},[e,A]),y.useEffect(function(){e.setViewport(i,n,D)},[e,i,n,D]),y.useEffect(function(){e.isRollupAvailable&&(e.rollupConfig=C)},[e,e.isRollupAvailable,C]),y.useEffect(function(){e.isSelectDistinctAvailable&&(e.selectDistinctColumns=F)},[e,F]),y.useEffect(function(){e.isTotalsAvailable&&(e.totalsConfig=g)},[e,e.isTotalsAvailable,g]),y.useEffect(function(){e.pendingRowCount=w},[e,w]),y.useEffect(function(){e.pendingDataMap=v},[e,v]),y.useEffect(function(){N&&e.updateFrozenColumns(N)},[e,N]),y.useEffect(function(){e.columnHeaderGroups=E},[e,E]),y.useEffect(function(){O&&Ni(e)&&(e.partitionConfig=O)},[e,O]),null});an.displayName="IrisGridModelUpdater";const nu=an;function on(r,e,t){return e=au(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function au(r){var e=ou(r,"string");return typeof e=="symbol"?e:String(e)}function ou(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var vi=ce.module("ColumnStatistics"),su={SIZE:"Number of Rows"};class Et extends y.Component{static getStatsLabel(e){var t;return(t=su[e])!==null&&t!==void 0?t:e.split(" ").map(i=>i[0].toUpperCase()+i.substr(1).toLowerCase()).join(" ")}constructor(e){super(e),on(this,"cancelablePromise",void 0),this.handleError=this.handleError.bind(this),this.handleGenerateStatistics=this.handleGenerateStatistics.bind(this),this.handleStatistics=this.handleStatistics.bind(this),this.cancelablePromise=null,this.state={error:null,loading:!1,statistics:null,numRows:0}}componentDidMount(){this.maybeGenerateStatistics()}componentWillUnmount(){this.cancelablePromise&&this.cancelablePromise.cancel()}maybeGenerateStatistics(){var{column:e,model:t}=this.props,i=t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount;this.setState({numRows:i}),!t.isColumnStatisticsAvailable||e.isProxy===!0?this.setState({loading:!1}):i<Et.AUTO_GENERATE_LIMIT&&this.handleGenerateStatistics()}handleGenerateStatistics(){this.setState({loading:!0});var{column:e,model:t}=this.props;this.cancelablePromise=Oe.makeCancelable(t.columnStatistics(e)),this.cancelablePromise.then(this.handleStatistics).catch(this.handleError)}handleStatistics(e){vi.debug("Received statistics",e);var{model:t,onStatistics:i}=this.props,n=[];e.statisticsMap.forEach((a,o)=>{n.push({operation:Et.getStatsLabel(o),value:a,type:e.getType(o)})}),e.uniqueValues.forEach((a,o)=>{n.push({operation:o,className:"column-statistics-unique-value",value:a,type:"long"})}),this.setState({loading:!1,statistics:n,numRows:t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount}),i()}handleError(e){if(e!=null&&Oe.isCanceled(e)){vi.debug("Called handleError on a cancelled promise result");return}vi.error("Error generating statistics",e),this.setState({error:e,loading:!1,statistics:null})}render(){var e,{column:t,model:i}=this.props,{error:n,loading:a,statistics:o,numRows:u}=this.state,l=!a&&n==null&&o==null&&i.isColumnStatisticsAvailable,d=[],c=t.type.substring(t.type.lastIndexOf(".")+1),m=t.description===null?null:t.description;if(o!=null)for(var p=0;p<o.length;p+=1){var{operation:h,className:f,value:C,type:g}=o[p],F=g?i.displayString(C,g):i.displayString(C,t.type,t.name),w=s.jsxs(ke.Fragment,{children:[s.jsx("div",{className:Y("column-statistic-operation",f),children:h}),s.jsx("div",{className:"column-statistic-value",children:F})]},h);d.push(w)}var v=$e(i)&&i.hasExpandableRows?"Expanded Rows":"Number of Rows",N=i.displayString(u,"long"),A=i.getColumnIndexByName(t.name);return s.jsxs("div",{className:"column-statistics",children:[s.jsxs("div",{className:"column-statistics-title",children:[(e=t.displayName)!==null&&e!==void 0?e:t.name,s.jsxs("span",{className:"column-statistics-type",children:[" (",c,")"]}),s.jsx(Wr,{className:"column-statistics-copy",tooltip:"Copy column name",copy:t.name})]}),m!=null&&s.jsx("div",{className:"column-statistics-description",children:m}),A!=null&&!i.isColumnSortable(A)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(Z,{icon:ma,className:"mr-1"}),"Not sortable"]}),A!=null&&!i.isColumnMovable(A)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(Z,{icon:i.isColumnFrozen(A)?pa:ga,className:"mr-1"}),i.isColumnFrozen(A)?"Frozen":"Not movable"]}),s.jsxs("div",{className:"column-statistics-grid",children:[o==null&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"column-statistic-operation",children:v}),s.jsx("div",{className:"column-statistic-value",children:N})]}),d]}),l&&s.jsx(W,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,children:"Generate Stats"}),n!=null&&s.jsx("div",{className:"error-message",children:"".concat(n)}),o&&!a&&s.jsx(W,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,icon:va,children:"Refresh"}),a&&s.jsxs("div",{className:"column-statistics-loading",children:[s.jsx(kt,{className:"loading-spinner-vertical-align"}),"Calculating Stats..."]})]})}}on(Et,"AUTO_GENERATE_LIMIT",1e5);const lu=Et;function uu(r,e,t){return e=du(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function du(r){var e=cu(r,"string");return typeof e=="symbol"?e:String(e)}function cu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class hu extends y.PureComponent{static createSearchFilter(e,t,i,n,a){var o=a?n.filter(d=>!i.includes(d.name)).map(d=>d.name):i;if(t&&o.length>0){var u=e.FilterValue.ofString(t),l=o.length===n.length?e.FilterCondition.search(u):e.FilterCondition.search(u,n.filter(d=>o.includes(d.name)).map(d=>d.filter()));return l}}constructor(e){super(e),uu(this,"searchField",void 0),this.handleSearchValueChange=this.handleSearchValueChange.bind(this),this.toggleColumn=this.toggleColumn.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.selectNumbers=this.selectNumbers.bind(this),this.searchField=ke.createRef(),this.state={isConfigureColumnsShown:!1}}focus(){var e;(e=this.searchField.current)===null||e===void 0||e.focus()}handleSearchValueChange(e){var{onChange:t,selectedColumns:i,invertSelection:n}=this.props;t(e.target.value,i,n)}sendColumnChange(e,t){var{onChange:i,value:n}=this.props;i(n,e,t)}setInvertSelection(e){var{onChange:t,value:i}=this.props;t(i,[],e)}toggleColumn(e){var{selectedColumns:t,invertSelection:i}=this.props;if(t.includes(e))this.sendColumnChange(t.filter(a=>a!==e),i);else{var n=t.slice();n.push(e),this.sendColumnChange(n,i)}}selectAll(){this.setInvertSelection(!0)}clear(){this.setInvertSelection(!1)}selectNumbers(){var{columns:e}=this.props;this.sendColumnChange(e.filter(t=>T.isNumberType(t.type)).map(t=>t.name),!1)}render(){var{value:e,selectedColumns:t,invertSelection:i,columns:n}=this.props,{isConfigureColumnsShown:a}=this.state,o=t.length===0&&i===!0||t.length===n.length&&i===!1,u=t.length===0&&i===!1||t.length===n.length&&i===!0,l;return o?l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:gr,mask:ci,transform:"shrink-2 down-5 right-7"}),s.jsx(Z,{icon:fa,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}):u?l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:Ca,mask:ci,transform:"shrink-1 down-5 right-7"}),s.jsx(Z,{icon:pr,className:"text-danger",transform:"shrink-4 down-5 right-7"})]}):l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:gr,mask:ci,transform:"shrink-2 down-5 right-7"}),s.jsx(Z,{icon:Sa,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}),s.jsxs("div",{className:"cross-column-container",children:[s.jsx(Ka,{className:"cross-column-search",placeholder:"Search Data...","data-testid":"cross-column-search",value:e,onChange:this.handleSearchValueChange,ref:this.searchField}),s.jsxs("button",{type:"button",className:"btn btn-link btn-link-icon px-2",onClick:()=>{a?this.setState({isConfigureColumnsShown:!1}):this.setState({isConfigureColumnsShown:!0})},children:[s.jsx("div",{className:"fa-layers",children:l}),s.jsx(Xe,{children:"Configure Columns"}),s.jsx(Kr,{isShown:a,className:"cross-column-popper",onExited:()=>{this.setState({isConfigureColumnsShown:!1})},closeOnBlur:!0,interactive:!0,children:s.jsxs("div",{className:"cross-column-popup",children:["Searched Columns",s.jsx("div",{className:"cross-column-scroll",children:n.map(d=>d.isProxy===!0?null:s.jsxs(ke.Fragment,{children:[s.jsx(Ya,{className:"cross-column-checkbox",checked:i?!t.includes(d.name):t.includes(d.name),onChange:()=>this.toggleColumn(d.name),children:d.name}),d.type.substring(d.type.lastIndexOf(".")+1)]},d.name))}),s.jsxs("div",{className:"cross-column-button-bar",children:[s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,children:"Select All"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.clear,children:"Clear"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectNumbers,children:"Numbers Only"})]}),u&&s.jsxs("p",{className:"text-danger",children:[s.jsx(Z,{icon:pr})," Select at least one column to search."]})]})})]})]})}}const xt=hu;function Dr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function Ir(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dr(Object(t),!0).forEach(function(i){ft(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Pr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function fi(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Pr(a,i,n,o,u,"next",l)}function u(l){Pr(a,i,n,o,u,"throw",l)}o(void 0)})}}function ft(r,e,t){return e=mu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mu(r){var e=pu(r,"string");return typeof e=="symbol"?e:String(e)}function pu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var qe=ce.module("IrisGridPartitionSelector");class gu extends y.Component{constructor(e){super(e),ft(this,"pending",void 0),ft(this,"tableUtils",void 0),ft(this,"getCachedChangeCallback",J(i=>n=>this.handlePartitionSelect(i,n))),ft(this,"getCachedFormatValueCallback",J(i=>n=>this.getDisplayValue(i,n))),this.handleKeyTableClick=this.handleKeyTableClick.bind(this),this.handleMergeClick=this.handleMergeClick.bind(this),this.handlePartitionSelect=this.handlePartitionSelect.bind(this);var{model:t}=e;this.tableUtils=new T(t.dh),this.pending=new Yr,this.state={isLoading:!0,keysTable:null,partitionFilters:null,partitionTables:null}}componentDidMount(){var e=this;return fi(function*(){var{model:t}=e.props;try{var i=yield e.pending.add(t.partitionKeysTable().then(o=>{var u=t.partitionColumns.map(l=>l.sort().desc());return o.applySort(u),o}),o=>o.close()),n=yield Promise.all(t.partitionColumns.map(function(){var o=fi(function*(u,l){return e.pending.add(i.selectDistinct(t.partitionColumns.slice(0,l+1)),d=>d.close())});return function(u,l){return o.apply(this,arguments)}}())),a=e.getPartitionFilters(n);e.setState({isLoading:!1,keysTable:i,partitionFilters:a,partitionTables:n})}catch(o){if(!Oe.isCanceled(o))throw o}})()}componentDidUpdate(e){var{partitionConfig:t}=e,{partitionConfig:i}=this.props;t!==i&&this.updatePartitionFilters()}componentWillUnmount(){this.pending.cancel();var{keysTable:e,partitionTables:t}=this.state;e?.close(),t?.forEach(i=>i.close())}handleKeyTableClick(){qe.debug2("handleKeyTableClick");var{partitionConfig:e}=this.props,t=Ir({},e);t.mode=e.mode==="keys"?"partition":"keys",this.sendUpdate(t)}handleMergeClick(){qe.debug2("handleMergeClick");var{partitionConfig:e}=this.props,t=Ir({},e);t.mode=e.mode==="merged"?"partition":"merged",this.sendUpdate(t)}handlePartitionSelect(e,t){var i=this;return fi(function*(){var{model:n,partitionConfig:a}=i.props;qe.debug("handlePartitionSelect",e,t,a);var o=[...a.partitions];if(o[e]=t,e===n.partitionColumns.length-1){i.sendUpdate({partitions:o,mode:"partition"});return}var{keysTable:u}=i.state;L(u);try{i.setState({isLoading:!0});var l=yield i.pending.add(u.copy(),p=>p.close()),d=o.slice(0,e+1).map((p,h)=>{var f=l.columns[h];return i.tableUtils.makeNullableEqFilter(f,p)});l.applyFilter(d),l.setViewport(0,0,l.columns);var c=yield i.pending.add(l.getViewportData()),m={partitions:l.columns.map(p=>{var h;return(h=c.rows[0].get(p))!==null&&h!==void 0?h:null}),mode:"partition"};l.close(),i.sendUpdate(m)}catch(p){Oe.isCanceled(p)||qe.error("Unable to get partition tables",p)}finally{i.setState({isLoading:!1})}})()}sendUpdate(e){qe.debug2("sendUpdate",e);var{onChange:t}=this.props;t(e)}getDisplayValue(e,t){var{model:i}=this.props;if(t===null)return"(null)";if(t===void 0||t==="")return"";var n=i.partitionColumns[e];return T.isCharType(n.type)&&t.toString().length>0?String.fromCharCode(parseInt(t.toString(),10)):i.displayString(t,n.type,n.name)}updatePartitionFilters(){var{partitionTables:e}=this.state;L(e);var{partitionConfig:t}=this.props,{mode:i}=t;if(qe.debug("updatePartitionFilters",t),i==="partition"){var n=this.getPartitionFilters(e);this.setState({partitionFilters:n})}}getPartitionFilters(e){var{model:t,partitionConfig:i}=this.props,{partitions:n}=i;if(qe.debug("getPartitionFilters",i),n.length!==e.length)throw new Error("Invalid partition config set. Expected ".concat(e.length," partitions, but got ").concat(n.length));for(var a=[],o=0;o<n.length;o+=1)if(o===0)a.push([]);else{var u=a[o-1],l=n[o-1],d=t.partitionColumns[o-1],c=[...u,this.tableUtils.makeNullableEqFilter(d,l)];a.push(c)}return a}render(){var{model:e,partitionConfig:t}=this.props,{isLoading:i,partitionFilters:n,partitionTables:a}=this.state,{partitions:o}=t;n!==null&&a!==null&&n.forEach((l,d)=>{a[d].applyFilter(l)});var u=e.partitionColumns.map((l,d)=>s.jsxs("div",{className:"column-selector",children:[a?.[d]&&s.jsx(ao,{label:l.name,labelPosition:"side",table:a[d],direction:"bottom",shouldFlip:!1,keyColumn:a[d].columns[d].name,placeholder:"Loading...",labelColumn:a[d].columns[d].name,onChange:this.getCachedChangeCallback(d),defaultSelectedKey:o[d],isDisabled:d>0&&t.mode!=="partition"||i}),e.partitionColumns.length-1===d||s.jsx(Z,{icon:Ta})]},"selector-".concat(l.name)));return s.jsxs("div",{className:"iris-grid-partition-selector",children:[s.jsx("div",{className:"table-name",children:"Partitioned Table"}),s.jsxs("div",{className:"partition-button-group",children:[s.jsx(W,{onClick:this.handleKeyTableClick,kind:"inline",tooltip:"View keys as table",icon:ba,active:t.mode==="keys",disabled:i,children:"Keys"}),s.jsx(W,{onClick:this.handleMergeClick,kind:"inline",tooltip:"View all partitions as one merged table",icon:s.jsx(Z,{icon:Ea,rotation:90}),active:t.mode==="merged",disabled:i,children:"Merge"})]}),u]})}}const vu=gu;function fu(r,e,t){return e=Cu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cu(r){var e=Su(r,"string");return typeof e=="symbol"?e:String(e)}function Su(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Tu=ce.module("SelectDistinctBuilder");class sn extends y.Component{constructor(e){super(e),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleDropdownChanged=this.handleDropdownChanged.bind(this);var{model:t,selectDistinctColumns:i}=this.props;this.state={inputs:i.length>0?[...i]:[""],columns:t.originalColumns}}componentDidUpdate(e,t){var{inputs:i}=this.state,{onChange:n}=this.props;if(t.inputs!==i){var a=i.filter(o=>o!=="");De(t.inputs.filter(o=>o!==""),a)||n(a)}}handleAddColumnClick(){this.setState(e=>{var{inputs:t}=e;return{inputs:[...t,""]}})}handleDeleteColumn(e){this.setState(t=>{var{inputs:i}=t;return{inputs:i.length===1&&e===0?[""]:i.filter((n,a)=>e!==a)}})}handleDropdownChanged(e,t){Tu.debug("handleDropdownChanged",e,t),this.setState(i=>{var{inputs:n}=i,a=[...n];return a[e]=t,{inputs:a}})}renderInputs(){var{columns:e,inputs:t}=this.state;return t.map((i,n)=>{var a=e.filter(o=>{var{name:u}=o;return u===i||!t.includes(u)}).map(o=>{var{name:u}=o;return s.jsx("option",{value:u,children:u},u)});return s.jsxs("div",{className:"form-inline px-3 pb-3",children:[s.jsxs(nt,{className:"form-control custom-select col",value:i,onChange:o=>this.handleDropdownChanged(n,o),children:[s.jsx("option",{value:"",children:"Select a column"}),a]}),(t.length>1||i!=="")&&s.jsx(W,{kind:"ghost",className:"ml-1 px-2",onClick:()=>{this.handleDeleteColumn(n)},icon:s.jsx(Z,{icon:Ai,transform:"grow-3"}),tooltip:"Delete column"})]},n)})}render(){var{columns:e,inputs:t}=this.state,i=t.length>=e.length;return s.jsxs("div",{role:"presentation",className:"select-distinct-builder-container h-100",children:[s.jsx("div",{className:"select-distinct-title",children:"Display Unique Values From"}),this.renderInputs(),s.jsx("hr",{}),s.jsx("div",{className:"pt-1 px-3",children:s.jsx(W,{kind:"ghost",className:"btn-add-column",onClick:this.handleAddColumnClick,disabled:i,icon:Ri,children:"Add Additional Column"})}),s.jsx("div",{className:"select-distinct-builder-footer",children:s.jsx("div",{className:"select-distinct-builder-hint",children:"Display only unique values from the selected table columns. Note that this will reset any filters and display only the selected columns."})})]})}}fu(sn,"defaultProps",{selectDistinctColumns:[],onChange:()=>{}});const bu=sn;function ji(r){var{items:e,onChange:t=()=>{}}=r;return s.jsx(zr,{items:Array.from(e.entries()).map(i=>{var[n,a]=i;return{title:ji.getAdvancedSettingsTitleForKey(n),isOn:a,onChange:o=>t(n,o)}})})}ji.getAdvancedSettingsTitleForKey=r=>{switch(r){case Lt.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from a control";case Lt.LINK_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from an incoming link filter"}};function Lr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function tt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(i){Eu(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Eu(r,e,t){return e=yu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yu(r){var e=wu(r,"string");return typeof e=="symbol"?e:String(e)}function wu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ur=ce.module("ConditionalFormattingMenu"),Ci=()=>{};function Fu(r){var{column:{type:e}}=r;if(T.isNumberType(e))return r.condition===P.IS_NULL||r.condition===P.IS_NOT_NULL?"":"".concat(r.value);if(T.isCharType(e))return r.condition===k.IS_NULL||r.condition===k.IS_NOT_NULL?"":"".concat(r.value);if(T.isStringType(e))return r.condition===B.IS_NULL||r.condition===B.IS_NOT_NULL?"":'"'.concat(r.value,'"');if(T.isDateType(e))return r.condition===k.IS_NULL||r.condition===k.IS_NOT_NULL?"":"".concat(r.value);if(T.isBooleanType(e))return"";throw new Error("Invalid column type ".concat(e," in getRuleValue"))}function Nu(r){return T.isNumberType(r.column.type)&&r.condition===P.IS_BETWEEN?"".concat(r.start," < ").concat(r.column.name," < ").concat(r.end):"".concat(r.column.name," ").concat(cs(r.column.type,r.condition),`
|
|
2
2
|
`).concat(Fu(r))}function Ou(r){var{rules:e=[],onChange:t=Ci,onCreate:i=Ci,onSelect:n=Ci}=r,a=y.useCallback((d,c,m)=>{d.stopPropagation(),Ur.debug("Rule clicked",c,m),n(m)},[n]),o=y.useCallback((d,c,m)=>{d.stopPropagation(),Ur.debug("Delete button clicked",c,m);var p=[...e];p.splice(m,1),t(p)},[t,e]),u=y.useCallback(d=>{d.stopPropagation()},[]),l=y.useCallback(d=>{if(Cr.stopDragging(),d.destination!=null){var c=d.source.index,m=d.destination.index,p=[...e],h=e[c];p.splice(c,1),p.splice(m,0,h),t(p)}},[t,e]);return s.jsxs("div",{className:"conditional-formatting-rules",children:[s.jsx(aa,{onDragStart:Cr.startDragging,onDragEnd:l,children:s.jsx(oa,{droppableId:"droppable-custom-columns",children:(d,c)=>s.jsxs("div",tt(tt({ref:d.innerRef},d.droppableProps),{},{className:Y("droppable-container",{dragging:c.draggingFromThisWith}),children:[e.length===0&&s.jsx("div",{className:"text-muted pl-2",children:"No formats defined"}),e.map((m,p)=>s.jsx(sa,{draggableId:"".concat(p,"-").concat(m.type),index:p,disableInteractiveElementBlocking:!0,children:(h,f)=>s.jsx("div",tt(tt({role:"menuitem",tabIndex:0,onClick:C=>a(C,m,p),className:Y("draggable-container",{dragging:f.isDragging}),ref:h.innerRef},h.draggableProps),{},{children:s.jsx("div",{className:"conditional-formatting-list-item",children:s.jsxs("div",{className:"formatting-item",children:[s.jsx("div",{className:"rule-icon",children:s.jsx("span",{className:"rule-icon-bg",style:{backgroundColor:Ut(m.config.style),color:jt(m.config.style)},children:m.type===Ce.ROWS?"row":"col"})}),s.jsx("div",{className:"rule-title",children:Nu(m.config)}),s.jsx(W,{kind:"ghost",className:"ml-1 px-2",onClick:C=>o(C,m,p),icon:Ai,tooltip:"Delete rule"}),s.jsxs("button",tt(tt({type:"button",className:"btn btn-link btn-link-icon px-2 btn-drag-handle",onClick:u},h.dragHandleProps),{},{children:[s.jsx(Xe,{children:"Drag to re-order"}),s.jsx(Z,{icon:ya})]}))]})})}))},"".concat(p,"-").concat(m.type))),d.placeholder]}))})}),s.jsx("hr",{}),s.jsx(W,{kind:"ghost",onClick:i,icon:Ri,children:"Add New Rule"})]})}var ze=ce.module("ConditionEditor"),Au=()=>{},Ru=[P.IS_EQUAL,P.IS_NOT_EQUAL,P.IS_BETWEEN,P.GREATER_THAN,P.GREATER_THAN_OR_EQUAL,P.LESS_THAN,P.LESS_THAN_OR_EQUAL,P.IS_NULL,P.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:zo(r)},r)),_u=[B.IS_EXACTLY,B.IS_NOT_EXACTLY,B.CONTAINS,B.DOES_NOT_CONTAIN,B.STARTS_WITH,B.ENDS_WITH,B.IS_NULL,B.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:Xo(r)},r)),xu=[k.IS_EXACTLY,k.IS_NOT_EXACTLY,k.IS_BEFORE,k.IS_BEFORE_OR_EQUAL,k.IS_AFTER,k.IS_AFTER_OR_EQUAL,k.IS_NULL,k.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:Zo(r)},r)),Du=[ne.IS_TRUE,ne.IS_FALSE,ne.IS_NULL,ne.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:Jo(r)},r)),Iu=[ee.IS_EQUAL,ee.IS_NOT_EQUAL,ee.IS_NULL,ee.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:es(r)},r));function Pu(r,e,t,i){return r===P.IS_NULL||r===P.IS_NOT_NULL||r===P.IS_BETWEEN&&t!=null&&t!==""&&!Number.isNaN(Number.parseFloat(t))&&i!=null&&i!==""&&!Number.isNaN(Number.parseFloat(i))||r!==P.IS_BETWEEN&&e!==void 0&&e!==""&&!Number.isNaN(Number.parseFloat(e))}function Lu(r,e,t,i,n,a,o){switch(r){case P.IS_EQUAL:case P.IS_NOT_EQUAL:case P.GREATER_THAN:case P.GREATER_THAN_OR_EQUAL:case P.LESS_THAN:case P.LESS_THAN_OR_EQUAL:return s.jsx("input",{type:"number",className:"form-control",placeholder:"Enter value",value:n??"",onChange:e});case P.IS_BETWEEN:return s.jsxs("div",{className:"d-flex flex-row",children:[s.jsx("input",{type:"number",className:"form-control d-flex mr-2",placeholder:"Start value",value:a??"",onChange:t}),s.jsx("input",{type:"number",className:"form-control d-flex",placeholder:"End value",value:o??"",onChange:i})]});case P.IS_NULL:case P.IS_NOT_NULL:return null}}function Uu(r,e,t){switch(r){case B.IS_NULL:case B.IS_NOT_NULL:return null;default:return s.jsx("input",{type:"text",className:"form-control",placeholder:"Enter value",value:t??"",onChange:e})}}function ju(r,e,t){switch(r){case k.IS_NULL:case k.IS_NOT_NULL:return null;default:return s.jsx("input",{type:"text",className:"form-control",placeholder:"Enter value",value:t??"",onChange:e})}}function ku(){return null}function Gu(r,e,t){switch(r){case ee.IS_NULL:case ee.IS_NOT_NULL:return null;default:return s.jsx("input",{type:"text",className:"form-control",maxLength:1,placeholder:"Enter value",value:t??"",onChange:e})}}function ln(r){var{column:e,config:t,dh:i,onChange:n=Au}=r,a=e.type,[o,u]=y.useState(a),[l,d]=y.useState(t.condition),[c,m]=y.useState(t.value),[p,h]=y.useState(t.start),[f,C]=y.useState(t.end);a!==o&&(d(Zr(a)),m(Jr(a)),h(void 0),C(void 0),u(a));var g=y.useMemo(()=>{if(a===void 0)return[];if(T.isNumberType(a))return Ru;if(T.isCharType(a))return Iu;if(T.isStringType(a))return _u;if(T.isDateType(a))return xu;if(T.isBooleanType(a))return Du},[a]),F=y.useCallback(E=>{ze.debug("handleConditionChange",E),d(E)},[]),w=y.useCallback(E=>{var{value:O}=E.target;ze.debug("handleValueChange",O),m(O)},[]),v=y.useCallback(E=>{var{value:O}=E.target;ze.debug("handleStartValueChange",O),h(O)},[]),N=y.useCallback(E=>{var{value:O}=E.target;ze.debug("handleEndValueChange",O),C(O)},[]);y.useEffect(function(){var O=!0;l===void 0?(ze.debug("Unable to create formatting rule. Condition is not selected."),O=!1):T.isNumberType(e.type)&&!Pu(l,c,p,f)?(ze.debug("Unable to create formatting rule. Invalid value",c),O=!1):T.isDateType(e.type)&&!ms(i,l,c)&&(ze.debug("Unable to create formatting rule. Invalid date condition",c),O=!1),n({condition:l,value:c,start:p,end:f},O)},[n,e.type,i,l,c,p,f]);var A=y.useMemo(()=>{if(a===void 0)return null;if(T.isNumberType(a))return Lu(l,w,v,N,c,p,f);if(T.isCharType(a))return Gu(l,w,c);if(T.isStringType(a))return Uu(l,w,c);if(T.isDateType(a))return ju(l,w,c);if(T.isBooleanType(a))return ku()},[a,l,c,p,f,w,v,N]);return s.jsxs("div",{className:"condition-editor mb-2",children:[s.jsx(nt,{value:l,"data-testid":"condition-select",className:"custom-select mb-2",onChange:F,children:g}),A]})}var Mu=ce.module("StyleEditor"),Vu="#fcfcfa",Bu="#f0f0ee",$u="#1a171a",Qu=200,Hu=()=>{};function un(r){var e,t,{config:i,onChange:n=Hu}=r,[a,o]=y.useState(i.type),[u,l]=y.useState((e=(t=i.customConfig)===null||t===void 0?void 0:t.background)!==null&&e!==void 0?e:Vu),[d,c]=y.useState(!1),[m,p]=y.useState(Qu),h=y.useRef(null),f=y.useCallback(A=>{var{value:E}=A.target;Mu.debug("handleBackgroundChange",E),l(E)},[]),C=y.useCallback(()=>{d&&c(!1)},[d]),g=y.useCallback(()=>{d||w(),c(!d)},[d]),F=y.useMemo(()=>[$.NO_FORMATTING,$.POSITIVE,$.NEGATIVE,$.WARN,$.NEUTRAL,$.ACCENT_1,$.ACCENT_2,$.CUSTOM],[]);function w(){h.current&&p(h.current.getBoundingClientRect().width)}y.useEffect(function(){n({type:a,customConfig:{color:wa.isDark(u)?Bu:$u,background:u}})},[n,a,u]);var v=y.useCallback(()=>{for(var A=[],E=function(){var x=F[O],G="option-".concat(O,"-").concat(x);A.push(s.jsxs(W,{kind:"inline",className:"style-option-btn",onClick:()=>{o(x),c(!1)},style:{color:jt({type:x}),background:Ut({type:x})},children:[x===a&&s.jsx(Z,{icon:wi,className:"mr-2"}),x!==a&&s.jsx("span",{className:"mr-4"}),yr(x)]},G))},O=0;O<F.length;O+=1)E();return A},[F,a]),N=y.useCallback(()=>s.jsx("div",{className:"style-menu-container",role:"presentation",style:{width:m},children:s.jsx("div",{className:"style-options",children:v()})}),[m,v]);return s.jsxs("div",{className:"style-editor",children:[s.jsxs("div",{className:"mb-2",ref:h,children:[s.jsx("label",{className:"mb-0",children:"Style"}),s.jsxs(W,{kind:"inline",className:"cs-dropdown custom-select",style:{color:jt({type:a}),background:Ut({type:a})},onClick:g,children:[yr(a),s.jsx(qa,{isShown:d,actions:{menuElement:N()},popperOptions:{placement:"bottom-start"},popperClassName:"style-dropdown-menu",onMenuClosed:C,menuStyle:{maxWidth:"100rem"}})]})]}),a===$.CUSTOM&&s.jsxs("div",{className:"mb-2",children:[s.jsx("label",{className:"mb-0",children:"Background"}),s.jsx("input",{type:"color",value:u,className:"custom-select color-select",onChange:f})]})]})}function jr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function dn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jr(Object(t),!0).forEach(function(i){Wu(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):jr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Wu(r,e,t){return e=Ku(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ku(r){var e=Yu(r,"string");return typeof e=="symbol"?e:String(e)}function Yu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var pt=ce.module("ColumnFormatEditor"),qu=()=>{};function zu(r){var{type:e,name:t}=r[0],i={type:e,name:t},n=dn({column:i,style:tn()},Mt(e));return n}function Xu(r){var e,{columns:t,config:i=zu(t),dh:n,onChange:a=qu}=r,[o,u]=y.useState((e=t.find(w=>w.name===i.column.name&&w.type===i.column.type))!==null&&e!==void 0?e:t[0]),[l,d]=y.useState(en(i)),[c,m]=y.useState(!1),[p,h]=y.useState(i.style),f=y.useCallback(w=>{var v=t.find(N=>{var{name:A}=N;return A===w});v!==void 0?(u(v),o.type!==v.type&&(d(Mt(v.type)),m(!1))):pt.error("Column ".concat(w," not found."))},[t,o]),C=y.useCallback((w,v)=>{pt.debug("handleConditionChange",w,v),d(w),m(v)},[]),g=y.useCallback(w=>{pt.debug("handleStyleChange",w),h(w)},[]);y.useEffect(function(){var v=c;o===void 0&&(pt.debug("Column is not selected, invalidating update."),v=!1),(p===void 0||p.type===$.NO_FORMATTING)&&(pt.debug("Style is not selected, invalidating update."),v=!1);var{type:N,name:A}=o,E={type:N,name:A};a(dn({column:E,style:p},l),v)},[a,o,p,l,c]);var F=y.useMemo(()=>t.map(w=>{var{name:v}=w;return v}),[t]);return s.jsxs("div",{className:"conditional-rule-editor form",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("label",{className:"mb-0",children:"Format Cell If"}),s.jsx(Xr,{"aria-label":"Select column to format",defaultSelectedKey:o?.name,onChange:f,children:F})]}),o!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(ln,{dh:n,column:o,config:l,onChange:C}),s.jsx(un,{config:p,onChange:g})]})]})}function kr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function cn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kr(Object(t),!0).forEach(function(i){Zu(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):kr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Zu(r,e,t){return e=Ju(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ju(r){var e=ed(r,"string");return typeof e=="symbol"?e:String(e)}function ed(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var gt=ce.module("RowFormatEditor"),td=()=>{};function id(r){var{type:e,name:t}=r[0],i={type:e,name:t},n=cn({column:i,style:tn()},Mt(e));return n}function rd(r){var e,{columns:t,config:i=id(t),dh:n,onChange:a=td}=r,[o,u]=y.useState((e=t.find(w=>w.name===i.column.name&&w.type===i.column.type))!==null&&e!==void 0?e:t[0]),[l,d]=y.useState(en(i)),[c,m]=y.useState(!1),[p,h]=y.useState(i.style),f=y.useCallback(w=>{var v=t.find(N=>{var{name:A}=N;return A===w});v!==void 0?(u(v),o.type!==v.type&&(d(Mt(v.type)),m(!1))):gt.error("Column ".concat(w," not found."))},[t,o]),C=y.useCallback((w,v)=>{gt.debug("handleConditionChange",w,v),d(w),m(v)},[]),g=y.useCallback(w=>{gt.debug("handleStyleChange",w),h(w)},[]);y.useEffect(function(){if(o===void 0){gt.debug("Column is not selected, skip update.");return}if(p===void 0){gt.debug("Style is not selected, skip update.");return}var{type:v,name:N}=o,A={type:v,name:N};a(cn({column:A,style:p},l),c)},[a,o,p,l,c]);var F=y.useMemo(()=>t.map(w=>{var{name:v}=w;return v}),[t]);return s.jsxs("div",{className:"conditional-rule-editor form",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("label",{className:"mb-0",children:"Format Row If"}),s.jsx(Xr,{"aria-label":"Select column to format row by",defaultSelectedKey:o?.name,onChange:f,children:F})]}),o!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(ln,{column:o,config:l,dh:n,onChange:C}),s.jsx(un,{config:p,onChange:g})]})]})}var Si=ce.module("ConditionalFormatEditor"),Ti=()=>{};function nd(r){switch(r){case Ce.CONDITIONAL:return s.jsx(so,{});case Ce.ROWS:return s.jsx(oo,{})}}function ad(r){switch(r){case Ce.CONDITIONAL:return"Conditional";case Ce.ROWS:return"Rows"}}var Gr=[Ce.CONDITIONAL,Ce.ROWS];function od(r){var e,{columns:t,dh:i,onSave:n=Ti,onUpdate:a=Ti,onCancel:o=Ti,rule:u}=r,l=t.filter(ps),[d,c]=y.useState((e=u?.type)!==null&&e!==void 0?e:Gr[0]),[m,p]=y.useState(u),[h,f]=y.useState(!1),C=y.useCallback(()=>{o()},[o]),g=y.useCallback(()=>{if(m===void 0){Si.error("Rule is not defined.");return}n(m)},[n,m]),F=y.useCallback(v=>{Si.debug("handleFormatterChange",v),c(v)},[]),w=y.useCallback((v,N)=>{Si.debug("handleRuleChange",v,N,d);var A={type:d,config:v};p(A),f(N),a(N?A:void 0)},[a,d]);return s.jsxs("div",{className:"conditional-format-editor form",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("label",{className:"mb-0",htmlFor:"formatter-select",children:"Select Formatter"}),s.jsx("div",{className:"formatter-list",children:Gr.map((v,N)=>s.jsx("div",{className:"formatter-type",children:s.jsxs("button",{type:"button",className:Y("btn","btn-icon","btn-formatter-type",{active:v===d}),"data-index":N,onClick:()=>F(v),children:[nd(v),ad(v)]})},v))})]}),d===Ce.CONDITIONAL&&s.jsx(Xu,{columns:l,dh:i,config:m?.config,onChange:w}),d===Ce.ROWS&&s.jsx(rd,{columns:l,config:m?.config,dh:i,onChange:w}),s.jsx("hr",{}),s.jsxs("div",{className:"d-flex justify-content-end my-3",children:[s.jsx(W,{kind:"secondary",onClick:C,className:"mr-2",children:"Cancel"}),s.jsx(W,{kind:"primary",onClick:g,disabled:m===void 0||!h,children:"Done"})]})]})}function sd(r){var e,t,{text:i,isOpen:n,onClose:a}=r,[o,u]=y.useState(!1),[l,d]=y.useState(0),[c,m]=y.useState(!1),[p,h]=y.useState(!1),[f,C]=y.useState(!1),g=y.useRef();y.useEffect(function(){if(n){try{JSON.parse(i),C(!0)}catch{C(!1)}h(!1)}},[n,i]),y.useEffect(function(){g.current&&g.current.layout()},[l]),y.useEffect(function(){g.current&&g.current.updateOptions({lineNumbers:c?"on":"off"})},[c]);function F(){m(!c)}function w(){var E,O=(E=g.current)===null||E===void 0?void 0:E.getModel();!f||!O||(p?(O.setValue(i),h(!1)):(O.setValue(JSON.stringify(JSON.parse(i),void 0,2)),h(!0)),v())}function v(){var E,O,D=g.current;D&&m(((E=(O=D.getModel())===null||O===void 0?void 0:O.getLineCount())!==null&&E!==void 0?E:0)>1)}function N(){o&&(g.current=void 0,a())}function A(E){g.current=E,d(E.getContentHeight()),E.onDidContentSizeChange(O=>{var{contentHeight:D}=O;return d(D)}),v()}return!n&&!o?null:s.jsxs(Fa,{isOpen:n,centered:!0,keyboard:!0,toggle:N,onOpened:()=>u(!0),onClosed:()=>{u(!1),d(0)},className:"cell-overflow-modal",size:"xl",children:[s.jsxs(Na,{toggle:a,children:[s.jsx("h5",{className:"overflow-modal-title",children:"Cell Contents"}),s.jsx(Wr,{kind:"inline",tooltip:"Copy cell contents",copy:(e=(t=g.current)===null||t===void 0?void 0:t.getValue())!==null&&e!==void 0?e:i}),s.jsx(W,{kind:"inline",active:c,icon:Oa,tooltip:"Toggle line numbers",onClick:F}),f&&s.jsx(W,{kind:"inline",icon:Aa,active:p,tooltip:"Format as JSON",onClick:w})]}),s.jsx(Ra,{style:{height:l},children:s.jsx(za,{onEditorInitialized:A,settings:{value:i,readOnly:!0,wordWrap:"on",language:f?"typescript":"plaintext",folding:f,padding:{bottom:16},lineNumbers:c?"on":"off",overviewRulerLanes:0,renderLineHighlight:"none",find:{seedSearchStringFromSelection:"never"}}})})]})}function ld(r){return r.model!==void 0}var ud="###,##0",hn=y.forwardRef((r,e)=>{var{gotoRow:t,gotoRowError:i,gotoValueError:n,onGotoRowSubmit:a,isShown:o,onEntering:u,onEntered:l,onExiting:d,onExited:c,model:m,onGotoRowNumberChanged:p,onClose:h,gotoValueSelectedColumnName:f,gotoValue:C,gotoValueFilter:g,onGotoValueSelectedColumnNameChanged:F,onGotoValueSelectedFilterChanged:w,onGotoValueChanged:v,onGotoValueSubmit:N}=r,A=y.useRef(null),E=y.useRef(null),[O,D]=y.useState(!1),x=[];ld(m)&&m.table!==void 0&&({columns:x}=m.table);var{dh:G,rowCount:z}=m,M=y.useMemo(()=>"goto-row-input-".concat(bi()),[]),oe=S=>{S.key==="Enter"?(S.stopPropagation(),S.preventDefault(),N()):(S.key==="Backspace"||S.key==="Delete")&&(C==="".concat(Number.POSITIVE_INFINITY)||C==="".concat(Number.NEGATIVE_INFINITY))&&Ee("")},X=S=>{S.key==="Enter"&&(S.stopPropagation(),S.preventDefault(),N(S.shiftKey))},le=m.getColumnIndexByName(f),_e=x[le??0],Le=_e?.type,Ge=T.getNormalizedType(Le),Ee=S=>{v(S??"")};y.useImperativeHandle(e,()=>({focus(){var S;D(!0),(S=A.current)===null||S===void 0||S.select()}}));var He=()=>{if(O&&document.activeElement!==A.current){var S;(S=A.current)===null||S===void 0||S.select()}else if(!O&&document.activeElement!==E.current){var R;(R=E.current)===null||R===void 0||R.select()}};y.useEffect(He,[O]);var at=()=>{switch(Ge){case T.dataType.DECIMAL:case T.dataType.INT:return s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:E,className:Y("form-control",{"is-invalid":n!==""}),onKeyDown:oe,placeholder:"value",onChange:S=>{var R=S.target.value.toLowerCase();/^-?[0-9]*\.?[0-9]*$/.test(S.target.value)?Ee(S.target.value):R==="-i"||R==="-infinity"?Ee("".concat(Number.NEGATIVE_INFINITY)):(R==="i"||R==="infinity")&&Ee("".concat(Number.POSITIVE_INFINITY))},value:C,"aria-label":"Value Input"})});case T.dataType.DATETIME:return s.jsx("div",{className:"goto-value-date-time-input",children:s.jsx(Eo,{ref:E,className:Y("form-control","goto-value-date-time-input",{"is-invalid":n!==""}),defaultValue:C,onChange:Ee,onSubmit:X,"aria-label":"Value Input"})});case T.dataType.STRING:return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"goto-row-input",children:s.jsxs(nt,{className:"custom-select",onChange:S=>{w(S)},value:g,"aria-label":"filter-type-select",children:[s.jsx("option",{value:Te.eqIgnoreCase,children:"Equals (case-insensitive)"},Te.eqIgnoreCase),s.jsx("option",{value:Te.containsIgnoreCase,children:"Contains (case-insensitive)"},Te.containsIgnoreCase),s.jsx("option",{value:Te.eq,children:"Equals"},Te.eq),s.jsx("option",{value:Te.contains,children:"Contains"},Te.contains)]})}),s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:E,className:Y("form-control",{"is-invalid":n!==""}),onKeyDown:X,placeholder:"value",onChange:S=>Ee(S.target.value),value:C,"aria-label":"Value Input"})})]});case T.dataType.BOOLEAN:return s.jsx("div",{className:"goto-row-input",children:s.jsxs(nt,{className:"custom-select",onChange:S=>{Ee(S)},value:C,"aria-label":"Value Input",children:[s.jsx("option",{"aria-label":"null value",value:""},"null"),s.jsx("option",{value:"true",children:"true"},"true"),s.jsx("option",{value:"false",children:"false"},"false")]})});default:return s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:E,className:"form-control",onKeyDown:X,placeholder:"value",onChange:S=>Ee(S.target.value),value:C,"aria-label":"Value Input"})})}};return s.jsx(Vt,{isShown:o,className:Y("goto-row"),onEntering:u,onEntered:()=>{l(),He()},onExiting:d,onExited:c,children:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"goto-row-row",children:[s.jsxs("div",{className:Y("goto-row-wrapper",{"is-inactive":!O}),onClick:()=>D(!0),onFocus:()=>D(!0),role:"group",children:[s.jsx("label",{className:"goto-row-text",htmlFor:M,children:"Go to row"}),s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:A,"data-testid":"goto-row-input",type:"number",onKeyDown:S=>{S.key==="Enter"&&(S.stopPropagation(),S.preventDefault(),a())},className:Y("form-control",{"is-invalid":i!==""}),placeholder:"Row number",onChange:S=>{p(S)},value:t,id:M})}),s.jsxs("div",{className:"goto-row-text",children:["of"," ",G.i18n.NumberFormat.format(ud,z)]}),i&&s.jsx("div",{className:"text-danger",children:i})]}),s.jsx("div",{className:"goto-row-close",children:s.jsx(W,{kind:"ghost",onClick:h,children:s.jsx(Z,{icon:Qr,style:{marginRight:"0"}})})})]}),m.isSeekRowAvailable&&s.jsx("div",{className:"goto-row-row",children:s.jsxs("div",{className:Y("goto-row-wrapper",{"is-inactive":O}),onClick:()=>D(!1),onFocus:()=>D(!1),role:"group",children:[s.jsx("div",{className:"goto-row-text",children:"Go to value"}),s.jsx("div",{className:"goto-row-input",children:s.jsx(nt,{className:"custom-select",onChange:S=>{var R=S;F(R)},value:f,"aria-label":"column-name-select",id:"column-name-select",children:x.map(S=>s.jsx("option",{value:S.name,children:S.name},S.name))})}),at(),s.jsxs("div",{children:[s.jsx(W,{tooltip:"Previous match",icon:_a,kind:"ghost",disabled:C==="",onClick:()=>{N(!0)}}),s.jsx(W,{tooltip:"Next match",icon:xa,kind:"ghost",disabled:C==="",onClick:()=>{N(!1)}})]}),n&&s.jsx("div",{className:"text-danger",children:n})]})})]})})});hn.displayName="GotoRow";const dd=hn;function Mr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function vt(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Mr(a,i,n,o,u,"next",l)}function u(l){Mr(a,i,n,o,u,"throw",l)}o(void 0)})}}function Vr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function se(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vr(Object(t),!0).forEach(function(i){_(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Vr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function _(r,e,t){return e=cd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function cd(r){var e=hd(r,"string");return typeof e=="symbol"?e:String(e)}function hd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var I=ce.module("IrisGrid"),md=500,pd=500,gd=250,vd=250,fd=250,mn=Object.freeze({aggregations:de,showOnTop:!1}),Cd="yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS z";function Br(r){var{advancedFilters:e,aggregationSettings:t,customColumns:i,quickFilters:n,reverseType:a,rollupConfig:o,searchFilter:u,selectDistinctColumns:l,sorts:d}=r;return e.size===0&&t.aggregations.length===0&&i.length===0&&n.size===0&&a===T.REVERSE_TYPE.NONE&&o==null&&u==null&&l.length===0&&d.length===0}class Pe extends y.Component{constructor(e){var t,i,n,a;super(e),_(this,"grid",void 0),_(this,"lastFocusedFilterBarColumn",void 0),_(this,"lastLoadedConfig",void 0),_(this,"tooltip",void 0),_(this,"pending",void 0),_(this,"globalColumnFormats",void 0),_(this,"dateTimeFormatterOptions",void 0),_(this,"decimalFormatOptions",void 0),_(this,"integerFormatOptions",void 0),_(this,"truncateNumbersWithPound",void 0),_(this,"showEmptyStrings",void 0),_(this,"showNullStrings",void 0),_(this,"loadingScrimStartTime",void 0),_(this,"loadingScrimFinishTime",void 0),_(this,"animationFrame",void 0),_(this,"loadingTimer",void 0),_(this,"tableSaver",void 0),_(this,"crossColumnRef",void 0),_(this,"isAnimating",void 0),_(this,"filterInputRef",void 0),_(this,"gotoRowRef",void 0),_(this,"isCopying",void 0),_(this,"toggleFilterBarAction",void 0),_(this,"toggleSearchBarAction",void 0),_(this,"toggleGotoRowAction",void 0),_(this,"discardAction",void 0),_(this,"commitAction",void 0),_(this,"contextActions",void 0),_(this,"tableUtils",void 0),_(this,"keyHandlers",void 0),_(this,"mouseHandlers",void 0),_(this,"getAdvancedMenuOpenedHandler",J(S=>this.handleAdvancedMenuOpened.bind(this,S),{max:100})),_(this,"getCachedAdvancedFilterMenuActions",J((S,R,j,Q,H)=>s.jsx(Go,{model:S,column:R,onFilterChange:this.handleAdvancedFilterChange,onSortChange:this.handleAdvancedFilterSortChange,onDone:this.handleAdvancedFilterDone,options:j,sortDirection:Q,formatter:H,tableUtils:this.tableUtils}),{max:50})),_(this,"getCachedOptionItems",J((S,R,j,Q,H,q,te,ue,ae,ge,Ze,wt,Ft,Qt,Ht,Nt)=>{var he=[];return S&&he.push({type:K.CHART_BUILDER,title:"Chart Builder",icon:Da}),he.push({type:K.VISIBILITY_ORDERING_BUILDER,title:"Organize Columns",icon:Ia}),j&&he.push({type:K.CONDITIONAL_FORMATTING,title:"Conditional Formatting",icon:Pa}),R&&he.push({type:K.CUSTOM_COLUMN_BUILDER,title:"Custom Columns",icon:La}),Q&&he.push({type:K.ROLLUP_ROWS,title:"Rollup Rows",icon:Ua}),H&&he.push({type:K.AGGREGATIONS,title:"Aggregate Columns",icon:ja}),q&&he.push({type:K.SELECT_DISTINCT,title:"Select Distinct Values",icon:ka}),te&&Ft&&he.push({type:K.TABLE_EXPORTER,title:"Download CSV",icon:Ga}),Nt&&he.push({type:K.ADVANCED_SETTINGS,title:"Advanced Settings",icon:Ma}),he.push({type:K.QUICK_FILTERS,title:"Quick Filters",subtitle:ue.shortcut.getDisplayText(),icon:Pt,isOn:Ze,onChange:ue.action}),Qt&&he.push({type:K.SEARCH_BAR,title:"Search Bar",subtitle:ae.shortcut.getDisplayText(),icon:Va,isOn:wt,onChange:ae.action}),he.push({type:K.GOTO,title:"Go to",subtitle:ge.shortcut.getDisplayText(),icon:Ba,isOn:Ht,onChange:ge.action}),Object.freeze(he)},{max:1})),_(this,"getCachedHiddenColumns",J((S,R)=>ie.getHiddenColumns(new Map([...S.initialColumnWidths,...R])),{max:1})),_(this,"getAggregationMap",J((S,R)=>{var j={};return R.forEach(Q=>{var{operation:H,selected:q,invert:te}=Q;j[H]=Rt.getOperationColumnNames(S,H,q,te)}),j})),_(this,"getOperationMap",J((S,R)=>{var j={};return R.filter(Q=>!Rt.isRollupOperation(Q.operation)).forEach(Q=>{var{operation:H,selected:q,invert:te}=Q;Rt.getOperationColumnNames(S,H,q,te).forEach(ue=>{var ae,ge=[...(ae=j[ue])!==null&&ae!==void 0?ae:[],H];j[ue]=Object.freeze(ge)})}),j})),_(this,"getOperationOrder",J(S=>S.map(R=>R.operation).filter(R=>!Rt.isRollupOperation(R)))),_(this,"getCachedFormatColumns",J((S,R,j)=>hs(S,R,j))),_(this,"getCachedPreviewFormatColumns",J((S,R,j,Q,H)=>{if(I.debug("getCachedPreviewFormatColumns",j,Q,H),Q!==void 0&&H!==void 0){var q=[...j];return q[H]=Q,this.getCachedFormatColumns(S,R,q)}return this.getCachedFormatColumns(S,R,j)})),_(this,"getModelRollupConfig",J((S,R,j)=>ie.getModelRollupConfig(S,R,j))),_(this,"getModelTotalsConfig",J((S,R,j)=>{var Q,H;if(((Q=R==null||(H=R.columns)===null||H===void 0?void 0:H.length)!==null&&Q!==void 0?Q:0)>0)return null;var q=j.aggregations.filter(ae=>ae.selected.length>0||ae.invert);if(q.length===0)return null;var te=this.getOperationMap(S,q),ue=this.getOperationOrder(q);return{operationMap:te,operationOrder:ue,showOnTop:j.showOnTop,defaultOperation:ro.SKIP}})),_(this,"getCachedStateOverride",J((S,R,j,Q,H,q,te,ue,ae,ge)=>({hoverSelectColumn:S,isFilterBarShown:R,isSelectingColumn:j,loadingScrimProgress:Q,quickFilters:H,advancedFilters:q,sorts:te,reverseType:ue,rollupConfig:ae,isMenuShown:ge}),{max:1})),_(this,"getCachedFilter",J((S,R,j,Q)=>[...S??[],...ie.getFiltersFromFilterMap(R),...ie.getFiltersFromFilterMap(j),...Q!==void 0?[Q]:[]],{max:1})),_(this,"getCachedTheme",J((S,R,j,Q)=>{var H,q=S??lo(),te=Q>0?(H=R?.rowFooterWidth)!==null&&H!==void 0?H:q.rowFooterWidth:0;return se(se(se({},q),R),{},{autoSelectRow:!j,rowFooterWidth:te})},{max:1})),_(this,"getCachedKeyHandlers",J(S=>[...S,...this.keyHandlers].sort((R,j)=>R.order-j.order))),_(this,"getCachedMouseHandlers",J(S=>[...S,...this.mouseHandlers])),_(this,"getCachedRenderer",J(S=>S??new uo,{max:1})),_(this,"getAlwaysFetchColumns",J((S,R,j,Q,H,q)=>{for(var te=[],ue=0;ue<Q;ue+=1)te.push(R[ve.getModelIndex(ue,j)].name);for(var ae=0;ae<H;ae+=1)te.push(R[ve.getModelIndex(R.length-1-ae,j)].name);if(q)for(var ge=q[0];ge<=q[1];ge+=1)te.push(R[ve.getModelIndex(ge,j)].name);var Ze=new Set([...S,...te]);return Object.freeze([...Ze])})),_(this,"updateSearchFilter",rt((S,R,j,Q)=>{var{model:H}=this.props,q=xt.createSearchFilter(H.dh,S,R,j,Q);this.setState({searchFilter:q})},gd)),_(this,"showViewportLoading",hr(()=>{var{model:S}=this.props,{loadingSpinnerShown:R}=this.state;S.isViewportPending&&!R&&this.startLoading("Waiting for viewport...",{loadingCancelShown:!1,loadingBlocksGrid:!1})},md,{leading:!1,trailing:!0})),_(this,"handleConditionalFormatEditorUpdate",rt(S=>{this.setState({conditionalFormatPreview:S})},fd)),_(this,"handleDownloadProgressUpdate",hr((S,R)=>{var{tableDownloadStatus:j}=this.state;j===Ye.DOWNLOAD_STATUS.DOWNLOADING&&this.setState({tableDownloadProgress:S,tableDownloadEstimatedTime:R})},pd)),_(this,"getOverflowButtonTooltip",J(S=>{if(S==null)return null;var R=se(se({position:"absolute"},S),{},{pointerEvents:"none"}),j={placement:"left",modifiers:{flip:{behavior:["left","right"]}}};return s.jsx("div",{style:R,children:s.jsx(Xe,{options:j,ref:this.handleTooltipRef,children:"View full contents"},Date.now())})})),_(this,"getExpandCellTooltip",J(S=>{if(S==null)return null;var{expandTooltipDisplayValue:R}=this.state,{model:j}=this.props,Q=$e(j)&&j.isExpandAllAvailable,H=se(se({position:"absolute"},S),{},{pointerEvents:"none"}),q={placement:"bottom-start"};return s.jsx("div",{style:H,children:s.jsx(Xe,{options:q,ref:this.handleTooltipRef,children:s.jsxs("div",{style:{textAlign:"left"},children:["Click to ",R," row",Q&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),Ae.isMacPlatform()?"⌘":"Ctrl+","Click to expand row and all children"]})]})},Date.now())})})),_(this,"getLinkHoverTooltip",J(S=>{if(S==null)return null;var{linkHoverDisplayValue:R}=this.state,j=se(se({position:"absolute"},S),{},{pointerEvents:"none"}),Q={placement:"bottom"};return s.jsx("div",{style:j,children:s.jsx(Xe,{options:Q,ref:this.handleTooltipRef,children:s.jsxs("div",{className:"link-hover-tooltip",children:[R," - Click once to follow.",s.jsx("br",{}),"Click and hold to select this cell."]})})})})),_(this,"handleGotoValueChanged",S=>{this.setState({gotoValue:S,gotoValueManuallyChanged:!0}),this.debouncedSeekRow(S)}),_(this,"debouncedSeekRow",rt(S=>{this.seekRow(S)},vd)),this.handleAdvancedFilterChange=this.handleAdvancedFilterChange.bind(this),this.handleAdvancedFilterSortChange=this.handleAdvancedFilterSortChange.bind(this),this.handleAdvancedFilterDone=this.handleAdvancedFilterDone.bind(this),this.handleAdvancedMenuOpened=this.handleAdvancedMenuOpened.bind(this),this.handleGotoRowOpened=this.handleGotoRowOpened.bind(this),this.handleGotoRowClosed=this.handleGotoRowClosed.bind(this),this.handleAdvancedMenuClosed=this.handleAdvancedMenuClosed.bind(this),this.handleAggregationChange=this.handleAggregationChange.bind(this),this.handleAggregationsChange=this.handleAggregationsChange.bind(this),this.handleAggregationEdit=this.handleAggregationEdit.bind(this),this.handleAnimationLoop=this.handleAnimationLoop.bind(this),this.handleAnimationStart=this.handleAnimationStart.bind(this),this.handleAnimationEnd=this.handleAnimationEnd.bind(this),this.handleChartChange=this.handleChartChange.bind(this),this.handleChartCreate=this.handleChartCreate.bind(this),this.handleGridError=this.handleGridError.bind(this),this.handleFilterBarChange=this.handleFilterBarChange.bind(this),this.handleFilterBarDone=this.handleFilterBarDone.bind(this),this.handleFilterBarTab=this.handleFilterBarTab.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleMenu=this.handleMenu.bind(this),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleMenuSelect=this.handleMenuSelect.bind(this),this.handleMenuBack=this.handleMenuBack.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleSelectionChanged=this.handleSelectionChanged.bind(this),this.handleMovedColumnsChanged=this.handleMovedColumnsChanged.bind(this),this.handleHeaderGroupsChanged=this.handleHeaderGroupsChanged.bind(this),this.handleUpdate=this.handleUpdate.bind(this),this.handleTooltipRef=this.handleTooltipRef.bind(this),this.handleViewChanged=this.handleViewChanged.bind(this),this.handleFormatSelection=this.handleFormatSelection.bind(this),this.handleConditionalFormatCreate=this.handleConditionalFormatCreate.bind(this),this.handleConditionalFormatEdit=this.handleConditionalFormatEdit.bind(this),this.handleConditionalFormatsChange=this.handleConditionalFormatsChange.bind(this),this.handleConditionalFormatEditorSave=this.handleConditionalFormatEditorSave.bind(this),this.handleConditionalFormatEditorCancel=this.handleConditionalFormatEditorCancel.bind(this),this.handleUpdateCustomColumns=this.handleUpdateCustomColumns.bind(this),this.handleCustomColumnsChanged=this.handleCustomColumnsChanged.bind(this),this.handleSelectDistinctChanged=this.handleSelectDistinctChanged.bind(this),this.handlePendingDataUpdated=this.handlePendingDataUpdated.bind(this),this.handleViewportUpdated=this.handleViewportUpdated.bind(this),this.handlePendingCommitClicked=this.handlePendingCommitClicked.bind(this),this.handlePendingDiscardClicked=this.handlePendingDiscardClicked.bind(this),this.handleGotoRowSelectedRowNumberSubmit=this.handleGotoRowSelectedRowNumberSubmit.bind(this),this.focusRowInGrid=this.focusRowInGrid.bind(this),this.handleDownloadTable=this.handleDownloadTable.bind(this),this.handleDownloadTableStart=this.handleDownloadTableStart.bind(this),this.handleCancelDownloadTable=this.handleCancelDownloadTable.bind(this),this.handleDownloadCanceled=this.handleDownloadCanceled.bind(this),this.handleDownloadCompleted=this.handleDownloadCompleted.bind(this),this.handlePartitionChange=this.handlePartitionChange.bind(this),this.handleColumnVisibilityChanged=this.handleColumnVisibilityChanged.bind(this),this.handleColumnVisibilityReset=this.handleColumnVisibilityReset.bind(this),this.handleCrossColumnSearch=this.handleCrossColumnSearch.bind(this),this.handleRollupChange=this.handleRollupChange.bind(this),this.handleOverflowClose=this.handleOverflowClose.bind(this),this.getColumnBoundingRect=this.getColumnBoundingRect.bind(this),this.handleGotoRowSelectedRowNumberChanged=this.handleGotoRowSelectedRowNumberChanged.bind(this),this.handleGotoValueSelectedColumnNameChanged=this.handleGotoValueSelectedColumnNameChanged.bind(this),this.handleGotoValueSelectedFilterChanged=this.handleGotoValueSelectedFilterChanged.bind(this),this.handleGotoValueChanged=this.handleGotoValueChanged.bind(this),this.handleGotoValueSubmitted=this.handleGotoValueSubmitted.bind(this),this.handleViewportUpdated=this.handleViewportUpdated.bind(this),this.makeQuickFilter=this.makeQuickFilter.bind(this),this.grid=null,this.lastLoadedConfig=null,this.pending=new Yr,this.globalColumnFormats=de,this.decimalFormatOptions={},this.integerFormatOptions={},this.truncateNumbersWithPound=!1,this.showEmptyStrings=!0,this.showNullStrings=!0,this.tableSaver=null,this.crossColumnRef=ke.createRef(),this.isAnimating=!1,this.filterInputRef=ke.createRef(),this.gotoRowRef=ke.createRef(),this.isCopying=!1,this.toggleFilterBarAction={action:()=>this.toggleFilterBar(),shortcut:Ne.TABLE.TOGGLE_QUICK_FILTER},this.toggleSearchBarAction={action:()=>this.toggleSearchBar(),shortcut:Ne.TABLE.TOGGLE_SEARCH},this.toggleGotoRowAction={action:()=>this.toggleGotoRow(),shortcut:Ne.TABLE.GOTO_ROW},this.discardAction={action:()=>{var{model:S}=this.props;Be(S)&&S.isEditable&&S.pendingDataMap.size>0&&this.discardPending().catch(I.error)},shortcut:Ne.INPUT_TABLE.DISCARD},this.commitAction={action:()=>{var{model:S}=this.props;Be(S)&&S.isEditable&&S.pendingDataMap.size>0&&S.pendingDataErrors.size===0&&this.commitPending().catch(I.error)},shortcut:Ne.INPUT_TABLE.COMMIT},this.contextActions=[this.toggleFilterBarAction,this.toggleSearchBarAction,this.toggleGotoRowAction,this.discardAction,this.commitAction];var{aggregationSettings:o,conditionalFormats:u,customColumnFormatMap:l,isFilterBarShown:d,isSelectingPartition:c,partitions:m,partitionConfig:p,model:h,movedColumns:f,movedRows:C,rollupConfig:g,userColumnWidths:F,userRowHeights:w,showSearchBar:v,searchValue:N,selectedSearchColumns:A,invertSearchColumns:E,advancedFilters:O,quickFilters:D,selectDistinctColumns:x,pendingDataMap:G,canCopy:z,frozenColumns:M,columnHeaderGroups:oe}=e,{dh:X}=h,le=[new _s(this),new Ms(this),new Hs(this)],_e=[new zs(this),new Ql(this),new eu(this),new tl(this),new ol(this),new Yl(this),new Gl(this),new wl(this,X),new Pl(this),new zl(this)];z&&(le.push(new Ls(this)),_e.push(new Rl(this)));var Le=f.length>0?f:h.initialMovedColumns,Ge=C.length>0?C:h.initialMovedRows,Ee=new co({userColumnWidths:new Map(F),userRowHeights:new Map(w),movedColumns:Le,initialColumnWidths:new Map(h==null||(t=h.layoutHints)===null||t===void 0||(i=t.hiddenColumns)===null||i===void 0?void 0:i.map(S=>[h.getColumnIndexByName(S),0]))}),He=A??[],at=xt.createSearchFilter(X,N,He,h.columns,E);this.tableUtils=new T(X),this.mouseHandlers=_e,this.keyHandlers=le,this.state={isFilterBarShown:d,isSelectingPartition:c,focusedFilterBarColumn:null,metricCalculator:Ee,metrics:void 0,partitionConfig:p??(m&&m.length?{partitions:m,mode:"partition"}:void 0),quickFilters:D?new Map(D):new Map,advancedFilters:new Map(O),shownAdvancedFilter:null,hoverAdvancedFilter:null,sorts:[],reverseType:T.REVERSE_TYPE.NONE,customColumns:[],selectDistinctColumns:x,selectedRanges:[],copyOperation:null,loadingText:null,loadingScrimProgress:null,loadingSpinnerShown:!1,loadingCancelShown:!1,loadingBlocksGrid:!1,movedColumns:Le,movedRows:Ge,shownColumnTooltip:null,formatter:new mi(X),isMenuShown:!1,customColumnFormatMap:new Map(l),conditionalFormats:u,conditionalFormatEditIndex:null,conditionalFormatPreview:void 0,hoverSelectColumn:null,isTableDownloading:!1,isReady:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:0,showSearchBar:v,searchFilter:at,searchValue:N,selectedSearchColumns:He,invertSearchColumns:E,rollupConfig:g,rollupSelectedColumns:[],aggregationSettings:o,selectedAggregation:null,openOptions:[],pendingRowCount:0,pendingDataMap:G??new Map,pendingDataErrors:new Map,pendingSavePromise:null,pendingSaveError:null,toastMessage:null,frozenColumns:M,showOverflowModal:!1,overflowText:"",overflowButtonTooltipProps:null,expandCellTooltipProps:null,expandTooltipDisplayValue:"expand",linkHoverTooltipProps:null,linkHoverDisplayValue:"",isGotoShown:!1,gotoRow:"",gotoRowError:"",gotoValueError:"",gotoValueSelectedColumnName:(n=(a=h.columns[0])===null||a===void 0?void 0:a.name)!==null&&n!==void 0?n:"",gotoValueSelectedFilter:Te.eqIgnoreCase,gotoValue:"",gotoValueManuallyChanged:!1,columnHeaderGroups:oe??h.initialColumnHeaderGroups}}componentDidMount(){var{model:e}=this.props;this.initState(),this.startListening(e)}componentDidUpdate(e,t){var{inputFilters:i,isSelectingColumn:n,settings:a,model:o,customFilters:u,sorts:l}=this.props;o!==e.model&&(this.stopListening(e.model),this.startListening(o));var d=i!==e.inputFilters?i.filter(F=>!e.inputFilters.includes(F)):[];if(d.length>0){var c,{advancedSettings:m}=this.props,p=(c=m.get(Lt.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS))!==null&&c!==void 0?c:!1;p&&(this.clearGridInputField(),this.clearCrossColumSearch()),this.startLoading("Filtering...",{resetRanges:!0}),this.applyInputFilters(d,p)}n!==e.isSelectingColumn&&this.resetColumnSelection(),a!==e.settings&&this.updateFormatterSettings(a),u!==e.customFilters&&this.startLoading("Filtering...",{resetRanges:!0}),l!==e.sorts&&this.updateSorts(l);var{loadingScrimStartTime:h,loadingScrimFinishTime:f}=this;h!=null&&f!=null&&window.requestAnimationFrame(()=>{var F=Date.now(),w=F-h,v=f-h,N=Math.min(w/v,1);f<F&&(this.loadingScrimStartTime=void 0,this.loadingScrimFinishTime=void 0),this.setState(A=>A.loadingScrimProgress==null?(I.debug2("Ignoring scrim update because loading cancelled."),null):{loadingScrimProgress:N})});var{openOptions:C}=this.state;if(C!==t.openOptions){var g=F=>F.type===K.AGGREGATION_EDIT;!C.some(g)&&t.openOptions.some(g)&&this.removeEmptyAggregations()}this.sendStateChange()}componentWillUnmount(){var{model:e}=this.props;this.stopListening(e),this.pending.cancel(),this.updateSearchFilter.cancel(),this.loadingTimer&&clearTimeout(this.loadingTimer),this.handleDownloadProgressUpdate.cancel(),this.animationFrame!==void 0&&cancelAnimationFrame(this.animationFrame),this.showViewportLoading.cancel()}get gridWrapper(){var e,t;return(e=(t=this.grid)===null||t===void 0?void 0:t.canvasWrapper.current)!==null&&e!==void 0?e:null}getKeyHandlers(){var{keyHandlers:e}=this.props;return this.getCachedKeyHandlers(e)}get renderer(){var{renderer:e}=this.props;return this.getCachedRenderer(e)}getMouseHandlers(){var{mouseHandlers:e}=this.props;return this.getCachedMouseHandlers(e)}getValueForCell(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{model:n}=this.props,{dh:a}=n,o=this.getModelColumn(e),u=this.getModelRow(t);if(i&&o!=null&&u!=null){var l=n.valueForCell(o,u);if(T.isDateType(n.columns[o].type)){var{formatter:d}=n;return a.i18n.DateTimeFormat.format(Cd,l,a.i18n.TimeZone.getTimeZone(d.timeZone))}return l}return i?null:o!=null&&u!=null?n.textForCell(o,u):""}getModelColumn(e){var{metrics:t}=this.state;L(t);var{modelColumns:i}=t;return i==null?null:e!=null?i.get(e):null}getModelRow(e){var{metrics:t}=this.state;L(t);var{modelRows:i}=t;return i==null?null:e!=null?i.get(e):null}getTheme(){var e,{model:t,theme:i}=this.props;return this.getCachedTheme(this.context,i,(e=Be(t)&&t.isEditable)!==null&&e!==void 0?e:!1,t.floatingTopRowCount+t.floatingBottomRowCount)}getVisibleColumn(e){var{movedColumns:t}=this.state;return ve.getVisibleIndex(e,t)}makeQuickFilter(e,t,i){try{return this.tableUtils.makeQuickFilter(e,t,i)}catch(n){I.error("Error creating quick filter",n)}return null}applyInputFilters(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{model:i}=this.props,{advancedFilters:n,quickFilters:a}=this.state,o=t?new Map:new Map(n),u=t?new Map:new Map(a),l=t&&n.size>0;e.forEach(d=>{var{name:c,type:m,value:p}=d,h=i.columns.findIndex(f=>{var{name:C,type:g}=f;return C===c&&g===m});h>=0?(l=o.delete(h)||l,l=this.applyQuickFilter(h,p,u)||l):I.error("Unable to find column for inputFilter",c,m,p)}),l&&this.setState({quickFilters:u,advancedFilters:o})}applyQuickFilter(e,t,i){var{model:n}=this.props,{formatter:a}=n,o=n.columns[e];if(t!=null&&"".concat(t).trim().length>0){var u=i.get(e);if(u!=null){var{text:l}=u;if(l===t)return I.debug2("Ignoring change to existing filter"),!1}return i.set(e,{text:t,filter:this.makeQuickFilter(o,t,a.timeZone)}),!0}return i.delete(e)}setAdvancedFilterMap(e){this.setState({advancedFilters:e})}setAdvancedFilter(e,t,i){I.debug("Setting advanced filter",e,t),this.startLoading("Filtering...",{resetRanges:!0}),this.setState(n=>{var{advancedFilters:a}=n,o=new Map(a);return t==null?o.delete(e):o.set(e,{filter:t,options:i}),{advancedFilters:o}})}setQuickFilter(e,t,i){I.debug("Setting quick filter",e,t,i),this.startLoading("Filtering...",{resetRanges:!0}),this.setState(n=>{var{quickFilters:a}=n,o=new Map(a);return o.set(e,{filter:t,text:i}),{quickFilters:o}})}setFilterMap(e){var t;I.debug("setFilterMap",e);var{advancedSettings:i}=this.props,n=(t=i.get(Lt.LINK_CHANGE_CLEARS_ALL_FILTERS))!==null&&t!==void 0?t:!1;n&&this.clearAllFilters();var{model:a}=this.props;e.forEach((o,u)=>{var{columnType:l,filterList:d}=o,c=a.columns.find(f=>f.name===u&&f.type===l);if(c!=null){var m=a.getColumnIndexByName(c.name);L(m);var p=ie.combineFiltersFromList(l,d);if(p.length===0)this.removeQuickFilter(m);else{var{formatter:h}=a;this.setQuickFilter(m,this.makeQuickFilter(c,p,h.timeZone),"".concat(p))}}})}removeColumnFilter(e){this.startLoading("Filtering...",{resetRanges:!0});var t=Array.isArray(e)?e:[e,e];this.setState(i=>{var{advancedFilters:n,quickFilters:a}=i,o=n?new Map(n):new Map,u=a?new Map(a):new Map;return o.forEach((l,d)=>{d>=t[0]&&d<=t[1]&&o.delete(d)}),u.forEach((l,d)=>{d>=t[0]&&d<=t[1]&&u.delete(d)}),{quickFilters:u,advancedFilters:o}})}removeQuickFilter(e){this.startLoading("Clearing Filter...",{resetRanges:!0}),this.setState(t=>{var{quickFilters:i}=t,n=new Map(i);return n.delete(e),{quickFilters:n}})}clearAllFilters(){I.debug("Clearing all filters");var{advancedFilters:e,quickFilters:t,searchFilter:i}=this.state;t.size===0&&e.size===0&&i===null||(this.clearGridInputField(),this.startLoading("Clearing Filters...",{resetRanges:!0}),this.setState({quickFilters:new Map,advancedFilters:new Map,searchValue:"",searchFilter:void 0}))}clearCrossColumSearch(){I.debug("Clearing cross-column search"),this.setState({searchValue:"",searchFilter:void 0})}clearGridInputField(){this.filterInputRef.current!=null&&this.filterInputRef.current.setValue("")}rebuildFilters(){I.debug("Rebuilding filters");var{model:e}=this.props,{advancedFilters:t,quickFilters:i}=this.state,{columns:n,formatter:a}=e,o=new Map,u=new Map;t.forEach((l,d)=>{var{options:c}=l,m=n[d],p=this.tableUtils.makeAdvancedFilter(m,c,a.timeZone);o.set(d,{options:c,filter:p})}),i.forEach((l,d)=>{var{text:c}=l,m=n[d];u.set(d,{text:c,filter:this.makeQuickFilter(m,c,a.timeZone)})}),this.startLoading("Rebuilding filters...",{resetRanges:!0}),this.setState({quickFilters:u,advancedFilters:o})}setFilters(e){var{quickFilters:t,advancedFilters:i}=e;this.setState({quickFilters:t,advancedFilters:i})}updateFormatterSettings(e){var t,i,n,a,o,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,l=Tr.getColumnFormats(e),d=Tr.getDateTimeFormatterOptions(e),c=(t=e?.defaultDecimalFormatOptions)!==null&&t!==void 0?t:{},m=(i=e?.defaultIntegerFormatOptions)!==null&&i!==void 0?i:{},p=(n=e?.truncateNumbersWithPound)!==null&&n!==void 0?n:!1,h=(a=e?.showEmptyStrings)!==null&&a!==void 0?a:!0,f=(o=e?.showNullStrings)!==null&&o!==void 0?o:!0,C=!De(this.globalColumnFormats,l),g=!De(this.dateTimeFormatterOptions,d),F=!De(this.decimalFormatOptions,e?.defaultDecimalFormatOptions),w=!De(this.integerFormatOptions,m),v=this.truncateNumbersWithPound!==p,N=this.showEmptyStrings!==h,A=this.showNullStrings!==f;(C||g||F||w||v||N||A)&&(this.globalColumnFormats=l,this.dateTimeFormatterOptions=d,this.decimalFormatOptions=c,this.integerFormatOptions=m,this.truncateNumbersWithPound=p,this.showEmptyStrings=h,this.showNullStrings=f,this.updateFormatter({},u),g&&u&&this.rebuildFilters())}updateFormatter(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{customColumnFormatMap:n}=this.state,{model:a}=this.props,o=se({customColumnFormatMap:n},e),u=[...(t=this.globalColumnFormats)!==null&&t!==void 0?t:[],...o.customColumnFormatMap.values()],l=new mi(a.dh,u,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions,this.truncateNumbersWithPound,this.showEmptyStrings,this.showNullStrings);I.debug("updateFormatter",this.globalColumnFormats,u),this.setState(se(se({},o),{},{formatter:l}),()=>{i&&this.grid&&this.grid.forceUpdate()})}initFormatter(){var{settings:e}=this.props;this.updateFormatterSettings(e)}initState(){var{model:e}=this.props;try{Ni(e)&&e.isPartitionRequired?this.loadPartitionsTable(e):this.loadTableState()}catch(t){this.handleTableLoadError(t)}}loadTableState(){var{applyInputFiltersOnInit:e,inputFilters:t,sorts:i,model:n,reverseType:a,customColumns:o,searchValue:u,selectedSearchColumns:l,invertSearchColumns:d}=this.props,c=l??[],m=xt.createSearchFilter(n.dh,u,c,n.columns,d);if(e){var p=t.filter(h=>h.value!=null);this.applyInputFilters(p)}this.setState({sorts:i,reverseType:a,customColumns:o,isReady:!0,searchFilter:m}),this.initFormatter()}loadPartitionsTable(e){var t=this;return vt(function*(){try{var i=yield t.getInitialPartitionConfig(e);t.setState({isSelectingPartition:!0,partitionConfig:i},t.loadTableState)}catch(n){Oe.isCanceled(n)||t.handleTableLoadError(n)}})()}getInitialPartitionConfig(e){var t=this;return vt(function*(){var{partitionConfig:i}=t.state;if(i!==void 0)return i;var n=yield t.pending.add(e.partitionKeysTable(),u=>u.close()),{dh:a}=e,o=n.columns.map(u=>u.sort().desc());return n.applySort(o),n.setViewport(0,0),new Promise((u,l)=>{n.addEventListener(a.Table.EVENT_UPDATED,d=>{try{var{detail:c}=d;if(c.rows.length===0)return;var m=c.rows[0],p=n.columns.map(f=>{var C;return(C=m.get(f))!==null&&C!==void 0?C:null}),h={partitions:p,mode:"partition"};n.close(),u(h)}catch(f){n.close(),l(f)}})})})()}copyCell(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{canCopy:n}=this.props;if(n){var a=String(this.getValueForCell(e,t,i));Ii(a).catch(o=>I.error("Unable to copy cell",o))}else I.error("Attempted to copyCell for user without copy permission.")}copyColumnHeader(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==null){var{canCopy:i}=this.props,{movedColumns:n}=this.state;if(i){var a={columnIndex:e,columnDepth:t,movedColumns:n};this.setState({copyOperation:a})}else I.error("Attempted copyColumnHeader for user without copy permission.")}}copyRanges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=arguments.length>3?arguments[3]:void 0,{model:a,canCopy:o}=this.props,{metricCalculator:u,movedColumns:l}=this.state,d=u.getUserColumnWidths();if(o){var c={ranges:Fe.boundedRanges(e,a.columnCount,a.rowCount),includeHeaders:t,formatValues:i,movedColumns:l,userColumnWidths:d,error:n};this.setState({copyOperation:c})}else I.error("Attempted copyRanges for user without copy permission.")}startLoading(e){var{resetRanges:t=!1,loadingCancelShown:i=!0,loadingBlocksGrid:n=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.setState({loadingText:e,loadingCancelShown:i,loadingBlocksGrid:n});var a=this.getTheme();if(t&&this.grid&&(this.grid.clearSelectedRanges(),this.grid.setViewState({top:0},!0)),this.loadingScrimStartTime==null){var o,u,{minScrimTransitionTime:l,maxScrimTransitionTime:d}=a;L(l),L(d);var c=(o=(u=this.gridWrapper)===null||u===void 0?void 0:u.getBoundingClientRect().height)!==null&&o!==void 0?o:0,m=Math.max(l,Math.min(c/2,d));this.loadingScrimStartTime=Date.now(),this.loadingScrimFinishTime=this.loadingScrimStartTime+m,this.setState({loadingScrimProgress:0}),this.loadingTimer=setTimeout(()=>{this.setState({loadingSpinnerShown:!0})},Pe.loadingSpinnerDelay)}}stopLoading(){this.showViewportLoading.cancel(),this.loadingScrimStartTime=void 0,this.loadingScrimFinishTime=void 0,this.setState({loadingText:null,loadingScrimProgress:null,loadingSpinnerShown:!1,loadingCancelShown:!1}),this.loadingTimer!=null&&(clearTimeout(this.loadingTimer),this.loadingTimer=void 0)}rollback(){if(this.lastLoadedConfig){I.debug("loading last loading config",this.lastLoadedConfig);var{advancedFilters:e,aggregationSettings:t,customColumns:i,quickFilters:n,reverseType:a,rollupConfig:o,searchFilter:u,selectDistinctColumns:l,sorts:d}=this.lastLoadedConfig;this.lastLoadedConfig=null,this.setState({advancedFilters:e,aggregationSettings:t,customColumns:i,quickFilters:n,reverseType:a,rollupConfig:o,searchFilter:u,selectDistinctColumns:l,sorts:d})}else I.debug("remove all sorts, filters, and custom columns"),this.setState({advancedFilters:new Map,aggregationSettings:mn,customColumns:[],quickFilters:new Map,reverseType:T.REVERSE_TYPE.NONE,rollupConfig:void 0,selectDistinctColumns:[],sorts:[]})}canRollback(){return this.lastLoadedConfig!=null||!Br(this.state)}startListening(e){e.addEventListener(xe.EVENT.UPDATED,this.handleUpdate),e.addEventListener(xe.EVENT.REQUEST_FAILED,this.handleRequestFailed),e.addEventListener(xe.EVENT.COLUMNS_CHANGED,this.handleCustomColumnsChanged),e.addEventListener(xe.EVENT.PENDING_DATA_UPDATED,this.handlePendingDataUpdated),e.addEventListener(xe.EVENT.VIEWPORT_UPDATED,this.handleViewportUpdated)}stopListening(e){e.removeEventListener(xe.EVENT.UPDATED,this.handleUpdate),e.removeEventListener(xe.EVENT.REQUEST_FAILED,this.handleRequestFailed),e.removeEventListener(xe.EVENT.COLUMNS_CHANGED,this.handleCustomColumnsChanged),e.removeEventListener(xe.EVENT.PENDING_DATA_UPDATED,this.handlePendingDataUpdated),e.removeEventListener(xe.EVENT.VIEWPORT_UPDATED,this.handleViewportUpdated)}focus(){var e;(e=this.grid)===null||e===void 0||e.focus()}focusFilterBar(e){var{movedColumns:t}=this.state,{model:i}=this.props,{columnCount:n}=i,a=ve.getModelIndex(e,t);if(e==null||e<0||n<=e||!i.isFilterable(a)){this.setState({focusedFilterBarColumn:null});return}var{metricCalculator:o,metrics:u}=this.state;L(u);var{left:l,rightVisible:d,lastLeft:c}=u;if(e<l){var m;(m=this.grid)===null||m===void 0||m.setViewState({left:e},!0)}else if(d<e){var p,h,f=(p=this.grid)===null||p===void 0?void 0:p.getMetricState();L(f);var C=o.getLastLeft(f,e,o.getVisibleWidth(f));(h=this.grid)===null||h===void 0||h.setViewState({left:Math.min(C,c),leftOffset:0},!0)}this.lastFocusedFilterBarColumn=e,this.setState({focusedFilterBarColumn:e,isFilterBarShown:!0})}hideColumnByVisibleIndex(e){var t,{metricCalculator:i,movedColumns:n}=this.state;i.setColumnWidth(ve.getModelIndex(e,n),0),(t=this.grid)===null||t===void 0||t.forceUpdate()}freezeColumnByColumnName(e){var{frozenColumns:t,movedColumns:i}=this.state,{model:n}=this.props;I.debug2("freezing column",e);var a=t==null?new Set(n.frozenColumns):new Set(t);a.add(e);var o=n.getColumnIndexByName(e);L(o);var u=ve.getVisibleIndex(o,i),l=ve.moveItem(u,a.size-1,i);this.setState({frozenColumns:[...a],movedColumns:l})}unFreezeColumnByColumnName(e){var{frozenColumns:t,movedColumns:i}=this.state,{model:n}=this.props;I.debug2("unfreezing column",e);var a=t==null?new Set(n.frozenColumns):new Set(t);a.delete(e);var o=n.getColumnIndexByName(e);L(o);var u=ve.getVisibleIndex(o,i),l=ve.moveItem(u,a.size+n.frontColumns.length,i);this.setState({frozenColumns:[...a],movedColumns:l})}handleColumnVisibilityChanged(e,t){var i,{metricCalculator:n,metrics:a}=this.state;L(a),t?e.forEach(o=>{var u=n.initialColumnWidths.get(o),l=Fi(a.calculatedColumnWidths,o);u!==l?n.setColumnWidth(o,l):n.resetColumnWidth(o)}):e.forEach(o=>{n.setColumnWidth(o,0)}),(i=this.grid)===null||i===void 0||i.forceUpdate()}handleColumnVisibilityReset(){var e,t,{metricCalculator:i,metrics:n}=this.state,{model:a}=this.props;L(n);for(var o=0;o<n.columnCount;o+=1)i.resetColumnWidth(o);this.handleMovedColumnsChanged(a.initialMovedColumns),this.handleHeaderGroupsChanged(a.initialColumnHeaderGroups),this.setState({frozenColumns:(e=(t=a.layoutHints)===null||t===void 0?void 0:t.frozenColumns)!==null&&e!==void 0?e:[]})}handleCrossColumnSearch(e,t,i){var{model:n}=this.props;this.startLoading("Searching..."),this.updateSearchFilter(e,t,n.columns,i),this.setState({searchValue:e,selectedSearchColumns:t,invertSearchColumns:i})}handleAnimationLoop(){var e;(e=this.grid)===null||e===void 0||e.updateCanvas(),this.isAnimating&&(this.animationFrame=requestAnimationFrame(this.handleAnimationLoop))}handleAnimationStart(){I.debug2("handleAnimationStart"),this.isAnimating=!0,this.animationFrame=requestAnimationFrame(this.handleAnimationLoop)}handleAnimationEnd(){I.debug2("handleAnimationEnd"),this.isAnimating=!1}handlePartitionChange(e){this.startLoading("Partitioning..."),this.setState({partitionConfig:e})}handleTableLoadError(e){if(!Oe.isCanceled(e)){I.error(e);var{onError:t}=this.props;t(e)}}handleViewportUpdated(){var{model:e}=this.props,{loadingText:t,loadingSpinnerShown:i}=this.state,n="Waiting for viewport...";e.isViewportPending&&!i?this.showViewportLoading():t===n&&!e.isViewportPending&&this.stopLoading()}showAllColumns(){for(var e,{metricCalculator:t}=this.state,i=t.getUserColumnWidths(),n=[...i.entries()],a=0;a<n.length;a+=1){var[o,u]=n[a];u===0&&t.resetColumnWidth(o)}(e=this.grid)===null||e===void 0||e.forceUpdate()}toggleSort(e,t){I.info("Toggling sort for column",e);var{model:i}=this.props,n=this.getModelColumn(e);if(L(n),i.isColumnSortable(e)){var{sorts:a}=this.state,o=T.toggleSortForColumn(a,i.columns,n,t);this.updateSorts(o)}else I.debug("Column type was not sortable",i.columns[e])}updateSorts(e){var t;this.startLoading("Sorting..."),this.setState({sorts:e}),(t=this.grid)===null||t===void 0||t.forceUpdate()}sortColumn(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.sortDirection.none,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;L(e);var{model:o}=this.props,u=T.sortColumn(o.sort,o.columns,e,i,n,a);this.startLoading("Sorting..."),this.setState({sorts:u}),(t=this.grid)===null||t===void 0||t.forceUpdate()}reverse(e){var t;this.startLoading("Reversing..."),this.setState({reverseType:e}),(t=this.grid)===null||t===void 0||t.forceUpdate()}isReversible(){var{model:e}=this.props;return e.isReversible}toggleFilterBar(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.lastFocusedFilterBarColumn,{isFilterBarShown:t}=this.state;if(t=!t,this.setState({isFilterBarShown:t}),t)if(e!=null)this.focusFilterBar(e);else{for(var i=0,{model:n}=this.props,{columnCount:a}=n,o=0;o<a;o+=1){var u=this.getModelColumn(o);if(u!=null){var l=n.columns[u];if(l!=null&&T.isTextType(l.type)){i=o;break}}}this.focusFilterBar(i)}else{var d;(d=this.grid)===null||d===void 0||d.focus()}}isTableSearchAvailable(){var e,t,i,{model:n,canToggleSearch:a}=this.props,{dh:o}=n,u=n==null||(e=n.layoutHints)===null||e===void 0?void 0:e.searchDisplayMode;return u===((t=o.SearchDisplayMode)===null||t===void 0?void 0:t.SEARCH_DISPLAY_HIDE)?!1:u===((i=o.SearchDisplayMode)===null||i===void 0?void 0:i.SEARCH_DISPLAY_SHOW)?!0:a}toggleSearchBar(){var{showSearchBar:e}=this.state;if(this.isTableSearchAvailable()){var t=!e;this.setState({showSearchBar:t},()=>{var i;if(t&&(i=this.crossColumnRef)!==null&&i!==void 0&&i.current){var n;(n=this.crossColumnRef)===null||n===void 0||n.current.focus()}else{var a;(a=this.grid)===null||a===void 0||a.focus()}})}}toggleGotoRow(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",{isGotoShown:o}=this.state;if(i||n){var u;this.setState({isGotoShown:!0,gotoValue:n,gotoValueSelectedColumnName:a,gotoRowError:"",gotoValueError:"",gotoValueManuallyChanged:!1}),this.focusRowInGrid(i),(u=this.gotoRowRef.current)===null||u===void 0||u.focus();return}var l=(e=this.grid)===null||e===void 0?void 0:e.state.cursorRow,d=(t=this.grid)===null||t===void 0?void 0:t.state.cursorColumn;if(l==null||d==null){this.setState({isGotoShown:!o,gotoRow:"",gotoValue:"",gotoRowError:"",gotoValueError:"",gotoValueManuallyChanged:!1});return}var{model:c}=this.props,{name:m,type:p}=c.columns[d],h=c.valueForCell(d,l),f=ie.convertValueToText(h,p);this.setState({isGotoShown:!o,gotoRow:"".concat(l+1),gotoValue:f,gotoValueSelectedColumnName:m,gotoRowError:"",gotoValueError:"",gotoValueManuallyChanged:!1})}commitPending(){var e=this;return vt(function*(){var t,i,{model:n}=e.props;if(!Be(n)||!n.isEditable)throw new Error("Cannot save, table is not editable");var{pendingSavePromise:a}=e.state;if(a!=null)throw new Error("Save already in progress");var o=(t=document)===null||t===void 0||(i=t.activeElement)===null||i===void 0?void 0:i.classList.contains("grid-cell-input-field");if(o!=null&&o){var u;if(document.activeElement!=null&&document.activeElement.classList.contains("error"))throw new Xa("Current input is invalid");(u=e.grid)===null||u===void 0||u.focus()}var l=e.pending.add(n.commitPending()).then(()=>{e.setState({pendingSaveError:null,pendingSavePromise:null})}).catch(d=>{Oe.isCanceled(d)||e.setState({pendingSaveError:d,pendingSavePromise:null})});return e.setState({pendingSavePromise:l}),l})()}discardPending(){var e=this;return vt(function*(){var{pendingSavePromise:t}=e.state;if(t!=null)throw new Error("Cannot cancel a save in progress");e.setState({pendingSavePromise:null,pendingSaveError:null,pendingDataMap:new Map,pendingDataErrors:new Map})})()}selectColumn(e){var{onColumnSelected:t}=this.props;t(e)}selectData(e,t){var i=this.getRowDataMap(t),{onDataSelected:n}=this.props;n(t,i)}getRowDataMap(e){for(var t=this,{model:i}=this.props,{columns:n,groupedColumns:a}=i,o={},u=function(){var c=n[l],{name:m,type:p}=c,h=i.valueForCell(l,e),f=i.textForCell(l,e),C=t.getVisibleColumn(l),g=$e(i)&&i.isRowExpandable(e),F=a.find(w=>w.name===m)!=null;o[m]={value:h,text:f,type:p,isGrouped:F,isExpandable:g,visibleIndex:C}},l=0;l<n.length;l+=1)u();return o}handleAdvancedFilterChange(e,t,i){var{model:n}=this.props,a=n.getColumnIndexByName(e.name);L(a),this.setAdvancedFilter(a,t,i)}handleAdvancedFilterSortChange(e,t){var i,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{model:a}=this.props,o=a.getColumnIndexByName(e.name);L(o);var u=a.columns[o].name,l=T.getSortForColumn(a.sort,u),d=null;(l==null||l.direction!==t)&&(t===T.sortDirection.descending?d=e.sort().desc():d=e.sort().asc());var c=T.setSortForColumn(a.sort,u,d,n);I.info("Setting table sorts",c),this.startLoading("Sorting..."),this.setState({sorts:c}),(i=this.grid)===null||i===void 0||i.forceUpdate()}handleAdvancedFilterDone(){var e;(e=this.grid)===null||e===void 0||e.focus()}handleAdvancedMenuOpened(e){this.setState({shownAdvancedFilter:e})}handleGotoRowOpened(){this.setState({isGotoShown:!0,gotoValueManuallyChanged:!1})}handleGotoRowClosed(){this.setState({isGotoShown:!1,gotoValueManuallyChanged:!1})}handleAdvancedMenuClosed(e){var t,{focusedFilterBarColumn:i,isFilterBarShown:n}=this.state;if(n&&i===e&&((t=this.filterInputRef)===null||t===void 0?void 0:t.current)!==null){var a;(a=this.filterInputRef)===null||a===void 0||a.current.focus(),this.setState({shownAdvancedFilter:null})}else this.setState({focusedFilterBarColumn:null,shownAdvancedFilter:null})}handleCancel(){this.rollback()}handleChartChange(){}handleChartCreate(e){var{model:t,onCreateChart:i}=this.props;i(e,t)}handleGridError(e){I.warn("Grid Error",e),this.setState({toastMessage:s.jsx("div",{className:"error-message",children:"".concat(e)})})}handleFilterBarChange(e){this.startLoading("Filtering...",{resetRanges:!0}),this.setState(t=>{var{focusedFilterBarColumn:i,quickFilters:n}=t,a=new Map(n);if(i!=null){var o=this.getModelColumn(i);L(o),this.applyQuickFilter(o,e,a)}return{quickFilters:a}})}handleFilterBarDone(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e){var i;(i=this.grid)===null||i===void 0||i.focus()}t&&this.setState({focusedFilterBarColumn:null})}handleFilterBarTab(e){var{focusedFilterBarColumn:t}=this.state;L(t),e?this.focusFilterBar(t-1):this.focusFilterBar(t+1)}handleFormatSelection(e,t){var{model:i}=this.props,n=i.columns[e],{customColumnFormatMap:a}=this.state,o=new Map(a);if(t!=null){var u=T.getNormalizedType(n.type);L(u);var l=mi.makeColumnFormattingRule(u,n.name,t);o.set(n.name,l)}else o.delete(n.name);this.updateFormatter({customColumnFormatMap:o})}handleMenu(e){e.stopPropagation(),this.setState({isMenuShown:!0})}handleMenuClose(){this.setState({isMenuShown:!1,openOptions:[]})}handleMenuBack(){this.setState(e=>{var{openOptions:t}=e,i=[...t];return i.pop(),{openOptions:i}})}handleMenuSelect(e){this.setState(t=>{var{openOptions:i}=t;return{openOptions:[...i,e]}})}handleRequestFailed(e){var{detail:t}=e;I.error("request failed:",t),this.stopLoading();var{partitionConfig:i}=this.state;if(no(t)&&i!=null)this.startLoading("Reloading partition...",{resetRanges:!0}),this.setState({partitionConfig:void 0},()=>{this.initState()});else if(this.canRollback())this.startLoading("Rolling back changes...",{resetRanges:!0}),this.rollback();else{I.error("Table failed and unable to rollback");var{onError:n}=this.props;n(new Error("Error displaying table: ".concat(t)))}}handleUpdate(){var e;I.debug2("Received model update");var{advancedFilters:t,aggregationSettings:i,customColumns:n,quickFilters:a,reverseType:o,rollupConfig:u,searchFilter:l,selectDistinctColumns:d,sorts:c}=this.state,m={advancedFilters:t,aggregationSettings:i,customColumns:n,quickFilters:a,reverseType:o,rollupConfig:u,searchFilter:l,selectDistinctColumns:d,sorts:c};Br(m)?this.lastLoadedConfig=null:this.lastLoadedConfig=m,(e=this.grid)===null||e===void 0||e.forceUpdate(),this.stopLoading()}handleViewChanged(e){var t,i,{model:n}=this.props,{selectionEndRow:a=0}=(t=(i=this.grid)===null||i===void 0?void 0:i.state)!==null&&t!==void 0?t:{},o=0;if(Be(n)&&n.isEditable){L(e);var{bottomViewport:u}=e,l=n.rowCount-n.floatingBottomRowCount;a===l-1?o=n.pendingRowCount+1:a===l-2?o=n.pendingRowCount:o=Math.max(0,u-(n.rowCount-n.pendingRowCount)-n.floatingTopRowCount-n.floatingBottomRowCount-1)}this.setState({metrics:e,pendingRowCount:o})}handleSelectionChanged(e){var t;L(e);var{onSelectionChanged:i}=this.props,{copyOperation:n}=this.state;this.setState({selectedRanges:e}),n!=null&&this.setState({copyOperation:null}),((t=this.grid)===null||t===void 0?void 0:t.state.cursorRow)!=null&&this.setState({gotoRow:"".concat(this.grid.state.cursorRow+1)}),i(e)}handleMovedColumnsChanged(e,t){this.setState({movedColumns:e},t)}handleHeaderGroupsChanged(e){var{model:t}=this.props;this.setState({columnHeaderGroups:ie.parseColumnHeaderGroups(t,e).groups},()=>{var i;return(i=this.grid)===null||i===void 0?void 0:i.forceUpdate()})}handleTooltipRef(e){e?.startTimer(),this.tooltip=e}handleConditionalFormatsChange(e){I.debug("Updated conditional formats",e),this.setState({conditionalFormats:e})}handleConditionalFormatCreate(){I.debug("Create new conditional format");var{openOptions:e,conditionalFormats:t}=this.state;this.setState({openOptions:[...e,{type:K.CONDITIONAL_FORMATTING_EDIT,title:"Create Formatting Rule"}],conditionalFormatEditIndex:t.length,conditionalFormatPreview:void 0})}handleConditionalFormatEdit(e){I.debug("Edit conditional format",e);var{openOptions:t,conditionalFormats:i}=this.state;this.setState({openOptions:[...t,{type:K.CONDITIONAL_FORMATTING_EDIT,title:"Edit Formatting Rule"}],conditionalFormatEditIndex:e,conditionalFormatPreview:se({},i[e])})}handleConditionalFormatEditorSave(e){I.debug("Save conditional format changes",e),this.setState(t=>{if(t.conditionalFormatEditIndex===null)return I.debug("Invalid format index"),null;var i=[...t.conditionalFormats];return i[t.conditionalFormatEditIndex]=e,{conditionalFormats:i}},()=>{this.handleMenuBack()})}handleConditionalFormatEditorCancel(){this.handleMenuBack(),this.setState({conditionalFormatEditIndex:null})}handleUpdateCustomColumns(e){I.info("handleUpdateCustomColumns:",e);var{model:t}=this.props,{movedColumns:i,sorts:n,quickFilters:a,advancedFilters:o,selectDistinctColumns:u}=this.state,{columns:l}=t,d=t.customColumns.map(g=>"".concat(g)),c=ie.getRemovedCustomColumnNames(d,e);if(c.length>0){var m=ie.removeSortsInColumns(n,c),p=ie.removeFiltersInColumns(l,a,c),h=ie.removeFiltersInColumns(l,o,c),f=ie.removeColumnFromMovedColumns(l,i,c),C=ie.removeColumnsFromSelectDistinctColumns(u,c);m.length!==n.length&&(I.debug("removing sorts from removed custom columns..."),this.setState({sorts:m})),(p.size!==a.size||h.size!==o.size)&&(I.debug("removing filters from removed custom columns..."),this.setState({quickFilters:p,advancedFilters:h})),De(i,f)||(I.debug("change moved columns for removed custom columns",f),this.setState({movedColumns:f})),De(u,C)||(I.debug("change selectDistinct columns for removed custom columns",f),this.setState({selectDistinctColumns:C}))}this.setState({customColumns:e}),e.length>0&&this.startLoading("Applying custom columns...")}handleCustomColumnsChanged(){I.debug("custom columns changed");var{isReady:e}=this.state;if(e){var t;this.stopLoading(),(t=this.grid)===null||t===void 0||t.forceUpdate()}else this.loadTableState()}handlePendingCommitClicked(){return this.commitPending()}handlePendingDiscardClicked(){return this.discardPending()}handlePendingDataUpdated(){var e;I.debug("pending data updated");var{model:t}=this.props,{pendingDataMap:i,pendingDataErrors:n}=t;this.setState({pendingDataMap:i,pendingDataErrors:n,pendingSaveError:null}),(e=this.grid)===null||e===void 0||e.forceUpdate()}handleAggregationsChange(e){I.debug("handleAggregationsChange",e),this.startLoading("Aggregating ".concat(e.aggregations.map(t=>t.operation).join(", "),"...")),this.setState({aggregationSettings:e})}handleAggregationChange(e){I.debug("handleAggregationChange",e),this.startLoading("Aggregating ".concat(e.operation,"...")),this.setState(t=>{var{aggregationSettings:i}=t;return{selectedAggregation:e,aggregationSettings:se(se({},i),{},{aggregations:i.aggregations.map(n=>n.operation===e.operation?e:n)})}})}handleAggregationEdit(e){I.debug("handleAggregationEdit",e);var{openOptions:t}=this.state;this.setState({openOptions:[...t,{type:K.AGGREGATION_EDIT,title:"Edit Columns to ".concat(e.operation)}],selectedAggregation:e})}handleRollupChange(e){var t,i;I.info("Rollup change",e),this.resetGridViewState(),this.showAllColumns(),this.clearAllFilters(),this.startLoading("Grouping by columns ".concat((t=e==null||(i=e.columns)===null||i===void 0?void 0:i.join(", "))!==null&&t!==void 0?t:"","...")),this.setState({rollupConfig:e,movedColumns:[],frozenColumns:[],sorts:[],reverseType:T.REVERSE_TYPE.NONE,selectDistinctColumns:[]})}handleSelectDistinctChanged(e){I.debug("SelectDistinct change",e),this.resetGridViewState(),this.showAllColumns(),this.clearAllFilters(),this.startLoading("Selecting distinct values in ".concat(e.length>0?e.join(", "):"","...")),this.setState({selectDistinctColumns:e,movedColumns:[],sorts:[],reverseType:T.REVERSE_TYPE.NONE})}handleDownloadTableStart(){var{canDownloadCsv:e}=this.props;e?this.setState({isTableDownloading:!0,tableDownloadProgress:0,tableDownloadEstimatedTime:null,tableDownloadStatus:Ye.DOWNLOAD_STATUS.INITIATING}):I.error("Attempted to handleDownloadTableStart for user without download CSV permission.")}handleDownloadTable(e,t,i,n,a,o,u){var{canDownloadCsv:l}=this.props;l?(I.info("start table downloading",e,t,i,n,a,o,u),this.setState(()=>(this.tableSaver&&this.tableSaver.startDownload(e,t,i,n,a,o,u),{tableDownloadStatus:Ye.DOWNLOAD_STATUS.DOWNLOADING}))):I.error("Attempted to handleDownloadTable for user without download CSV permission.")}removeEmptyAggregations(){I.debug("removeEmptyAggregations"),this.setState(e=>{var{aggregationSettings:t}=e,{aggregations:i}=t,n=i.filter(a=>a.selected.length>0||a.invert);return n.length!==i.length?{selectedAggregation:null,aggregationSettings:se(se({},t),{},{aggregations:n})}:{selectedAggregation:null,aggregationSettings:t}})}seekRow(e){var t=arguments,i=this;return vt(function*(){var n,a=t.length>1&&t[1]!==void 0?t[1]:!1,{gotoValueSelectedColumnName:o,gotoValueSelectedFilter:u}=i.state,{model:l}=i.props,{dh:d}=l;if(l.isSeekRowAvailable&&e!==""){var c=ie.getColumnByName(l.columns,o);if(c!==void 0){var m=(n=i.grid)===null||n===void 0?void 0:n.state.cursorRow;m==null&&(m=0);var p=u===Te.contains||u===Te.containsIgnoreCase,h=u===Te.eqIgnoreCase||u===Te.containsIgnoreCase;try{var f,{formatter:C}=l,g=T.getNormalizedType(c.type),F;switch(g){case T.dataType.CHAR:case T.dataType.STRING:{F=yield l.seekRow(m,c,d.ValueType.STRING,e,h,p,a??!1);break}case T.dataType.DATETIME:{var[w]=Di.parseDateRange(d,e,C.timeZone);F=yield l.seekRow(m,c,d.ValueType.DATETIME,w,void 0,void 0,a??!1);break}case T.dataType.DECIMAL:case T.dataType.INT:{if(!T.isBigDecimalType(c.type)&&!T.isBigIntegerType(c.type)){var v=parseInt(e,10);e==="-Infinity"?v=Number.NEGATIVE_INFINITY:e==="Infinity"&&(v=Number.POSITIVE_INFINITY),F=yield l.seekRow(m,c,d.ValueType.NUMBER,v,void 0,void 0,a??!1)}else F=yield l.seekRow(m,c,d.ValueType.STRING,e,void 0,void 0,a??!1);break}default:F=yield l.seekRow(m,c,d.ValueType.STRING,i.tableUtils.makeValue(c.type,e,C.timeZone),void 0,void 0,a??!1)}(f=i.grid)===null||f===void 0||f.setFocusRow(F),i.setState({gotoValueError:""})}catch{i.setState({gotoValueError:"invalid input"})}}}})()}handleCancelDownloadTable(){var e;(e=this.tableSaver)===null||e===void 0||e.cancelDownload(),this.setState({isTableDownloading:!1})}handleDownloadCompleted(){this.setState({isTableDownloading:!1,tableDownloadProgress:100,tableDownloadStatus:Ye.DOWNLOAD_STATUS.FINISHED})}handleDownloadCanceled(){this.setState({isTableDownloading:!1,tableDownloadProgress:0,tableDownloadStatus:Ye.DOWNLOAD_STATUS.CANCELED})}deleteRanges(e){var{model:t}=this.props;if(!qr(t)||!t.isDeletable)throw new Error("Model does not support deleting ranges");this.pending.add(t.delete(e)).catch(i=>{Oe.isCanceled(i)||I.error("Unable to delete ranges",e,i)})}resetColumnSelection(){if(this.grid!=null){var{isSelectingColumn:e}=this.props;if(e){var{columnAllowedCursor:t}=this.props;this.grid.setState({cursor:t})}else this.grid.setState({cursor:null}),this.setState({hoverSelectColumn:null})}}resetGridViewState(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.grid&&(this.grid.clearSelectedRanges(),this.grid.setViewState({left:0,top:0,topOffset:0,leftOffset:0},e))}sendStateChange(){if(this.grid){var{state:e}=this,{state:t}=this.grid,{onStateChange:i}=this.props;i(e,t)}}handleOverflowClose(){this.setState({showOverflowModal:!1})}getColumnBoundingRect(){var e,{metrics:t,shownColumnTooltip:i}=this.state;L(t),L(i);var n=(e=this.gridWrapper)===null||e===void 0?void 0:e.getBoundingClientRect(),a=20;L(n);var{columnHeaderHeight:o,allColumnXs:u,allColumnWidths:l,width:d,columnHeaderMaxDepth:c}=t,m=u.get(i),p=l.get(i);L(m),L(p);var h=n.left+di(m+p/2,a,d-a);return{top:n.top+(c-1)*o,left:n.left+di(m+p/2,a,d-a),bottom:n.top+c*o,right:n.left+di(m+p/2,a,d-a)+1,width:1,height:o,x:h,y:n.top,toJSON:()=>{throw new Error("not implemented")}}}handleGotoRowSelectedRowNumberSubmit(){var{gotoRow:e}=this.state;this.focusRowInGrid(e)}focusRowInGrid(e){var{model:t}=this.props,{rowCount:i}=t;if(this.setState({gotoRow:e}),e===""){this.setState({gotoRowError:"",gotoValueError:""});return}var n=parseInt(e,10);if(n>i||n<-i)this.setState({gotoRowError:"Invalid row index"});else if(n===0){var a;this.setState({gotoRowError:"",gotoValueError:""}),(a=this.grid)===null||a===void 0||a.setFocusRow(0)}else if(n<0){var o;this.setState({gotoRowError:"",gotoValueError:""}),(o=this.grid)===null||o===void 0||o.setFocusRow(n+i)}else{var u;(u=this.grid)===null||u===void 0||u.setFocusRow(n-1),this.setState({gotoRowError:"",gotoValueError:""})}}handleGotoRowSelectedRowNumberChanged(e){var t=e.target.value;this.focusRowInGrid(t)}getColumnTooltip(e,t,i){var{columnHeaderHeight:n,columnHeaderMaxDepth:a,allColumnXs:o,allColumnWidths:u,width:l}=t,d=o.get(e),c=u.get(e);if(d==null||c==null)return null;var m=Math.max(0,d),p=c;d+c>l?p=l-d:d<0&&(p=c-Math.abs(d));var h={position:"absolute",top:(a-1)*n,left:m,width:p,height:n,pointerEvents:"none"},f={clientWidth:1,clientHeight:n,getBoundingClientRect:this.getColumnBoundingRect},C={placement:"bottom",modifiers:{flip:{behavior:["bottom","top"]}}},g=this.getModelColumn(e);if(g==null)return null;var F=i.columns[g];return F==null?null:s.jsx("div",{style:h,children:s.jsx(Xe,{timeout:400,interactive:!0,options:C,ref:this.handleTooltipRef,referenceObject:f,onExited:()=>{this.setState({shownColumnTooltip:null})},children:s.jsx(lu,{model:i,column:F,onStatistics:()=>{var w;(w=this.tooltip)===null||w===void 0||w.update()}})},F.name)})}handleGotoValueSelectedColumnNameChanged(e){var t,{model:i}=this.props,n=(t=this.grid)===null||t===void 0?void 0:t.state.cursorRow,{gotoValueSelectedColumnName:a,gotoValueManuallyChanged:o}=this.state;if(n!=null){var u=i.getColumnIndexByName(e),l=ie.getColumnByName(i.columns,e),d=ie.getColumnByName(i.columns,a);if(u==null||l==null)return;var c=i.valueForCell(u,n),m=ie.convertValueToText(c,l.type);o&&l.type===d?.type?this.setState({gotoValueSelectedColumnName:e,gotoValueError:""}):this.setState({gotoValueSelectedColumnName:e,gotoValue:m,gotoValueError:"",gotoValueManuallyChanged:!1})}this.setState({gotoValueSelectedColumnName:e,gotoValueError:""})}handleGotoValueSelectedFilterChanged(e){this.setState({gotoValueSelectedFilter:e,gotoValueError:""})}handleGotoValueSubmitted(e){var{gotoValue:t}=this.state;this.seekRow(t,e)}render(){var e,t,i=this,n,a,o,{children:u,customFilters:l,getDownloadWorker:d,isSelectingColumn:c,isStuckToBottom:m,isStuckToRight:p,model:h,name:f,onlyFetchVisibleColumns:C,alwaysFetchColumns:g,advancedSettings:F,onAdvancedSettingsChange:w,canDownloadCsv:v,onCreateChart:N}=this.props,{metricCalculator:A,metrics:E,isFilterBarShown:O,isSelectingPartition:D,isMenuShown:x,isReady:G,copyOperation:z,focusedFilterBarColumn:M,loadingText:oe,loadingScrimProgress:X,loadingSpinnerShown:le,loadingCancelShown:_e,loadingBlocksGrid:Le,shownColumnTooltip:Ge,hoverAdvancedFilter:Ee,shownAdvancedFilter:He,hoverSelectColumn:at,quickFilters:S,advancedFilters:R,searchFilter:j,selectDistinctColumns:Q,movedColumns:H,movedRows:q,formatter:te,conditionalFormats:ue,conditionalFormatPreview:ae,conditionalFormatEditIndex:ge,sorts:Ze,reverseType:wt,customColumns:Ft,selectedRanges:Qt,isTableDownloading:Ht,tableDownloadStatus:Nt,tableDownloadProgress:he,tableDownloadEstimatedTime:Wt,showSearchBar:ki,searchValue:pn,selectedSearchColumns:gn,invertSearchColumns:vn,aggregationSettings:Kt,selectedAggregation:Gi,rollupConfig:We,openOptions:ot,pendingSavePromise:fn,pendingSaveError:Cn,pendingRowCount:Sn,pendingDataErrors:Tn,pendingDataMap:Mi,toastMessage:bn,frozenColumns:En,columnHeaderGroups:Vi,showOverflowModal:yn,overflowText:wn,overflowButtonTooltipProps:Bi,expandCellTooltipProps:$i,linkHoverTooltipProps:Qi,isGotoShown:Hi,gotoRow:Fn,gotoRowError:Nn,gotoValueError:On,gotoValueSelectedColumnName:An,gotoValue:Rn,gotoValueSelectedFilter:_n,partitionConfig:Yt}=this.state;if(!G)return null;var st=this.getTheme(),xn=this.getCachedFilter(l,S,R,j),Wi=A.getUserColumnWidths(),Dn=this.getCachedStateOverride(at,O,c,X,S,R,Ze,wt,We,x),In=E?E.top:0,Pn=E?E.bottomViewport:0,Ki=null,Yi=null;C&&(Ki=E?E.left:0,Yi=E?E.right:0);var Ln=E!=null&&E.width>0&&E.height>0,qi=((e=We==null||(t=We.columns)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>0,zi=null,Un=E?Math.min(Math.max(Pe.minDebounce,Math.round(E.rowCount/200)),Pe.maxDebounce):Pe.maxDebounce;if(O&&M!=null&&E!=null){var{gridX:jn,gridY:kn,allColumnXs:Gn,allColumnWidths:Mn,width:Vn}=E,Xi=Gn.get(M),Zi=Mn.get(M);if(Xi!=null&&Zi!=null){var qt,zt,Xt,Ji=jn+Xi,Bn=kn-((qt=st.filterBarHeight)!==null&&qt!==void 0?qt:0),$n=Zi+1,Qn=((zt=st.filterBarHeight)!==null&&zt!==void 0?zt:0)-1,Hn={top:Bn,left:Ji,minWidth:Math.min($n,Vn-Ji),height:Qn},Zt="",er=!0,Jt=this.getModelColumn(M);L(Jt);var ei=S.get(Jt),tr=R.get(Jt);ei!=null&&(Zt=ei.text,er=ei.filter!=null);var Wn=S.size!==0||R.size!==0;zi=s.jsx(Fs,{ref:this.filterInputRef,style:Hn,className:Y({error:!er,active:Zt!==""||tr!=null,"iris-grid-has-filter":Wn}),isAdvancedFilterSet:tr!=null,onAdvancedFiltersTriggered:()=>{this.setState({shownAdvancedFilter:M})},onChange:this.handleFilterBarChange,onDone:this.handleFilterBarDone,onTab:this.handleFilterBarTab,onContextMenu:(Xt=this.grid)===null||Xt===void 0?void 0:Xt.handleContextMenu,debounceMs:Un,value:Zt},M)}}var ir=null;if(oe!=null){var Kn=s.jsxs("div",{className:"iris-grid-loading-status",children:[s.jsx("div",{className:Y("iris-grid-loading-status-bar",{show:le}),children:oe}),s.jsxs("button",{type:"button",onClick:this.handleCancel,className:Y("iris-grid-btn-cancel",{show:_e}),children:[s.jsx(Z,{icon:Qr,transform:"down-1"}),"Cancel"]})]}),Yn=E?E.gridY:0;ir=s.jsx("div",{className:"iris-grid-loading",style:Le?{top:Yn}:{},children:Kn})}var rr=null;if(Ge!=null&&E){var ti;rr=this.getColumnTooltip(Ge,E,h),(ti=this.tooltip)===null||ti===void 0||ti.update()}var nr=[];if(E&&O)for(var{gridX:qn,gridY:zn,visibleColumns:ar,allColumnXs:Xn,allColumnWidths:Zn}=E,{filterBarHeight:ii}=st,Jn=function(){var re=ar[ri],Je=Xn.get(re),Me=Zn.get(re),lt=i.getModelColumn(re);if(lt!=null){var ai=h.isFilterable(lt);if(ai&&Je!=null&&Me!=null&&Me>0){var oi=qn+Je+Me-24,et=zn-(ii??0)+2,ut={position:"absolute",top:et,left:oi},si=R.get(lt),Ot=si!=null,dt=re===Ee||re===M||Ot,ct=s.jsx("div",{className:Y("advanced-filter-button-container",{hidden:!dt}),style:ut,children:dt&&s.jsx(W,{kind:"ghost",className:Y("btn-link-icon advanced-filter-button",{"filter-set":Ot}),onClick:()=>{i.setState({shownAdvancedFilter:re})},onContextMenu:li=>{var ui;(ui=i.grid)===null||ui===void 0||ui.handleContextMenu(li)},onMouseEnter:()=>{i.setState({hoverAdvancedFilter:re})},onMouseLeave:()=>{i.setState({hoverAdvancedFilter:null})},children:s.jsxs("div",{className:"fa-layers",children:[s.jsx(Z,{icon:_i,className:"filter-solid"}),s.jsx(Z,{icon:Pt,className:"filter-light"})]})})},re);nr.push(ct)}}},ri=0;ri<ar.length;ri+=1)Jn();var or=[];if(E)for(var{gridX:sr,visibleColumns:lr,allColumnXs:ea,allColumnWidths:ta,columnHeaderHeight:ur}=E,ia=function(){var re=lr[ni],Je=ea.get(re),Me=ta.get(re);if(Je!=null&&Me!=null&&Me>0){var lt=sr+Je,ai=sr+Je+Me-20,oi=O?{position:"absolute",top:ur,left:ai,width:20,height:st.filterBarHeight}:{position:"absolute",top:0,left:lt,width:Me,height:ur},et=i.getModelColumn(re);if(et!=null){var ut=h.columns[et];if(ut==null)return I.warn("Column does not exist at index ".concat(et," for column array of length ").concat(h.columns.length)),"continue";var si=R.get(et),{options:Ot}=si||{},dt=T.getSortForColumn(h.sort,ut.name),ct=dt?dt.direction:null;if(!Za(ct))throw new Error("Invalid sort direction: ".concat(ct));var li=s.jsx("div",{className:"advanced-filter-menu-container",style:oi,children:s.jsx(Kr,{className:"advanced-filter-menu-popper",onEntered:i.getAdvancedMenuOpenedHandler(re),onExited:()=>{i.handleAdvancedMenuClosed(re)},isShown:He===re,interactive:!0,closeOnBlur:!0,options:{positionFixed:!0},children:i.getCachedAdvancedFilterMenuActions(h,ut,Ot,ct,te)})},re);or.push(li)}}},ni=0;ni<lr.length;ni+=1)var ra=ia();var dr=this.getCachedOptionItems(N!==void 0&&h.isChartBuilderAvailable,h.isCustomColumnsAvailable,h.isFormatColumnsAvailable,h.isRollupAvailable,h.isTotalsAvailable||qi,h.isSelectDistinctAvailable,h.isExportAvailable,this.toggleFilterBarAction,this.toggleSearchBarAction,this.toggleGotoRowAction,O,ki,v,this.isTableSearchAvailable(),Hi,F.size>0),cr=this.getCachedHiddenColumns(A,Wi),na=ot.map(ye=>{switch(ye.type){case K.CHART_BUILDER:return s.jsx(fo,{model:h,onChange:this.handleChartChange,onSubmit:this.handleChartCreate},K.CHART_BUILDER);case K.VISIBILITY_ORDERING_BUILDER:return s.jsx(vo,{model:h,movedColumns:H,hiddenColumns:cr,columnHeaderGroups:Vi,onColumnVisibilityChanged:this.handleColumnVisibilityChanged,onReset:this.handleColumnVisibilityReset,onMovedColumnsChanged:this.handleMovedColumnsChanged,onColumnHeaderGroupChanged:this.handleHeaderGroupsChanged},K.VISIBILITY_ORDERING_BUILDER);case K.CONDITIONAL_FORMATTING:return s.jsx(Ou,{rules:ue,onChange:this.handleConditionalFormatsChange,onCreate:this.handleConditionalFormatCreate,onSelect:this.handleConditionalFormatEdit});case K.CONDITIONAL_FORMATTING_EDIT:return L(h.columns),L(this.handleConditionalFormatEditorUpdate),s.jsx(od,{dh:h.dh,columns:h.columns,rule:ae,onUpdate:this.handleConditionalFormatEditorUpdate,onSave:this.handleConditionalFormatEditorSave,onCancel:this.handleConditionalFormatEditorCancel});case K.CUSTOM_COLUMN_BUILDER:return s.jsx(go,{model:h,customColumns:Ft,onSave:this.handleUpdateCustomColumns,onCancel:this.handleMenuBack},K.CUSTOM_COLUMN_BUILDER);case K.ROLLUP_ROWS:return s.jsx(po,{model:h,onChange:this.handleRollupChange,config:We},K.ROLLUP_ROWS);case K.AGGREGATIONS:return s.jsx(mo,{settings:Kt,isRollup:qi,onChange:this.handleAggregationsChange,onEdit:this.handleAggregationEdit});case K.AGGREGATION_EDIT:return Gi&&s.jsx(ho,{aggregation:Gi,columns:h.originalColumns,onChange:this.handleAggregationChange});case K.TABLE_EXPORTER:return s.jsx(Ye,{model:h,name:f,userColumnWidths:Wi,movedColumns:H,isDownloading:Ht,tableDownloadStatus:Nt,tableDownloadProgress:he,tableDownloadEstimatedTime:Wt??void 0,onDownload:this.handleDownloadTable,onDownloadStart:this.handleDownloadTableStart,onCancel:this.handleCancelDownloadTable,selectedRanges:Qt},K.TABLE_EXPORTER);case K.SELECT_DISTINCT:return s.jsx(bu,{model:h,selectDistinctColumns:Q,onChange:this.handleSelectDistinctChanged});case K.ADVANCED_SETTINGS:return s.jsx(ji,{items:F,onChange:w});default:throw Error("Unexpected option type ".concat(ye.type))}});return s.jsxs("div",{className:"iris-grid",role:"presentation",children:[s.jsxs("div",{className:"iris-grid-column",children:[u!=null&&s.jsx("div",{className:"iris-grid-bar",children:u}),s.jsx(Ei,{in:D,timeout:yi.transitionSlowMs,classNames:"iris-grid-bar-horizontal",onEnter:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExit:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"iris-grid-partition-selector-wrapper iris-grid-bar iris-grid-bar-primary",children:Ni(h)&&h.isPartitionRequired&&Yt&&s.jsx(vu,{model:h,partitionConfig:Yt,onChange:this.handlePartitionChange})})}),s.jsx(Ei,{in:ki,timeout:yi.transitionSlowMs,classNames:"iris-grid-bar-horizontal",onEnter:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExit:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"iris-grid-bar",children:s.jsx(xt,{value:pn,selectedColumns:gn,invertSelection:vn,onChange:this.handleCrossColumnSearch,columns:h.columns,ref:this.crossColumnRef})})}),s.jsxs(Oo,{ref:ye=>{this.grid=ye},isStickyBottom:!Be(h)||!h.isEditable,isStuckToBottom:m,isStuckToRight:p,metricCalculator:A,model:h,keyHandlers:this.getKeyHandlers(),mouseHandlers:this.getMouseHandlers(),movedColumns:H,movedRows:q,onError:this.handleGridError,onViewChanged:this.handleViewChanged,onSelectionChanged:this.handleSelectionChanged,onMovedColumnsChanged:this.handleMovedColumnsChanged,renderer:this.renderer,stateOverride:Dn,theme:st,children:[s.jsx(sd,{isOpen:yn,text:wn,onClose:this.handleOverflowClose}),Ln&&s.jsx(nu,{model:h,modelColumns:h.columns,top:In,bottom:Pn,left:Ki,right:Yi,filter:xn,formatter:te,sorts:Ze,reverseType:wt,movedColumns:H,customColumns:Ft,hiddenColumns:cr,alwaysFetchColumns:this.getAlwaysFetchColumns(g,h.columns,H,h.floatingLeftColumnCount,h.floatingRightColumnCount,(n=this.grid)===null||n===void 0||(a=n.state.draggingColumn)===null||a===void 0?void 0:a.range),formatColumns:this.getCachedPreviewFormatColumns(h.dh,h.columns,ue,ae,((o=ot[ot.length-1])===null||o===void 0?void 0:o.type)===K.CONDITIONAL_FORMATTING_EDIT?ge??void 0:void 0),rollupConfig:this.getModelRollupConfig(h.originalColumns,We,Kt),totalsConfig:this.getModelTotalsConfig(h.columns,We,Kt),selectDistinctColumns:Q,pendingRowCount:Sn,pendingDataMap:Mi,frozenColumns:En,columnHeaderGroups:Vi,partitionConfig:Yt}),!x&&s.jsx("div",{className:"grid-settings-button",children:s.jsx(W,{kind:"ghost","data-testid":"btn-iris-grid-settings-button-".concat(f),onClick:this.handleMenu,icon:s.jsx(Z,{icon:$a,transform:"up-1"}),tooltip:"Table Options"})}),zi,ir,nr,rr,or,Bi&&this.getOverflowButtonTooltip(Bi),$i&&this.getExpandCellTooltip($i),Qi&&this.getLinkHoverTooltip(Qi)]}),s.jsx(dd,{ref:this.gotoRowRef,model:h,isShown:Hi,gotoRow:Fn,gotoRowError:Nn,gotoValueError:On,onGotoRowSubmit:this.handleGotoRowSelectedRowNumberSubmit,onGotoRowNumberChanged:this.handleGotoRowSelectedRowNumberChanged,onClose:this.handleGotoRowClosed,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:()=>{this.handleAnimationStart(),this.focus()},onExited:this.handleAnimationEnd,gotoValueSelectedColumnName:An,gotoValue:Rn,gotoValueFilter:_n,onGotoValueSelectedColumnNameChanged:this.handleGotoValueSelectedColumnNameChanged,onGotoValueSelectedFilterChanged:this.handleGotoValueSelectedFilterChanged,onGotoValueChanged:this.handleGotoValueChanged,onGotoValueSubmit:this.handleGotoValueSubmitted}),s.jsx(fs,{error:Cn,isSaving:fn!=null,saveTooltip:"Commit (".concat(this.commitAction.shortcut.getDisplayText(),")"),discardTooltip:"Discard (".concat(this.discardAction.shortcut.getDisplayText(),")"),pendingDataErrors:Tn,pendingDataMap:Mi,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd,onSave:this.handlePendingCommitClicked,onDiscard:this.handlePendingDiscardClicked}),s.jsx(iu,{children:bn}),s.jsx(Es,{model:h,copyOperation:z??void 0,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd}),s.jsx(Co,{dh:h.dh,ref:ye=>{this.tableSaver=ye},getDownloadWorker:d,onDownloadCompleted:this.handleDownloadCompleted,onDownloadCanceled:this.handleDownloadCanceled,onDownloadProgressUpdate:this.handleDownloadProgressUpdate,isDownloading:Nt===Ye.DOWNLOAD_STATUS.DOWNLOADING,formatter:te})]}),s.jsx(wo,{in:x,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"table-sidebar",children:s.jsxs(yo,{children:[s.jsx(fr,{title:"Table Options",onClose:this.handleMenuClose,children:s.jsx(zr,{onSelect:ye=>this.handleMenuSelect(dr[ye]),items:dr})}),na.map((ye,re)=>s.jsx(fr,{title:ot[re].title,onBack:this.handleMenuBack,onClose:this.handleMenuClose,children:ye},ot[re].type))]})})}),s.jsx(U,{actions:this.contextActions})]})}}_(Pe,"contextType",So);_(Pe,"minDebounce",150);_(Pe,"maxDebounce",500);_(Pe,"loadingSpinnerDelay",800);_(Pe,"defaultProps",{children:null,advancedFilters:Ve,advancedSettings:Ve,alwaysFetchColumns:de,conditionalFormats:de,customColumnFormatMap:Ve,isFilterBarShown:!1,applyInputFiltersOnInit:!1,movedColumns:de,movedRows:de,inputFilters:de,customFilters:de,onCreateChart:void 0,onColumnSelected:()=>{},onDataSelected:()=>{},onError:()=>{},onStateChange:()=>{},onAdvancedSettingsChange:()=>{},partitions:void 0,partitionConfig:void 0,quickFilters:Ve,selectDistinctColumns:de,sorts:de,reverseType:T.REVERSE_TYPE.NONE,customColumns:de,aggregationSettings:mn,rollupConfig:void 0,userColumnWidths:Ve,userRowHeights:Ve,onSelectionChanged:()=>{},isSelectingColumn:!1,isSelectingPartition:!1,isStuckToBottom:!1,isStuckToRight:!1,columnSelectionValidator:null,columnAllowedCursor:null,columnNotAllowedCursor:null,copyCursor:"copy",name:"table",onlyFetchVisibleColumns:!0,showSearchBar:!1,searchValue:"",selectedSearchColumns:null,invertSearchColumns:!0,onContextMenu:()=>de,pendingDataMap:Ve,getDownloadWorker:Fo.getServiceWorker,settings:{timeZone:"America/New_York",defaultDateTimeFormat:Di.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,formatter:de,decimalFormatOptions:At.shape({defaultFormatString:At.string}),integerFormatOptions:At.shape({defaultFormatString:At.string})},canCopy:!0,canDownloadCsv:!0,frozenColumns:null,theme:null,canToggleSearch:!0,mouseHandlers:de,keyHandlers:de});export{Pe as default};
|
|
3
|
-
//# sourceMappingURL=IrisGrid-
|
|
3
|
+
//# sourceMappingURL=IrisGrid-8471fc12.js.map
|