@deephaven/code-studio 1.23.1-legacy-table-plugin.bbf55c8.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/build/assets/{AppRoot-BuL0lHHY.js → AppRoot-DtgU9S6w.js} +7 -7
  2. package/build/assets/{AppRoot-BuL0lHHY.js.map → AppRoot-DtgU9S6w.js.map} +1 -1
  3. package/build/assets/{Chart-DKqBjFyT.js → Chart-D6UaIH7W.js} +2 -2
  4. package/build/assets/{Chart-DKqBjFyT.js.map → Chart-D6UaIH7W.js.map} +1 -1
  5. package/build/assets/{ControlType-BLIWbm69.js → ControlType-BF6z_P8r.js} +45 -45
  6. package/build/assets/ControlType-BF6z_P8r.js.map +1 -0
  7. package/build/assets/{ControlType-DDy7c-ZY.css → ControlType-DmGEZHbj.css} +1 -1
  8. package/build/assets/{FormatterUtils-twHdmGXI.js → FormatterUtils-DaRzdlBV.js} +2 -2
  9. package/build/assets/{FormatterUtils-twHdmGXI.js.map → FormatterUtils-DaRzdlBV.js.map} +1 -1
  10. package/build/assets/Grid-CHE58QlW.js +5 -0
  11. package/build/assets/Grid-CHE58QlW.js.map +1 -0
  12. package/build/assets/Grid-CxX9cJnd.css +1 -0
  13. package/build/assets/IrisGrid-DAGrSu_b.js +15 -0
  14. package/build/assets/IrisGrid-DAGrSu_b.js.map +1 -0
  15. package/build/assets/{IrisGridModel-6f53dQlx.js → IrisGridModel-B5RDaEyK.js} +5 -5
  16. package/build/assets/IrisGridModel-B5RDaEyK.js.map +1 -0
  17. package/build/assets/{IrisGridShortcuts-DaLHHBjg.js → IrisGridShortcuts-DPT2MWqR.js} +2 -2
  18. package/build/assets/{IrisGridShortcuts-DaLHHBjg.js.map → IrisGridShortcuts-DPT2MWqR.js.map} +1 -1
  19. package/build/assets/{LocalWorkspaceStorage-CBqyfbb5.js → LocalWorkspaceStorage-BuDLzqZU.js} +2 -2
  20. package/build/assets/{LocalWorkspaceStorage-CBqyfbb5.js.map → LocalWorkspaceStorage-BuDLzqZU.js.map} +1 -1
  21. package/build/assets/{MarkdownEditor-BjlY3grl.js → MarkdownEditor-DNHlrUbB.js} +2 -2
  22. package/build/assets/{MarkdownEditor-BjlY3grl.js.map → MarkdownEditor-DNHlrUbB.js.map} +1 -1
  23. package/build/assets/{MarkdownNotebook-_1cGWk6_.js → MarkdownNotebook-iMR2NeGd.js} +2 -2
  24. package/build/assets/{MarkdownNotebook-_1cGWk6_.js.map → MarkdownNotebook-iMR2NeGd.js.map} +1 -1
  25. package/build/assets/{MissingPartitionError-ChbZu1r1.js → MissingPartitionError-Dn6pH0MY.js} +2 -2
  26. package/build/assets/{MissingPartitionError-ChbZu1r1.js.map → MissingPartitionError-Dn6pH0MY.js.map} +1 -1
  27. package/build/assets/{MockChartModel-DWwBoX83.js → MockChartModel-Bkg1e6Ga.js} +2 -2
  28. package/build/assets/{MockChartModel-DWwBoX83.js.map → MockChartModel-Bkg1e6Ga.js.map} +1 -1
  29. package/build/assets/PasteKeyHandler-BSnDQVgb.js +10 -0
  30. package/build/assets/PasteKeyHandler-BSnDQVgb.js.map +1 -0
  31. package/build/assets/Picker-B-hqvbWn.js +26 -0
  32. package/build/assets/Picker-B-hqvbWn.js.map +1 -0
  33. package/build/assets/{IrisGridThemeProvider-BheYBAWy.css → Picker-DNKZjwkf.css} +1 -1
  34. package/build/assets/{StyleGuideRoot-BZZo0CSl.js → StyleGuideRoot-BPXTRoo8.js} +2 -2
  35. package/build/assets/{StyleGuideRoot-BZZo0CSl.js.map → StyleGuideRoot-BPXTRoo8.js.map} +1 -1
  36. package/build/assets/{index-BDMrCE1B.js → index-BiIsbkVm.js} +3 -3
  37. package/build/assets/{index-BDMrCE1B.js.map → index-BiIsbkVm.js.map} +1 -1
  38. package/build/assets/index-tBlevD2r.js +25 -0
  39. package/build/assets/{index-B1f5OcJG.js.map → index-tBlevD2r.js.map} +1 -1
  40. package/build/assets/{index-BIgOr0yI.js → index-xPESISXj.js} +24 -24
  41. package/build/assets/index-xPESISXj.js.map +1 -0
  42. package/build/index.html +2 -2
  43. package/package.json +31 -31
  44. package/build/assets/ControlType-BLIWbm69.js.map +0 -1
  45. package/build/assets/Grid-CMnbHmCk.js +0 -7
  46. package/build/assets/Grid-CMnbHmCk.js.map +0 -1
  47. package/build/assets/Grid-DPUNpG8i.css +0 -1
  48. package/build/assets/GridTokenMouseHandler-B-shYgV-.js +0 -7
  49. package/build/assets/GridTokenMouseHandler-B-shYgV-.js.map +0 -1
  50. package/build/assets/IrisGrid-DKZ2yZaM.js +0 -15
  51. package/build/assets/IrisGrid-DKZ2yZaM.js.map +0 -1
  52. package/build/assets/IrisGridModel-6f53dQlx.js.map +0 -1
  53. package/build/assets/IrisGridThemeProvider-Btc8nPE1.js +0 -26
  54. package/build/assets/IrisGridThemeProvider-Btc8nPE1.js.map +0 -1
  55. package/build/assets/index-B1f5OcJG.js +0 -25
  56. package/build/assets/index-BIgOr0yI.js.map +0 -1
  57. /package/build/assets/{GridTokenMouseHandler-DTMTgCrk.css → PasteKeyHandler-DTMTgCrk.css} +0 -0
@@ -1,26 +0,0 @@
1
- import{aS as bi,B,S as kt,c as K,C as Ie,y as yi,aV as Ci,ae as $n,b as Ht,_ as Si,t as Qe,d as wi,P as Oi,au as ji,dE as st,U as Ue,G as St,bm as ut,a as Be,D as oe,I as we,af as Ti,v as $e,aw as $,e5 as Pi,e6 as xi,e7 as Di,u as ft,by as Mn,bx as Zt,bB as Ni,bz as Ft,br as Ii,bw as Ei,e8 as Ai,bs as Ri,aP as ki,J as Fi}from"./ControlType-BLIWbm69.js";import{r as C,I as d,M as X,K as Y,b3 as Bt,b2 as Ee,bD as Wt,H as Xe,bC as _i,bE as Gn,ad as ht,a0 as Ln,a1 as je,U as Ye,a7 as We,a$ as $i,co as Mi,cp as Gi,cq as _t,cr as Jt,cs as Li,ct as Ui,aw as $t,cu as Hi,b7 as Bi,a8 as Mt,cv as ge,cw as Wi,cx as zi,cy as Vi,cz as Ki,cA as er,cB as Qi,cC as Xi,cD as Yi,cE as qi,cF as Zi,ac as Un,cG as Ji,cH as tr,cI as rr,bG as eo,aZ as to,ba as ro,a9 as wt,aV as nr,bJ as Me}from"./vendor-CLIsHur_.js";import{bU as ir,aS as Hn,f as qe,g as zt,L as de,W as ae,bV as Vt,bW as Kt,aU as Bn,aW as no,z as io,bX as oo,aX as Qt,aO as dt,aP as ao,a3 as Wn,e as k,bm as ze,bY as lo,p as so,bI as or,bZ as zn,b_ as Vn,bl as uo,b$ as Ot,v as co,c0 as ho,U as mo,bN as vo,aL as po,c1 as fo,c2 as go,c3 as bo,c4 as Kn,c5 as Qn,c6 as Xn,c7 as be,c8 as yo,c9 as Co,ca as So,cb as wo,cc as Oo,d as ar,be as jo,aM as To,bB as ce,au as Po,ak as xo,br as Do}from"./index-BDMrCE1B.js";import{S as No,b as Io,c as jt,r as Eo,I as gt,C as De,k as Yn}from"./MissingPartitionError-ChbZu1r1.js";import{p as Ce,P as Ao,l as Ro,x as lr,I as et,T as ko,K as Fo,k as _o,w as $o}from"./IrisGridShortcuts-DaLHHBjg.js";import{c as he,O as Mo,G as me,n as qn,o as Gt,p as Go,q as sr,r as Lo,s as Uo,v as ur,T as Ho,w as Bo,l as Wo,g as zo}from"./GridTokenMouseHandler-B-shYgV-.js";import{e as Vo}from"./monaco-DaE0jI-i.js";import{I as Re,G as Z,d as H,m as Zn,e as Ve,f as Ko}from"./IrisGridModel-6f53dQlx.js";import{F as Qo,c as Xo}from"./FormatterUtils-twHdmGXI.js";function fc(r,e){var t=bi(e);(t===void 0||!e.every((n,i)=>n===t[i]))&&r()}function Yo(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=C.useRef(),i=C.useRef(0);return C.useCallback(o=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var a=Math.floor(o.target.scrollTop/r);i.current!==a&&(i.current=a,e(a))},t)},[t,r,e])}function dr(r,e){return ea(r)||Jo(r,e)||Zo(r,e)||qo()}function qo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zo(r,e){if(r){if(typeof r=="string")return cr(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?cr(r,e):void 0}}function cr(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Jo(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function ea(r){if(Array.isArray(r))return r}function ta(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=r.getKey,t=e===void 0?ra:e,n=C.useState([]),i=dr(n,2),o=i[0],a=i[1],l=C.useState(()=>new Set),s=dr(l,2),u=s[0],c=s[1],m=C.useCallback(w=>T=>t(T)===w,[t]),h=C.useCallback(w=>{var T;return(T=o.find(m(w)))!==null&&T!==void 0?T:null},[o,m]),v=C.useCallback(w=>{var T=h(w);if(T==null)throw new Error("No item found matching key: ".concat(w));return T},[h]),p=C.useCallback(w=>{a(T=>[...T,...w])},[]),g=C.useCallback((w,T)=>{a(x=>[...x.slice(0,w),...T,...x.slice(w)])},[]),b=C.useCallback(w=>{var T=new Set(w);a(x=>x.filter(D=>!T.has(t(D))))},[t]),f=C.useCallback((w,T)=>{var x=o.findIndex(m(w));x!==-1&&a(D=>[...D.slice(0,x),T,...D.slice(x+1)])},[o,m]),S=C.useCallback(w=>{if(w.size!==0){var T=[],x=new Map;for(var D of w.keys()){var A=o.findIndex(m(D));T.push(A),x.set(A,D)}T.sort((E,N)=>E-N);var R=[];o.forEach((E,N)=>{if(T[0]===N){var I=x.get(T.shift()),F=w.get(I);R.push(F)}else R.push(E)}),a(R)}},[o,m]),y=C.useMemo(()=>({items:o,selectedKeys:u,append:p,bulkUpdate:S,findItem:h,getItem:v,insert:g,remove:b,setItems:a,setSelectedKeys:c,update:f}),[p,S,h,v,g,o,b,a,u,f]);return y}function ra(r){var e=r!=null&&typeof r=="object"&&"key"in r;if(!e)throw new Error("Item does not have a `key` prop.");return r.key}function hr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function mr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hr(Object(t),!0).forEach(function(n){na(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):hr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function na(r,e,t){return(e=ia(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ia(r){var e=oa(r,"string");return typeof e=="symbol"?e:e+""}function oa(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function aa(r,e){return da(r)||ua(r,e)||sa(r,e)||la()}function la(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sa(r,e){if(r){if(typeof r=="string")return vr(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?vr(r,e):void 0}}function vr(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function ua(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function da(r){if(Array.isArray(r))return r}function ca(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:100,t=C.useState({state:r,undoStack:[],redoStack:[]}),n=aa(t,2),i=n[0],o=n[1],a=C.useCallback(c=>{o(m=>{var h=m.undoStack,v=m.state;return c===v?m:(h.push(v),h.length>e&&h.shift(),{state:c,undoStack:h,redoStack:[]})})},[e]),l=C.useCallback(()=>{o(c=>{if(c.undoStack.length===0)return c;var m=c.undoStack,h=c.redoStack,v=c.state,p=m.pop();return h.push(v),{state:p,undoStack:m,redoStack:h}})},[]),s=C.useCallback(()=>{o(c=>{if(c.redoStack.length===0)return c;var m=c.undoStack,h=c.redoStack,v=c.state,p=h.pop();return m.push(v),{state:p,undoStack:m,redoStack:h}})},[]),u=C.useCallback(()=>{o(c=>mr(mr({},c),{},{undoStack:[],redoStack:[]}))},[]);return{state:i.state,set:a,undo:l,redo:s,canUndo:i.undoStack.length>0,canRedo:i.redoStack.length>0,clear:u}}function pr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function fr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pr(Object(t),!0).forEach(function(n){ha(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ha(r,e,t){return(e=ma(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ma(r){var e=va(r,"string");return typeof e=="symbol"?e:e+""}function va(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function tt(r,e){return ba(r)||ga(r,e)||fa(r,e)||pa()}function pa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fa(r,e){if(r){if(typeof r=="string")return gr(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gr(r,e):void 0}}function gr(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function ga(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function ba(r){if(Array.isArray(r))return r}var br=de.module("Aggregations");function gc(r){var e=r.isRollup,t=r.settings,n=r.availablePlacements,i=n===void 0?["top","bottom"]:n,o=r.onChange,a=r.onEdit,l=r.dh,s=t.aggregations,u=t.showOnTop,c=C.useMemo(()=>No.filter(O=>!s.some(P=>P.operation===O)&&!(O===Io.MEDIAN&&l.AggregationOperation.MEDIAN===void 0)),[s,l]),m=C.useState(c[0]),h=tt(m,2),v=h[0],p=h[1],g=C.useState([]),b=tt(g,2),f=b[0],S=b[1],y=C.useCallback(function(O){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];o(fr(fr({},t),O),P,_)},[o,t]),w=C.useCallback(function(O){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];y({aggregations:O},P,_)},[y]),T=C.useCallback(O=>{y({showOnTop:O})},[y]),x=C.useCallback(()=>{br.debug("handleDragStart"),Ce.startDragging()},[]),D=C.useCallback(O=>{var P=O.destination,_=O.source;if(br.debug("handleDragEnd",P,_),Ce.stopDragging(),P!=null){var L=P.index;_.index<P.index&&(L+=1);var z=[...s],q=Ce.reorder(z,f,z,L),re=Ce.adjustDestinationIndex(L,f),J=[[re,re+q.length-1]];w(z),S(J)}},[w,s,f,S]),A=C.useCallback(O=>{p(O)},[p]),R=C.useCallback(()=>{w([...s,{operation:v,selected:[],invert:!0}],[v])},[s,v,w]),E=C.useCallback(O=>{var P=s.reduce((q,re,J)=>{var Se=tt(q,2),Ge=Se[0],Je=Se[1];return J===O?Je.push(re.operation):Ge.push(re),[Ge,Je]},[[],[]]),_=tt(P,2),L=_[0],z=_[1];w(L,[],z)},[s,w]),N=C.useCallback(O=>{S(O)},[S]),I=C.useCallback(O=>{var P=s[O];jt.isRollupOperation(P.operation)||a(P)},[s,a]),F=C.useCallback(O=>{T(O==="true")},[T]);C.useEffect(function(){c.length>0&&!c.includes(v)&&p(c[0])},[c,v]);var U=C.useCallback(O=>{var P=O.item,_=O.itemIndex,L=O.isClone,z=L===void 0?!1:L,q=O.selectedCount,re=P.operation,J=z?"".concat(q):void 0,Se=z?"item-list-item-clone":void 0,Ge=jt.isRollupOperation(P.operation),Je=jt.isRollupProhibited(P.operation),gi=!z&&!Ge;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:Y("item-list-item-content","draggable-item-list-item-content",Se),children:[d.jsxs("span",{className:"title",children:[re,!e&&Ge&&d.jsxs("span",{className:"small text-warning",children:[d.jsx(X,{icon:ir})," Requires rollup"]}),e&&Je&&d.jsxs("span",{className:"small text-warning",children:[d.jsx(X,{icon:ir})," Not available on rollups"]})]}),he.renderBadge({text:J}),he.renderHandle()]}),!z&&d.jsxs(d.Fragment,{children:[d.jsx(B,{kind:"ghost",className:"btn-edit",icon:Hn,tooltip:"Edit Columns",onClick:()=>a(P),disabled:!gi}),d.jsx(B,{kind:"ghost",className:"btn-delete",icon:qe,tooltip:"Delete Aggregation",onClick:()=>E(_)})]})]})},[E,a,e]),M=c.length>0,G=s.length>0;return d.jsxs("div",{className:"aggregations",children:[M&&d.jsxs("div",{className:"form-inline",children:[d.jsx(kt,{onChange:A,value:v,children:c.map(O=>d.jsx(Mo,{value:O,children:O},O))}),d.jsxs("button",{type:"button",className:"btn btn-link btn-add",onClick:R,children:[d.jsx(X,{icon:zt}),"Add Aggregation"]})]}),M&&G&&d.jsx("hr",{}),G&&d.jsxs(d.Fragment,{children:[!e&&d.jsxs("div",{children:[d.jsx("label",{id:"placement-options-label",children:"Placement: "}),d.jsxs(Bt,{"aria-labelledby":"placement-options-label",marginStart:"size-125",orientation:"horizontal",onChange:F,value:"".concat(u),children:[d.jsx(Ee,{value:"true",isDisabled:!i.includes("top"),children:"Top"}),d.jsx(Ee,{value:"false",isDisabled:!i.includes("bottom"),children:"Bottom"})]})]}),d.jsx(Wt,{onDragStart:x,onDragEnd:D,children:d.jsx(he,{className:"selected-aggregations",itemCount:s.length,items:s,renderItem:U,offset:0,onSelectionChange:N,onSelect:I,selectedRanges:f,isMultiSelect:!0})})]})]})}function yr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Oe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yr(Object(t),!0).forEach(function(n){ya(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):yr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ya(r,e,t){return(e=Ca(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ca(r){var e=Sa(r,"string");return typeof e=="symbol"?e:e+""}function Sa(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Tt(r,e){return Ta(r)||ja(r,e)||Oa(r,e)||wa()}function wa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
5
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oa(r,e){if(r){if(typeof r=="string")return Cr(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Cr(r,e):void 0}}function Cr(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function ja(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function Ta(r){if(Array.isArray(r))return r}var ve=function(r){return r[r.NONE=0]="NONE",r[r.ASCENDING=1]="ASCENDING",r[r.DESCENDING=2]="DESCENDING",r}(ve||{}),Pa=30;function bc(r){var e=r.aggregation,t=r.columns,n=r.onChange,i=C.useState(-1),o=Tt(i,2),a=o[0],l=o[1],s=C.useState(-1),u=Tt(s,2),c=u[0],m=u[1],h=C.useState(ve.NONE),v=Tt(h,2),p=v[0],g=v[1],b=e.invert,f=e.selected,S=C.useRef(null),y=C.useCallback(I=>f.includes(I)?!b:b,[b,f]),w=C.useMemo(()=>{var I=Eo(t,e.operation);return p!==ve.NONE&&(I=K.sortColumns(I,p===ve.ASCENDING)),I},[t,e.operation,p]),T=C.useMemo(()=>a>=0?w.slice(a,c+1).map(I=>({value:I.name,displayValue:I.name,isSelected:y(I.name)})):[],[w,y,c,a]),x=C.useCallback(I=>{var F=w[I].name,U=f.indexOf(F),M=[...f],G=b;U>=0?M.splice(U,1):(M.push(F),M.length===w.length&&(M=[],G=!b)),n(Oe(Oe({},e),{},{selected:M,invert:G}))},[e,b,w,f,n]),D=C.useCallback(()=>{g(ve.NONE),n(Oe(Oe({},e),{},{selected:[],invert:!0}))},[e,n]),A=C.useCallback((I,F)=>{l(I),m(F)},[l,m]),R=C.useCallback(()=>{f.length===0?n(Oe(Oe({},e),{},{invert:!b})):n(Oe(Oe({},e),{},{selected:[],invert:!0}))},[e,b,n,f]),E=f.length===0?b:null,N=f.length!==0||!b||p!==ve.NONE;return d.jsxs("div",{role:"menu",className:"aggregation-edit",children:[d.jsx("div",{className:"top-menu",children:d.jsxs("div",{className:"form-inline",children:[d.jsx(Ie,{checked:E,onChange:R,children:"Toggle All"}),d.jsx("div",{className:"spacer"}),d.jsx(yi,{in:N,timeout:ae.transitionSlowMs,mountOnEnter:!0,unmountOnExit:!0,children:d.jsx(B,{kind:"ghost",className:"btn-reset",onClick:D,children:"Reset"})}),d.jsx(B,{kind:"ghost",className:Y({active:p===ve.ASCENDING}),icon:Vt,tooltip:"Sort ascending",onClick:()=>g(ve.ASCENDING)}),d.jsx(B,{kind:"ghost",className:Y({active:p===ve.DESCENDING}),icon:Kt,tooltip:"Sort descending",onClick:()=>g(ve.DESCENDING)})]})}),d.jsx("div",{className:"aggregation-edit-item-list",children:d.jsx(Ci,{itemCount:w.length,items:T,offset:a,renderItem:I=>{var F=I.item;return d.jsx(Ie,{checked:y(F.value),children:F.displayValue})},onSelect:x,onViewportChange:A,rowHeight:Pa,focusSelector:"input",ref:S})})]})}function Sr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function wr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sr(Object(t),!0).forEach(function(n){xa(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Sr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function xa(r,e,t){return(e=Da(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Da(r){var e=Na(r,"string");return typeof e=="symbol"?e:e+""}function Na(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ia(r){return d.jsx("svg",wr(wr({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),d.jsx("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})}))}function Or(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function jr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(t),!0).forEach(function(n){Ea(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Or(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ea(r,e,t){return(e=Aa(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Aa(r){var e=Ra(r,"string");return typeof e=="symbol"?e:e+""}function Ra(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ka(r){return d.jsx("svg",jr(jr({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),d.jsx("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})}))}function Tr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Pr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tr(Object(t),!0).forEach(function(n){Fa(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Tr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Fa(r,e,t){return(e=_a(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _a(r){var e=$a(r,"string");return typeof e=="symbol"?e:e+""}function $a(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ma(r){return d.jsx("svg",Pr(Pr({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),d.jsx("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),d.jsx("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})}))}function xr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Dr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xr(Object(t),!0).forEach(function(n){Ga(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):xr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ga(r,e,t){return(e=La(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function La(r){var e=Ua(r,"string");return typeof e=="symbol"?e:e+""}function Ua(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ha(r){return d.jsx("svg",Dr(Dr({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),d.jsx("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})}))}function Nr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ir(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nr(Object(t),!0).forEach(function(n){Ba(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Nr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ba(r,e,t){return(e=Wa(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wa(r){var e=za(r,"string");return typeof e=="symbol"?e:e+""}function za(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Va(r){return d.jsx("svg",Ir(Ir({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),d.jsx("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),d.jsx("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})}))}function Er(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ar(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Er(Object(t),!0).forEach(function(n){Ka(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Er(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ka(r,e,t){return(e=Qa(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qa(r){var e=Xa(r,"string");return typeof e=="symbol"?e:e+""}function Xa(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function yc(r){return d.jsxs("svg",Ar(Ar({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[d.jsx("rect",{width:"48",height:"48",fill:"none"}),d.jsx("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),d.jsx("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),d.jsx("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),d.jsx("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]}))}function Rr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function kr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rr(Object(t),!0).forEach(function(n){Ya(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Rr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ya(r,e,t){return(e=qa(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function qa(r){var e=Za(r,"string");return typeof e=="symbol"?e:e+""}function Za(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Cc(r){return d.jsxs("svg",kr(kr({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[d.jsx("rect",{width:"48",height:"48",fill:"none"}),d.jsx("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),d.jsx("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),d.jsx("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]}))}var Fr=de.module("ChartBuilder");class pe extends C.PureComponent{static getMaxSeriesCount(e,t){switch(t){case e.plot.SeriesPlotStyle.PIE:return 1;case e.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static makeSeriesItem(e){return{id:Xe(),value:e}}static makeDefaultSeriesItems(e,t,n){var i=pe.getMaxSeriesCount(e,t);if(i===0||n==null||n.length===0)return[];var o=n.length>1?n[1].name:n[0].name;return[pe.makeSeriesItem(o)]}static getDefaultXAxis(e,t){return t!=null&&t.length>0?t[0].name:null}constructor(e){super(e),$n(this);var t=e.model,n=t.columns,i=t.dh,o=this.getTypes()[0],a=pe.getDefaultXAxis(o,n),l=pe.makeDefaultSeriesItems(i,o,n);this.state={type:o,seriesItems:l,xAxis:a,isLinked:!0}}getTypes(){var e=this.props.model,t=e.dh;return[t.plot.SeriesPlotStyle.LINE,t.plot.SeriesPlotStyle.BAR,t.plot.SeriesPlotStyle.SCATTER,t.plot.SeriesPlotStyle.PIE]}getTypeName(e){var t=this.props.model,n=t.dh;switch(e){case n.plot.SeriesPlotStyle.LINE:return"Line";case n.plot.SeriesPlotStyle.BAR:return"Bar";case n.plot.SeriesPlotStyle.SCATTER:return"Scatter";case n.plot.SeriesPlotStyle.PIE:return"Pie";case n.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}getTypeIcon(e){var t=this.props.model,n=t.dh;switch(e){case n.plot.SeriesPlotStyle.LINE:return d.jsx(Ma,{});case n.plot.SeriesPlotStyle.BAR:return d.jsx(Ia,{});case n.plot.SeriesPlotStyle.SCATTER:return d.jsx(Va,{});case n.plot.SeriesPlotStyle.PIE:return d.jsx(Ha,{});case n.plot.SeriesPlotStyle.HISTOGRAM:return d.jsx(ka,{});default:return null}}getXAxisLabel(e){var t=this.props.model,n=t.dh;switch(e){case n.plot.SeriesPlotStyle.PIE:return"Labels";case n.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}getSeriesLabel(e){var t=this.props.model,n=t.dh;switch(e){case n.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}handleAddSeries(){this.setState(e=>{var t=e.seriesItems,n=[...t],i=this.props.model,o=i.columns;return n.push({id:Xe(),value:o[0].name}),{seriesItems:n}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e==="true"},this.sendChange)}handleReset(){var e=this.props.model,t=e.columns,n=e.dh,i=this.getTypes()[0],o=pe.getDefaultXAxis(i,t),a=pe.makeDefaultSeriesItems(n,i,t),l=!0;this.setState({type:i,seriesItems:a,xAxis:o,isLinked:l},this.sendChange)}handleSeriesChange(e,t){var n=e;this.setState(i=>{var o=i.seriesItems;return o=[...o],o[t].value=n,{seriesItems:o}},this.sendChange)}handleSeriesDeleteClick(e){this.setState(t=>{var n=t.seriesItems,i=[...n];return i.splice(e,1),{seriesItems:i}},this.sendChange)}handleSubmit(e){e.preventDefault();var t=this.props.onSubmit,n=this.state,i=n.type,o=n.seriesItems,a=n.xAxis,l=n.isLinked,s=o.map(u=>u.value);t({type:i,series:s,xAxis:a,isLinked:l})}handleTypeClick(e){var t=this.getTypes()[e];Fr.debug2("handleTypeSelect",t),this.setState(n=>{var i=this.props.model,o=i.dh,a=pe.getMaxSeriesCount(o,t),l=n.seriesItems;if(l=l.slice(0,a),l.length===0&&a>0){var s=i.columns;l=pe.makeDefaultSeriesItems(o,t,s)}return{type:t,seriesItems:l}},this.sendChange)}handleXAxisChange(e){var t=e;Fr.debug2("x-axis change",t),this.setState({xAxis:t},this.sendChange)}sendChange(){var e=this.props.onChange,t=this.state,n=t.isLinked,i=t.type,o=t.seriesItems,a=t.xAxis,l=o.map(s=>s.value);e({type:i,series:l,xAxis:a,isLinked:n})}render(){var e=this.props.model,t=e.columns,n=e.dh,i=this.state,o=i.seriesItems,a=i.type,l=i.xAxis,s=i.isLinked,u=pe.getMaxSeriesCount(n,a),c=this.getXAxisLabel(a),m=this.getSeriesLabel(a),h=o.length>0,v=o.length<u;return d.jsx("div",{className:"chart-builder",children:d.jsxs("form",{onSubmit:this.handleSubmit,children:[d.jsxs("div",{className:"form-row",children:[d.jsx("label",{children:"Select Chart Type"}),d.jsx("div",{className:"form-row",children:this.getTypes().map((p,g)=>{var b=p;return d.jsx("div",{className:"col col-chart-type",children:d.jsxs("button",{type:"button",className:Y("btn","btn-icon","btn-chart-type",{active:p===a}),onClick:()=>this.handleTypeClick(g),children:[this.getTypeIcon(p),this.getTypeName(p)]})},b)})})]}),d.jsx("hr",{}),d.jsxs("div",{className:"form-row form-inline",children:[d.jsx("label",{className:"col-2 label-left",children:c}),d.jsx(kt,{className:"form-control select-x-axis col",value:l,onChange:this.handleXAxisChange,children:t.map(p=>d.jsx("option",{value:p.name,children:p.name},p.name))})]}),h&&d.jsx("hr",{}),o.map((p,g)=>d.jsxs("div",{className:"form-row form-inline form-series-item","data-testid":"form-series-item-".concat(g),children:[d.jsx("label",{className:"col-2 label-left",children:g===0?m:""}),d.jsx(kt,{className:"form-control select-series col",value:p.value,onChange:b=>this.handleSeriesChange(b,g),"data-testid":"select-series-item-".concat(g),children:t.map(b=>d.jsx("option",{value:b.name,children:b.name},b.name))}),o.length>1&&d.jsx(B,{kind:"ghost",className:"btn-delete-series ml-2 px-2","data-testid":"delete-series-".concat(g),onClick:()=>{this.handleSeriesDeleteClick(g)},icon:qe,tooltip:"Delete"})]},p.id)),v&&d.jsxs("div",{className:"form-row",children:[d.jsx("div",{className:"col-2"}),d.jsx(B,{kind:"ghost",className:"btn-add-series mt-1",onClick:this.handleAddSeries,icon:zt,children:"Add Series"})]}),d.jsxs("div",{className:"form-row chart-builder-link",children:[d.jsx("label",{className:"col-2 label-right",children:d.jsxs("div",{className:"fa-md fa-layers",children:[d.jsx(X,{mask:no,icon:Bn,transform:"right-5 down-5"}),d.jsx(X,{icon:s?io:oo,transform:"grow-2 right-8 down-6"})]})}),d.jsxs(Bt,{"aria-label":"Link state options",orientation:"horizontal",onChange:this.handleLinkStateChange,value:"".concat(s),children:[d.jsx(Ee,{value:"true",children:"Sync State"}),d.jsx(Ee,{value:"false",children:"Freeze State"})]})]}),d.jsxs("div",{className:"form-row",children:[d.jsx("div",{className:"col-2 label-right"}),d.jsx("div",{className:"col chart-builder-link-info",children:s?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),d.jsxs("div",{className:Y("form-row","justify-content-end","my-3"),children:[d.jsx(B,{kind:"secondary",className:"btn-reset",onClick:this.handleReset,children:"Reset"}),d.jsx(B,{kind:"primary",type:"submit",className:"btn-submit",children:"Create"})]})]})})}}function _r(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ja(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(t),!0).forEach(function(n){mt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):_r(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function mt(r,e,t){return(e=el(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function el(r){var e=tl(r,"string");return typeof e=="symbol"?e:e+""}function tl(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Jn extends C.Component{constructor(e){super(e),mt(this,"editorContainer",void 0),mt(this,"editor",void 0),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var e,t=this.props,n=t.value,i=t.editorSettings,o=Ja({copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:n,wordWrap:"on",automaticLayout:!0,autoClosingBrackets:"beforeWhitespace"},i);if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=Vo.create(this.editorContainer,o),this.editor.layout(),(e=this.editor.getModel())===null||e===void 0||e.updateOptions({tabSize:0}),this.editor.onKeyDown(this.handleKeyDown),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var e;(e=this.editor)===null||e===void 0||e.dispose(),this.editor=void 0}handleContentChanged(){var e,t=this.props.onContentChanged,n=(e=this.editor)===null||e===void 0||(e=e.getModel())===null||e===void 0?void 0:e.getValue();n!==void 0&&this.setState({isEditorEmpty:n.length===0}),t(n)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var e,t,n=(e=(t=this.editor)===null||t===void 0||(t=t.getModel())===null||t===void 0?void 0:t.getValue())!==null&&e!==void 0?e:"";this.setState({isEditorEmpty:n.length===0,isEditorFocused:!1})}handleContainerClick(){var e,t=this.state.isEditorFocused;t||(e=this.editor)===null||e===void 0||e.focus()}handleKeyDown(e){var t=this.props,n=t.onTab,i=t.editorIndex;e.code==="Tab"&&(e.stopPropagation(),e.preventDefault(),n(i,e.shiftKey))}render(){var e=this.props,t=e.className,n=e.invalid,i=e.placeholder,o=i===void 0?"":i,a=e.value,l=this.state,s=l.isEditorFocused,u=l.isEditorEmpty;return d.jsxs("div",{className:Y("input-editor-wrapper",{focused:s,invalid:n},t),role:"presentation",onClick:this.handleContainerClick,children:[d.jsx("div",{className:"editor-container",ref:c=>{this.editorContainer=c},"data-testid":"custom-column-formula"}),u&&!a&&o.length>0&&d.jsx("div",{className:"editor-placeholder text-muted",children:o})]})}}mt(Jn,"defaultProps",{value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1});function $r(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function rt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(t),!0).forEach(function(n){rl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$r(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function rl(r,e,t){return(e=nl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nl(r){var e=il(r,"string");return typeof e=="symbol"?e:e+""}function il(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Mr=Object.freeze({NAME:"name",FORMULA:"formula"}),ol=()=>{};function al(r){var e=r.eventKey,t=r.name,n=r.inputIndex,i=r.formula,o=r.onChange,a=r.onDeleteColumn,l=r.onTabInEditor,s=r.invalid,u=r.isDuplicate,c=t===""||Ht.isValidColumnName(t),m=C.useCallback(h=>{h!==void 0&&(h.replace(/(\r\n|\n|\r)/gm,""),o(e,Mr.FORMULA,h))},[o,e]);return d.jsx(_i,{draggableId:e,index:n,disableInteractiveElementBlocking:!0,children:(h,v)=>d.jsxs("div",rt(rt({className:Y("draggable-container",{dragging:v.isDragging}),ref:h.innerRef},h.draggableProps),{},{children:[d.jsxs("div",{className:"custom-column-input-container",children:[d.jsxs("div",{className:"pb-3",children:[d.jsxs("div",{className:"d-flex flex-row custom-column-name",children:[d.jsx("input",{className:Y("form-control custom-column-input",{"is-invalid":s||!c||u}),placeholder:"Column Name",value:t,onChange:p=>{o(e,Mr.NAME,p.target.value)}}),d.jsx(B,{kind:"ghost",className:"ml-1 px-2",onClick:()=>{a(e)},icon:qe,tooltip:"Delete custom column"}),d.jsx(B,rt(rt({kind:"ghost",className:"btn-drag-handle",onClick:ol},h.dragHandleProps),{},{icon:Qt,tooltip:"Drag column to re-order"}))]}),(!c||u)&&d.jsx("p",{className:"validate-label-error text-danger mb-0 mt-2 pl-1",children:c?"Duplicate name":"Invalid name"})]}),d.jsx(Jn,{editorSettings:{language:"deephavenDb"},editorIndex:n,placeholder:"Column Formula",value:i,onContentChanged:m,onTab:l,invalid:s})]}),d.jsx("hr",{})]}))})}function ll(r){return(r==null?void 0:r.isDeletable)!==void 0}function ei(r){return(r==null?void 0:r.hasExpandableColumns)!==void 0}function Gr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Pt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gr(Object(t),!0).forEach(function(n){Fe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Fe(r,e,t){return(e=sl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sl(r){var e=ul(r,"string");return typeof e=="symbol"?e:e+""}function ul(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ne extends C.Component{static makeCustomColumnInputEventKey(){return Xe()}static createCustomColumnInput(){return{eventKey:Xe(),name:"",formula:""}}constructor(e){super(e),Fe(this,"container",void 0),Fe(this,"successButtonTimer",void 0),Fe(this,"getInput",ht((t,n)=>t.find(i=>i.eventKey===n))),Fe(this,"getInputIndex",ht((t,n)=>t.findIndex(i=>i.eventKey===n))),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleSaveClick=this.handleSaveClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleCustomColumnUpdated=this.handleCustomColumnUpdated.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.resetRequestFailed=this.resetRequestFailed.bind(this),this.handleEditorTabNavigation=this.handleEditorTabNavigation.bind(this),this.state={inputs:[],isCustomColumnApplying:!1,errorMessage:null,hasRequestFailed:!1,isSuccessShowing:!1},this.container=null,this.successButtonTimer=null}componentDidMount(){var e=this.props.customColumns;this.parseCustomColumns(e),this.startListening()}componentWillUnmount(){this.stopListening(),this.successButtonTimer&&clearTimeout(this.successButtonTimer)}resetErrorMessage(){this.setState({errorMessage:null})}startListening(){var e=this.props.model;e.addEventListener(Re.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.addEventListener(Re.EVENT.UPDATED,this.handleCustomColumnUpdated),e.addEventListener(Re.EVENT.REQUEST_FAILED,this.handleRequestFailed)}stopListening(){var e=this.props.model;e.removeEventListener(Re.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.removeEventListener(Re.EVENT.UPDATED,this.handleCustomColumnUpdated),e.removeEventListener(Re.EVENT.REQUEST_FAILED,this.handleRequestFailed)}parseCustomColumns(e){if(e.length>0){var t=e.map(n=>{var i=n.split(/=(.+)/,2);return{eventKey:Ne.makeCustomColumnInputEventKey(),name:i[0],formula:i[1]}});this.setState({inputs:t})}else this.setState({inputs:[Ne.createCustomColumnInput()]})}handleAddColumnClick(){var e=this.state.inputs,t=[...e];t.push(Ne.createCustomColumnInput()),this.setState({inputs:t})}handleDeleteColumn(e){var t=this.state.inputs,n=this.getInputIndex(t,e),i=[...t];i.splice(n,1),i.length===0&&i.push(Ne.createCustomColumnInput()),this.setState({inputs:i})}handleInputChange(e,t,n){var i=this.state.inputs,o=this.getInputIndex(i,e),a=this.getInput(i,e),l=Pt({},a);l[t]=n;var s=[...i];s.splice(o,1,l),this.setState({inputs:s})}handleCustomColumnUpdated(){var e=this.state.isCustomColumnApplying;e&&this.setState({isCustomColumnApplying:!1,isSuccessShowing:!0},()=>{this.successButtonTimer=setTimeout(()=>this.setState({isSuccessShowing:!1}),Ne.SUCCESS_SHOW_DURATION)})}handleRequestFailed(e){var t=e,n=this.state.isCustomColumnApplying;n&&this.setState({isCustomColumnApplying:!1,errorMessage:d.jsxs(d.Fragment,{children:[d.jsxs("p",{children:[d.jsx(X,{icon:dt})," Failed to apply custom columns."]}),d.jsxs("div",{className:"error-box",children:[t.detail.errorMessage,d.jsx("br",{}),"Table configuration:"," ",JSON.stringify(t.detail.configuration)]})]}),hasRequestFailed:!0})}handleDragEnd(e){if(Ce.stopDragging(),!!e.destination){var t=this.state.inputs,n=e.source.index,i=e.destination.index,o=[...t],a=t[n];o.splice(n,1),o.splice(i,0,a),this.setState({inputs:o})}}handleEditorTabNavigation(e,t){var n=this.state.inputs;if(t){var i;((i=this.container)===null||i===void 0?void 0:i.querySelectorAll(".btn-drag-handle")[e]).focus();return}if(e===n.length-1){var o;(o=this.container)===null||o===void 0||(o=o.querySelector(".btn-add-column"))===null||o===void 0||o.focus()}else{var a,l=e+1;((a=this.container)===null||a===void 0?void 0:a.querySelectorAll(".custom-column-input")[l]).focus()}}handleSaveClick(){var e=this.props,t=e.onSave,n=e.customColumns,i=this.state,o=i.inputs,a=i.isCustomColumnApplying;if(!a){var l=[];o.forEach(s=>{var u=s.name,c=s.formula;u&&c&&l.push("".concat(u,"=").concat(c))}),this.resetErrorMessage(),this.setState({isCustomColumnApplying:l.length>0||n.length>0}),t(l)}}resetRequestFailed(){this.setState(e=>{var t=e.hasRequestFailed;return t?{hasRequestFailed:!1}:null})}renderInputs(){var e=this.state,t=e.inputs,n=e.hasRequestFailed,i=new Map;return t.forEach(o=>{var a,l=o.name;return i.set(l,((a=i.get(l))!==null&&a!==void 0?a:0)+1)}),t.map((o,a)=>{var l,s=o.eventKey,u=o.name,c=o.formula,m=((l=i.get(u))!==null&&l!==void 0?l:0)>1;return d.jsx(al,{inputIndex:a,eventKey:s,name:u,formula:c,onChange:this.handleInputChange,onDeleteColumn:this.handleDeleteColumn,onTabInEditor:this.handleEditorTabNavigation,invalid:n,isDuplicate:m},s)})}renderSaveButton(){var e=this.state,t=e.inputs,n=e.isCustomColumnApplying,i=e.isSuccessShowing,o=t.length>1?"Save Columns":"Save Column",a=t.every(u=>{var c=u.name;return c===""||Ht.isValidColumnName(c)}),l=t.filter(u=>{var c=u.name;return c!==""}).map(u=>{var c=u.name;return c}),s=new Set(l).size===l.length;return d.jsxs(B,{kind:i?"success":"primary",className:Y("btn-apply",{"btn-spinner":n}),disabled:i||n||!a||!s,onClick:this.handleSaveClick,icon:i?ao:void 0,children:[n&&d.jsxs("span",{children:[d.jsx(Wn,{className:"mr-2 loading-spinner-vertical-align"}),d.jsx("span",{className:"btn-normal-content",children:"Applying"})]}),!i&&!n&&o,i&&"Success"]})}render(){var e=this.props.onCancel,t=this.state.errorMessage;return d.jsxs("div",{role:"presentation",className:"custom-column-builder-container",ref:n=>{this.container=n},onClick:this.resetRequestFailed,onFocus:this.resetRequestFailed,children:[d.jsx("hr",{}),d.jsx(Wt,{onDragStart:Ce.startDragging,onDragEnd:this.handleDragEnd,children:d.jsx(Gn,{droppableId:"droppable-custom-columns",children:(n,i)=>d.jsxs("div",Pt(Pt({ref:n.innerRef},n.droppableProps),{},{className:Y("droppable-container",{dragging:i.draggingFromThisWith}),children:[this.renderInputs(),n.placeholder]}))})}),d.jsx("div",{className:"pt-1 px-3",children:d.jsx(B,{kind:"ghost",className:"btn-add-column",onClick:this.handleAddColumnClick,icon:zt,children:"Add Another Column"})}),d.jsxs("div",{className:"custom-column-builder-footer",children:[t&&d.jsx("div",{className:"error-message",children:t}),d.jsxs("div",{className:"d-flex justify-content-end",children:[d.jsx(B,{kind:"secondary",className:"mr-2",onClick:e,children:"Cancel"}),this.renderSaveButton()]})]})]})}}Fe(Ne,"SUCCESS_SHOW_DURATION",750);var dl=function(r){return r.ADVANCED_SETTINGS="ADVANCED_SETTINGS",r.AGGREGATIONS="AGGREGATIONS",r.AGGREGATION_EDIT="AGGREGATIONS_EDIT",r.CHART_BUILDER="CHART_BUILDER",r.CUSTOM_COLUMN_BUILDER="CUSTOM_COLUMN_BUILDER",r.QUICK_FILTERS="QUICK_FILTERS",r.ROLLUP_ROWS="ROLLUP_ROWS",r.SEARCH_BAR="SEARCH_BAR",r.SELECT_DISTINCT="SELECT_DISTINCT",r.TABLE_EXPORTER="TABLE_EXPORTER",r.VISIBILITY_ORDERING_BUILDER="VISIBILITY_ORDERING_BUILDER",r.CONDITIONAL_FORMATTING="CONDITIONAL_FORMATTING",r.CONDITIONAL_FORMATTING_EDIT="CONDITIONAL_FORMATTING_EDIT",r.GOTO="GOTO",r}(dl||{});function Lr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ur(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(n){Pe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Pe(r,e,t){return(e=cl(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:e+""}function hl(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Le=de.module("RollupRows"),ml=150,nt="grouped-rollup-rows",xt="ungrouped-rollup-rows";class le extends C.Component{static renderColumn(e){var t=e.item,n=e.isClone,i=e.selectedCount,o=t==null?void 0:t.name,a=n!==void 0&&n?"".concat(i):void 0,l=n!==void 0&&n?"item-list-item-clone":"";return he.renderTextItem({text:o,badgeText:a,className:l})}static addGroupings(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length;if(t==null||t.length===0)return e;var i=n,o=e.filter((a,l)=>t.includes(a)?(l<i&&(i-=1),!1):!0);return o.splice(i,0,...t),o}static isGroupable(e){return!K.isBigDecimalType(e.type)&&!K.isBigIntegerType(e.type)}constructor(e){super(e),Pe(this,"ungroupedList",void 0),Pe(this,"groupedList",void 0),Pe(this,"search",Ln(c=>{for(var m=this.getSortedUngroupedColumns(),h=[],v=null,p=0;p<m.length;p+=1){var g=m[p];g.name.toLowerCase().includes(c.toLowerCase())&&(v==null&&(v=p),h.push([p,p]))}k(v),this.setState({ungroupedSelectedRanges:h}),h.length>0&&this.ungroupedList.current&&this.ungroupedList.current.scrollToItem(v)},ml)),Pe(this,"getCachedUngroupedColumns",je((c,m)=>c.filter(h=>le.isGroupable(h)&&m.find(v=>v===h.name)==null),{max:100})),Pe(this,"getCachedSortedColumns",je((c,m)=>m==null?[...c]:K.sortColumns(c,m===le.SORT.ASCENDING),{max:100})),this.handleDeleteClicked=this.handleDeleteClicked.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUngroupedSelect=this.handleUngroupedSelect.bind(this),this.handleUngroupedSelectionChange=this.handleUngroupedSelectionChange.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupedSelectionChange=this.handleGroupedSelectionChange.bind(this),this.handleShowConstituentsChange=this.handleShowConstituentsChange.bind(this),this.handleShowNonAggregatedColumnsChange=this.handleShowNonAggregatedColumnsChange.bind(this),this.handleSortAscending=this.handleSortAscending.bind(this),this.handleSortDescending=this.handleSortDescending.bind(this),this.renderGroupedItem=this.renderGroupedItem.bind(this),this.ungroupedList=Ye.createRef(),this.groupedList=Ye.createRef();var t=e.config,n=t??{},i=n.columns,o=i===void 0?[]:i,a=n.showConstituents,l=a===void 0?!0:a,s=n.showNonAggregatedColumns,u=s===void 0?!0:s;this.state={ungroupedSelectedRanges:[],columns:o,groupedSelectedRanges:[],searchFilter:"",showConstituents:l,showNonAggregatedColumns:u,dragSource:null,sort:null}}componentDidUpdate(e,t){var n=this.props.config,i=this.state,o=i.columns,a=i.showConstituents,l=i.showNonAggregatedColumns;n!==e.config?this.updateFromConfig():(o!==t.columns||a!==t.showConstituents||l!==t.showNonAggregatedColumns)&&(n==null||o!==n.columns||a!==n.showConstituents||l!==n.showNonAggregatedColumns)&&this.sendChange()}componentWillUnmount(){this.search.cancel()}handleSearchChange(e){var t=e.target.value;if(this.setState({searchFilter:t}),!t){this.search.cancel(),this.resetSelection();return}this.search(t)}handleSortAscending(){this.setState(e=>{var t=e.sort;return{sort:t===le.SORT.ASCENDING?null:le.SORT.ASCENDING}})}handleSortDescending(){this.setState(e=>{var t=e.sort;return{sort:t===le.SORT.DESCENDING?null:le.SORT.DESCENDING}})}resetSelection(){this.setState({ungroupedSelectedRanges:[],groupedSelectedRanges:[]})}handleDragStart(e){Le.debug("handleDragStart",e),document.documentElement.classList.add("drag-pointer-events-none"),this.setState({dragSource:e.source})}handleDragEnd(e){Le.debug("handleDragEnd",e),document.documentElement.classList.remove("drag-pointer-events-none"),this.setState({dragSource:null});var t=e.destination,n=e.source;if(!(t==null||n==null)){if(t.droppableId===xt){this.setState(a=>{var l=a.groupedSelectedRanges,s=a.columns,u=[...s];return Ce.reorder(u,l,[],0),{columns:u,ungroupedSelectedRanges:[],groupedSelectedRanges:[]}});return}var i=n.droppableId===nt,o=t.index;i&&n.index<t.index&&(o+=1),this.setState(a=>{var l=a.columns,s=a.ungroupedSelectedRanges,u=a.groupedSelectedRanges,c=[...l],m=i?c:this.getSortedUngroupedColumns().map(b=>b.name),h=i?u:s,v=Ce.reorder(m,h,c,o),p=i?Ce.adjustDestinationIndex(o,u):o,g=[[p,p+v.length-1]];return{columns:c,ungroupedSelectedRanges:[],groupedSelectedRanges:g}}),this.resetSelection()}}handleUngroupedSelect(e){Le.debug("handleUngroupedSelect"),this.setState(t=>{var n=t.columns;return{columns:le.addGroupings(n,[this.getSortedUngroupedColumns()[e].name]),ungroupedSelectedRanges:[],groupedSelectedRanges:[]}})}handleUngroupedSelectionChange(e){Le.debug2("handleUngroupedSelectionChange",e),this.setState(t=>{var n=t.ungroupedSelectedRanges;return e===n?null:{ungroupedSelectedRanges:e,groupedSelectedRanges:[]}})}handleGroupedSelectionChange(e){Le.debug2("handleGroupedSelectedRanges",e),this.setState(t=>{var n=t.groupedSelectedRanges;return e===n?null:{groupedSelectedRanges:e,ungroupedSelectedRanges:[]}})}handleDeleteClicked(e){this.setState(t=>{var n=t.columns,i=n.slice();return i.splice(e,1),{columns:i}})}handleShowConstituentsChange(){this.setState(e=>{var t=e.showConstituents;return{showConstituents:!t}})}handleShowNonAggregatedColumnsChange(){this.setState(e=>{var t=e.showNonAggregatedColumns;return{showNonAggregatedColumns:!t}})}updateFromConfig(){var e=this.props.config,t=e??{},n=t.columns,i=n===void 0?[]:n,o=t.showConstituents,a=o===void 0?!0:o,l=t.showNonAggregatedColumns,s=l===void 0?!0:l;this.setState({columns:i,showConstituents:a,showNonAggregatedColumns:s})}sendChange(){var e=this.props.onChange,t=this.state,n=t.columns,i=t.showConstituents,o=t.showNonAggregatedColumns;e({columns:n,showConstituents:i,showNonAggregatedColumns:o})}getUngroupedColumns(){var e=this.props.model,t=this.state.columns,n=e.originalColumns;return this.getCachedUngroupedColumns(n,t)}getSortedUngroupedColumns(){var e=this.state.sort,t=this.getUngroupedColumns();return this.getCachedSortedColumns(t,e)}renderGroupedItem(e){var t=e.item,n=e.itemIndex,i=e.isClone,o=e.selectedCount,a=i!==void 0&&i?"":"  ".repeat(n),l="".concat(a).concat(t),s=i!==void 0&&i?"".concat(o):void 0,u=i!==void 0&&i?"item-list-item-clone":"";return d.jsxs(d.Fragment,{children:[he.renderTextItem({text:l,badgeText:s,className:u}),(i===void 0||!i)&&d.jsx(B,{kind:"ghost",className:"btn btn-link btn-link-icon btn-delete-grouping float-right",onClick:()=>this.handleDeleteClicked(n),children:d.jsx(X,{icon:qe})})]})}render(){var e=this.state,t=e.columns,n=e.dragSource,i=e.searchFilter,o=e.groupedSelectedRanges,a=e.ungroupedSelectedRanges,l=e.showConstituents,s=e.showNonAggregatedColumns,u=e.sort,c=this.getSortedUngroupedColumns(),m=t.length*he.DEFAULT_ROW_HEIGHT,h=c.length*he.DEFAULT_ROW_HEIGHT+10,v=Math.min(3*he.DEFAULT_ROW_HEIGHT,h);return d.jsx("div",{role:"menu",className:Y("rollup-rows",{"is-dragging":n!=null}),tabIndex:0,children:d.jsxs(Wt,{onDragEnd:this.handleDragEnd,onDragStart:this.handleDragStart,children:[d.jsxs("div",{className:"rollup-rows-group-by",children:[d.jsx("div",{className:"section-title",children:"Group By"}),t.length===0&&d.jsx(Gn,{droppableId:"placeholder",children:(p,g)=>d.jsx("div",Ur(Ur({className:Y("placeholder","text-muted",{"is-dragging-from-this":g.draggingFromThisWith,"is-dragging-over":g.isDraggingOver,"is-dropping":g.draggingOverWith}),ref:p.innerRef},p.droppableProps),{},{children:"To create a rollup, drag columns from the list below and drop them into this area."}))}),t.length>0&&d.jsx(he,{draggingItemClassName:"rollup-rows-dragging-grouped-item",draggablePrefix:nt,droppableId:nt,itemCount:t.length,items:t,offset:0,onSelectionChange:this.handleGroupedSelectionChange,ref:this.groupedList,renderItem:this.renderGroupedItem,selectedRanges:o,style:{"--group-list-height":"".concat(m,"px"),"--row-height":"".concat(he.DEFAULT_ROW_HEIGHT,"px")},isMultiSelect:!0,hasPlaceholder:!0})]}),d.jsxs("div",{className:"rollup-rows-available-columns",children:[d.jsx("div",{className:"section-title",children:"Available Grouping Columns"}),d.jsxs("div",{className:"top-menu",children:[d.jsx(Si,{className:"w-100",value:i,matchCount:i?a.length:void 0,placeholder:"Find column...",onChange:this.handleSearchChange}),d.jsxs(B,{kind:"ghost",className:Y("btn-link btn-link-icon",{active:u===le.SORT.ASCENDING}),onClick:this.handleSortAscending,children:[d.jsx(X,{icon:Vt}),d.jsx(Qe,{children:"Sort ascending"})]}),d.jsxs(B,{kind:"ghost",className:Y("btn-link btn-link-icon",{active:u===le.SORT.DESCENDING}),onClick:this.handleSortDescending,children:[d.jsx(X,{icon:Kt}),d.jsx(Qe,{children:"Sort descending"})]})]}),d.jsx(he,{className:"rollup-available-grouping-columns",draggablePrefix:xt,droppableId:xt,itemCount:c.length,items:c,renderItem:le.renderColumn,offset:0,onSelect:this.handleUngroupedSelect,onSelectionChange:this.handleUngroupedSelectionChange,ref:this.ungroupedList,selectedRanges:a,style:{maxHeight:h,minHeight:v},isDropDisabled:(n==null?void 0:n.droppableId)!==nt,isMultiSelect:!0}),d.jsxs("div",{className:"bottom-menu",children:[d.jsx("div",{className:"label",children:"Show:"}),d.jsx(Ie,{checked:l,onChange:this.handleShowConstituentsChange,children:"Constituents"}),d.jsx(Ie,{checked:s,onChange:this.handleShowNonAggregatedColumnsChange,children:"Non-Aggregated Columns"})]})]})]})})}}Pe(le,"SORT",Object.freeze({ASCENDING:"ASC",DESCENDING:"DESC"}));Pe(le,"defaultProps",{config:null,onChange:()=>{}});function Hr(r,e,t,n,i,o,a){try{var l=r[o](a),s=l.value}catch(u){return void t(u)}l.done?e(s):Promise.resolve(s).then(n,i)}function vl(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(s){Hr(o,n,i,a,l,"next",s)}function l(s){Hr(o,n,i,a,l,"throw",s)}a(void 0)})}}function Br(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Wr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Br(Object(t),!0).forEach(function(n){Ae(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Br(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ae(r,e,t){return(e=pl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pl(r){var e=fl(r,"string");return typeof e=="symbol"?e:e+""}function fl(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var gl=de.module("TableCsvExporter");class W extends C.Component{static getDateString(e){return e.i18n.DateTimeFormat.format(W.FILENAME_DATE_FORMAT,new Date)}constructor(e){super(e),this.handleDownloadClick=this.handleDownloadClick.bind(this),this.handleDownloadRowOptionChanged=this.handleDownloadRowOptionChanged.bind(this),this.handleCustomizedDownloadRowOptionChanged=this.handleCustomizedDownloadRowOptionChanged.bind(this),this.handleCustomizedDownloadRowsChanged=this.handleCustomizedDownloadRowsChanged.bind(this),this.handleIncludeColumnHeadersChanged=this.handleIncludeColumnHeadersChanged.bind(this),this.handleIncludeHiddenColumnsChanged=this.handleIncludeHiddenColumnsChanged.bind(this),this.handleUseUnformattedValuesChanged=this.handleUseUnformattedValuesChanged.bind(this);var t=e.model,n=e.name;this.state={fileName:"".concat(n,"-").concat(W.getDateString(t.dh),".csv"),downloadRowOption:W.DOWNLOAD_ROW_OPTIONS.ALL_ROWS,customizedDownloadRowOption:W.CUSTOMIZED_ROWS_OPTIONS.FIRST,customizedDownloadRows:W.DEFAULT_DOWNLOAD_ROWS,includeColumnHeaders:!0,includeHiddenColumns:!1,useUnformattedValues:!1,errorMessage:null,id:Xe()}}getSnapshotRanges(){var e=this.props,t=e.model,n=e.selectedRanges,i=this.state,o=i.downloadRowOption,a=i.customizedDownloadRowOption,l=i.customizedDownloadRows,s=t.rowCount,u=t.columnCount,c=[];switch(o){case W.DOWNLOAD_ROW_OPTIONS.ALL_ROWS:c.push(new Z(0,0,u-1,s-1));break;case W.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS:c=n.map(m=>Wr(Wr({},m),{},{startColumn:0,endColumn:u-1})).sort((m,h)=>m.startRow!=null&&h.startRow!=null?m.startRow-h.startRow:0);break;case W.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS:switch(a){case W.CUSTOMIZED_ROWS_OPTIONS.FIRST:c.push(new Z(0,0,u-1,Math.min(l-1,s-1)));break;case W.CUSTOMIZED_ROWS_OPTIONS.LAST:c.push(new Z(0,Math.max(0,s-l),u-1,s-1));break}break}return c}getModelRanges(e){var t=this.props,n=t.userColumnWidths,i=t.movedColumns,o=this.state.includeHiddenColumns,a=gt.getHiddenColumns(n),l=H.getModelRanges(e,i);if(!o&&a.length>0){var s=a.map(Z.makeColumn);l=Z.subtractRangesFromRanges(l,s)}return l}resetDownloadState(){this.setState({errorMessage:null})}handleDownloadClick(){var e=this;return vl(function*(){var t=e.props,n=t.model,i=t.isDownloading,o=t.onDownloadStart,a=t.onDownload,l=t.onCancel,s=e.state,u=s.fileName,c=s.includeColumnHeaders,m=s.useUnformattedValues;if(i){l();return}e.resetDownloadState();var h=e.getSnapshotRanges(),v=e.getModelRanges(h);if(e.validateOptionInput()){o();try{var p=yield n.export(),g=p.setViewport(0,0);yield g.getViewportData(),a(u,p,g,h,v,c,m)}catch(b){gl.error("CSV download failed",b),e.setState({errorMessage:d.jsxs("p",{children:[d.jsx(X,{icon:dt})," ","".concat(b)]})}),l()}}})()}handleDownloadRowOptionChanged(e){this.setState({downloadRowOption:e})}handleCustomizedDownloadRowOptionChanged(e){e!==null&&this.setState({customizedDownloadRowOption:String(e)})}handleCustomizedDownloadRowsChanged(e){this.setState({customizedDownloadRows:e})}handleIncludeColumnHeadersChanged(){this.setState(e=>{var t=e.includeColumnHeaders;return{includeColumnHeaders:!t}})}handleIncludeHiddenColumnsChanged(){this.setState(e=>{var t=e.includeHiddenColumns;return{includeHiddenColumns:!t}})}handleUseUnformattedValuesChanged(){this.setState(e=>{var t=e.useUnformattedValues;return{useUnformattedValues:!t}})}validateOptionInput(){var e=this.props.selectedRanges,t=this.state,n=t.downloadRowOption,i=t.customizedDownloadRows;return n===W.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS&&e.length===0?(this.setState({errorMessage:d.jsxs("p",{children:[d.jsx(X,{icon:dt})," No rows selected. Please select some rows in the table."]})}),!1):n===W.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS&&i<=0?(this.setState({errorMessage:d.jsxs("p",{children:[d.jsx(X,{icon:dt})," Number of rows to output must be greater than 0"]})}),!1):!0}render(){var e=this.props,t=e.model,n=e.isDownloading,i=e.tableDownloadProgress,o=e.tableDownloadEstimatedTime,a=e.selectedRanges,l=e.tableDownloadStatus,s=this.state,u=s.fileName,c=s.downloadRowOption,m=s.customizedDownloadRowOption,h=s.customizedDownloadRows,v=s.includeColumnHeaders,p=s.includeHiddenColumns,g=s.useUnformattedValues,b=s.errorMessage,f=s.id,S=t.rowCount;return d.jsxs("div",{className:"table-csv-exporter",children:[d.jsx("div",{id:"download-rows-label",className:"section-title",children:"Download Rows"}),d.jsx("div",{className:"form-group",children:d.jsxs(Bt,{"aria-labelledby":"download-rows-label",onChange:this.handleDownloadRowOptionChanged,value:c,isDisabled:n,children:[d.jsxs(Ee,{value:W.DOWNLOAD_ROW_OPTIONS.ALL_ROWS,"data-testid":"radio-csv-exporter-download-all",children:["All Rows",d.jsx("span",{className:"text-muted ml-2",children:"(".concat(S.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")," rows)")})]}),d.jsxs(Ee,{value:W.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS,"data-testid":"radio-csv-exporter-only-selected",children:["Only Selected Rows",d.jsx("span",{className:"text-muted ml-2",children:a.length>0?"(".concat(Z.rowCount(a).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")," rows)"):null})]}),d.jsxs("div",{className:"d-flex",children:[d.jsx(Ee,{value:W.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS,"data-testid":"radio-csv-exporter-customized-rows",margin:"0","aria-label":"Download a custom number of rows"}),d.jsxs("div",{className:"radio-input-row",role:"presentation",onClick:()=>{this.setState({downloadRowOption:W.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS})},children:[d.jsxs(Ao,{selectedKey:m,"data-testid":"select-csv-exporter-customized-rows",isDisabled:n,onChange:this.handleCustomizedDownloadRowOptionChanged,"aria-label":"First or last number of rows",flex:!0,children:[d.jsx(We,{children:"First"},"FIRST"),d.jsx(We,{children:"Last"},"LAST")]}),d.jsx($i,{id:"customizedRows-".concat(f),"data-testid":"input-csv-exporter-customized-rows",name:"customizedRows-".concat(f),minValue:1,defaultValue:100,value:h,width:"100%",minWidth:0,isDisabled:n,onChange:this.handleCustomizedDownloadRowsChanged,"aria-label":"Number of rows to download",flex:!0}),d.jsx("div",{children:"Rows"})]})]})]})}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{htmlFor:"customizedRows-".concat(f),children:"File Name"}),d.jsx("input",{type:"text",className:"form-control",id:"filename-".concat(f),"data-testid":"input-csv-exporter-file-name",name:"filename-".concat(f),value:u,onChange:y=>{this.setState({fileName:y.target.value})},disabled:n})]}),d.jsxs("div",{className:"checkbox-options",children:[d.jsx(Ie,{checked:v,onChange:this.handleIncludeColumnHeadersChanged,children:"Include column headers"}),d.jsx(Ie,{checked:p,onChange:this.handleIncludeHiddenColumnsChanged,children:"Include hidden columns"}),d.jsx(Ie,{checked:g,onChange:this.handleUseUnformattedValuesChanged,children:"Use unformatted values"})]}),d.jsxs("div",{className:"section-footer flex-column",children:[b!=null&&d.jsx("div",{className:"error-message",children:b}),l&&d.jsxs("div",{className:"download-status",children:[(l===W.DOWNLOAD_STATUS.DOWNLOADING||l===W.DOWNLOAD_STATUS.INITIATING)&&d.jsxs(d.Fragment,{children:[l===W.DOWNLOAD_STATUS.INITIATING&&d.jsx("div",{className:"text-muted",children:"Starting Download..."}),l===W.DOWNLOAD_STATUS.DOWNLOADING&&d.jsxs("div",{className:"text-muted d-flex justify-content-between",children:[d.jsx("span",{children:o||o===0?"Estimated time: ".concat(wi.formatElapsedTime(o)):null}),d.jsx("span",{children:"".concat(i,"%")})]})]}),l===W.DOWNLOAD_STATUS.FINISHED&&d.jsx("div",{className:"text-muted text-right",children:"Download Completed"}),l===W.DOWNLOAD_STATUS.CANCELED&&d.jsx("div",{className:"text-muted",children:"Download Canceled"}),(l===W.DOWNLOAD_STATUS.DOWNLOADING||l===W.DOWNLOAD_STATUS.INITIATING)&&d.jsx("div",{className:"progress",children:d.jsx("div",{className:"progress-bar progress-bar-striped progress-bar-animated",style:{width:"".concat(i,"%")}})}),l===W.DOWNLOAD_STATUS.FINISHED&&d.jsx("div",{className:"progress",children:d.jsx("div",{className:"progress-bar bg-success",style:{width:"".concat(i,"%")}})})]}),d.jsxs(B,{kind:"primary","data-testid":"btn-csv-exporter-download",className:Y("btn-downloading",{"btn-spinner btn-cancelable":n}),onClick:this.handleDownloadClick,children:[n&&d.jsxs("span",{children:[d.jsx(Wn,{className:"mr-2 loading-spinner-vertical-align"}),d.jsx("span",{className:"btn-normal-content",children:"Downloading"}),d.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!n&&"Download"]})]})]})}}Ae(W,"FILENAME_DATE_FORMAT","yyyy-MM-dd-HHmmss");Ae(W,"DOWNLOAD_STATUS",{INITIATING:"INITIATING",DOWNLOADING:"DOWNLOADING",FINISHED:"FINISHED",CANCELED:"CANCELED"});Ae(W,"DOWNLOAD_ROW_OPTIONS",{ALL_ROWS:"ALL_ROWS",SELECTED_ROWS:"SELECTED_ROWS",CUSTOMIZED_ROWS:"CUSTOMIZED_ROWS"});Ae(W,"CUSTOMIZED_ROWS_OPTIONS",{FIRST:"FIRST",LAST:"LAST"});Ae(W,"DEFAULT_DOWNLOAD_ROWS",100);Ae(W,"defaultProps",{onDownloadStart:()=>{},isDownloading:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:null,selectedRanges:[]});function V(r,e,t){return(e=bl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bl(r){var e=yl(r,"string");return typeof e=="symbol"?e:e+""}function yl(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ye=de.module("TableSaver"),Cl="yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS z";function Sl(r){return r.added!==void 0}function wl(r){if(!Sl(r))throw new Error("event is not UpdateEventData")}class se extends C.PureComponent{static csvEscapeString(e){return'"'.concat(e.replace(/"/g,'""'),'"')}constructor(e){super(e),V(this,"sw",void 0),V(this,"port",void 0),V(this,"fileWriter",void 0),V(this,"table",void 0),V(this,"tableSubscription",void 0),V(this,"columns",void 0),V(this,"fileName",void 0),V(this,"includeColumnHeaders",void 0),V(this,"useUnformattedValues",void 0),V(this,"chunkRows",void 0),V(this,"gridRanges",void 0),V(this,"gridRangeCounter",void 0),V(this,"rangedSnapshotsTotal",void 0),V(this,"rangedSnapshotCounter",void 0),V(this,"snapshotsTotal",void 0),V(this,"snapshotCounter",void 0),V(this,"snapshotsBuffer",void 0),V(this,"currentSnapshotIndex",void 0),V(this,"snapshotPending",void 0),V(this,"cancelableSnapshots",void 0),V(this,"streamTimeout",void 0),V(this,"snapshotHandlerTimeout",void 0),V(this,"downloadStartTime",void 0),V(this,"iframe",void 0),V(this,"useBlobFallback",void 0),V(this,"getCachedCustomColumnFormatFlag",Zn(Qo.isCustomColumnFormatDefined,{max:1e4})),this.handlePortMessage=this.handlePortMessage.bind(this),this.handleSnapshotResolved=this.handleSnapshotResolved.bind(this),this.handleDownloadTimeout=this.handleDownloadTimeout.bind(this),this.state={},this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.includeColumnHeaders=!0,this.useUnformattedValues=!1,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.useBlobFallback=!1}componentDidMount(){var e=this.props.getDownloadWorker;e().then(t=>{ye.info("found active service worker"),this.sw=t,this.sw.postMessage("ping")}).catch(t=>{ye.warn("Download csv is not optimized.",t),this.useBlobFallback=!0})}componentWillUnmount(){this.removeIframe(),this.streamTimeout&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout&&clearTimeout(this.snapshotHandlerTimeout)}createWriterStream(e){var t=this.useBlobFallback,n=[],i=null;t&&(i=TextEncoder.prototype.encode.bind(new TextEncoder));var o=this.fileName,a={};return t?(a.write=l=>{k(i),l.header!==void 0&&n.push(i(l.header)),l.rows!==void 0&&n.push(i(l.rows))},a.close=()=>{k(o);var l=new Blob(n,{type:"application/octet-stream; charset=utf-8"}),s=document.createElement("a");s.href=URL.createObjectURL(l),s.download=o,s.click()},a.abort=()=>{e.postMessage({cancel:!0}),e.close()}):(a.write=l=>{e.postMessage(l)},a.close=()=>{e.postMessage({end:!0}),e.close()},a.abort=()=>{e.postMessage({cancel:!0}),e.close()}),new WritableStream(a)}startDownload(e,t,n,i,o,a,l){var s=this.props.isDownloading;if(!s){this.downloadStartTime=Date.now(),ye.info("start downloading ".concat(e)),this.table=t,this.columns=gt.columnsFromRanges(o,t.columns),this.tableSubscription=n,this.gridRanges=i,this.includeColumnHeaders=a,this.useUnformattedValues=l;var u=encodeURIComponent(e.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A"),c=new MessageChannel;if(this.port=c.port1,this.fileName=e,this.fileWriter=this.createWriterStream(this.port).getWriter(),this.useBlobFallback){this.writeCsvTable(a);return}this.sw&&this.sw.postMessage({encodedFileName:u},[c.port2]),this.port.onmessage=this.handlePortMessage}}finishDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.close();var e=this.props.onDownloadCompleted;e(),this.resetTableSaver(),this.downloadStartTime!==void 0&&ye.info("download finished, total elapsed time ".concat((Date.now()-this.downloadStartTime)/1e3," seconds"))}cancelDownload(){var e,t,n;(e=this.table)===null||e===void 0||e.close(),(t=this.tableSubscription)===null||t===void 0||t.close(),(n=this.fileWriter)===null||n===void 0||n.abort(),this.cancelableSnapshots.forEach(o=>{o&&(o.catch(()=>null),o.cancel())});var i=this.props.onDownloadCanceled;i(),this.resetTableSaver()}resetTableSaver(){this.table=void 0,this.tableSubscription=void 0,this.columns=void 0,this.chunkRows=void 0,this.removeIframe(),this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.includeColumnHeaders=!0,this.useUnformattedValues=!1,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout!=null&&clearTimeout(this.snapshotHandlerTimeout),this.streamTimeout=void 0,this.snapshotHandlerTimeout=void 0}handleDownloadTimeout(){ye.info("download canceled"),this.cancelDownload()}writeTableHeader(){var e,t="";if(this.columns)for(var n=0;n<this.columns.length;n+=1)t+=this.columns[n].name,t+=n===this.columns.length-1?`
6
- `:",";(e=this.fileWriter)===null||e===void 0||e.write({header:t}).then(()=>null)}startWriteTableBody(){this.columns&&this.gridRanges!=null&&(this.chunkRows=Math.floor(se.DOWNLOAD_CELL_CHUNK/this.columns.length),this.rangedSnapshotsTotal=this.gridRanges.map(e=>(k(e.endRow),k(e.startRow),k(this.chunkRows),Math.ceil((e.endRow-e.startRow+1)/this.chunkRows))),this.snapshotsTotal=this.rangedSnapshotsTotal.reduce((e,t)=>e+t),ye.info("start writing table, total snapshots: ",this.snapshotsTotal),this.makeSnapshot(Math.min(se.SNAPSHOT_BUFFER_SIZE,this.snapshotsTotal)))}writeCsvTable(e){e&&this.writeTableHeader(),this.startWriteTableBody()}writeSnapshot(e,t,n){if(this.currentSnapshotIndex===e&&this.fileWriter){for(;this.snapshotsBuffer.has(this.currentSnapshotIndex);){var i=this.snapshotsBuffer.get(this.currentSnapshotIndex);k(i),this.fileWriter.write({rows:this.convertSnapshotIntoCsv(i)}),this.snapshotsBuffer.delete(this.currentSnapshotIndex),this.currentSnapshotIndex+=1,this.updateDownloadProgress(e)}if(this.snapshotsTotal&&this.currentSnapshotIndex>=this.snapshotsTotal){this.finishDownload();return}}this.snapshotCounter&&this.snapshotsTotal&&this.snapshotCounter<this.snapshotsTotal&&(ye.debug2(`
7
- current range index: `.concat(this.gridRangeCounter,`,
8
- snapshotIndexCounter: `).concat(this.snapshotCounter,`,
9
- currentRangedSnapshotIndex : `).concat(this.rangedSnapshotCounter,`,
10
- snapshotpending: `).concat(this.snapshotPending,`,
11
- buffered `).concat(this.snapshotsBuffer.size,`
12
- making `).concat(Math.min(se.SNAPSHOT_BUFFER_SIZE-this.snapshotsBuffer.size-this.snapshotPending,this.snapshotsTotal-this.snapshotCounter),` more snapshots
13
- `)),this.makeSnapshot(Math.min(se.SNAPSHOT_BUFFER_SIZE-this.snapshotsBuffer.size-this.snapshotPending,this.snapshotsTotal-this.snapshotCounter)))}updateDownloadProgress(e){if(e!=null&&this.snapshotsTotal!=null&&this.downloadStartTime!=null){var t=this.props.onDownloadProgressUpdate,n=Math.floor(e*100/this.snapshotsTotal),i=e>1?Math.floor((Date.now()-this.downloadStartTime)*(this.snapshotsTotal-e)/e/1e3):null;t(n,i)}}convertSnapshotIntoCsv(e){for(var t="",n=e.added.iterator(),i=this.props,o=i.dh,a=i.formatter,l=[];n.hasNext();)l.push(n.next().value);k(this.columns);for(var s=this.useUnformattedValues,u=0;u<l.length;u+=1)for(var c=l[u],m=0;m<this.columns.length;m+=1){var h=this.columns[m],v=h.type,p=h.name,g=null;if(s){var b,f=(b=e.getData(c,this.columns[m]))!==null&&b!==void 0?b:"";f!==""&&K.isDateType(v)&&(f=o.i18n.DateTimeFormat.format(Cl,f,o.i18n.TimeZone.getTimeZone(a.timeZone))),g=f.toString()}else{var S=this.getCachedCustomColumnFormatFlag(a,p,v),y=null;if(!S){var w=e.getFormat(c,this.columns[m]);y=(w==null?void 0:w.formatString)!=null?w:null}y?g=a.getFormattedString(e.getData(c,this.columns[m]),v,p,y):g=a.getFormattedString(e.getData(c,this.columns[m]),v,p)}t+=se.csvEscapeString(g),t+=m===this.columns.length-1?`
14
- `:","}return t}makeSnapshot(e){var t=this;if(!(e<=0)){var n=this.props.dh;k(this.gridRangeCounter);var i=0,o=this.gridRanges[this.gridRangeCounter];k(this.tableSubscription),k(this.columns);for(var a=function(){k(o),k(o.startRow),k(o.endRow),k(t.rangedSnapshotCounter),k(t.chunkRows);var s=o.startRow+t.rangedSnapshotCounter*t.chunkRows,u=Math.min(s+t.chunkRows-1,o.endRow),c=t.snapshotCounter;t.cancelableSnapshots.push(Oi.makeCancelable(t.tableSubscription.snapshot(n.RangeSet.ofRange(s,u),t.columns).then(m=>(wl(m),t.handleSnapshotResolved(m,c,s,u),c)).catch(m=>{ye.error(m)}),m=>{ye.info("snapshot ".concat(m," has been canceled"))})),t.rangedSnapshotCounter+=1,t.snapshotCounter+=1,t.snapshotPending+=1,t.rangedSnapshotCounter>=t.rangedSnapshotsTotal[t.gridRangeCounter]&&(t.gridRangeCounter+=1,t.rangedSnapshotCounter=0,o=t.gridRanges[t.gridRangeCounter]),i+=1};i<e;)a()}}handlePortMessage(e){var t=e.data,n=t.download,i=t.readableStreamPulling;if(!this.useBlobFallback){if(n!=null){var o=this.includeColumnHeaders;this.makeIframe("".concat(n)),this.writeCsvTable(o)}i!=null&&(this.useBlobFallback||(this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.streamTimeout=setTimeout(this.handleDownloadTimeout,se.STREAM_TIMEOUT)))}}handleSnapshotResolved(e,t,n,i){this.snapshotHandlerTimeout=setTimeout(()=>{this.snapshotsBuffer.set(t,e),this.snapshotPending-=1,this.writeSnapshot(t,n,i),this.cancelableSnapshots[t]=null},se.SNAPSHOT_HANDLER_TIMEOUT)}makeIframe(e){var t=document.createElement("iframe");t.hidden=!0,t.src=e,t.name="iframe",document.body.appendChild(t),this.iframe=t}removeIframe(){var e;(e=this.iframe)===null||e===void 0||e.remove(),this.iframe=void 0}render(){return null}}V(se,"DOWNLOAD_CELL_CHUNK",6e3);V(se,"SNAPSHOT_BUFFER_SIZE",5);V(se,"STREAM_TIMEOUT",8e3);V(se,"SNAPSHOT_HANDLER_TIMEOUT",5);V(se,"defaultProps",{isDownloading:!1,onDownloadCompleted:()=>{},onDownloadCanceled:()=>{},onDownloadProgressUpdate:()=>{}});function it(r,e){return Pl(r)||Tl(r,e)||jl(r,e)||Ol()}function Ol(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jl(r,e){if(r){if(typeof r=="string")return zr(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?zr(r,e):void 0}}function zr(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Tl(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function Pl(r){if(Array.isArray(r))return r}function xl(r){var e,t=r.group,n=r.onDelete,i=r.onColorChange,o=r.onNameChange,a=r.validateName,l=t.isNew,s=C.useRef(null),u=C.useRef(null),c=C.useState(!1),m=it(c,2),h=m[0],v=m[1],p=C.useState(l?"":t.name),g=it(p,2),b=g[0],f=g[1],S=C.useState(l),y=it(S,2),w=y[0],T=y[1],x=C.useState(!1),D=it(x,2),A=D[0],R=D[1],E=b!==t.name?a(b):"",N=l&&!A||E==="",I=C.useCallback(()=>{v(!1)},[]);C.useEffect(function(){w&&s.current&&(s.current.focus(),s.current.select())},[w]),C.useEffect(function(){if(h){var O,P;(O=u.current)===null||O===void 0||O.click(),(P=u.current)===null||P===void 0||P.focus(),window.addEventListener("click",I,!0)}return()=>window.removeEventListener("click",I,!0)},[h,I]);var F=()=>{N&&(t.name!==b&&o(t,b),T(!1))},U=()=>{if(l){n(t);return}f(t.name),T(!1)},M=G=>{R(!0),G.key==="Enter"&&(G.stopPropagation(),F()),G.key===" "&&G.stopPropagation(),G.key==="Escape"&&U()};return w?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"editing-container",children:[d.jsx("input",{ref:s,className:Y("form-control",{"is-invalid":!N}),value:b,placeholder:"Group Name",onChange:G=>f(G.target.value),onKeyDown:M,onBlur:()=>R(!0)}),d.jsx(B,{kind:"ghost",icon:ze,tooltip:"Confirm",onClick:F}),d.jsx(B,{kind:"ghost",icon:lo,tooltip:"Cancel",onClick:U})]}),!N&&d.jsx("p",{className:"mb-0 validate-label-error text-danger",children:E})]}):d.jsxs("div",{className:"group-name-wrapper",children:[d.jsx("span",{className:"column-name",children:b}),d.jsx(B,{className:"p-1 mx-1",kind:"ghost",icon:Hn,tooltip:"Edit",onClick:()=>{T(!0)}}),d.jsxs("span",{className:"right-buttons",children:[d.jsx(B,{kind:"ghost",icon:qe,tooltip:"Delete group",onClick:()=>n(t)}),d.jsx(B,{kind:"ghost",className:"color-swatch mr-1",icon:t.color!==void 0?d.jsxs("span",{className:"fa-layers",children:[d.jsx(X,{className:"color-swatch",icon:or,color:ae.white,transform:"down-1"}),d.jsx(X,{className:"color-swatch",icon:or,color:t.color,transform:"shrink-2 down-1"})]}):so,tooltip:"Set color",onClick:()=>v(G=>!G)}),h&&d.jsxs(d.Fragment,{children:[d.jsx("input",{"aria-label":"Color input",ref:u,type:"color",list:"presetColors",value:(e=t.color)!==null&&e!==void 0?e:ae["content-bg"],style:{visibility:"hidden",width:0,height:0,padding:0,border:0},onChange:G=>{i(t,G.target.value)}}),d.jsxs("datalist",{id:"presetColors",children:[d.jsx("option",{children:ae["content-bg"]}),d.jsx("option",{children:ae.primary}),d.jsx("option",{children:ae.foreground}),d.jsx("option",{children:ae.green}),d.jsx("option",{children:ae.yellow}),d.jsx("option",{children:ae.orange}),d.jsx("option",{children:ae.red}),d.jsx("option",{children:ae.purple}),d.jsx("option",{children:ae.blue}),d.jsx("option",{children:ae["gray-400"]})]})]})]})]})}function Vr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Kr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vr(Object(t),!0).forEach(function(n){Dl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Vr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Dl(r,e,t){return(e=Nl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nl(r){var e=Il(r,"string");return typeof e=="symbol"?e:e+""}function Il(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function El(){}var Al=C.forwardRef(function(e,t){var n=e.value,i=e.clone,o=e.childCount,a=e.item,l=e.onVisibilityChange,s=e.visibilityClickAndDrag,u=e.onClick,c=e.onGroupDelete,m=e.onGroupColorChange,h=e.onGroupNameChange,v=e.validateGroupName,p=e.handleProps,g=a.data,b=g.group,f=g.modelIndex,S=g.isVisible,y=C.useRef(null),w=C.useCallback(x=>{if(x.buttons===1){var D;l([f].flat(),!S),(D=y.current)===null||D===void 0||D.focus()}},[l,f,S]),T=C.useCallback(x=>{u(n,x)},[u,n]);return d.jsxs("div",Kr(Kr({ref:t,className:Y("tree-item",{isSelected:a.selected,"two-dragged":o===2,"multiple-dragged":o>2}),onClick:T,"data-index":a.index},p),{},{children:[!i&&d.jsx(B,{ref:y,kind:"ghost",className:"px-1",onClick:El,onMouseDown:w,onMouseEnter:s?w:void 0,icon:S?zn:Vn,tooltip:"Toggle visibility"}),d.jsx("span",{title:n,className:Y("column-name",b&&"column-group"),children:b&&!i?d.jsx(xl,{group:b,onDelete:c,onColorChange:m,onNameChange:h,validateName:v}):n}),d.jsxs("div",{children:[i&&o>1&&d.jsx("span",{className:"item-count",children:o}),!i&&d.jsxs(d.Fragment,{children:[d.jsx(Qe,{children:"Drag to re-order"}),d.jsx(X,{icon:Qt})]})]})]}))}),Rl=C.memo(Al);function kl(r){return r.parentId!==void 0}function Qr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ot(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(t),!0).forEach(function(n){Fl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Qr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Fl(r,e,t){return(e=_l(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _l(r){var e=$l(r,"string");return typeof e=="symbol"?e:e+""}function $l(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ml(r,e){return Hl(r)||Ul(r,e)||Ll(r,e)||Gl()}function Gl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ll(r,e){if(r){if(typeof r=="string")return Xr(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Xr(r,e):void 0}}function Xr(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Ul(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function Hl(r){if(Array.isArray(r))return r}function Bl(r,e){return Math.round(r/e)}function ti(r,e,t,n,i,o,a){var l,s=(l=r.get(n))!==null&&l!==void 0?l:{},u=s.modelIndex,c=s.visibleIndex;if(u===void 0||c===void 0){var m=t.get(n);if(m==null)throw new Error("Column or header group not found: ".concat(n));var h=m.childIndexes.flat();return{id:n,selected:o.has(n),children:m.children.filter((v,p)=>a||!i.has(m.childIndexes[p])).map(v=>ti(r,e,t,v,i,o,a)).sort((v,p)=>{var g=Array.isArray(v.data.visibleIndex)?v.data.visibleIndex[0]:v.data.visibleIndex,b=Array.isArray(p.data.visibleIndex)?p.data.visibleIndex[0]:p.data.visibleIndex;return g-b}),data:{modelIndex:h,visibleIndex:m.getVisibleRange(e),group:m,isVisible:h.some(v=>!i.has(v))}}}return{id:n,children:[],selected:o.has(n),data:{modelIndex:u,visibleIndex:c,isVisible:!i.has(u)}}}function Wl(r,e,t,n,i,o){var a=[],l=new Set(i),s=new Map(t.map(b=>[b.name,b])),u=new Set(n),c=0,m=Z.boundedRanges(H.getModelRange(Z.makeNormalized(0,0,r.length-1,0),e),r.length,1),h=m.flatMap(b=>{var f=b.startColumn,S=b.endColumn,y=S-f+1,w=new Array(y).fill(0).map((T,x)=>[c+x,f+x]);return c+=y,w}),v=new Map(h),p=new Map([...v.entries()].map(b=>{var f=Ml(b,2),S=f[0],y=f[1];return[r[y].name,{visibleIndex:S,modelIndex:y}]}));c=0;for(var g=function(){var f=v.get(c);k(f);for(var S=r[f].name,y=t.find(T=>{var x=T.children;return x.includes(S)});y!==void 0&&y.parent!==void 0;)y=s.get(y.parent);var w=ti(p,e,s,y?y.name:S,u,l,o);a.push(w),Array.isArray(w.data.visibleIndex)?c+=w.data.visibleIndex[1]-w.data.visibleIndex[0]+1:c+=1};c<r.length;)g();return a}function vt(r,e,t,n,i){var o=r.findIndex(f=>{var S=f.id;return S===t}),a=r.findIndex(f=>{var S=f.id;return S===e});if(o===-1||a===-1)return null;var l=r[a],s=Mi(r,a,o),u=s[o-1],c=s[o+1],m=Bl(n,i),h=l.depth+m,v=zl({previousItem:u,nextItem:c}),p=Vl({nextItem:c}),g=h;return h>=v?g=v:h<p&&(g=p),{depth:g,maxDepth:v,minDepth:p,parentId:b()};function b(){var f;if(g===0||!u)return null;if(g===u.depth)return u.parentId;if(g>u.depth)return u.id;var S=(f=s.slice(0,o).reverse().find(y=>y.depth===g))===null||f===void 0?void 0:f.parentId;return S??null}}function zl(r){var e,t,n=r.previousItem,i=r.nextItem;return Math.max((e=n==null?void 0:n.depth)!==null&&e!==void 0?e:0,(t=i==null?void 0:i.depth)!==null&&t!==void 0?t:0)}function Vl(r){var e=r.nextItem;return e?e.depth:0}function ri(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return r.reduce((n,i)=>[...n,ot(ot({},i),{},{parentId:e,depth:t,index:0}),...ri(i.children,i.id,t+1)],[]).map((n,i)=>ot(ot({},n),{},{index:i}))}function Dt(r){return r.every(kl)?[...r]:ri(r)}function bt(r){var e=r.clone,t=e===void 0?!1:e,n=r.depth,i=r.withDepthMarkers,o=i===void 0?!0:i,a=r.disableInteraction,l=a===void 0?!1:a,s=r.ghost,u=s===void 0?!1:s,c=r.handleProps,m=r.value,h=r.dragRef,v=h===void 0?null:h,p=r.wrapperRef,g=p===void 0?null:p,b=r.renderItem,f=r.item,S=r.style,y=r.top,w=C.useMemo(()=>o?Array(n).fill(0).map((D,A)=>d.jsx("span",{className:"depth-line",style:S},"depth-line-".concat(A))):null,[n,S,o]),T=C.useMemo(()=>({ref:v,clone:t,value:m,item:f,handleProps:c}),[v,t,m,f,c]),x=C.useMemo(()=>({top:y,position:"absolute"}),[y]);return d.jsxs("li",{className:Y("item-wrapper",{clone:t,ghost:u,disableInteraction:l}),"data-id":f.id,"data-index":f.index,ref:g,style:x,children:[!t&&o&&w,b(T)]},m)}bt.displayName="TreeItem";var Kl=["id","depth","top","measureElement"];function Yr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function at(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(t),!0).forEach(function(n){Ql(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Yr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ql(r,e,t){return(e=Xl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xl(r){var e=Yl(r,"string");return typeof e=="symbol"?e:e+""}function Yl(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ql(r,e){if(r==null)return{};var t,n,i=Zl(r,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(n=0;n<o.length;n++)t=o[n],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function Zl(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}var Jl=r=>{var e=r.isSorting,t=r.wasDragging;return!(e||t)};function es(r){var e=r.id,t=r.depth,n=r.top,i=r.measureElement,o=ql(r,Kl),a=Gi({id:e,animateLayoutChanges:Jl}),l=a.attributes,s=a.isDragging,u=a.isSorting,c=a.listeners,m=a.setDraggableNodeRef,h=a.setDroppableNodeRef,v=a.transform,p=a.transition,g=_t.Translate.toString(v),b=C.useMemo(()=>({transform:g,transition:p}),[g,p]),f=C.useMemo(()=>at(at(at({},l),c),{},{style:b}),[l,c,b]),S=C.useCallback(y=>{h(y),i==null||i(y)},[h,i]);return d.jsx(bt,at({dragRef:m,wrapperRef:S,depth:t,ghost:s,disableInteraction:u,handleProps:f,style:b,top:n},o))}function ni(r){var e,t,n,i,o,a,l,s,u=r.items,c=r.indentationWidth,m=c===void 0?30:c,h=r.renderItem,v=r.isDraggable,p=v===void 0?!0:v,g=r.withDepthMarkers,b=g===void 0?!0:g,f=r.virtualizerRef,S=Jt(),y=(e=(t=S.active)===null||t===void 0?void 0:t.id)!==null&&e!==void 0?e:null,w=(n=(i=S.over)===null||i===void 0?void 0:i.id)!==null&&n!==void 0?n:null,T=S.active?((o=(a=S.active.rect.current.translated)===null||a===void 0?void 0:a.left)!==null&&o!==void 0?o:0)-((l=(s=S.active.rect.current.initial)===null||s===void 0?void 0:s.left)!==null&&l!==void 0?l:0):0,x=C.useMemo(()=>y!=null?u.filter(O=>{var P=O.id,_=O.selected;return P===y||!_}):u,[y,u]),D=C.useMemo(()=>x.findIndex(O=>{var P=O.id;return P===y}),[y,x]),A=C.useCallback(O=>{var P=Li(O);return D>=0&&(D<P[0]||D>P[P.length-1])&&P.push(D),P},[D]),R=C.useCallback(()=>{var O,P;return(O=(P=N.current)===null||P===void 0?void 0:P.parentElement)!==null&&O!==void 0?O:null},[]),E=C.useCallback(()=>30,[]),N=C.useRef(null),I=Ui({count:x.length,getScrollElement:R,estimateSize:E,rangeExtractor:A,overscan:10,gap:1});C.useImperativeHandle(f,()=>I,[I]);var F=I.getVirtualItems(),U=Jt(),M=U.measureDroppableContainers;C.useEffect(function(){M(F.map(P=>{var _=P.index;return x[_].id}))},[x,M,F]);var G=p&&y!=null&&w!=null?vt(x,y,w,T,m):null;return d.jsx("div",{className:Y("tree-container",y!=null&&"marching-ants"),style:{height:"".concat(I.getTotalSize(),"px"),position:"relative"},ref:N,children:I.getVirtualItems().map(O=>{var P=O.index,_=O.start,L=x[P],z=L.id,q=L.depth;return p?d.jsx(es,{id:z,value:z,depth:z===y&&G?G.depth:q,item:L,renderItem:h,withDepthMarkers:b,top:_,measureElement:I.measureElement},z):d.jsx(bt,{value:z,depth:q,item:L,renderItem:h,withDepthMarkers:b,top:_,wrapperRef:I.measureElement},z)})})}function ts(r,e,t,n,i,o,a){var l=[],s=n,u=i[0].data.visibleIndex,c=r.index,m=e.index,h=Array.isArray(u)?u[1]+1:u+1;s=Te(i[0],e.parentId,s);for(var v=1;v<i.length;v+=1){var p=i[v].data.visibleIndex;l=H.moveItemOrRange(p,h,l,!0),h+=Array.isArray(p)?p[1]-p[0]+1:1,s=Te(i[v],e.parentId,s)}var g=[Array.isArray(u)?u[0]:u,h-1],b=Array.isArray(e.data.visibleIndex)?e.data.visibleIndex[0]:e.data.visibleIndex,f=H.getVisibleIndex(b,l);return c>m&&f>b&&(f-=1),e.children.length>0&&(Array.isArray(u)?u[0]:u)<f&&(f-=1),g[0]<f&&(f-=g[1]-g[0]),l=H.moveItemOrRange(g,$t(f,o,a),l),{groups:s,movedColumns:l.length>0?t.concat(l):t}}function Te(r,e,t){if(r.parentId===e)return t;var n=t.map(f=>new De(f)),i=new Map(n.map(f=>[f.name,f])),o=n.find(f=>f.name===r.parentId),a=n.find(f=>f.name===e),l=n.find(f=>f.name===r.id);if(o!=null&&(o.children=o.children.filter(f=>f!==r.id),o.children.length===0)){var s,u=new Set([o.name]),c=o.parent,m=c===void 0?"":c,h=i.get(m);for((s=h)===null||s===void 0||s.removeChildren([o.name]);h&&h.children.length===0;){var v,p;u.add(h.name);var g=(v=(p=h)===null||p===void 0?void 0:p.parent)!==null&&v!==void 0?v:"",b=i.get(g);b==null||b.removeChildren([h.name]),h=b}n=n.filter(f=>{var S=f.name;return!u.has(S)})}return a!=null&&a.addChildren([r.id]),l==null||l.setParent(e??void 0),n}function qr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Zr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qr(Object(t),!0).forEach(function(n){rs(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):qr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function rs(r,e,t){return(e=ns(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ns(r){var e=is(r,"string");return typeof e=="symbol"?e:e+""}function is(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var os=C.forwardRef(function(e,t){var n=e.value,i=e.item,o=e.onClick,a=e.onKeyDown,l=e.handleProps,s=C.useCallback(c=>{o(i,c)},[o,i]),u=C.useCallback(c=>{a(i,c)},[a,i]);return d.jsxs("div",Zr(Zr({ref:t,className:Y("tree-item",{isSelected:i.selected}),onClick:s,onKeyDownCapture:u,"data-index":i.index},l),{},{children:[d.jsx("span",{title:n,className:Y("column-name"),children:n}),d.jsxs("div",{children:[d.jsx(Qe,{children:"Drag to re-order"}),d.jsx(X,{icon:Qt})]})]}))}),as=C.memo(os);function Jr(r,e){return ds(r)||us(r,e)||ss(r,e)||ls()}function ls(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
17
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ss(r,e){if(r){if(typeof r=="string")return en(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?en(r,e):void 0}}function en(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function us(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function ds(r){if(Array.isArray(r))return r}function cs(r){var e,t,n=r.items,i=r.onModalOpenChange,o=r.onClick,a=r.onDragStart,l=r.setSelection,s=C.useState(""),u=Jr(s,2),c=u[0],m=u[1],h=C.useState(!1),v=Jr(h,2),p=v[0],g=v[1],b=C.useRef(null),f=C.useRef(null),S=C.useCallback(()=>{p||(g(!0),i(!0))},[i,p]),y=C.useCallback(()=>{p&&(g(!1),i(!1))},[i,p]),w=C.useCallback(O=>{S(),m(O)},[S]),T=C.useCallback(O=>{(!f.current||!f.current.element.contains(O.relatedTarget))&&y()},[y]),x=C.useCallback(O=>{var P,_=(P=b.current)===null||P===void 0?void 0:P.getInputElement();(!_||!_.contains(O.relatedTarget))&&y()},[y]),D=C.useCallback(O=>{a==null||a(O),y()},[a,y]);Hi({onDragStart:p?D:void 0});var A=C.useCallback((O,P)=>{o(O,P),!P.shiftKey&&!H.isModifierKeyDown(P)&&y()},[o,y]),R=C.useCallback((O,P)=>{var _=P.key;if(_==="Enter")P.preventDefault(),P.stopPropagation(),l([O]),y();else if(_==="ArrowDown"){var L;P.preventDefault(),P.stopPropagation();var z=(L=P.currentTarget.parentElement)===null||L===void 0||(L=L.nextElementSibling)===null||L===void 0?void 0:L.querySelector('.tree-item[tabindex="0"]');z==null||z.scrollIntoView({block:"nearest"}),z==null||z.focus()}else if(_==="ArrowUp"){var q;P.preventDefault(),P.stopPropagation();var re=(q=P.currentTarget.parentElement)===null||q===void 0||(q=q.previousElementSibling)===null||q===void 0?void 0:q.querySelector('.tree-item[tabindex="0"]');if(re)re.scrollIntoView({block:"nearest"}),re.focus();else{var J;(J=b.current)===null||J===void 0||(J=J.getInputElement())===null||J===void 0||J.focus()}}},[l,y]),E=C.useCallback(O=>{var P=O.value,_=O.item,L=O.ref,z=O.handleProps;return d.jsx(as,{ref:L,value:P,item:_,onClick:A,onKeyDown:R,handleProps:z},_.id)},[A,R]);Ro((e=b.current)===null||e===void 0||(e=e.getInputElement())===null||e===void 0?void 0:e.closest(".visibility-ordering-builder"),()=>{var O;(O=f.current)===null||O===void 0||O.scheduleUpdate()});var N=C.useMemo(()=>{if(c==="")return n;var O=c.toLowerCase();return n.filter(P=>P.id.toLowerCase().includes(O))},[n,c]),I=C.useCallback(O=>{if(O.key==="Escape"&&c===""&&y(),O.key==="Enter"&&N.length>0){O.preventDefault();var P=N[0];l([P]),y()}if(O.key==="ArrowDown"&&N.length>0){var _;O.preventDefault();var L=(_=f.current)===null||_===void 0?void 0:_.element.querySelector('.tree-item[tabindex="0"]');L==null||L.focus()}},[l,N,y,c]),F=C.useCallback(()=>{l(N),y()},[N,l,y]),U=C.useMemo(()=>{var O=!1;return N.some(P=>{if(P.selected){if(O)return!0;O=!0}return!1})},[N]),M=c!==""&&N.length>1,G=U||M;return d.jsxs(d.Fragment,{children:[d.jsx(Bi,{"aria-label":"Search columns",ref:b,value:c,onChange:w,onFocus:S,onBlur:T,onKeyDown:I}),d.jsx(ji,{ref:f,isShown:p,interactive:!0,keepInParent:!0,onBlur:x,onExited:y,options:{placement:"bottom-end",modifiers:{preventOverflow:{priority:["top"]},flip:{enabled:!1}}},referenceObject:(t=b.current)===null||t===void 0?void 0:t.getInputElement(),className:"visibility-search-list",children:d.jsx("div",{className:"visibility-search-list-inner",children:N.length===0?d.jsx("div",{className:"no-results",children:"No matching columns"}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"search-tree-container",children:d.jsx(ni,{items:N,withDepthMarkers:!1,renderItem:E})}),G&&d.jsxs("div",{className:"footer-buttons",children:[U&&d.jsx(Mt,{isQuiet:!0,onPress:y,children:"Select Group"}),M&&d.jsx(Mt,{isQuiet:!0,onPress:F,children:"Select Matching"})]})]})})})]})}function tn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function lt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tn(Object(t),!0).forEach(function(n){hs(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):tn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function hs(r,e,t){return(e=ms(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ms(r){var e=vs(r,"string");return typeof e=="symbol"?e:e+""}function vs(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ps=[ge.Down,ge.Right,ge.Up,ge.Left],fs=[ge.Left,ge.Right];function gs(r,e){return(t,n)=>{var i=n.currentCoordinates,o=n.context,a=o.active,l=o.over,s=o.collisionRect,u=o.droppableRects,c=o.droppableContainers;if(ps.includes(t.code)){if(!a||!s)return;t.preventDefault();var m=r.current,h=m.items,v=m.offset,p=(l==null?void 0:l.id)!=null?vt(h,a.id,l.id,v,e):null;if(fs.includes(t.code)&&(l==null?void 0:l.id)!=null&&p!=null){var g=p.depth,b=p.maxDepth,f=p.minDepth;switch(t.code){case ge.Left:if(g>f)return lt(lt({},i),{},{x:i.x-e});break;case ge.Right:if(g<b)return lt(lt({},i),{},{x:i.x+e});break}return}var S=[];c.forEach(O=>{if(!(O!=null&&O.disabled||O.id===(l==null?void 0:l.id))){var P=u.get(O.id);if(P)switch(t.code){case ge.Down:s.top<P.top&&S.push(O);break;case ge.Up:s.top>P.top&&S.push(O);break}}});var y=Wi({collisionRect:s,droppableRects:u,droppableContainers:S}),w=zi(y,"id");if(w===(l==null?void 0:l.id)&&y.length>1&&(w=y[1].id),w!=null&&(l==null?void 0:l.id)!=null){var T=u.get(a.id),x=u.get(w),D=c.get(w);if(T&&x&&D){var A=h.findIndex(O=>{var P=O.id;return P===w}),R=h[A],E=h.findIndex(O=>{var P=O.id;return P===a.id}),N=h[E],I=vt(h,a.id,w,(R.depth-N.depth)*e,e);if(R!=null&&N!=null&&I!=null){var F=I.depth,U=A>E,M=U?1:-1,G={x:x.left+F*e,y:x.top+M};return G}}}}}}function bs(r,e,t){return(e=ys(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ys(r){var e=Cs(r,"string");return typeof e=="symbol"?e:e+""}function Cs(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ii extends Vi{}bs(ii,"activators",[{eventName:"onPointerDown",handler:r=>{var e=r.nativeEvent;return!(!e.isPrimary||e.button!==0||ws(e.target))}}]);var Ss=["button","input","textarea","select","option"];function ws(r){return!!((r==null?void 0:r.tagName)!=null&&Ss.includes(r.tagName.toLowerCase()))}function rn(r,e){return Ps(r)||Ts(r,e)||js(r,e)||Os()}function Os(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function js(r,e){if(r){if(typeof r=="string")return nn(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?nn(r,e):void 0}}function nn(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Ts(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function Ps(r){if(Array.isArray(r))return r}function on(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function xe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?on(Object(t),!0).forEach(function(n){xs(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):on(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function xs(r,e,t){return(e=Ds(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ds(r){var e=Ns(r,"string");return typeof e=="symbol"?e:e+""}function Ns(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Is={droppable:{strategy:Yi.Always}},Es={activationConstraint:{distance:5}},As={pointerEvents:"none"},Rs={keyframes(r){var e=r.transform;return[{opacity:1,transform:_t.Transform.toString(e.initial)},{opacity:0,transform:_t.Transform.toString(e.final)}]},easing:"ease-out",sideEffects(r){var e=r.active;e.node.animate([{opacity:0},{opacity:1}],{duration:rr.duration,easing:rr.easing})}};function _e(r){var e;return _e.offsetY==null&&r.activeNodeRect&&r.activatorEvent instanceof PointerEvent&&(_e.offsetY=Math.floor((r.activatorEvent.clientY-r.activeNodeRect.top)/r.activeNodeRect.height)*r.activeNodeRect.height),r.activeNodeRect||(_e.offsetY=null),xe(xe({},r.transform),{},{y:r.transform.y+((e=_e.offsetY)!==null&&e!==void 0?e:0)})}_e.offsetY=null;var ks=r=>{if(!r.pointerCoordinates)return tr(r);var e=r.pointerCoordinates,t=e.x,n=e.y,i=r.collisionRect,o=i.width,a=i.height,l=xe(xe({},r),{},{collisionRect:{width:o,height:a,bottom:n+a/2,left:t-o/2,right:t+o/2,top:n-a/2}});return tr(l)};function Fs(r){var e=r.items,t=r.indentationWidth,n=t===void 0?30:t,i=r.onDragStart,o=r.onDragEnd,a=r.children,l=r.renderItem,s=C.useState(null),u=rn(s,2),c=u[0],m=u[1],h=C.useState(0),v=rn(h,2),p=v[0],g=v[1],b=c!=null?e.find(E=>{var N=E.id;return N===c}):null,f=C.useRef({items:e,offset:p}),S=C.useMemo(()=>({coordinateGetter:gs(f,n),keyboardCodes:{start:["Space"],cancel:["Escape"],end:["Space"]}}),[n]),y=Ki(er(ii,Es),er(Qi,S)),w=C.useMemo(()=>e.map(E=>{var N=E.id;return N}),[e]);C.useEffect(()=>{f.current={items:e,offset:p}},[e,p]);var T=C.useCallback(E=>{var N=E.active.id;m(N),i==null||i(N,E),document.body.style.setProperty("cursor","grabbing")},[i]),x=C.useCallback(E=>{var N=E.delta;g(N.x)},[]),D=C.useCallback(()=>{m(null),g(0),document.body.style.setProperty("cursor","")},[]),A=C.useCallback(E=>{var N,I,F,U,M=E.active,G=E.over,O=M.id!=null&&(G==null?void 0:G.id)!=null?vt(e,M.id,G.id,((N=(I=M.rect.current.translated)===null||I===void 0?void 0:I.left)!==null&&N!==void 0?N:0)-((F=(U=M.rect.current.initial)===null||U===void 0?void 0:U.left)!==null&&F!==void 0?F:0),n):null;if(O&&G){var P=O.depth,_=O.parentId,L=JSON.parse(JSON.stringify(e)),z=L.findIndex(J=>{var Se=J.id;return Se===G.id}),q=L.findIndex(J=>{var Se=J.id;return Se===M.id}),re=L[q];L[q]=xe(xe({},re),{},{depth:P,parentId:_}),o==null||o(re,xe(xe({},L[z]),{},{parentId:O.parentId}))}D()},[e,n,o,D]),R=C.useCallback(()=>{D()},[D]);return d.jsx(Xi,{sensors:y,collisionDetection:ks,measuring:Is,onDragStart:T,onDragMove:x,onDragEnd:A,onDragCancel:R,children:d.jsxs(qi,{items:w,strategy:Zi,children:[a,Un.createPortal(d.jsx(Ji,{dropAnimation:Rs,modifiers:[_e],className:"visibility-ordering-list",style:As,children:c!=null&&b?d.jsx(bt,{depth:b.depth,clone:!0,value:c,renderItem:l,item:b}):null}),document.body)]})})}function _s(r,e){return Ls(r)||Gs(r,e)||Ms(r,e)||$s()}function $s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ms(r,e){if(r){if(typeof r=="string")return an(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?an(r,e):void 0}}function an(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Gs(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function Ls(r){if(Array.isArray(r))return r}function ln(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function pt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ln(Object(t),!0).forEach(function(n){te(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ln(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function te(r,e,t){return(e=Us(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Us(r){var e=Hs(r,"string");return typeof e=="symbol"?e:e+""}function Hs(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var sn=de.module("VisibilityOrderingBuilder");class Q extends C.PureComponent{static shouldRenderColumn(e){return e.isProxy!==!0}constructor(e){super(e),te(this,"wrapperRef",Ye.createRef()),te(this,"lastFocusedItemIndex",null),te(this,"list",void 0),te(this,"virtualizerRef",Ye.createRef()),te(this,"scrollAndFocusColumnOnUpdate",null),te(this,"handleGroupColorChange",eo((t,n)=>{var i=this.props,o=i.columnHeaderGroups,a=i.onColumnHeaderGroupChanged,l=[...o],s=new De(pt(pt({},t),{},{color:n}));l.splice(l.findIndex(u=>{var c=u.name;return c===t.name}),1,s),a(l)},250)),te(this,"getMemoizedFirstMovableIndex",je((t,n,i)=>{for(var o=0;o<n.length;o+=1){var a=H.getModelIndex(o,i);if(t.isColumnMovable(a))return o}return null},{max:10})),te(this,"getMemoizedLastMovableIndex",je((t,n,i)=>{for(var o=n.length-1;o>=0;o-=1){var a=H.getModelIndex(o,i);if(t.isColumnMovable(a))return o}return null},{max:10})),te(this,"memoizedGetTreeItems",je((t,n,i,o,a,l)=>Wl(t,n,i,o,[...a.values()],l),{max:2})),te(this,"memoizedGetFlattenedTree",je(t=>Dt(t),{max:2})),te(this,"makeVisibilityOrderingList",je((t,n,i,o)=>{var a=this.props.movedColumns,l=[],s=this.getFirstMovableIndex(),u=this.getLastMovableIndex(),c=n.findIndex(x=>{var D=x.data;return Array.isArray(D.visibleIndex)?D.visibleIndex[0]===s:D.visibleIndex===s}),m=n.findLastIndex(x=>{var D=x.data;return Array.isArray(D.visibleIndex)?D.visibleIndex[1]===u:D.visibleIndex===u}),h=n.slice(c,m+1);if(i||(h=h.filter(x=>x.data.isVisible)),s==null||u===null){for(var v=0;v<t.length;v+=1){var p=H.getModelIndex(v,a),g=t[p];Q.shouldRenderColumn(g)&&l.push(this.renderImmovableItem(g.name))}return l}for(var b=0;b<s;b+=1){var f=H.getModelIndex(b,a),S=t[f];Q.shouldRenderColumn(S)&&l.push(this.renderImmovableItem(S.name))}s!==null&&s>0&&l.push(d.jsx("hr",{},"top-horizontal-divider")),l.push(d.jsx(ni,{items:h,renderItem:this.renderItem,isDraggable:o,virtualizerRef:this.virtualizerRef},"movable-items")),u!=null&&u<t.length-1&&l.push(d.jsx("hr",{},"bottom-horizontal-divider"));for(var y=u+1;y<t.length;y+=1){var w=H.getModelIndex(y,a),T=t[w];Q.shouldRenderColumn(T)&&l.push(this.renderImmovableItem(T.name))}return l},{max:10})),te(this,"renderImmovableItem",je(t=>d.jsx("div",{className:"visibility-ordering-list-item immovable",children:d.jsx("div",{className:"column-item",children:d.jsx("span",{className:"column-name",children:t})})},t),{max:100})),this.handleItemClick=this.handleItemClick.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupDelete=this.handleGroupDelete.bind(this),this.handleGroupNameChange=this.handleGroupNameChange.bind(this),this.handleGroupCreate=this.handleGroupCreate.bind(this),this.validateGroupName=this.validateGroupName.bind(this),this.addColumnToSelected=this.addColumnToSelected.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleOverflowAction=this.handleOverflowAction.bind(this),this.handleKeyboardShortcut=this.handleKeyboardShortcut.bind(this),this.handleSearchModalOpenChange=this.handleSearchModalOpenChange.bind(this),this.handleSearchSelect=this.handleSearchSelect.bind(this),this.handleSearchItemClicked=this.handleSearchItemClicked.bind(this),this.renderItem=this.renderItem.bind(this),this.state={selectedColumns:new Set,lastSelectedColumn:"",showHiddenColumns:!0,isSearchModalOpen:!1,movedColumns:e.movedColumns,columnHeaderGroups:e.columnHeaderGroups},this.list=null}componentDidMount(){k(this.wrapperRef.current),this.wrapperRef.current.addEventListener("focusin",e=>{if(e.target instanceof HTMLElement){var t=e.target.closest(".tree-item");t!=null&&(this.lastFocusedItemIndex=typeof t.dataset.index=="string"?parseInt(t.dataset.index,10):null)}})}componentDidUpdate(e){var t=this.props,n=t.movedColumns,i=t.columnHeaderGroups;if(e.movedColumns!==n&&this.setState({movedColumns:n}),e.columnHeaderGroups!==i&&this.setState({columnHeaderGroups:i}),this.scrollAndFocusColumnOnUpdate!=null){var o,a=_s(this.scrollAndFocusColumnOnUpdate,2),l=a[0],s=a[1];(o=this.virtualizerRef.current)===null||o===void 0||o.scrollToIndex(l),window.requestAnimationFrame(()=>{var m;if(this.scrollAndFocusColumnOnUpdate!=null){var h=(m=this.list)===null||m===void 0?void 0:m.querySelector('.item-wrapper[data-id="'.concat(s,'"] .tree-item'));h instanceof HTMLElement?h.focus():sn.warn("Could not focus item ".concat(s," after scroll")),this.scrollAndFocusColumnOnUpdate=null}})}if((document.activeElement===document.body||document.activeElement===document.documentElement)&&this.lastFocusedItemIndex!==null){var u,c=(u=this.list)===null||u===void 0?void 0:u.querySelector('.item-wrapper[data-index="'.concat(this.lastFocusedItemIndex,'"] .tree-item'));c!=null&&c instanceof HTMLElement?c.focus():(sn.warn("Could not maintain focus"),this.lastFocusedItemIndex=null)}}componentWillUnmount(){var e=this.props,t=e.columnHeaderGroups,n=e.onColumnHeaderGroupChanged,i=t.filter(o=>!o.isNew);i.length!==t.length&&n(i)}resetVisibilityOrdering(){var e=this.props,t=e.model,n=e.onReset,i=e.onMovedColumnsChanged,o=e.onColumnHeaderGroupChanged;this.setState({selectedColumns:new Set,lastSelectedColumn:""}),n(),o(t.initialColumnHeaderGroups),i(t.initialMovedColumns)}resetSelection(){this.setState({selectedColumns:new Set,lastSelectedColumn:""})}moveSelectedColumns(e){var t=this.props.columnHeaderGroups,n=this.state.selectedColumns,i=this.getFlattenedTree(),o=this.getFirstMovableIndex(),a=this.getLastMovableIndex();k(o),k(a);var l=this.getSelectedParentItems(),s=e===Q.MOVE_OPTIONS.UP||e===Q.MOVE_OPTIONS.TOP;s||l.reverse();for(var u=[],c=t,m=function(){var p=l[h],g=p.id,b=p.parentId,f=p.depth,S=p.data.visibleIndex;switch(e){case Q.MOVE_OPTIONS.TOP:{u=H.moveItemOrRange(S,o,u,!0);var y=Array.isArray(S)?S[1]-S[0]+1:1;o+=y,c=Te(l[h],null,c);break}case Q.MOVE_OPTIONS.BOTTOM:{u=H.moveItemOrRange(S,a,u,!0);var w=Array.isArray(S)?S[1]-S[0]+1:1;a-=w,c=Te(l[h],null,c);break}case Q.MOVE_OPTIONS.UP:{var T=i.findIndex(P=>P.id===g),x=i.map((P,_)=>_<T&&!n.has(P.id)).lastIndexOf(!0),D=i[x];if(D!=null&&D.parentId!==b)if(Math.abs(D.depth-f)>1){var A=i.map((P,_)=>_<x&&P.depth===f).lastIndexOf(!0),R=i[A];c=Te(l[h],R.id,c)}else c=Te(l[h],D.parentId,c);else{var E=$t(Array.isArray(S)?S[0]-1:S-1,o,a);u=H.moveItemOrRange(S,E,u,!1);var N=Array.isArray(S)?S[1]-S[0]+1:1;o+=N}break}case Q.MOVE_OPTIONS.DOWN:{var I=i.findIndex(P=>P.id===g),F=i.find((P,_)=>_>I&&!n.has(P.id));if((F==null?void 0:F.parentId)!==b){var U,M=i.find(P=>P.id===b);c=Te(l[h],(U=M==null?void 0:M.parentId)!==null&&U!==void 0?U:null,c);break}else if((F==null?void 0:F.children.length)>0){c=Te(l[h],F.id,c);break}var G=$t(Array.isArray(S)?S[0]+1:S+1,o,a);u=H.moveItemOrRange(S,G,u,!1);var O=Array.isArray(S)?S[1]-S[0]+1:1;a-=O;break}}},h=0;h<l.length;h+=1)m();return{newMoves:u,groups:c}}handleMoveColumns(e){var t=this.props,n=t.onMovedColumnsChanged,i=t.movedColumns,o=t.onColumnHeaderGroupChanged,a=this.moveSelectedColumns(e),l=a.newMoves,s=a.groups,u;e===Q.MOVE_OPTIONS.TOP&&(u=()=>{var c;(c=this.virtualizerRef.current)===null||c===void 0||c.scrollToOffset(0)}),e===Q.MOVE_OPTIONS.BOTTOM&&(u=()=>{var c;(c=this.virtualizerRef.current)===null||c===void 0||c.scrollBy(this.virtualizerRef.current.getTotalSize())}),o(s),l.length>0&&n(i.concat(l),u)}getSortMoves(e,t,n){var i=[...e],o=t===Q.SORTING_OPTIONS.ASC;i.sort((h,v)=>{var p=h.id.toUpperCase(),g=v.id.toUpperCase();return st.sort(p,g,o)});for(var a=[...n],l=Math.min(...i.flatMap(h=>{var v=h.data.modelIndex;return Array.isArray(v)?H.getVisibleIndexes(v,a):H.getVisibleIndex(v,a)})),s=0;s<i.length;s+=1){var u=i[s],c=u.data.modelIndex,m=Array.isArray(c)?H.getVisibleIndexes(c,a):H.getVisibleIndex(c,a);a=Array.isArray(m)?H.moveRange([Math.min(...m),Math.max(...m)],l,a,!0):H.moveItem(m,l,a),Array.isArray(m)&&(a=this.getSortMoves(u.children,t,a)),l+=Array.isArray(c)?c.length:1}return a}handleSortColumns(e){for(var t,n,i=this.props,o=i.model,a=i.onMovedColumnsChanged,l=this.getTreeItems(),s=(t=this.getFirstMovableIndex())!==null&&t!==void 0?t:0,u=(n=this.getLastMovableIndex())!==null&&n!==void 0?n:l.length-1,c=l.slice(s,u+1),m=[...o.initialMovedColumns],h=0;h<o.frozenColumns.length;h+=1){var v,p=o.frozenColumns[h],g=H.getVisibleIndex((v=o.getColumnIndexByName(p))!==null&&v!==void 0?v:0,m);g!==h&&m.push({from:g,to:h})}var b=this.getSortMoves(c,e,m);a(b)}handleItemClick(e,t){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(t.stopPropagation(),t.target instanceof HTMLElement&&(t.target.tagName==="BUTTON"||t.target.tagName==="INPUT"))return[];(n=t.currentTarget)===null||n===void 0||n.focus();var o=this.state,a=o.selectedColumns,l=o.lastSelectedColumn,s=H.isModifierKeyDown(t),u=t.shiftKey,c=a.has(e),m=[e];if(c&&s)return this.removeColumnFromSelected(e),[];var h=this.getFlattenedTree(i);if(c&&!u&&l===e){var v=h.find(f=>{var S=f.id;return S===e});k(v);var p=Dt(v.children).length;if(p+1===a.size)return this.resetSelection(),[]}if(u){var g=h.findIndex(f=>f.id===e),b=h.findIndex(f=>f.id===l);m.push(...h.slice(Math.min(b,g),Math.max(b,g)+1).map(f=>f.id))}return this.addColumnToSelected(m,s||u),this.setState({lastSelectedColumn:e}),m}handleSearchItemClicked(e,t){var n=this.handleItemClick(e.id,t,!0),i=this.state.showHiddenColumns,o=this.props.onColumnVisibilityChanged;if(n.length!==0){var a=this.getSelectedItemModelIndexes(new Set(n));i||o(a,!0),!(t.shiftKey||H.isModifierKeyDown(t))&&(this.scrollAndFocusColumnOnUpdate=[e.index,e.id])}}handleSearchSelect(e){if(e.length!==0){var t=this.state.showHiddenColumns,n=this.props.onColumnVisibilityChanged;if(!t){var i=[...new Set(e.map(o=>o.data.modelIndex).flat())];n(i,!0)}this.scrollAndFocusColumnOnUpdate=[e[0].index,e[0].id],this.addColumnToSelected(e.map(o=>o.id),!1)}}addColumnToSelected(e,t){var n=this.state.selectedColumns,i=new Set(t?[...n.values()].concat(e):e),o=this.getFlattenedTree();o.forEach(a=>{var l=a.id,s=a.children;i.has(l)&&s.forEach(u=>i.add(u.id))}),this.setState({selectedColumns:i})}removeColumnFromSelected(e){var t=this.state.selectedColumns,n=this.getFlattenedTree(),i=n.find(l=>{var s=l.id;return s===e});k(i);var o=n.find(l=>{var s=l.id;return s===i.parentId});Dt(i==null?void 0:i.children).forEach(l=>t.delete(l.id));for(var a=function(){t.delete(o.id);var s=o.parentId;o=n.find(u=>{var c=u.id;return c===s})};o!=null;)a();t.delete(e),this.setState({selectedColumns:new Set(t)})}handleDragStart(e,t){var n=this.state.selectedColumns;if(!n.has(e)){var i=t.activatorEvent,o=H.isModifierKeyDown(i)||i.shiftKey;this.handleItemClick(e,t.activatorEvent,!0),this.addColumnToSelected([e],o)}}handleDragEnd(e,t){var n=this.props,i=n.model,o=n.movedColumns,a=n.onMovedColumnsChanged,l=n.columnHeaderGroups,s=n.onColumnHeaderGroupChanged,u=this.getSelectedParentItems(),c=this.getFirstMovableIndex(),m=this.getLastMovableIndex();k(c),k(m);var h=ts(e,t,o,l,u,c,m),v=h.groups,p=h.movedColumns,g=v!==l?gt.parseColumnHeaderGroups(i,v).groups:l;s(g),a(p),this.setState({movedColumns:p,columnHeaderGroups:g}),this.scrollAndFocusColumnOnUpdate=[t.index,e.id]}handleGroupNameChange(e,t){var n,i=this.props,o=i.columnHeaderGroups,a=i.onColumnHeaderGroupChanged,l=i.endUndoGroup,s=[...o],u=e.name,c=s.findIndex(f=>{var S=f.name;return S===u}),m=s[c];k(m);var h=new De(m);h.name=t,s.splice(c,1,h);var v=s.findIndex(f=>{var S=f.name;return S===h.parent});if(v>=0){var p=new De(s[v]);p.removeChildren([u]),p.addChildren([t]),s.splice(v,1,p)}var g=(n=this.list)===null||n===void 0?void 0:n.querySelector('.item-wrapper[data-id="'.concat(u,'"]'));if(g!=null){var b=g.getAttribute("data-index");this.scrollAndFocusColumnOnUpdate=b!=null?[parseInt(b,10),t]:null}a(s),l()}handleGroupDelete(e){var t=this.props,n=t.columnHeaderGroups,i=t.endUndoGroup,o=t.onColumnHeaderGroupChanged,a=n.filter(u=>u.name!==e.name),l=a.findIndex(u=>u.name===e.parent);if(l>=0){var s=new De(a[l]);s.addChildren(e.children),s.removeChildren([e.name]),a.splice(l,1,s)}o(a),i()}handleGroupCreate(){var e=this.props,t=e.movedColumns,n=e.onMovedColumnsChanged,i=e.onColumnHeaderGroupChanged,o=e.startUndoGroup,a=this.moveSelectedColumns(Q.MOVE_OPTIONS.TOP),l=a.newMoves,s=a.groups,u=s.filter(p=>!p.isNew),c=this.getSelectedParentItems(),m=c.map(p=>p.data.modelIndex).flat().filter(p=>p>=0),h="".concat(De.NEW_GROUP_PREFIX,"-").concat(Date.now()),v=new De({name:h,children:c.map(p=>{var g=p.id;return g}),depth:0,childIndexes:[...new Set(m)]});o(),n(t.concat(l),()=>{var p;(p=this.virtualizerRef.current)===null||p===void 0||(p=p.scrollElement)===null||p===void 0||p.scrollTo({top:0})}),i(u.concat([v])),this.resetSelection()}validateGroupName(e){var t=this.props,n=t.model,i=t.columnHeaderGroups,o=n.columns;return Ht.isValidColumnName(e)?o.some(a=>{var l=a.name;return l===e})||i.some(a=>{var l=a.name;return l===e})?"Duplicate name":"":"Invalid name"}renderItem(e){var t=e.value,n=e.clone,i=e.item,o=e.ref,a=e.handleProps,l=this.props.onColumnVisibilityChanged,s=this.state,u=s.selectedColumns,c=s.showHiddenColumns,m=t;if(n){var h=this.getSelectedParentItems().map(v=>{var p=v.id;return p});m=h.join(", ")}return d.jsx(Rl,{ref:o,value:m,clone:n,item:i,childCount:u.size,onVisibilityChange:l,visibilityClickAndDrag:c,onClick:this.handleItemClick,onGroupDelete:this.handleGroupDelete,onGroupColorChange:this.handleGroupColorChange,onGroupNameChange:this.handleGroupNameChange,validateGroupName:this.validateGroupName,handleProps:a},i.id)}getFirstMovableIndex(){var e=this.props,t=e.model,n=e.movedColumns;return this.getMemoizedFirstMovableIndex(t,t.columns,n)}getLastMovableIndex(){var e=this.props,t=e.model,n=e.movedColumns;return this.getMemoizedLastMovableIndex(t,t.columns,n)}getTreeItems(e){var t=this.props,n=t.model,i=t.hiddenColumns,o=this.state,a=o.movedColumns,l=o.columnHeaderGroups,s=o.selectedColumns,u=o.showHiddenColumns;return this.memoizedGetTreeItems(n.columns,a,l,i,s,e??u)}getFlattenedTree(e){return this.memoizedGetFlattenedTree(this.getTreeItems(e))}getSelectedItemModelIndexes(e){var t=this.props.model;return[...e.values()].map(n=>t.getColumnIndexByName(n)).filter(n=>n!=null).flat()}getSelectedParentItems(){var e=this.state.selectedColumns,t=this.getFlattenedTree();return t.filter(n=>{var i=n.id,o=n.parentId;return e.has(i)&&!e.has(o??"")})}handleOverflowAction(e){var t=this.props,n=t.undo,i=t.redo;switch(e){case"undo":n();break;case"redo":i();break;case"showHidden":this.setState(o=>({showHiddenColumns:!o.showHiddenColumns,selectedColumns:new Set}));break}}handleKeyboardShortcut(e){var t=this.props,n=t.canUndo,i=t.canRedo,o=t.undo,a=t.redo;Ue.UNDO.matchesEvent(e)&&n?(e.preventDefault(),o()):Ue.REDO.matchesEvent(e)&&i&&(e.preventDefault(),a())}handleSearchModalOpenChange(e){if(e)this.resetSelection();else{var t=this.state,n=t.showHiddenColumns,i=t.selectedColumns,o=this.props.onColumnVisibilityChanged;if(!n){var a=this.getSelectedItemModelIndexes(i);o(a,!0)}}this.setState({isSearchModalOpen:e})}render(){var e=this.props,t=e.model,n=e.hiddenColumns,i=e.onColumnVisibilityChanged,o=e.canUndo,a=e.canRedo,l=this.state,s=l.selectedColumns,u=l.showHiddenColumns,c=l.isSearchModalOpen,m=s.size>0,h=this.getFlattenedTree(),v=new Set(n),p=m?this.getSelectedItemModelIndexes(s):t.columns.map((y,w)=>w),g=m?p.some(y=>!v.has(y)):v.size<t.columns.length,b=g?"Hide All":"Show All",f=g?"Hide Selected":"Show Selected",S=this.makeVisibilityOrderingList(t.columns,h,u,!c);return d.jsx(Fs,{items:h,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,renderItem:this.renderItem,children:d.jsxs("div",{role:"menu",ref:this.wrapperRef,className:"visibility-ordering-builder",tabIndex:0,onKeyUp:this.handleKeyboardShortcut,children:[d.jsxs("div",{className:"top-menu",children:[d.jsx(B,{kind:"ghost",className:"toggle-visibility-btn",onClick:()=>{i(p,!g)},icon:g?zn:Vn,tooltip:"Toggle column visibility",children:m?f:b}),d.jsx(cs,{items:h,onModalOpenChange:this.handleSearchModalOpenChange,onClick:this.handleSearchItemClicked,setSelection:this.handleSearchSelect}),d.jsxs(to,{closeOnSelect:!0,children:[d.jsx(Mt,{isQuiet:!0,"aria-label":"More options",children:d.jsx(X,{icon:uo})}),d.jsxs(ro,{onAction:this.handleOverflowAction,disabledKeys:[!o&&"undo",!a&&"redo"].filter(y=>typeof y=="string"),children:[d.jsxs(lr,{"aria-label":"Undo and Redo",children:[d.jsxs(We,{textValue:"Undo",children:[d.jsx(wt,{children:d.jsx(X,{icon:Ot})}),d.jsx(St,{children:"Undo"}),d.jsx(nr,{children:Ue.UNDO.getDisplayText()})]},"undo"),d.jsxs(We,{textValue:"Redo",children:[d.jsx(wt,{children:d.jsx(X,{icon:Ot})}),d.jsx(St,{children:"Redo"}),d.jsx(nr,{children:Ue.REDO.getDisplayText()})]},"redo")]}),d.jsx(lr,{"aria-label":"More actions",children:d.jsxs(We,{textValue:"Show hidden columns",children:[d.jsx(wt,{children:d.jsx(X,{icon:u?ze:Ot})}),d.jsx(St,{children:"Show hidden columns"})]},"showHidden")})]})]})]}),d.jsxs("div",{className:"top-menu",children:[d.jsx(B,{kind:"ghost",icon:co,className:"px-1",tooltip:"Reset to default",onClick:()=>{this.resetVisibilityOrdering()},children:"Reset"}),d.jsx("span",{className:"vertical-divider"}),d.jsx(B,{kind:"ghost",icon:Vt,className:"px-1",tooltip:"Sort ascending",onClick:()=>{this.handleSortColumns(Q.SORTING_OPTIONS.ASC)}}),d.jsx(B,{kind:"ghost",icon:Kt,className:"px-1",tooltip:"Sort descending",onClick:()=>{this.handleSortColumns(Q.SORTING_OPTIONS.DSC)}}),d.jsx("span",{className:"vertical-divider"}),d.jsxs(B,{kind:"ghost",className:"px-1",tooltip:"Create group from selection",disabled:!m,onClick:this.handleGroupCreate,children:[d.jsxs("span",{className:"fa-layers",children:[d.jsx(X,{mask:ho,icon:Bn,transform:"right-7 down-5 shrink-6"}),d.jsx(X,{icon:mo,transform:"right-8 down-6 shrink-8"})]}),"Group"]}),d.jsx("span",{className:"vertical-divider"}),d.jsx(B,{kind:"ghost",icon:vo,className:"px-1",tooltip:"Move selection up",onClick:()=>{this.handleMoveColumns(Q.MOVE_OPTIONS.UP)},disabled:!m}),d.jsx(B,{kind:"ghost",icon:po,className:"px-1",tooltip:"Move selection down",onClick:()=>{this.handleMoveColumns(Q.MOVE_OPTIONS.DOWN)},disabled:!m}),d.jsx(B,{kind:"ghost",icon:fo,className:"px-1",tooltip:"Move selection to top",onClick:()=>{this.handleMoveColumns(Q.MOVE_OPTIONS.TOP)},disabled:!m}),d.jsx(B,{kind:"ghost",icon:go,className:"px-1",tooltip:"Move selection to bottom",onClick:()=>{this.handleMoveColumns(Q.MOVE_OPTIONS.BOTTOM)},disabled:!m})]}),d.jsx("div",{role:"menu",ref:y=>{this.list=y},className:Y("visibility-ordering-list"),children:S})]})})}}te(Q,"SORTING_OPTIONS",{DSC:"DSC",ASC:"ASC"});te(Q,"MOVE_OPTIONS",{TOP:"TOP",BOTTOM:"BOTTOM",UP:"UP",DOWN:"DOWN"});var Bs=C.memo(r=>{var e=r.movedColumns,t=r.hiddenColumns,n=r.columnHeaderGroups,i=r.onMovedColumnsChanged,o=r.onColumnVisibilityChanged,a=r.onColumnHeaderGroupChanged,l=r.onFrozenColumnsChanged,s=r.__testRef,u=ca({movedColumns:e,hiddenColumns:t,columnHeaderGroups:n,frozenColumns:r.model.frozenColumns}),c=u.set,m=u.undo,h=u.canUndo,v=u.redo,p=u.canRedo,g=u.state,b=C.useRef(!1),f=C.useRef(!1),S=C.useCallback(()=>{f.current=!0},[]),y=C.useCallback(()=>{f.current=!1},[]);C.useEffect(()=>{b.current?(i(g.movedColumns),o(t,!0),o(g.hiddenColumns,!1),a(g.columnHeaderGroups),l(g.frozenColumns),b.current=!1):!f.current&&(e!==g.movedColumns||n!==g.columnHeaderGroups||t.length!==g.hiddenColumns.length||t.some((D,A)=>D!==g.hiddenColumns[A]))&&c({movedColumns:e,hiddenColumns:t,columnHeaderGroups:n,frozenColumns:r.model.frozenColumns})},[n,t,f,e,a,o,l,i,r.model.frozenColumns,c,g.columnHeaderGroups,g.frozenColumns,g.hiddenColumns,g.movedColumns]);var w=C.useCallback(D=>{D!==n&&a(gt.parseColumnHeaderGroups(r.model,D).groups)},[n,a,r.model]),T=C.useCallback(()=>{b.current=!0,m()},[m]),x=C.useCallback(()=>{b.current=!0,v()},[v]);return d.jsx(Q,pt(pt({},r),{},{ref:s,movedColumns:e,hiddenColumns:t,columnHeaderGroups:n,onMovedColumnsChanged:i,onColumnVisibilityChanged:o,onColumnHeaderGroupChanged:w,undo:T,canUndo:h,redo:x,canRedo:p,startUndoGroup:S,endUndoGroup:y}))});Bs.displayName="VisibilityOrderingBuilder";function Ws(r,e,t){return(e=zs(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function zs(r){var e=Vs(r,"string");return typeof e=="symbol"?e:e+""}function Vs(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Sc extends me{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 t=e.x,n=e.y,i=e.column,o=e.row;if(i==null||o==null)return null;var a=this.irisGrid,l=a.renderer,s=a.grid,u=a.state,c=a.props;if(!s)return null;var m=u.metrics,h=c.model,v=s.canvasContext,p=this.irisGrid.getTheme(),g={context:v,mouseX:t,mouseY:n,metrics:m,model:h,theme:p},b=l.getCellOverflowButtonPosition(g),f=b.left,S=b.top,y=b.width,w=b.height;return f==null||y==null||S==null||w==null?null:{left:f,top:S,width:y,height:w}}isHoveringOverflowButton(e){var t,n=e.x,i=e.y,o=(t=this.getButtonPosition(e))!==null&&t!==void 0?t:{},a=o.left,l=o.top,s=o.width,u=o.height;if(a==null||s==null||l==null||u==null)return!1;var c=this.irisGrid,m=c.renderer,h=c.grid,v=c.state,p=c.props;if(!h)return!1;var g=v.metrics,b=p.model,f=h.canvasContext,S=h.getTheme(),y={context:f,mouseX:n,mouseY:i,metrics:g,model:b,theme:S};return m.shouldRenderOverflowButton(y)&&n>=a&&n<=a+s&&i>=l&&i<=l+u}onMove(e){if(this.isHoveringOverflowButton(e)){var t=this.irisGrid.state.overflowButtonTooltipProps,n=this.getButtonPosition(e);Me(t,n)||this.irisGrid.setState({overflowButtonTooltipProps:n})}else this.destroyColumnTooltip();return this.setCursor(e)}onWheel(e){return this.destroyColumnTooltip(),this.onMove(e)}onDown(e){this.destroyColumnTooltip();var t=e.column,n=e.row;return this.isHoveringOverflowButton(e)?(this.irisGrid.setState({showOverflowModal:!0,overflowText:this.irisGrid.getValueForCell(t,n)}),!0):!1}onContextMenu(){return this.destroyColumnTooltip(),!1}onLeave(){return this.destroyColumnTooltip(),!1}}function Ks(r,e,t){return(e=Qs(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qs(r){var e=Xs(r,"string");return typeof e=="symbol"?e:e+""}function Xs(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class wc extends me{constructor(e){super(),Ks(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}isActive(){var e=this.irisGrid.props.isSelectingColumn;return e}isValidColumn(e){if(e==null||e.isProxy===!0)return!1;var t=this.irisGrid.props.columnSelectionValidator;return t!=null?t(e):!0}updateColumnSelectionStatus(){var e=this.irisGrid.props.columnSelectionValidator;e!=null&&e(null)}getTableColumn(e){if(e==null)return null;var t=this.irisGrid.props.model,n=this.irisGrid.getModelColumn(e);return n==null?null:t.columns[n]}onMove(e){if(!this.isActive())return!1;var t=this.irisGrid.props,n=t.columnAllowedCursor,i=t.columnNotAllowedCursor,o=e.column,a=this.getTableColumn(o);return this.isValidColumn(a)?(this.cursor=n,this.irisGrid.setState({hoverSelectColumn:o})):(this.cursor=i,this.irisGrid.setState({hoverSelectColumn:null})),!0}onWheel(e){if(!this.isActive())return!1;var t=this.irisGrid.props,n=t.columnAllowedCursor,i=t.columnNotAllowedCursor,o=e.column,a=this.getTableColumn(o);return this.isValidColumn(a)?(this.cursor=n,this.irisGrid.setState({hoverSelectColumn:o})):(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 t=e.column,n=this.getTableColumn(t);return n!=null&&this.isValidColumn(n)&&this.irisGrid.selectColumn(n),!0}}function Ys(r,e,t){return(e=qs(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function qs(r){var e=Zs(r,"string");return typeof e=="symbol"?e:e+""}function Zs(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Oc extends me{constructor(e){super(),Ys(this,"irisGrid",void 0),this.irisGrid=e}hideColumnTooltip(){var e=this.irisGrid.tooltip;e&&(e.stopTimer(),e.hide())}onDown(){return this.hideColumnTooltip(),!1}onContextMenu(){return this.hideColumnTooltip(),!1}onWheel(){return this.hideColumnTooltip(),!1}onLeave(e,t,n){var i=n instanceof MouseEvent?n:n.nativeEvent,o=i.relatedTarget,a=this.irisGrid.tooltip;if(!a)return!1;var l=a.popper.current;return l&&o instanceof Element&&l.element.contains(o)||this.hideColumnTooltip(),!1}onMove(e){var t=e.column,n=e.row,i=e.columnHeaderDepth,o=this.irisGrid.state.shownColumnTooltip,a=null;return t!==null&&n===null&&i===0&&(a=t),a!==o&&Un.flushSync(()=>{this.irisGrid.setState({shownColumnTooltip:a})}),!1}}function oi(r,e,t){return(e=Js(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Js(r){var e=eu(r,"string");return typeof e=="symbol"?e:e+""}function eu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yt extends C.Component{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yt.defaultProps;super(e),oi(this,"inputRef",void 0),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.inputRef=Ye.createRef()}handleInputChange(){var e=this.props.onChange;this.inputRef.current&&e(this.inputRef.current.value)}closeContextMenu(){var e=this.props.forwardedProps,t=e.closeMenu;t(!0)}revertToDefault(){var e=this.props.onChange;e(null)}returnFocusToContextMenu(){var e=bo.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 e=this.props,t=e.formatString,n=e.forwardedProps,i=e.placeholder,o=e.title,a=n.menuItem.description,l=n.iconElement;return d.jsxs("div",{className:"form-group flex-grow mb-0",children:[d.jsxs("div",{className:"custom-format-title",children:[d.jsx("span",{className:"icon",children:l}),d.jsxs("label",{className:"title mb-0",htmlFor:"custom-format-input",children:[o,a!=null&&d.jsx(Qe,{children:a})]})]}),d.jsx("div",{className:"pl-2 pr-2 pb-2",children:d.jsx("input",{id:"custom-format-input",className:"form-control text-right mb-0",type:"text",defaultValue:t,ref:this.inputRef,placeholder:i,onKeyDown:this.handleKeyDown,onChange:this.handleInputChange,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"})})]})}}oi(yt,"defaultProps",{formatString:"",forwardedProps:{menuItem:{},closeMenu(r){},iconElement:null},placeholder:"",title:"",onChange(r){}});class ue{static isDefaultSelected(e){return!e||![ut.TYPE_CONTEXT_CUSTOM,ut.TYPE_CONTEXT_PRESET].includes(e.type)}static isCustomSelected(e){return e!=null&&e.type===ut.TYPE_CONTEXT_CUSTOM}static makeOption(e,t,n,i){return{title:e,description:e,group:n,format:t,isSelected:i}}static makeCustomFormatOption(e,t,n,i,o){var a;return{title:e.label,description:e.label,format:e,group:t,isSelected:i,menuElement:d.jsx(yt,{formatString:(a=e.formatString)!==null&&a!==void 0?a:void 0,title:e.label,placeholder:n,onChange:o})}}}function Xt(r,e,t){return(e=tu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tu(r){var e=ru(r,"string");return typeof e=="symbol"?e:e+""}function ru(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ne{static getOptions(e,t){var n=new Date,i=[{group:ne.dateGroup,formatString:"yyyy-MM-dd"},{group:ne.dateGroup,formatString:"MM-dd-yyyy"},{group:ne.timeGroup,formatString:"HH:mm:ss"},{group:ne.timeGroup,formatString:"HH:mm:ss.SSS"},{group:ne.timeGroup,formatString:"HH:mm:ss.SSSSSSSSS"},{group:ne.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss"},{group:ne.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSS"},{group:ne.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSSSSSSSS"}],o=i.map(l=>{var s=Be.makeFormat("",l.formatString,Be.TYPE_CONTEXT_PRESET),u=e.getFormattedString(n,K.dataType.DATETIME,"",s);return ue.makeOption(u,s,l.group,Be.isSameFormat(s,t))}),a=ue.makeOption("Default",null,ne.dateGroup,ue.isDefaultSelected(t));return[a,...o]}}Xt(ne,"dateGroup",10);Xt(ne,"timeGroup",20);Xt(ne,"dateTimeGroup",30);function Ct(r,e,t){return(e=nu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nu(r){var e=iu(r,"string");return typeof e=="symbol"?e:e+""}function iu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ee{static getOptions(e,t,n){var i=[{format:oe.FORMAT_PERCENT,group:ee.presetGroup},{format:oe.FORMAT_BASIS_POINTS,group:ee.presetGroup},{format:oe.FORMAT_THOUSANDS,group:ee.presetGroup},{format:oe.FORMAT_MILLIONS,group:ee.presetGroup},{format:oe.FORMAT_SCIENTIFIC_NOTATION,group:ee.presetGroup},{format:oe.FORMAT_ROUND,group:ee.presetRoundGroup},{format:oe.FORMAT_ROUND_TWO_DECIMALS,group:ee.presetRoundGroup},{format:oe.FORMAT_ROUND_FOUR_DECIMALS,group:ee.presetRoundGroup}],o=ue.makeOption("Default",null,ee.defaultGroup,ue.isDefaultSelected(t)),a=i.map(c=>ue.makeOption(c.format.label,c.format,c.group,oe.isSameFormat(c.format,t))),l=ue.isCustomSelected(t),s=l?t:oe.makeCustomFormat(),u=ue.makeCustomFormatOption(s,ee.customGroup,oe.DEFAULT_FORMAT_STRING,l,c=>{if(c!=null){var m=oe.makeCustomFormat(c);oe.isValid(e,m)&&n(m)}else n(null)});return[o,...a,u]}}Ct(ee,"defaultGroup",10);Ct(ee,"presetGroup",20);Ct(ee,"presetRoundGroup",30);Ct(ee,"customGroup",40);function Yt(r,e,t){return(e=ou(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ou(r){var e=au(r,"string");return typeof e=="symbol"?e:e+""}function au(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class fe{static getOptions(e,t,n){var i=[{format:we.FORMAT_THOUSANDS,group:fe.presetGroup},{format:we.FORMAT_MILLIONS,group:fe.presetGroup},{format:we.FORMAT_SCIENTIFIC_NOTATION,group:fe.presetGroup}],o=ue.makeOption("Default",null,fe.defaultGroup,ue.isDefaultSelected(t)),a=i.map(c=>ue.makeOption(c.format.label,c.format,c.group,we.isSameFormat(c.format,t))),l=ue.isCustomSelected(t),s=l?t:we.makeCustomFormat(),u=ue.makeCustomFormatOption(s,fe.customGroup,we.DEFAULT_FORMAT_STRING,l,c=>{if(c!=null){var m=we.makeCustomFormat(c);we.isValid(e,m)&&n(m)}else n(null)});return[o,...a,u]}}Yt(fe,"defaultGroup",10);Yt(fe,"presetGroup",20);Yt(fe,"customGroup",30);var He;function qt(r,e,t){return(e=lu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lu(r){var e=su(r,"string");return typeof e=="symbol"?e:e+""}function su(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ze{static getIconForAlignment(e){return e==="center"?Kn:e==="left"?Qn:Xn}}He=Ze;qt(Ze,"defaultGroup",10);qt(Ze,"alignmentGroup",20);qt(Ze,"alignmentOptions",[{title:"Default",alignment:null,group:He.defaultGroup},{title:"Left Align",alignment:"left",icon:Qn,group:He.alignmentGroup},{title:"Center Align",alignment:"center",icon:Kn,group:He.alignmentGroup},{title:"Right Align",alignment:"right",icon:Xn,group:He.alignmentGroup}]);function un(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?un(Object(t),!0).forEach(function(n){ie(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):un(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function cn(r,e,t,n,i,o,a){try{var l=r[o](a),s=l.value}catch(u){return void t(u)}l.done?e(s):Promise.resolve(s).then(n,i)}function hn(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(s){cn(o,n,i,a,l,"next",s)}function l(s){cn(o,n,i,a,l,"throw",s)}a(void 0)})}}function ie(r,e,t){return(e=uu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function uu(r){var e=du(r,"string");return typeof e=="symbol"?e:e+""}function du(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var mn=de.module("IrisGridContextMenuHandler"),cu=150,vn="yyyy-MM-dd HH:mm:ss.SSSSSSSSS",Nt=1e3;class j extends me{static getQuickFilterCondition(e,t,n){return e&&n==="&&"?e.and(t):e&&n==="||"?e.or(t):t}static getQuickFilterText(e,t,n){return n&&e!=null?"".concat(e," ").concat(n," ").concat(t):t}static getOperatorAsText(e){return e==="&&"?"And":"Or"}static getRowOptionFormatted(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30;return"".concat(e,' "').concat(qn.truncate(t,n-e.length-3),'"')}constructor(e,t){super(),ie(this,"irisGrid",void 0),ie(this,"debouncedUpdateCustomFormat",void 0),ie(this,"dh",void 0),this.getNumberValueEqualsFilter=this.getNumberValueEqualsFilter.bind(this),this.getFilterValueForNumberOrChar=this.getFilterValueForNumberOrChar.bind(this),this.debouncedUpdateCustomFormat=Ln(e.handleFormatSelection,cu),this.dh=t,this.irisGrid=e}componentWillUnmount(){this.debouncedUpdateCustomFormat.flush()}getHeaderActions(e,t){var n=this.irisGrid,i=t.column;k(i);var o=n.props.model,a=o.columns,l=a[e],s=[],u=n.state,c=u.metrics,m=u.reverse,h=u.quickFilters,v=u.advancedFilters,p=u.searchFilter,g=n.getTheme();k(c);var b=g.filterIconColor,f=g.filterBarActiveColor,S=g.contextMenuSortIconColor,y=g.contextMenuReverseIconColor,w=o.sort,T=K.getSortForColumn(w,l.name),x=c.userColumnWidths,D=[...x.values()].some(I=>I===0),A=o.getColumnHeaderParentGroup(e,0)===void 0&&!(Ve(o)&&o.hasExpandableRows),R=o.isColumnFrozen(e),E=o.isColumnSortable(e);if(s.push({title:"Hide Column",group:j.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.hideColumnByVisibleIndex(i)}}),s.push({title:R?"Unfreeze Column":"Freeze Column",group:j.GROUP_HIDE_COLUMNS,disabled:!A,action:()=>{R?this.irisGrid.unFreezeColumnByColumnName(l.name):this.irisGrid.freezeColumnByColumnName(l.name)},order:30}),s.push({title:"Show All Columns",group:j.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.showAllColumns()},disabled:!D}),ei(o)&&o.hasExpandableColumns&&o.isExpandAllColumnsAvailable&&(s.push({title:"Expand All Columns",group:j.GROUP_EXPAND_COLLAPSE,order:30,action:()=>{this.irisGrid.expandAllColumns()}}),s.push({title:"Collapse All Columns",group:j.GROUP_EXPAND_COLLAPSE,order:40,action:()=>{this.irisGrid.collapseAllColumns()}})),s.push({title:"Resize Column",group:j.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.handleResizeColumn(e)},order:10}),s.push({title:"Resize All Columns",group:j.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.handleResizeAllColumns()},order:20}),s.push({title:"Quick Filters",icon:be,iconColor:f,shortcut:et.TABLE.TOGGLE_QUICK_FILTER,group:j.GROUP_FILTER,order:10,action:()=>{this.irisGrid.toggleFilterBar(i)},disabled:!o.isFilterable(e)}),s.push({title:"Advanced Filters",icon:v.get(e)?yo:Co,iconColor:b,group:j.GROUP_FILTER,order:20,action:()=>{this.irisGrid.handleAdvancedMenuOpened(i)},disabled:!o.isFilterable(e)}),s.push({title:"Clear Table Filters",group:j.GROUP_FILTER,order:40,shortcut:et.TABLE.CLEAR_FILTERS,action:()=>{this.irisGrid.clearAllFilters()},disabled:!(h.size>0||v.size>0||p!=null)}),s.push({title:"Sort by",icon:be,iconColor:S,group:j.GROUP_SORT,order:10,actions:this.sortByActions(l,e,T),disabled:!E}),s.push({title:"Add Additional Sort",disabled:T&&w.length===1||m&&w.length===1||T&&m&&w.length===2||w.length===0||!E,group:j.GROUP_SORT,order:20,actions:this.additionalSortActions(l,e)}),s.push({title:"Clear Table Sorting",disabled:w.length===0||m&&w.length===1,group:j.GROUP_SORT,action:()=>{this.irisGrid.sortColumn(i,j.COLUMN_SORT_DIRECTION.none)},order:30}),s.push({title:m?"Clear Reverse Table":"Reverse Table",icon:be,iconColor:y,group:j.GROUP_SORT,order:40,disabled:!o.isReversible,shortcut:et.TABLE.REVERSE,action:()=>{this.irisGrid.reverse(!m)}}),s.push({title:"Copy Column Name",group:j.GROUP_COPY,shortcutText:$e.isMacPlatform()?"⌥Click":"Alt+Click",action:()=>{var I;Ti((I=o.textForColumnHeader(e))!==null&&I!==void 0?I:"").catch(F=>mn.error("Unable to copy header",F))}}),K.isDateType(l.type))s.push({title:"Date/Time Format",group:j.GROUP_FORMAT,actions:this.dateFormatActions(l)});else if(K.isNumberType(l.type)){var N;s.push({title:"Number Format",group:j.GROUP_FORMAT,actions:(N=this.numberFormatActions(l))!==null&&N!==void 0?N:void 0})}return s.push({title:"Text Alignment",group:j.GROUP_FORMAT,actions:this.textAlignmentFormatActions(l)}),s}getCellActions(e,t,n){var i=this.irisGrid,o=n.column,a=n.row,l=i.props,s=l.model,u=l.canCopy,c=s.columns,m=i.getModelRow(a);k(m);var h=s.sourceForCell(e,m),v=h.column,p=h.row,g=i.state.selectedRanges,b=c[v],f=[],S=i.getTheme(),y=S.filterIconColor;if(b==null||a==null)return f;if(Ve(s)&&s.isRowExpandable(p)){var w=0,T=s.valueForCell(w,p),x=T==null?"null":s.textForCell(w,p);f.push({title:j.getRowOptionFormatted(s.isRowExpanded(p)?"Collapse":"Expand",x),group:j.GROUP_EXPAND_COLLAPSE,order:10,action:()=>{s.setRowExpanded(p,!s.isRowExpanded(p))}}),s.isExpandAllAvailable===!0&&f.push({title:j.getRowOptionFormatted("Expand All in",x),group:j.GROUP_EXPAND_COLLAPSE,order:20,action:()=>{s.setRowExpanded(p,!0,!0)}})}Ve(s)&&s.hasExpandableRows&&s.isExpandAllAvailable===!0&&(f.push({title:"Expand Entire Table",group:j.GROUP_EXPAND_COLLAPSE,order:30,action:()=>{s.expandAll()}}),f.push({title:"Collapse Entire Table",group:j.GROUP_EXPAND_COLLAPSE,order:40,action:()=>{s.collapseAll()}}));var D={title:"Go to",iconColor:y,shortcut:et.TABLE.GOTO_ROW,group:j.GROUP_GOTO,order:10,action:()=>{var N=String(i.getValueForCell(o,a,!0));this.irisGrid.toggleGotoRow("".concat(a+1),N,b.name)}};if(f.push(D),u&&(f.push({title:"Copy Cell",group:j.GROUP_COPY,shortcutText:$e.isMacPlatform()?"⌥Click":"Alt+Click",order:10,action:()=>{i.copyCell(o,a)}}),f.push({title:"Copy Cell Unformatted",group:j.GROUP_COPY,order:20,action:()=>{i.copyCell(o,a,!0)}})),Gt(s)&&s.isEditable){var A=g.every(N=>s.isEditableRange(N)),R=Z.containsCell(g,o,a),E=s.isEditableRange(Z.makeCell(o,a));(A||!R)&&E&&f.push({title:"Paste",group:j.GROUP_COPY,order:50,action:function(){var N=hn(function*(){try{var F=yield Pi(),U=F.split(`
20
- `).map(M=>M.split(" "));yield t.pasteValue(U)}catch(M){if(M instanceof xi)i.handleOpenNoPastePermissionModal("For security reasons your browser does not allow access to your clipboard on click.");else if(M instanceof Di)i.handleOpenNoPastePermissionModal("Requested clipboard permissions have not been granted, please grant them and try again.");else throw M}});function I(){return N.apply(this,arguments)}return I}()})}return f.push({title:"View Cell Contents",group:j.GROUP_VIEW_CONTENTS,order:10,action:()=>{i.setState({showOverflowModal:!0,overflowText:i.getValueForCell(o,a)})}}),Yn(s)&&!s.isPartitionAwareSourceTable&&f.push({title:"View Constituent Table",group:j.GROUP_VIEW_CONTENTS,order:40,action:()=>{i.selectPartitionKeyFromTable(a)}}),f}getCellFilterActions(e,t,n){var i=this;return hn(function*(){var o=i.dh,a=i.irisGrid,l=n.row,s=a.props.model,u=s.columns,c=a.getModelRow(l),m=t.getSelectedRanges;k(c);var h=s.sourceForCell(e,c),v=h.column,p=h.row,g=u[v];if(g==null||l==null)return[];if(!s.isFilterable(v))return[];var b=a.state.quickFilters,f=a.getTheme(),S=f.filterIconColor,y=a.props.settings,w=[...m()];if(w.length===0&&w.push(new Z(v,p,v,p)),Z.containsCell(w,v,p))for(var T=Z.rowCount(w);T>Nt;){var x=w.pop();k(x,"Selected ranges should not be empty");var D=Z.rowCount([x]);if(So(D,"Selected ranges should not be unbounded"),T-D<Nt){var A;w.push(new Z(x.startColumn,x.startRow,x.endColumn,((A=x.endRow)!==null&&A!==void 0?A:0)-(T-Nt)));break}T-=D}else w=[new Z(v,p,v,p)];wo(w);for(var R=yield s.snapshot(w),E=new Set,N=0;N<R.length;N+=1)R[N].length===1?R[N][0]!=null&&E.add(R[N][0]):R[N][v]!=null&&E.add(R[N][v]);var I={title:"Filter by Value".concat(E.size>1?"s":""),icon:be,iconColor:S,group:j.GROUP_FILTER,order:10,actions:[]};if(E.size===0)b.get(v)&&I.actions.push({title:"And",actions:i.nullFilterActions(g,b.get(v),"&&"),order:2,group:$.groups.high}),I.actions.push(...i.nullFilterActions(g));else if(E.size===1&&E.has(""))b.get(v)&&I.actions.push({title:"And",actions:i.emptyStringFilterActions(g,b.get(v),"&&"),order:2,group:$.groups.high}),I.actions.push(...i.emptyStringFilterActions(g));else if(K.isBooleanType(g.type))b.get(v)&&I.actions.push({title:"Or",actions:i.booleanFilterActions(g,s.textForCell(v,p),b.get(v),"||"),order:2,group:$.groups.high}),I.actions.push(...i.booleanFilterActions(g,s.textForCell(v,p)));else if(K.isNumberType(g.type)||K.isCharType(g.type))k(v),b.get(v)&&I.actions.push({title:"And",actions:i.numberFilterActions(g,E,b.get(v),"&&"),order:2,group:$.groups.high}),I.actions.push(...i.numberFilterActions(g,E,b.get(v)));else if(K.isDateType(g.type)){var F=new Be(o,{timeZone:y==null?void 0:y.timeZone,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:vn}),U=new Be(o,{timeZone:y==null?void 0:y.timeZone,showTimeZone:y==null?void 0:y.showTimeZone,showTSeparator:y==null?void 0:y.showTSeparator,defaultDateTimeFormatString:vn});b.get(v)&&I.actions.push({title:"And",actions:i.dateFilterActions(g,E,F,U,b.get(v),"&&"),order:2,group:$.groups.high}),I.actions.push(...i.dateFilterActions(g,E,F,U,b.get(v)))}else b.get(v)&&I.actions.push({title:"And",actions:i.stringFilterActions(g,E,b.get(v),"&&"),order:2,group:$.groups.high}),I.actions.push(...i.stringFilterActions(g,E));return[I]})()}getNumberValueEqualsFilter(e,t){var n=this.dh,i=e.filter();if(t===Number.POSITIVE_INFINITY)return n.FilterCondition.invoke("isInf",i).and(i.greaterThan(n.FilterValue.ofNumber(0)));if(t===Number.NEGATIVE_INFINITY)return n.FilterCondition.invoke("isInf",i).and(i.lessThan(n.FilterValue.ofNumber(0)));if(Number.isNaN(t))return n.FilterCondition.invoke("isNaN",i);var o=this.getFilterValueForNumberOrChar(e.type,t);return i.eq(o)}getFilterValueForNumberOrChar(e,t){var n=this.dh;return K.isCharType(e)?n.FilterValue.ofString(String.fromCharCode(t)):n.FilterValue.ofNumber(t)}onContextMenu(e,t,n){var i=this.irisGrid,o=e.y,a=e.column,l=e.row,s=e.columnHeaderDepth,u=i.getModelColumn(a),c=i.getModelRow(l),m=i.props,h=m.model,v=m.canCopy,p=h.columns,g=i.state,b=g.metrics,f=g.isFilterBarShown,S=g.quickFilters,y=g.advancedFilters,w=g.selectedRanges,T=Go.getLatestSelection(w,a,l);k(b);var x=b.columnHeaderHeight,D=b.gridY,A=b.columnHeaderMaxDepth,R=[];if(u!=null&&c!=null){var E=h.sourceForCell(u,c??0),N=E.column,I=E.row,F=h.valueForCell(N,I),U=h.textForCell(N,I),M=p[N],G=i.props.onContextMenu;M!=null&&R.push(...G({model:h,value:F,valueText:U,column:M,rowIndex:l,columnIndex:a,modelRow:c,modelColumn:u}))}if(u!=null){var O=h.getClearFilterRange(u);O!=null&&O.length>0&&R.push({title:O[1]-O[0]>0?"Clear Group Filter":"Clear Column Filter",group:j.GROUP_FILTER,order:30,action:()=>{this.irisGrid.removeColumnFilter(O)},disabled:!Array.from(S.keys()).some(P=>P>=O[0]&&P<=O[1])&&!Array.from(y.keys()).some(P=>P>=O[0]&&P<=O[1])})}return(f?o<=D:o<=x*A&&s===0)?u!=null&&R.push(...this.getHeaderActions(u,e)):(u!=null&&c!=null&&(R.push(...this.getCellActions(u,t,e)),R.push(this.getCellFilterActions(u,t,e))),v&&T.length>0&&(R.push({title:"Copy Selection",shortcut:Ue.COPY,group:j.GROUP_COPY,order:30,action:()=>{i.copyRanges(T)}}),R.push({title:"Copy Selection w/ Headers",group:j.GROUP_COPY,order:40,action:()=>{i.copyRanges(T,!0)}})),Gt(h)&&h.isEditable&&T.length>0&&ll(h)&&h.isDeletable&&R.push({title:"Delete Selected Rows",group:j.GROUP_EDIT,disabled:!h.isDeletableRanges(T),order:50,action:()=>{this.irisGrid.deleteRanges(T)}})),R.length===0?!1:(k(i.gridWrapper),$.triggerMenu(i.gridWrapper,n.clientX,n.clientY,R),!0)}dateFormatActions(e){for(var t=this,n=this.irisGrid.props.model,i=n.formatter,o=i.getColumnFormat(e.type,e.name),a=ne.getOptions(i,o),l=[],s=function(){var m=a[u],h=m.description,v=m.format,p=m.group,g=m.isSelected,b=m.title;l.push({title:b,description:h,icon:g?ze:void 0,group:p,order:u,action:()=>{var f=n.getColumnIndexByName(e.name);k(f),t.irisGrid.handleFormatSelection(f,v)}})},u=0;u<a.length;u+=1)s();return l}numberFormatActions(e){var t=this,n=this.irisGrid.props.model,i=n.formatter,o=this.dh,a=i.getColumnFormat(e.type,e.name),l,s=n.getColumnIndexByName(e.name);if(K.isDecimalType(e.type))l=ee.getOptions(o,a,h=>{k(s),this.debouncedUpdateCustomFormat(s,h)});else if(K.isIntegerType(e.type))l=fe.getOptions(o,a,h=>{k(s),this.debouncedUpdateCustomFormat(s,h)});else return mn.error("Invalid column type in numberFormatActions"),null;for(var u=[],c=function(){var v=l[m],p=v.format,g=v.isSelected;u.push(dn(dn({},l[m]),{},{icon:g?ze:void 0,order:m,action:()=>{s===void 0&&p&&p.type===ut.TYPE_CONTEXT_CUSTOM||(k(s),t.irisGrid.handleFormatSelection(s,p))}}))},m=0;m<l.length;m+=1)c();return u}textAlignmentFormatActions(e){var t=this.irisGrid.props.model,n=this.irisGrid.state.columnAlignmentMap,i=t.getColumnIndexByName(e.name);k(i);var o=n.get(e.name);return Ze.alignmentOptions.map((a,l)=>({title:a.title,icon:o==null&&a.alignment==null||o===a.alignment?ze:a.icon,order:l,group:a.group,action:()=>{this.irisGrid.handleColumnAlignmentChange(i,a.alignment)}}))}stringFilterActions(e,t,n,i){var o=this.dh,a=Array.from(t.keys()),l=a.map(f=>o.FilterValue.ofString(f)),s=l.length===1?l[0]:"the selected values",u=n;u||(u={filter:null,text:null});var c=u,m=c.filter,h=c.text,v=[],p=this.irisGrid.props.model,g=p.getColumnIndexByName(e.name),b=f=>{var S;return(S=K.escapeQuickTextFilter(f))!==null&&S!==void 0?S:""};return k(g),v.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?j.getOperatorAsText(i):""," ",st.join(a.slice(0,20).map(f=>'"'.concat(b(f),'"'))),a.length>1&&d.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",a.length," values selected)"]})]}),order:1,group:$.groups.high}),v.push({title:"text is exactly",description:"Show only rows where ".concat(e.name," is ").concat(s," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(g,j.getQuickFilterCondition(m,l.map(f=>e.filter().eq(f)).reduce((f,S)=>f.or(S)),i),j.getQuickFilterText(h,a.map(b).join(" || "),i))},order:10,group:$.groups.low}),v.push({title:"text is not exactly",description:"Show only rows where ".concat(e.name," is not ").concat(s," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(g,j.getQuickFilterCondition(m,l.map(f=>e.filter().notEq(f)).reduce((f,S)=>f.and(S)),i),j.getQuickFilterText(h,a.map(f=>"!=".concat(b(f))).join(" && "),i))},order:20,group:$.groups.low}),v.push({title:"text contains",description:"Show only rows where ".concat(e.name," contains ").concat(s),action:()=>{this.irisGrid.setQuickFilter(g,j.getQuickFilterCondition(m,e.filter().isNull().not().and(l.map(f=>e.filter().contains(f)).reduce((f,S)=>f.or(S))),i),j.getQuickFilterText(h,a.map(f=>"~".concat(b(f))).join(" || "),i))},order:30,group:$.groups.low}),v.push({title:"text does not contain",description:"Show only rows where ".concat(e.name," does not contain ").concat(s),action:()=>{this.irisGrid.setQuickFilter(g,j.getQuickFilterCondition(m,e.filter().isNull().or(l.map(f=>e.filter().contains(f).not()).reduce((f,S)=>f.and(S))),i),j.getQuickFilterText(h,a.map(f=>"!~".concat(b(f))).join(" && "),i))},order:40,group:$.groups.low}),v.push({title:"text starts with",description:"Show only rows where ".concat(e.name," starts with ").concat(s),action:()=>{this.irisGrid.setQuickFilter(g,j.getQuickFilterCondition(m,e.filter().isNull().not().and(l.map(f=>e.filter().invoke("startsWith",f)).reduce((f,S)=>f.or(S))),i),j.getQuickFilterText(h,a.map(f=>"".concat(b(f),"*")).join(" || "),i))},order:50,group:$.groups.low}),v.push({title:"text ends with",description:"Show only rows where ".concat(e.name," ends with ").concat(s),action:()=>{this.irisGrid.setQuickFilter(g,j.getQuickFilterCondition(m,e.filter().isNull().not().and(l.map(f=>e.filter().invoke("endsWith",f)).reduce((f,S)=>f.or(S))),i),j.getQuickFilterText(h,a.map(f=>"*".concat(b(f))).join(" || "),i))},order:60,group:$.groups.low}),v}numberFilterActions(e,t,n,i){var o=Array.from(t.keys()),a=o.length===1?"".concat(o):"the selected values",l=y=>K.isCharType(e.type)?String.fromCharCode(y):"".concat(y),s=null,u=null;n&&(s=n.filter,u=n.text);var c=[],m=this.irisGrid.props.model,h=m.getColumnIndexByName(e.name);if(k(h),c.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?j.getOperatorAsText(i):""," ",st.join(o.slice(0,20).map(y=>'"'.concat(l(y),'"'))),o.length>1&&d.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",o.length," values selected)"]})]}),order:1,group:$.groups.high}),c.push({title:"is equal to",description:"Show only rows where ".concat(e.name," is ").concat(a),action:()=>{this.irisGrid.setQuickFilter(h,j.getQuickFilterCondition(s,o.map(y=>this.getNumberValueEqualsFilter(e,y)).reduce((y,w)=>y.or(w)),i),j.getQuickFilterText(u,o.map(y=>"=".concat(l(y))).join(" || "),i))},order:10,group:$.groups.low}),c.push({title:"is not equal to",description:"Show only rows where ".concat(e.name," is not ").concat(a),action:()=>{this.irisGrid.setQuickFilter(h,j.getQuickFilterCondition(s,o.map(y=>this.getNumberValueEqualsFilter(e,y).not()).reduce((y,w)=>y.and(w)),i),j.getQuickFilterText(u,o.map(y=>"!=".concat(l(y))).join(" && "),i))},order:20,group:$.groups.low}),!t.has(Number.NaN)&&!t.has(Number.POSITIVE_INFINITY)&&!t.has(Number.NEGATIVE_INFINITY)&&!K.isCharType(e.type)){var v=o.reduce((y,w)=>y>w?y:w),p=o.reduce((y,w)=>y<w?y:w),g=this.getFilterValueForNumberOrChar(e.type,v),b=this.getFilterValueForNumberOrChar(e.type,p),f="".concat(g),S="".concat(b);c.push({title:"greater than",description:"Show only rows where ".concat(e.name," is greater than ").concat(f),action:()=>{this.irisGrid.setQuickFilter(h,j.getQuickFilterCondition(s,e.filter().greaterThan(g),i),j.getQuickFilterText(u,">".concat(l(v)),i))},order:30,group:$.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(h,j.getQuickFilterCondition(s,e.filter().greaterThanOrEqualTo(g),i),j.getQuickFilterText(u,">=".concat(l(v)),i))},order:40,group:$.groups.low}),c.push({title:"less than",description:"Show only rows where ".concat(e.name," is less than ").concat(S),action:()=>{this.irisGrid.setQuickFilter(h,j.getQuickFilterCondition(s,e.filter().lessThan(b),i),j.getQuickFilterText(u,"<".concat(l(p)),i))},order:50,group:$.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(S),action:()=>{this.irisGrid.setQuickFilter(h,j.getQuickFilterCondition(s,e.filter().lessThanOrEqualTo(b),i),j.getQuickFilterText(u,"<=".concat(l(p)),i))},order:60,group:$.groups.low})}return c}booleanFilterActions(e,t,n,i){var o=[],a=this.irisGrid.props.model,l=n||{},s=l.filter,u=l.text,c=a.getColumnIndexByName(e.name);return k(c),o.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?j.getOperatorAsText(i):""," ",'"',t??"null",'"']}),order:1,group:$.groups.high}),o.push({title:"true",description:"Show only rows where ".concat(e.name," is true"),action:()=>{this.irisGrid.setQuickFilter(c,j.getQuickFilterCondition(s,e.filter().isTrue(),i),j.getQuickFilterText(u,"true",i))},order:10,group:$.groups.low}),o.push({title:"false",description:"Show only rows where ".concat(e.name," is false"),action:()=>{this.irisGrid.setQuickFilter(c,j.getQuickFilterCondition(s,e.filter().isFalse(),i),j.getQuickFilterText(u,"false",i))},order:20,group:$.groups.low}),o.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(c,j.getQuickFilterCondition(s,e.filter().isNull(),i),j.getQuickFilterText(u,"null",i))},order:30,group:$.groups.low}),o.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(c,j.getQuickFilterCondition(s,e.filter().isNull().not(),i),j.getQuickFilterText(u,"!null",i))},order:40,group:$.groups.low}),o}dateFilterActions(e,t,n,i,o,a){var l=this.dh,s=Array.from(t.keys()),u=s.map(A=>l.FilterValue.ofNumber(A)),c=u.length===1?i.format(s[0]):"the selected values",m=s.reduce((A,R)=>A>R?A:R),h=s.reduce((A,R)=>A<R?A:R),v=l.FilterValue.ofNumber(m),p=l.FilterValue.ofNumber(h),g=n.format(m),b=n.format(h),f=i.format(m),S=i.format(h),y=null,w=null;o&&(y=o.filter,w=o.text);var T=this.irisGrid.props.model,x=T.getColumnIndexByName(e.name);k(x);var D=[];return D.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[a?j.getOperatorAsText(a):""," ",st.join(s.slice(0,20).map(A=>'"'.concat(i.format(A),'"'))),s.length>1&&d.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",s.length," values selected)"]})]}),order:1,group:$.groups.high}),D.push({title:"date is",description:"Show only rows where ".concat(e.name," is ").concat(c),action:()=>{this.irisGrid.setQuickFilter(x,j.getQuickFilterCondition(y,u.map(A=>e.filter().eq(A)).reduce((A,R)=>A.or(R)),a),j.getQuickFilterText(w,s.map(A=>"=".concat(n.format(A))).join(" || "),a))},order:10,group:$.groups.low}),D.push({title:"date is not",description:"Show only rows where ".concat(e.name," is not ").concat(c),action:()=>{this.irisGrid.setQuickFilter(x,j.getQuickFilterCondition(y,u.map(A=>e.filter().notEq(A)).reduce((A,R)=>A.and(R)),a),j.getQuickFilterText(w,s.map(A=>"!=".concat(n.format(A))).join(" && "),a))},order:20,group:$.groups.low}),D.push({title:"date is before",description:"Show only rows where ".concat(e.name," is before ").concat(S),action:()=>{this.irisGrid.setQuickFilter(x,j.getQuickFilterCondition(y,e.filter().lessThan(p),a),j.getQuickFilterText(w,"<".concat(b),a))},order:30,group:$.groups.low}),D.push({title:"date is before or equal",description:"Show only rows where ".concat(e.name," is before or equal to ").concat(S),action:()=>{this.irisGrid.setQuickFilter(x,j.getQuickFilterCondition(y,e.filter().lessThanOrEqualTo(p),a),j.getQuickFilterText(w,"<=".concat(b),a))},order:40,group:$.groups.low}),D.push({title:"date is after",description:"Show only rows where ".concat(e.name," is greater than ").concat(f),action:()=>{this.irisGrid.setQuickFilter(x,j.getQuickFilterCondition(y,e.filter().greaterThan(v),a),j.getQuickFilterText(w,">".concat(g),a))},order:50,group:$.groups.low}),D.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(x,j.getQuickFilterCondition(y,e.filter().greaterThanOrEqualTo(v),a),j.getQuickFilterText(w,">=".concat(g),a))},order:60,group:$.groups.low}),D}emptyStringFilterActions(e,t,n){var i=this.dh,o=i.FilterValue.ofString(""),a=t;a||(a={filter:null,text:null});var l=a,s=l.filter,u=l.text,c=[],m=this.irisGrid.props.model,h=m.getColumnIndexByName(e.name);return k(h),c.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?j.getOperatorAsText(n):""," ",d.jsx("i",{className:"text-muted",children:"empty"})]}),order:1,group:$.groups.high}),c.push({title:"is empty string",description:"Show only rows where ".concat(e.name," is empty"),action:()=>{this.irisGrid.setQuickFilter(h,j.getQuickFilterCondition(s,e.filter().eq(o),n),j.getQuickFilterText(u,"=",n))},order:10,group:$.groups.low}),c.push({title:"is not empty string",description:"Show only rows where ".concat(e.name," is not empty"),action:()=>{this.irisGrid.setQuickFilter(h,j.getQuickFilterCondition(s,e.filter().notEq(o),n),j.getQuickFilterText(u,"!=",n))},order:20,group:$.groups.low}),c}nullFilterActions(e,t,n){var i=null,o=null;t&&(i=t.filter,o=t.text);var a=[],l=this.irisGrid.props.model,s=l.getColumnIndexByName(e.name);return k(s),a.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?j.getOperatorAsText(n):""," ",d.jsx("i",{className:"text-muted",children:"null"})]}),order:1,group:$.groups.high}),a.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(s,j.getQuickFilterCondition(i,e.filter().isNull(),n),j.getQuickFilterText(o,"null",n))},order:10,group:$.groups.low}),a.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(s,j.getQuickFilterCondition(i,e.filter().isNull().not(),n),j.getQuickFilterText(o,"!null",n))},order:20,group:$.groups.low}),a}sortByActions(e,t,n){var i=this.irisGrid.getTheme(),o=i.contextMenuSortIconColor,a=[{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,j.COLUMN_SORT_DIRECTION.ascending)},icon:this.checkColumnSort(n,j.COLUMN_SORT_DIRECTION.ascending)?be:void 0,iconColor:o},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,j.COLUMN_SORT_DIRECTION.descending)},icon:this.checkColumnSort(n,j.COLUMN_SORT_DIRECTION.descending)?be:void 0,iconColor:o},{title:"Remove Sort",order:50,action:()=>{this.irisGrid.sortColumn(t,j.COLUMN_SORT_DIRECTION.none,!1,!0)},disabled:!n}];return K.isNumberType(e.type)&&(a.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,j.COLUMN_SORT_DIRECTION.ascending,!0)},icon:this.checkColumnSort(n,j.COLUMN_SORT_DIRECTION.ascending,!0)?be:void 0,iconColor:o}),a.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,j.COLUMN_SORT_DIRECTION.descending,!0)},icon:this.checkColumnSort(n,j.COLUMN_SORT_DIRECTION.descending,!0)?be:void 0,iconColor:o})),a}additionalSortActions(e,t){var n=this.irisGrid.getTheme(),i=n.contextMenuSortIconColor,o=[{title:"Add Sort By",menuElement:d.jsxs("div",{className:"btn-context-menu menu-title",children:[d.jsx("span",{className:"icon",children:d.jsx(X,{icon:be,style:{color:i??void 0}})}),d.jsx("span",{className:"title",children:"Add Additional Sort"}),d.jsx("span",{className:"shortcut",children:$e.isMacPlatform()?"⌘Click":"Ctrl+Click"})]}),order:1},{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,j.COLUMN_SORT_DIRECTION.ascending,!1,!0)}},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,j.COLUMN_SORT_DIRECTION.descending,!1,!0)}}];return K.isNumberType(e.type)&&(o.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,j.COLUMN_SORT_DIRECTION.ascending,!0,!0)}}),o.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,j.COLUMN_SORT_DIRECTION.descending,!0,!0)}})),o}checkColumnSort(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e?e.direction===t&&e.isAbs===n:!1}}ie(j,"GROUP_EDIT",$.groups.high+10);ie(j,"GROUP_HIDE_COLUMNS",$.groups.high+25);ie(j,"GROUP_FILTER",$.groups.high+50);ie(j,"GROUP_EXPAND_COLLAPSE",$.groups.high+55);ie(j,"GROUP_GOTO",$.groups.high+60);ie(j,"GROUP_SORT",$.groups.high+75);ie(j,"GROUP_COPY",$.groups.high+100);ie(j,"GROUP_FORMAT",$.groups.high+150);ie(j,"GROUP_VIEW_CONTENTS",$.groups.high+175);ie(j,"COLUMN_SORT_DIRECTION",{ascending:"ASC",descending:"DESC",none:null});function hu(r,e,t){return(e=mu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mu(r){var e=vu(r,"string");return typeof e=="symbol"?e:e+""}function vu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class jc extends me{constructor(e){super(250),hu(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onClick(e,t,n){return n.altKey&&!$e.isModifierKeyDown(n)&&!n.shiftKey?(this.cursor=null,e.columnHeaderDepth!==void 0?this.irisGrid.copyColumnHeader(e.column,e.columnHeaderDepth):this.irisGrid.copyRanges([Z.makeCell(e.column,e.row)]),!0):!1}onMove(e,t,n){return n.altKey&&!$e.isModifierKeyDown(n)&&!n.shiftKey&&e.column!=null&&(e.row!=null||e.columnHeaderDepth!=null)?(this.cursor=this.irisGrid.props.copyCursor,!0):!1}}function pu(r,e,t){return(e=fu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fu(r){var e=gu(r,"string");return typeof e=="symbol"?e:e+""}function gu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Tc extends me{constructor(e){super(880),pu(this,"irisGrid",void 0),this.irisGrid=e}onDoubleClick(e,t){var n=e.column,i=e.row;return i==null||n==null||this.irisGrid.selectData(n,i),!1}}function bu(r,e,t){return(e=yu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yu(r){var e=Cu(r,"string");return typeof e=="symbol"?e:e+""}function Cu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Pc extends me{constructor(e){super(),bu(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var t=e.y,n=e.column,i=e.row;if(n!==null&&i===null){var o=this.irisGrid.state,a=o.isFilterBarShown,l=o.metrics;if(!l)throw new Error("Metrics not set");var s=l.columnHeaderMaxDepth,u=this.irisGrid.getTheme();if(a&&u.columnHeaderHeight!=null&&u.filterBarHeight!=null&&t>u.columnHeaderHeight*s&&t<=u.columnHeaderHeight*s+u.filterBarHeight)return this.irisGrid.focusFilterBar(n),!0}return!1}onMove(e){var t=e.y,n=e.column,i=this.irisGrid.state,o=i.isFilterBarShown,a=i.hoverAdvancedFilter,l=i.metrics;if(!l)throw new Error("Metrics not set");var s=l.columnHeaderMaxDepth,u=this.irisGrid.getTheme(),c=null;return o&&u.columnHeaderHeight!=null&&u.filterBarHeight!=null&&n!==null&&t>=u.columnHeaderHeight*s&&t<=u.columnHeaderHeight*s+u.filterBarHeight&&(c=n),c!==a&&this.irisGrid.setState({hoverAdvancedFilter:c}),!1}onLeave(e){var t=e.column,n=this.irisGrid.state.hoverAdvancedFilter;return n!==null&&t!==n&&this.irisGrid.setState({hoverAdvancedFilter:null}),!1}}function Su(r,e,t){return(e=wu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function wu(r){var e=Ou(r,"string");return typeof e=="symbol"?e:e+""}function Ou(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class xc extends me{constructor(e){super(750),Su(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 t=e.x,n=e.y,i=e.column,o=e.row;if(i==null||o==null)return null;var a=this.irisGrid,l=a.renderer,s=a.grid,u=a.state,c=a.props;if(!s)return null;var m=u.metrics,h=c.model,v=s.canvasContext,p=s.getTheme(),g={context:v,mouseX:t,mouseY:n,metrics:m,model:h,theme:p},b=Ve(h)?h.depthForRow(o):null,f=l.getExpandButtonPosition(g,b),S=f.left,y=f.top,w=f.width,T=f.height;return S==null||w==null||y==null||T==null?null:{left:S,top:y,width:w,height:T}}onMove(e,t){if(sr.isInTreeBox(e,t)){var n=this.irisGrid.state.expandCellTooltipProps,i=this.irisGrid.props.model,o=this.getButtonPosition(e),a=e.row;k(a);var l=Ve(i)&&i.isRowExpanded(a);Me(n,o)||this.irisGrid.setState({expandCellTooltipProps:o,expandTooltipDisplayValue:l?"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}}function pn(r,e,t){return(e=ju(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ju(r){var e=Tu(r,"string");return typeof e=="symbol"?e:e+""}function Tu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Dc extends me{constructor(e){super(),pn(this,"irisGrid",void 0),pn(this,"column",void 0),this.column=null,this.irisGrid=e}getColumnFromGridPoint(e){var t=e.column,n=e.row,i=e.columnHeaderDepth;return t!==null&&n===null&&i===0?t:null}onDown(e){return this.column=this.getColumnFromGridPoint(e),!1}onClick(e,t,n){var i=this.getColumnFromGridPoint(e);if(i!=null&&i===this.column){var o=$e.isModifierKeyDown(n);return this.irisGrid.toggleSort(i,o),!0}return!1}}class Nc extends me{constructor(e){super(),this.irisGrid=e}onWheel(e,t,n){var i=this.irisGrid,o=i.props.model,a=i.state,l=a.metrics,s=a.pendingRowCount;k(l);var u=l.bottom,c=l.rowCount,m=l.rowHeight,h=H.getScrollDelta(n),v=h.deltaY;return Gt(o)&&o.isEditable&&u>=c-1&&v>0&&i.setState({pendingRowCount:s+Math.ceil(v/m)}),!1}}function It(r,e,t){return(e=Pu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Pu(r){var e=xu(r,"string");return typeof e=="symbol"?e:e+""}function xu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ic extends Lo{constructor(e){super(),It(this,"irisGrid",void 0),It(this,"lastColumn",void 0),It(this,"lastRow",void 0),this.irisGrid=e,this.lastColumn=null,this.lastRow=null}destroyTooltip(){this.irisGrid.setState({hoverTooltipProps:null})}setCursor(e,t){return this.isHoveringLink(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}onMove(e,t){var n=this.irisGrid.props.model,i=this.isHoveringLink(e,t),o=this.irisGrid.getModelColumn(e.column),a=this.irisGrid.getModelRow(e.row),l=o!=null&&a!=null?n.tooltipForCell(o,a):null;if(i&&this.currentLinkBox!=null&&Ko(this.currentLinkBox.token)){var s=this.irisGrid.state.hoverTooltipProps,u=this.currentLinkBox,c=u.x1,m=u.y1,h=u.x2,v=u.y2,p=this.currentLinkBox.token.href,g=h-c,b=v-m,f={left:c,top:m+1,width:g,height:b};Me(s,f)||this.irisGrid.setState({hoverTooltipProps:f,hoverDisplayValue:d.jsxs(d.Fragment,{children:[p," - Click once to follow.",d.jsx("br",{}),"Click and hold to select this cell."]})})}else if(l!==null){var S=this.irisGrid.state.hoverTooltipProps,y={left:e.x,top:e.y+1,width:1,height:1};Me(S,y)||(S==null?this.irisGrid.setState({hoverTooltipProps:y,hoverDisplayValue:l}):(this.lastColumn!==e.column||this.lastRow!==e.row)&&this.irisGrid.setState({hoverTooltipProps:null},()=>this.irisGrid.setState({hoverTooltipProps:y,hoverDisplayValue:l})))}else this.destroyTooltip();return this.lastColumn=e.column,this.lastRow=e.row,this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}function Du(r,e,t){return(e=Nu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nu(r){var e=Iu(r,"string");return typeof e=="symbol"?e:e+""}function Iu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ec extends me{constructor(e){super(878),Du(this,"irisGrid",void 0),this.irisGrid=e}onDoubleClick(e,t){var n=e.column,i=e.row,o=this.irisGrid,a=o.props.model,l=o.state.partitionConfig;return i==null||n==null||!Yn(a)||l==null||l.mode!=="keys"?!1:(this.irisGrid.selectPartitionKeyFromTable(i),!0)}}function Eu(r){var e=new Map;return si(r,e),e}function ai(r){return r.children.length===0}function li(r,e,t){var n,i=(n=t.get(r.name))!==null&&n!==void 0?n:0;if(t.set(r.name,i+e),!ai(r)){var o=e/r.children.length;r.children.forEach(a=>li(a,o,t))}}function si(r,e){if(ai(r))return r.value;var t=r.children.map(s=>si(s,e)),n=t.reduce((s,u)=>s+u,0);if(r.value<=n){var i,o=n-r.value,a=(i=e.get(r.name))!==null&&i!==void 0?i:0;return e.set(r.name,a+o),n}var l=(r.value-n)/r.children.length;return r.children.forEach(s=>{li(s,l,e)}),r.value}var Au=["userColumnWidthsByName"];function Ru(r,e){if(r==null)return{};var t,n,i=ku(r,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(n=0;n<o.length;n++)t=o[n],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function ku(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function ke(r,e,t){return(e=Fu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Fu(r){var e=_u(r,"string");return typeof e=="symbol"?e:e+""}function _u(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ct extends Uo{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.userColumnWidthsByName,n=Ru(e,Au);super(n),ke(this,"userColumnWidthsByName",void 0),ke(this,"cachedModelColumnNames",void 0),ke(this,"cachedHeaderGroupNames",void 0),ke(this,"cachedPaddingMaps",new Map),ke(this,"getCachedCurrentModelColumnNames",ht(i=>i.map(o=>o.name))),ke(this,"getCachedCurrentHeaderGroupNames",ht(i=>i.map(o=>o.name))),this.userColumnWidthsByName=t??new Map}static getModelColumnRoot(e,t){for(var n=0,i=e.getColumnHeaderParentGroup(t,n),o=i;i!=null;)o=i,n+=1,i=e.getColumnHeaderParentGroup(t,n);return o}static buildNode(e,t,n,i){var o,a=t.columnHeaderGroupMap.get(e);if(a){var l=i(e),s=a.children.map(u=>ct.buildNode(u,t,n,i));return{name:e,children:s,value:l}}return{name:e,children:[],value:(o=n(e))!==null&&o!==void 0?o:0}}getHeaderPadding(e,t,n){var i,o=e.model,a=ct.getModelColumnRoot(o,t);if(a==null)return 0;var l=this.cachedPaddingMaps.get(a.name);if(l!=null){var s;return(s=l.get(o.columns[t].name))!==null&&s!==void 0?s:0}var u=ct.buildNode(a.name,o,m=>{var h=o.getColumnIndexByName(m);return k(h,"".concat(m," not found in model columns")),super.calculateColumnHeaderWidth(h,e,n)},m=>{var h=o.columnHeaderGroupMap.get(m);return k(h,"".concat(m," not found in columnHeaderGroupMap")),this.getColumnHeaderGroupWidth(h.childIndexes[0],h.depth,e,n)}),c=Eu(u);return this.cachedPaddingMaps.set(a.name,c),(i=c.get(o.columns[t].name))!==null&&i!==void 0?i:0}updateCalculatedColumnWidths(e){k(this.cachedModelColumnNames);var t=new Map;this.cachedModelColumnNames.forEach((n,i)=>{var o=this.calculatedColumnWidths.get(i);o!=null&&t.set(n,o)}),this.resetCalculatedColumnWidths(),t.forEach((n,i)=>{var o=e.getColumnIndexByName(i);o!=null&&this.calculatedColumnWidths.set(o,n)}),ur(this.calculatedColumnWidths)}updateUserColumnWidths(e){this.userColumnWidths=new Map,this.userColumnWidthsByName.forEach((t,n)=>{var i=e.getColumnIndexByName(n);i!=null&&super.setColumnWidth(i,t)})}updateColumnWidthsIfNecessary(e){var t=this.getCachedCurrentModelColumnNames(e.columns),n=this.cachedModelColumnNames==null;this.cachedModelColumnNames!=null&&this.cachedModelColumnNames!==t&&!Me(t,this.cachedModelColumnNames)?(this.updateCalculatedColumnWidths(e),this.updateUserColumnWidths(e),this.cachedPaddingMaps.clear()):n&&this.userColumnWidthsByName.size>0&&this.updateUserColumnWidths(e),this.cachedModelColumnNames=t,this.cachedHeaderGroupNames!=null&&!Me(this.getCachedCurrentHeaderGroupNames(e.columnHeaderGroups),this.cachedHeaderGroupNames)&&this.resetCalculatedColumnWidths(),this.cachedHeaderGroupNames=e.columnHeaderGroups.map(i=>i.name)}resetCalculatedHeaderGroupWidths(){this.cachedPaddingMaps.clear()}resetCalculatedColumnWidths(){super.resetCalculatedColumnWidths(),this.resetCalculatedHeaderGroupWidths()}getGridY(e){var t=super.getGridY(e),n=e.isFilterBarShown,i=e.theme,o=e.advancedFilters,a=e.quickFilters,l=e.sorts,s=e.reverse;return n?t+=i.filterBarHeight:(a!=null&&a.size>0||o!=null&&o.size>0)&&(t+=i.filterBarCollapsedHeight),s&&l!=null&&l.length>0&&(t+=i.reverseHeaderBarHeight),t}getMetrics(e){var t=e.model;return this.updateColumnWidthsIfNecessary(t),super.getMetrics(e)}setColumnWidth(e,t){super.setColumnWidth(e,t),k(this.cachedModelColumnNames,"setColumnWidth should be called after getMetrics");var n=this.cachedModelColumnNames[e];n!=null&&(this.userColumnWidthsByName.set(n,t),ur(this.userColumnWidthsByName))}resetColumnWidth(e){super.resetColumnWidth(e),k(this.cachedModelColumnNames,"resetColumnWidth should be called after getMetrics");var t=this.cachedModelColumnNames[e];t!=null&&this.userColumnWidthsByName.delete(t)}resetColumnWidthByName(e){if(this.userColumnWidthsByName.delete(e),this.cachedModelColumnNames!=null){var t=this.cachedModelColumnNames.indexOf(e);t>=0&&super.resetColumnWidth(t)}}resetAllColumnWidths(){this.userColumnWidths=new Map,this.userColumnWidthsByName=new Map}getUserColumnWidths(){return this.userColumnWidths}getUserColumnWidthsByName(){return this.userColumnWidthsByName}getCalculatedColumnWidths(){return this.calculatedColumnWidths}calculateColumnHeaderWidth(e,t,n){var i=t.model,o=i.getColumnHeaderParentGroup(e,0),a=super.calculateColumnHeaderWidth(e,t,n);if(o==null)return a;var l=this.getHeaderPadding(t,e,n);return a+l}getColumnHeaderGroupWidth(e,t,n,i){var o=n.model,a=n.theme,l=n.context,s=a.headerHorizontalPadding,u=a.headerFont;this.calculateLowerFontWidth(u,l),this.calculateUpperFontWidth(u,l);var c=s*2,m=o.textForColumnHeader(e,t),h=ei(o)&&o.isColumnExpandable(e),v=h?a.iconSize:0;return m!==void 0&&m!==""?this.calculateTextWidth(l,u,m,i-c)+c+v:c+v}getFilterInputCoordinates(e,t,n){if(e<0)return null;var i=t.theme,o=i.filterBarHeight,a=o===void 0?0:o,l=n.gridX,s=n.gridY,u=n.allColumnXs,c=n.allColumnWidths,m=u.get(e),h=c.get(e);return m==null||h==null||h===0||a===0?null:{x:l+m,y:s-a,width:h+1,height:a-1}}getScrollLeftForColumn(e,t,n){var i=n.left,o=n.rightVisible,a=n.lastLeft;if(e<0)return null;if(e<i)return e;if(o<e){var l=this.getLastLeft(t,e,this.getVisibleWidth(t));return Math.min(l,a)}return null}getAdvancedFilterButtonCoordinates(e,t,n){var i=this.getFilterInputCoordinates(e,t,n);if(i==null)return null;var o=i.x,a=i.y,l=i.width;return{x:o+l-25,y:a+2}}}var $u=new Map([["sortUp",Oo],["sortDown",ar],["caretDown",ar],["caretRight",jo],["cellOverflow",To]]),Mu=Zn((r,e)=>{var t=$u.get(r);if(t===void 0)throw new Error("Icon is undefined");var n=Array.isArray(t.icon[4])?t.icon[4][0]:t.icon[4],i=new Path2D(n),o=new Path2D,a={a:e/t.icon[0],d:e/t.icon[1]};return o.addPath(i,a),o},{max:1e3});function Ke(r,e){return Mu(r,e)}class ui{static drawTreeMarker(e,t,n,i,o,a,l){e.save();var s=t.theme,u=s.iconSize,c=o.x1,m=o.x2,h=o.y1,v=o.y2,p=Ke(l?"caretDown":"caretRight",u),g=n+(c+m)/2-u/2,b=i+(v-h-u)/2;e.fillStyle=a,e.textAlign="center",e.translate(g,b),e.fill(p),e.restore()}}class Gu extends Ho{drawCellContent(e,t,n,i){var o,a=t.metrics,l=t.model,s=a.modelColumns,u=a.modelRows,c=ce(u,i),m=s.get(n);if(m!==void 0){var h=l.valueForCell(m,c);if(K.isTextType((o=l.columns[m])===null||o===void 0?void 0:o.type)&&(h===null||h==="")){var v=e.font;e.font="italic ".concat(v),super.drawCellContent(e,t,n,i),e.font=v;return}super.drawCellContent(e,t,n,i)}}getTextRenderMetrics(e,t,n){var i=H.getTextRenderMetrics(e,t,n),o=e.mouseX,a=e.mouseY,l=e.metrics,s=e.theme;if(o==null||a==null)return i;var u=H.getGridPointFromXY(o,a,l),c=u.column,m=u.row;if(t===c&&n===m){var h=this.getCellOverflowButtonPosition(o,a,l,s),v=h.left;this.shouldRenderOverflowButton(e)&&v!=null&&(i.width=v-l.gridX-i.x)}return i}getCellOverflowButtonPosition(e,t,n,i){var o={left:null,top:null,width:null,height:null};if(e==null||t==null||n==null)return o;var a=H.getCellInfoFromXY(e,t,n),l=a.rowHeight,s=a.columnWidth,u=a.left,c=a.top;if(u==null||s==null||c==null)return o;var m=n.width,h=n.verticalBarWidth,v=i.cellHorizontalPadding,p=i.iconSize,g=p+2*v,b=l,f=Math.min(n.gridX+u+s,m-h),S=f-g,y=n.gridY+c;return{left:S,top:y,width:g,height:b}}shouldRenderOverflowButton(e){var t,n=e.context,i=e.mouseX,o=e.mouseY,a=e.metrics,l=e.model,s=e.theme;if(i==null||o==null)return!1;var u=H.getCellInfoFromXY(i,o,a),c=u.row,m=u.column,h=u.modelRow,v=u.modelColumn;if(c==null||m==null||h==null||v==null||l.columns[v]==null||!K.isStringType(l.columns[v].type))return!1;var p=(t=l.textForCell(v,h))!==null&&t!==void 0?t:"",g=H.getTextRenderMetrics(e,m,c),b=g.width,f=a.fontWidthsLower.get(s.font),S=a.fontWidthsUpper.get(s.font);n.save(),n.font=s.font;var y=this.getCachedTruncatedString(n,p,b,f,S,l.truncationCharForCell(v,h));return n.restore(),p!==""&&y!==p}drawTreeMarker(e,t,n,i,o,a,l){ui.drawTreeMarker(e,t,n,i,o,a,l)}}class Lu extends Bo{drawTreeMarker(e,t,n,i,o,a,l){ui.drawTreeMarker(e,t,n,i,o,a,l)}}function fn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function gn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fn(Object(t),!0).forEach(function(n){Lt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):fn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Lt(r,e,t){return(e=Uu(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Uu(r){var e=Hu(r,"string");return typeof e=="symbol"?e:e+""}function Hu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Et=Object.freeze({SORT_UP:"sortUp",SORT_DOWN:"sortDown",CARET_DOWN:"caretDown",CARET_RIGHT:"caretRight",CELL_OVERFLOW:"cellOverflow"}),bn=10;class Ut extends qn{constructor(){super(...arguments),Lt(this,"textCellRenderer",new Gu),Lt(this,"dataBarCellRenderer",new Lu)}static isFilterValid(e,t){var n=e==null||e.filter!=null,i=t==null||t.filter!=null;return n&&i}getSortIcon(e,t){return e?e.direction===K.sortDirection.ascending?Ke(Et.SORT_UP,t):e.direction===K.sortDirection.descending?Ke(Et.SORT_DOWN,t):null:null}drawCanvas(e){super.drawCanvas(e),this.drawScrim(e)}drawGrid(e,t){super.drawGrid(e,t),this.drawCellOverflowButton(t)}drawGridLines(e,t){super.drawGridLines(e,t),this.drawGroupedColumnLine(e,t),this.drawPendingRowLine(e,t)}drawCellContent(e,t,n,i){var o=t.metrics,a=t.model,l=o.modelColumns,s=o.modelRows,u=l.get(n),c=ce(s,i);if(u!==void 0){var m=a.renderTypeForCell(u,c),h=this.getCellRenderer(m);h.drawCellContent(e,t,n,i)}}getCellOverflowButtonPosition(e){var t=e.mouseX,n=e.mouseY,i=e.metrics,o=e.theme;return this.textCellRenderer.getCellOverflowButtonPosition(t,n,i,o)}shouldRenderOverflowButton(e){return this.textCellRenderer.shouldRenderOverflowButton(e)}drawCellOverflowButton(e){var t=e.context,n=e.mouseX,i=e.mouseY,o=e.theme;if(!(n==null||i==null)&&this.shouldRenderOverflowButton(e)){var a=this.getCellOverflowButtonPosition(e),l=a.left,s=a.top,u=a.width,c=a.height,m=o.cellHorizontalPadding,h=o.overflowButtonColor,v=o.overflowButtonHoverColor,p=o.iconSize;t.save(),v!=null&&l!=null&&u!=null&&s!=null&&c!=null&&n>=l&&n<=l+u&&i>=s&&i<=s+c?t.fillStyle=v:h!=null&&(t.fillStyle=h);var g=Ke(Et.CELL_OVERFLOW,p);l!=null&&s!=null&&c!=null&&t.translate(l+m,s+(c-p)/2),t.fill(g),t.restore()}}drawGroupedColumnLine(e,t){var n=t.metrics,i=t.model,o=t.theme,a=i.groupedColumns,l=n.maxY,s=n.allColumnWidths,u=n.allColumnXs;if(!(a.length===0||o.groupedColumnDividerColor==null)){var c=a.length-1,m=u.get(c),h=s.get(c);if(!(m==null||h==null)){var v=m+h+.5;e.strokeStyle=o.groupedColumnDividerColor,e.lineWidth=1,e.beginPath(),e.moveTo(v,0),e.lineTo(v,l),e.stroke()}}}drawPendingRowLine(e,t){var n=t.metrics,i=t.model,o=t.theme,a=n.allRowYs,l=n.maxX,s=i.pendingRowCount;if(!(s<=0)){var u=i.rowCount-i.pendingRowCount-i.floatingBottomRowCount,c=a.get(u);c!=null&&(c-=.5,e.save(),e.setLineDash([4,2]),e.strokeStyle=o.pendingTextColor,e.lineWidth=1,e.beginPath(),e.moveTo(0,c),e.lineTo(l,c),e.stroke(),e.restore())}}drawMouseColumnHover(e,t){var n=t.theme,i=t.metrics,o=t.hoverSelectColumn;if(!(o==null||n.linkerColumnHoverBackgroundColor==null)){var a=i.allColumnWidths,l=i.allColumnXs,s=i.maxY,u=ce(l,o),c=ce(a,o);e.fillStyle=n.linkerColumnHoverBackgroundColor,e.fillRect(u,0,c,s)}}drawMouseRowHover(e,t){var n=t.isSelectingColumn;n||super.drawMouseRowHover(e,t)}drawScrim(e){var t=e.context,n=e.loadingScrimProgress,i=e.metrics,o=e.theme;if(n!=null){var a=i.width,l=i.height,s=i.gridY,u=o.scrimBlurSize,c=o.scrimColor;t.save(),t.globalCompositeOperation="color",t.filter="blur(".concat(u,"px)"),c!=null&&(t.fillStyle=c),t.beginPath(),t.rect(0,s,a,l-s),t.clip(),t.fillRect(-u,-u+s,u*2+a,(u*2+(l-s))*n),t.globalCompositeOperation="source-over",t.filter="blur(".concat(u,"px) opacity(15%)"),t.fillRect(-u,-u+s,u*2+a,(u*2+(l-s))*n),t.restore()}}drawColumnHeaders(e,t){super.drawColumnHeaders(e,t);var n=t.theme,i=t.metrics,o=t.model,a=t.reverse,l=i.columnHeaderHeight;if(this.drawFilterHeaders(e,t),!(l<=0)){var s=o.sort;if(s.length===1){var u;a?u=n.headerReverseBarColor:u=n.headerSortBarColor,this.drawHeaderBar(e,t,u,a?n.reverseHeaderBarHeight:n.sortHeaderBarHeight)}else s.length>1&&(a&&this.drawHeaderBar(e,t,n.headerReverseBarColor,n.reverseHeaderBarHeight,!1),this.drawHeaderBar(e,t,n.headerSortBarColor,n.sortHeaderBarHeight))}}drawHeaderBar(e,t,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=t.theme,l=t.metrics,s=t.model,u=l.columnHeaderHeight,c=l.width,m=0;o||(m=i),e.fillStyle=a.headerBarCasingColor,e.fillRect(0,s.columnHeaderMaxDepth*u-i-2+m,c,i+2),e.fillStyle=n,e.fillRect(0,s.columnHeaderMaxDepth*u-i-1+m,c,i)}drawColumnHeadersAtDepth(e,t,n,i,o){var a=t.metrics,l=t.model,s=t.isMenuShown,u=t.theme,c=l.columnHeaderMaxDepth,m=a.width,h=u.columnHeaderHeight,v=gn(gn({},i),{},{maxX:o===c-1&&i.maxX===m?m-(s?0:h):i.maxX});super.drawColumnHeadersAtDepth(e,t,n,v,o)}drawColumnHeaderAtIndex(e,t,n,i){var o;super.drawColumnHeaderAtIndex(e,t,n,i);var a=t.metrics,l=t.model,s=t.theme,u=a.modelColumns,c=a.allColumnWidths,m=a.allColumnXs,h=a.gridX,v=a.columnHeaderHeight,p=s.headerHorizontalPadding,g=s.iconSize,b=Math.round(g*.75),f=ce(c,n,0),S=ce(m,n)+h,y=u.get(n);if(y!=null){var w=(o=l.columns[y])===null||o===void 0?void 0:o.name;if(w!=null){var T=K.getSortForColumn(l.sort,w);if(T){var x=this.getSortIcon(T,b);if(x){var D=l.textForColumnHeader(y);if(D!==void 0){var A=this.getCachedHeaderWidth(e,D),R=h+S+A+p,E=i.maxX;E-=p;var N=h+S+f-b,I=R>E?R+1:Math.min(E,N),F=(v-b)*.5;e.save(),e.beginPath(),e.rect(S,0,f,v),e.clip(),e.fillStyle=s.headerSortBarColor,e.translate(I,F),e.fill(x),e.restore()}}}}}}drawFilterHeaders(e,t){var n=t.isFilterBarShown,i=t.quickFilters,o=t.advancedFilters;n?this.drawExpandedFilterHeaders(e,t):(i!=null&&i.size>0||o!=null&&o.size>0)&&this.drawCollapsedFilterHeaders(e,t)}drawExpandedFilterHeaders(e,t){var n=t.metrics,i=t.model,o=t.theme,a=t.quickFilters,l=t.advancedFilters,s=o.filterBarHeight;if(!(s<=0)){var u=n.gridX,c=n.gridY,m=n.maxX,h=n.modelColumns,v=n.visibleColumns,p=n.allColumnWidths,g=n.allColumnXs,b=c-s;e.save(),e.font=o.filterBarFont,e.textAlign="left",a!=null&&a.size>0||l!=null&&l.size>0?e.fillStyle=o.filterBarExpandedActiveBackgroundColor:e.fillStyle=o.filterBarExpandedBackgroundColor,e.fillRect(u,b,m,s-1),e.fillStyle=o.headerBarCasingColor,e.fillRect(u,b+s-1,m,1);var f=b;e.strokeStyle=o.filterBarSeparatorColor,e.beginPath();for(var S=0;S<v.length;S+=1){var y=v[S],w=ce(h,y),T=ce(g,y),x=ce(p,y);if(i.isFilterable(w)&&x>0){var D=u+(T??0);e.rect(D+.5,f+.5,x,s-2)}}e.stroke();for(var A=0;A<v.length;A+=1){var R=v[A],E=ce(p,R),N=ce(g,R),I=N+u;this.drawExpandedFilterHeader(e,t,R,I,E)}e.restore()}}drawExpandedFilterHeader(e,t,n,i,o){if(!(o<=0)){var a=t.metrics,l=t.theme,s=t.quickFilters,u=t.advancedFilters,c=a.modelColumns,m=a.gridY,h=l.filterBarHeight,v=l.filterBarExpandedActiveCellBackgroundColor,p=l.filterBarErrorColor,g=l.filterBarHorizontalPadding,b=l.headerColor,f=m-h,S=c.get(n);if(S!==void 0){var y=s.get(S),w=u.get(S);if(!(y==null&&w==null)){var T=null;if(y!=null){var x=y.text;if(T=x,T||(T=K.getFilterText(y.filter)),T!=null){var D=a.fontWidthsLower,A=a.fontWidthsUpper,R=D.get(e.font),E=A.get(e.font),N=o-g*2;T=this.textCellRenderer.getCachedTruncatedString(e,T,N,R,E)}}e.save();var I=Ut.isFilterValid(w,y);if(I&&v!=null)e.fillStyle=v,e.fillRect(i+1,f+1,o-1,h-3);else if(p!=null){e.fillStyle=p,e.lineWidth=2,e.strokeStyle=p;var F=i+2,U=f+2,M=o-3,G=h-5;e.strokeRect(F,U,M,G)}if(T!=null&&T!==""){var O=i+g,P=f+h*.5+1;e.fillStyle=b,e.fillText(T,O,P)}e.restore()}}}}drawCollapsedFilterHeaders(e,t){var n=t.metrics,i=t.theme,o=i.headerSeparatorColor,a=i.filterBarCollapsedHeight;if(!(a<=0)){var l=n.gridX,s=n.gridY,u=n.maxX,c=n.visibleColumns,m=n.allColumnWidths,h=n.allColumnXs,v=s-a;e.save(),e.fillStyle=o,e.fillRect(l,v,u,a);for(var p=0;p<c.length;p+=1){var g=c[p],b=m.get(g),f=h.get(g);if(f!=null&&b!=null){var S=f+l;this.drawCollapsedFilterHeader(e,t,g,S,b)}}e.restore()}}drawCollapsedFilterHeader(e,t,n,i,o){if(!(o<=0)){var a=t.metrics,l=t.theme,s=t.quickFilters,u=t.advancedFilters,c=a.modelColumns,m=a.gridY,h=c.get(n);if(h!==void 0){var v=s.get(h),p=u.get(h),g=l.filterBarCollapsedHeight,b=l.filterBarActiveColor,f=l.filterBarActiveBackgroundColor,S=l.filterBarErrorColor;e.save();var y=Ut.isFilterValid(p,v);f!=null&&v==null&&p==null?e.fillStyle=f:b!=null&&y?e.fillStyle=b:S!=null&&(e.fillStyle=S);var w=i+1,T=m-g,x=o-1,D=g-1;e.fillRect(w,T,x,D),e.restore()}}}drawRowFooters(e,t){var n=t.metrics,i=t.model,o=t.mouseX,a=t.mouseY,l=t.theme,s=n.gridY,u=n.gridX,c=n.maxX,m=n.modelRows,h=n.floatingTopHeight,v=n.floatingBottomHeight,p=n.floatingRows,g=n.rowFooterWidth,b=n.height,f=n.horizontalBarHeight,S=n.verticalBarWidth,y=n.allRowHeights,w=n.allRowYs,T=n.width;if(!(g<=0||p.length===0)){var x=l.cellHorizontalPadding,D=l.floatingGridRowColor,A=l.floatingRowBackgroundColors,R=l.headerColor,E=l.rowHoverBackgroundColor;e.translate(u,s),e.beginPath();var N=Math.min(c,T-g-S-u);e.fillStyle=A,h>0&&e.rect(N,0,g,h),v>0&&e.rect(N,b-s-f-v,g,v),e.fill();var I=o!=null&&a!=null&&o>=u&&o<=c+g?H.getRowAtY(a,n):null;if(E!=null&&I!==null&&p.includes(I)){e.fillStyle=E;var F=w.get(I),U=y.get(I);k(F),k(U),e.fillRect(N,F,g,U)}if(e.beginPath(),D!=null&&(e.strokeStyle=D),h>0&&(e.moveTo(N+.5,.5),e.lineTo(N+.5,h-.5)),v>0){var M=b-s-f-v;e.moveTo(N-.5,M+.5),e.lineTo(N-.5,M+v-.5)}e.stroke(),e.fillStyle=R,e.textAlign="left";for(var G=N+x,O=0;O<p.length;O+=1){var P=p[O],_=y.get(P),L=w.get(P),z=m.get(P);if(L!=null&&_!=null&&z!=null){var q=L+_*.5;e.fillText(i.textForRowFooter(z),G,q)}}e.translate(-u,-s)}}getExpandButtonPosition(e,t){var n=e.mouseX,i=e.mouseY,o=e.metrics,a=e.theme,l={left:null,top:null,width:null,height:null};if(n==null||i==null||t==null||!o)return l;var s=H.getCellInfoFromXY(n,i,o),u=s.rowHeight,c=s.left,m=s.top;if(c==null||u==null||m==null)return l;var h=a.cellHorizontalPadding,v=bn+2*h,p=Math.max(c+bn*t,o.gridX),g=o.gridY+m;return{left:p,top:g,width:v,height:u}}}const Bu="12px Fira Sans, sans-serif",Wu="var(--dh-color-white)",zu="var(--dh-color-black)",yn={"grid-bg":"var(--dh-color-grid-bg)",font:Bu,white:Wu,black:zu,"header-bg":"var(--dh-color-grid-header-bg)","header-color":"var(--dh-color-grid-header-text)","header-height":"30px","header-separator-color":"var(--dh-color-grid-header-separator)","header-separator-hover-color":"var(--dh-color-grid-header-separator-hover)","header-hidden-separator-hover-color":"var(--dh-color-grid-header-separator-hidden-hover)","header-sort-bar-color":"var(--dh-color-grid-header-sort-bar)","header-reverse-bar-color":"var(--dh-color-grid-header-reverse-bar)","header-bar-casing-color":"var(--dh-color-grid-header-bar-casing)","header-font":"600 12px Fira Sans, sans-serif","row-height":"19px","row-background-colors":"var(--dh-color-grid-row-0-bg) var(--dh-color-grid-row-1-bg)","active-cell-selection-border-width":"2px","selection-color":"var(--dh-color-grid-selection)","selection-outline-color":"var(--dh-color-grid-selection-outline)","selection-outline-casing-color":"var(--dh-color-grid-selection-outline-casing)","row-hover-bg":"var(--dh-color-grid-row-hover-bg)","row-shadow-alpha":"var(--dh-color-grid-row-shadow-alpha)","selected-row-hover-bg":"var(--dh-color-grid-row-hover-bg-selected)","scroll-bar-active-selection-tick-color":"var(--dh-color-grid-scroll-bar-active-selection-tick)","scroll-bar-bg":"var(--dh-color-grid-scroll-bar-bg)","scroll-bar-hover-bg":"var(--dh-color-grid-scroll-bar-hover-bg)","scroll-bar-casing-color":"var(--dh-color-grid-scroll-bar-casing)","scroll-bar-corner-color":"var(--dh-color-grid-scroll-bar-corner)","scroll-bar-color":"var(--dh-color-grid-scroll-bar)","scroll-bar-hover-color":"var(--dh-color-grid-scroll-bar-hover)","scroll-bar-active-color":"var(--dh-color-grid-scroll-bar-active)","text-color":"var(--dh-color-grid-text)","hyperlink-color":"var(--dh-color-grid-text-hyperlink)","positive-number-color":"var(--dh-color-grid-number-positive)","negative-number-color":"var(--dh-color-grid-number-negative)","zero-number-color":"var(--dh-color-grid-number-zero)","date-color":"var(--dh-color-grid-date)","pending-text-color":"var(--dh-color-grid-text-pending)","error-text-color":"var(--dh-color-grid-text-error)","null-string-color":"var(--dh-color-grid-string-null)","filter-bar-active-bg":"var(--dh-color-grid-filter-bar-active-bg)","filter-bar-active-color":"var(--dh-color-grid-filter-bar-active)","filter-bar-expanded-bg":"var(--dh-color-grid-filter-bar-expanded-bg)","filter-bar-expanded-active-bg":"var(--dh-color-grid-filter-bar-expanded-active-bg)","filter-bar-expanded-active-cell-bg":"var(--dh-color-grid-filter-bar-expanded-active-cell-bg)","filter-bar-separator-color":"var(--dh-color-grid-filter-bar-separator)","filter-bar-error-color":"var(--dh-color-grid-filter-bar-error)","filter-icon-color":"var(--dh-color-grid-filter-icon)","scrim-color":"var(--dh-color-grid-scrim)","context-menu-sort-icon-color":"var(--dh-color-grid-context-menu-sort-icon)","context-menu-reverse-icon-color":"var(--dh-color-grid-context-menu-reverse-icon)","linker-column-hover-bg":"var(--dh-color-grid-column-linker-hover-bg)","tree-line-color":"var(--dh-color-grid-tree-line)","tree-marker-color":"var(--dh-color-grid-tree-marker)","tree-marker-hover-color":"var(--dh-color-grid-tree-marker-hover)","grouped-column-divider-color":"var(--dh-color-grid-column-grouped-divider)","floating-grid-row-color":"var(--dh-color-grid-floating-row)","floating-row-background-colors":"var(--dh-color-grid-floating-row-bg)","floating-divider-inner-color":"var(--dh-color-grid-floating-divider-inner)","floating-divider-outer-color":"var(--dh-color-grid-floating-divider-outer)","overflow-button-color":"var(--dh-color-grid-overflow-button)","overflow-button-hover-color":"var(--dh-color-grid-overflow-button-hover)","zero-line-color":"var(--dh-color-grid-data-bar-zero-line)","positive-bar-color":"var(--dh-color-grid-data-bar-positive)","negative-bar-color":"var(--dh-color-grid-data-bar-negative)","marker-bar-color":"var(--dh-color-grid-data-bar-marker)"};function Cn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Sn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cn(Object(t),!0).forEach(function(n){Vu(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Cn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Vu(r,e,t){return(e=Ku(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ku(r){var e=Qu(r,"string");return typeof e=="symbol"?e:e+""}function Qu(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Xu(r,e){return Ju(r)||Zu(r,e)||qu(r,e)||Yu()}function Yu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
21
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qu(r,e){if(r){if(typeof r=="string")return wn(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?wn(r,e):void 0}}function wn(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Zu(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function Ju(r){if(Array.isArray(r))return r}var On=de.module("IrisGridTheme");function ed(){var r,e=Po(yn);return e["row-background-colors"]=xo((r=e["row-background-colors"])!==null&&r!==void 0?r:"").map(t=>{var n=Xu(t,2),i=n[0],o=n[1];return Do.normalizeCssColor(e["row-background-colors"].substring(i,o+1))}).join(" "),On.debug2("Iris grid theme:",yn),On.debug2("Iris grid theme derived:",e),Object.freeze(Sn(Sn({},Wo),{},{backgroundColor:e["grid-bg"],white:e.white,black:e.black,font:e.font,filterBarFont:e.font,headerBackgroundColor:e["header-bg"],headerColor:e["header-color"],headerSeparatorColor:e["header-separator-color"],headerSeparatorHoverColor:e["header-separator-hover-color"],headerHiddenSeparatorHoverColor:e["header-hidden-separator-hover-color"],headerSortBarColor:e["header-sort-bar-color"],headerReverseBarColor:e["header-reverse-bar-color"],headerBarCasingColor:e["header-bar-casing-color"],headerFont:e["header-font"],rowBackgroundColors:e["row-background-colors"],rowHoverBackgroundColor:e["row-hover-bg"],selectionColor:e["selection-color"],selectionOutlineColor:e["selection-outline-color"],selectionOutlineCasingColor:e["selection-outline-casing-color"],selectedRowHoverBackgroundColor:e["selected-row-hover-bg"],scrollBarBackgroundColor:e["scroll-bar-bg"],scrollBarHoverBackgroundColor:e["scroll-bar-hover-bg"],scrollBarCasingColor:e["scroll-bar-casing-color"],scrollBarCornerColor:e["scroll-bar-corner-color"],scrollBarColor:e["scroll-bar-color"],scrollBarHoverColor:e["scroll-bar-hover-color"],scrollBarActiveColor:e["scroll-bar-active-color"],scrollBarSelectionTickColor:e["selected-row-hover-bg"],scrollBarActiveSelectionTickColor:e["scroll-bar-active-selection-tick-color"],textColor:e["text-color"],hyperlinkColor:e["hyperlink-color"],positiveNumberColor:e["positive-number-color"],negativeNumberColor:e["negative-number-color"],zeroNumberColor:e["zero-number-color"],dateColor:e["date-color"],pendingTextColor:e["pending-text-color"],errorTextColor:e["error-text-color"],nullStringColor:e["null-string-color"],filterBarActiveBackgroundColor:e["filter-bar-active-bg"],filterBarExpandedBackgroundColor:e["filter-bar-expanded-bg"],filterBarExpandedActiveBackgroundColor:e["filter-bar-expanded-active-bg"],filterBarExpandedActiveCellBackgroundColor:e["filter-bar-expanded-active-cell-bg"],filterBarSeparatorColor:e["filter-bar-separator-color"],filterBarActiveColor:e["filter-bar-active-color"],filterBarErrorColor:e["filter-bar-error-color"],filterIconColor:e["filter-icon-color"],scrimColor:e["scrim-color"],contextMenuSortIconColor:e["context-menu-sort-icon-color"],contextMenuReverseIconColor:e["context-menu-reverse-icon-color"],allowRowResize:!1,autoSelectRow:!0,gridColumnColor:null,gridRowColor:null,groupedColumnDividerColor:e["grouped-column-divider-color"],columnHoverBackgroundColor:null,headerHorizontalPadding:12,scrollBarSize:13,scrollBarHoverSize:16,minScrollHandleSize:24,rowHeight:parseInt(e["row-height"],10)||19,columnWidth:100,rowHeaderWidth:0,rowFooterWidth:90,columnHeaderHeight:parseInt(e["header-height"],10)||30,filterBarHeight:30,filterBarCollapsedHeight:5,sortHeaderBarHeight:2,reverseHeaderBarHeight:4,filterBarHorizontalPadding:4,iconSize:16,activeCellSelectionBorderWidth:parseInt(e["active-cell-selection-border-width"],10)||2,shadowAlpha:parseFloat(e["row-shadow-alpha"])||.15,scrimBlurSize:25,minScrimTransitionTime:150,maxScrimTransitionTime:350,scrollSnapToRow:!0,linkerColumnHoverBackgroundColor:e["linker-column-hover-bg"],treeLineColor:e["tree-line-color"],treeMarkerColor:e["tree-marker-color"],treeMarkerHoverColor:e["tree-marker-hover-color"],floatingGridColumnColor:null,floatingGridRowColor:e["floating-grid-row-color"],floatingRowBackgroundColors:e["floating-row-background-colors"],floatingDividerInnerColor:e["floating-divider-inner-color"],floatingDividerOuterColor:e["floating-divider-outer-color"],overflowButtonColor:e["overflow-button-color"],overflowButtonHoverColor:e["overflow-button-hover-color"],zeroLineColor:e["zero-line-color"],positiveBarColor:e["positive-bar-color"],negativeBarColor:e["negative-bar-color"],markerBarColor:e["marker-bar-color"],density:{compact:{cellHorizontalPadding:5,headerHorizontalPadding:10,minColumnWidth:10,rowHeight:16,font:"11px Fira Sans, sans-serif",iconSize:14,columnHeaderHeight:26},spacious:{cellHorizontalPadding:7,headerHorizontalPadding:15,rowHeight:28}}}))}var jn=de.module("useTableListener"),di=(r,e,t)=>C.useEffect(function(){if(r==null){jn.debug2("Emitter undefined, skipping addEventListener",e);return}return jn.debug2("Adding listener",e),r.addEventListener(e,t)},[r,e,t]);function ci(r,e){return e==null?r.columns[0]:r.findColumn(e)}function hi(r,e,t){return t==null?e:r.findColumn(t)}function td(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"?r:String(r)}function rd(r,e){return String(r)}function nd(r){var e=r.table,t=r.descriptionColumnName,n=r.iconColumnName,i=r.keyColumnName,o=r.labelColumnName,a=r.formatValue,l=a===void 0?rd:a,s=C.useMemo(()=>e==null?null:ci(e,i),[i,e]),u=C.useMemo(()=>e==null||s==null?null:hi(e,s,o),[s,o,e]),c=C.useMemo(()=>e==null||t==null?null:e.findColumn(t),[t,e]),m=C.useMemo(()=>e==null||n==null?null:e.findColumn(n),[n,e]),h=C.useCallback(v=>{k(s,"keyColumn cannot be null."),k(u,"labelColumn cannot be null.");var p=td(v.get(s)),g=l(v.get(u),u.type),b=c==null?void 0:l(v.get(c),c.type),f=m==null?void 0:v.get(m);return{key:p,content:g,textValue:g,description:b,icon:f}},[c,l,m,s,u]);return h}function id(r){var e=ft(),t=C.useMemo(()=>{var l=Xo(e,r);return $n(l),l},[e,r]),n=t.getColumnFormat,i=t.getColumnFormatMapForType,o=t.getColumnTypeFormatter,a=t.getFormattedString;return{getColumnFormat:n,getColumnFormatMapForType:i,getColumnTypeFormatter:o,getFormattedString:a,timeZone:t.timeZone}}function mi(){var r=ft();return C.useMemo(()=>new K(r),[r])}function od(r,e){return ud(r)||sd(r,e)||ld(r,e)||ad()}function ad(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
22
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ld(r,e){if(r){if(typeof r=="string")return Tn(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Tn(r,e):void 0}}function Tn(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function sd(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function ud(r){if(Array.isArray(r))return r}function vi(r){var e=C.useState(0),t=od(e,2),n=t[1],i=ft(),o=C.useCallback(()=>{n(a=>a+1)},[]);return di(r,i.Table.EVENT_SIZECHANGED,o),Mn(r)}var dd=de.module("useInitializeViewportData");function cd(r){var e=r.items,t=r.targetSize,n=r.reuseExistingItems,i=e.length;return i===t?e:(dd.debug("size changed:",{currentSize:i,targetSize:t}),n?i>t?e.slice(0,t):[...e,...Zt(i,t-1)]:Array.from(Zt(0,t-1)))}function hd(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=ta({}),n=Math.max(0,vi(r));return C.useEffect(()=>{t.setItems(cd({items:t.items,targetSize:n,reuseExistingItems:e}))},[n,r]),t}function Pn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function xn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pn(Object(t),!0).forEach(function(n){md(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Pn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function md(r,e,t){return(e=vd(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function vd(r){var e=pd(r,"string");return typeof e=="symbol"?e:e+""}function pd(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function fd(r,e){return Cd(r)||yd(r,e)||bd(r,e)||gd()}function gd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
23
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bd(r,e){if(r){if(typeof r=="string")return Dn(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Dn(r,e):void 0}}function Dn(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function yd(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function Cd(r){if(Array.isArray(r))return r}function Sd(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=C.useRef(null),o=C.useRef(null),a=C.useRef(null),l=()=>{i.current&&(i.current.close(),i.current=null)};return(o.current!==r||a.current!==n)&&(o.current=r,a.current=n,l()),C.useEffect(()=>l,[]),C.useCallback(function(u){if(r!=null){var c=Ni(u,e,t,Mn(r)),m=fd(c,2),h=m[0],v=m[1];if(i.current==null&&n!=null&&!K.isTreeTable(r)){var p,g,b=xn(xn({},n),{},{rows:(p=n.rows)!==null&&p!==void 0?p:{first:h,last:v},columns:(g=n.columns)!==null&&g!==void 0?g:r.columns});i.current=r.createViewportSubscription(b)}if(i.current==null){r.setViewport(h,v);return}i.current.update({rows:{first:h,last:v},columns:r.columns})}},[r,t,e,n])}var wd=150,Od=200,jd=250,Td=500,At=de.module("useViewportData");function Pd(r){var e=r.table,t=r.itemHeight,n=t===void 0?1:t,i=r.scrollDebounce,o=i===void 0?wd:i,a=r.viewportSize,l=a===void 0?10:a,s=r.viewportPadding,u=s===void 0?50:s,c=r.deserializeRow,m=c===void 0?Ei:c,h=r.reuseItemsOnTableResize,v=h===void 0?!1:h,p=r.viewportSubscriptionOptions,g=p===void 0?null:p,b=C.useRef(0),f=hd(e,v),S=Sd(e,l,u,g),y=C.useCallback(E=>{b.current=E,e&&!Ft(e)?S(E):At.debug("setViewport called on closed table.",e)},[e,S]),w=C.useCallback(E=>{e&&!Ft(e)?(e.applyFilter(E),y(0)):At.debug("applyFiltersAndRefresh called on closed table.",e)},[y,e]),T=ft(),x=C.useRef();x.current=C.useMemo(()=>Ii(f,m),[m,f]);var D=C.useCallback(E=>{var N;(N=x.current)===null||N===void 0||N.call(x,E)},[]);di(e,T.Table.EVENT_UPDATED,D);var A=vi(e);C.useEffect(()=>{At.debug("Initializing viewport"),y(0)},[e,y]),C.useEffect(()=>{y(b.current)},[y,A]);var R=Yo(n,y,o);return C.useMemo(()=>({viewportData:f,size:A,table:e,applyFiltersAndRefresh:w,setViewport:y,onScroll:R}),[w,R,y,A,e,f])}function xd(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return C.useMemo(()=>Ai(...t.map(i=>i(r))),[r,...t])}function Dd(r,e){var t=r.applyFiltersAndRefresh;C.useEffect(()=>{t(e)},[t,e])}var Nd=["additionalFilterConditionFactories","searchColumnNames","timeZone"];function Nn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Rt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nn(Object(t),!0).forEach(function(n){Id(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Nn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Id(r,e,t){return(e=Ed(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ed(r){var e=Ad(r,"string");return typeof e=="symbol"?e:e+""}function Ad(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Rd(r,e){return $d(r)||_d(r,e)||Fd(r,e)||kd()}function kd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
24
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fd(r,e){if(r){if(typeof r=="string")return In(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?In(r,e):void 0}}function In(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function _d(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function $d(r){if(Array.isArray(r))return r}function Md(r,e){if(r==null)return{};var t,n,i=Gd(r,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(n=0;n<o.length;n++)t=o[n],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function Gd(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function Ld(r){var e=r.additionalFilterConditionFactories,t=e===void 0?[]:e,n=r.searchColumnNames,i=r.timeZone,o=Md(r,Nd),a=mi(),l=C.useState(""),s=Rd(l,2),u=s[0],c=s[1],m=C.useMemo(()=>Ri(a,n,u,i),[n,u,a,i]),h=ki(c,Od),v=Pd(Rt({itemHeight:ko,viewportSize:Td,viewportPadding:jd},o)),p=xd(v.table,m,...t);return Dd(v,p),Rt(Rt({},v),{},{onSearchTextChange:h})}function pi(r){C.useEffect(()=>()=>{if(r!=null&&!Ft(r)){var e;(e=r.close)===null||e===void 0||e.call(r)}},[r])}var Ac=pi;function En(r,e,t,n,i,o,a){try{var l=r[o](a),s=l.value}catch(u){return void t(u)}l.done?e(s):Promise.resolve(s).then(n,i)}function Ud(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(s){En(o,n,i,a,l,"next",s)}function l(s){En(o,n,i,a,l,"throw",s)}a(void 0)})}}function Hd(r){var e=r.columnName,t=r.value,n=r.table,i=mi();return C.useCallback(Ud(function*(){if(n==null||t==null||e==null)return null;var o=n.findColumn(e),a=i.getValueType(o.type),l=yield n.seekRow(0,o,a,t);return l===-1?null:l}),[e,n,i,t])}var Bd=["table","keyColumn","labelColumn","iconColumn","settings","onChange","onSelectionChange"];function An(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Rn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?An(Object(t),!0).forEach(function(n){Wd(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):An(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Wd(r,e,t){return(e=zd(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function zd(r){var e=Vd(r,"string");return typeof e=="symbol"?e:e+""}function Vd(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function kn(r,e,t,n,i,o,a){try{var l=r[o](a),s=l.value}catch(u){return void t(u)}l.done?e(s):Promise.resolve(s).then(n,i)}function Kd(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(s){kn(o,n,i,a,l,"next",s)}function l(s){kn(o,n,i,a,l,"throw",s)}a(void 0)})}}function Qd(r,e){return Zd(r)||qd(r,e)||Yd(r,e)||Xd()}function Xd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
25
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yd(r,e){if(r){if(typeof r=="string")return Fn(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Fn(r,e):void 0}}function Fn(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function qd(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(s=(n=o.call(t)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(c){u=!0,i=c}finally{try{if(!s&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function Zd(r){if(Array.isArray(r))return r}function Jd(r,e){if(r==null)return{};var t,n,i=ec(r,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(n=0;n<o.length;n++)t=o[n],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function ec(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}var tc=de.module("jsapi-components.usePickerProps");function rc(r){var e,t=r.table,n=r.keyColumn,i=r.labelColumn,o=r.iconColumn,a=r.settings,l=r.onChange,s=r.onSelectionChange,u=Jd(r,Bd),c=Fo(),m=c.itemHeight,h=id(a),v=h.getFormattedString,p=h.timeZone,g=u.selectedKey===void 0,b=C.useState(u.defaultSelectedKey),f=Qd(b,2),S=f[0],y=f[1],w=_o(K.copyTableAndApplyFilters,[t]),T=w.data;pi(T);var x=C.useMemo(()=>T==null?null:ci(T,n),[n,T]),D=C.useMemo(()=>T==null||x==null?null:hi(T,x,i),[x,i,T]),A=C.useMemo(()=>D==null?[]:[D.name],[D]),R=nd({table:T,iconColumnName:o,keyColumnName:n,labelColumnName:i,formatValue:v}),E=Hd({table:T,columnName:(e=x==null?void 0:x.name)!==null&&e!==void 0?e:null,value:g?S:u.selectedKey}),N=C.useCallback(Kd(function*(){var P=yield E();return P==null?null:P*m+$o}),[E,m]),I=Ld({reuseItemsOnTableResize:!0,table:T,itemHeight:m,deserializeRow:R,searchColumnNames:A,timeZone:p}),F=I.onScroll,U=I.onSearchTextChange,M=I.setViewport,G=I.viewportData;C.useEffect(function(){var _=!1;return E().then(L=>{L==null||_||M(L)}).catch(L=>{tc.error("Error setting viewport from selected key",L)}),()=>{_=!0}},[E,a,M]);var O=C.useCallback(P=>{var _;g&&y(P),(_=l??s)===null||_===void 0||_(P)},[g,l,s]);return Rn(Rn({},u),{},{normalizedItems:G.items,showItemIcons:o!=null,getInitialScrollPosition:N,onChange:O,onScroll:F,onSearchTextChange:U})}function _n(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function nc(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_n(Object(t),!0).forEach(function(n){ic(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):_n(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ic(r,e,t){return(e=oc(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function oc(r){var e=ac(r,"string");return typeof e=="symbol"?e:e+""}function ac(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Rc(r){var e=rc(r);return d.jsx(zo,nc({},e))}var fi=C.createContext({theme:null,density:"regular"});fi.displayName="IrisGridThemeContext";function kc(r){var e=r.children,t=r.density,n=t===void 0?"regular":t,i=Fi(),o=i.activeThemes,a=C.useMemo(()=>ed(),[o]),l=C.useMemo(()=>({theme:a,density:n}),[a,n]);return d.jsx(fi.Provider,{value:l,children:e})}export{Nc as $,bc as A,Cc as B,pe as C,ka as D,Sc as E,yc as F,ui as G,wc as H,Jn as I,Oc as J,j as K,jc as L,Tc as M,Pc as N,ct as O,Rc as P,Ec as Q,Ut as R,Od as S,xc as T,Dc as U,Td as V,fi as W,kc as X,Ic as Y,Ma as Z,dl as _,Yo as a,Ha as a0,le as a1,Va as a2,W as a3,se as a4,Bs as a5,ed as a6,ei as a7,ll as a8,ca as b,ta as c,ra as d,di as e,id as f,pi as g,ci as h,hi as i,nd as j,Ld as k,mi as l,rc as m,Pd as n,xd as o,Dd as p,jd as q,Hd as r,hd as s,Sd as t,fc as u,Ac as v,vi as w,gc as x,Ia as y,Ne as z};
26
- //# sourceMappingURL=IrisGridThemeProvider-Btc8nPE1.js.map